Search is not available for this dataset
query
stringlengths
7
355k
document
stringlengths
9
341k
metadata
dict
negatives
sequencelengths
0
101
negative_scores
sequencelengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
string > [[str name, str addr]... ]
function stringToStringTuples (str) { const tuples = [] const parts = str.split('/').slice(1) // skip first empty elem if (parts.length === 1 && parts[0] === '') { return [] } for (let p = 0; p < parts.length; p++) { const part = parts[p] const proto = protocols(part) if (proto.size === 0) { tuples.push([part]) continue } p++ // advance addr part if (p >= parts.length) { throw ParseError('invalid address: ' + str) } tuples.push([part, parts[p]]) } return tuples }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function combine_ipaddr(ipaddr_name) {\n\tvar obj;\n\tvar ip = \"\";\n\tfor (i=0;i<4;i++) {\n\t\tobj = get_by_name(ipaddr_name)[i];\n\t\tip += obj.value;\n\t\tif (i<3)\n\t\t\tip += \".\";\n\t}\n\tif (ip == \"...\") \n\t\tip = \"\";\n\treturn ip;\n}", "function stringToStringTuples(str) {\n const tuples = [];\n const parts = str.split('/').slice(1); // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return [];\n }\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p];\n const proto = protocols_1.protocols(part);\n if (proto.size === 0) {\n tuples.push([part]);\n continue;\n }\n p++; // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str);\n }\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/')),\n ]);\n break;\n }\n tuples.push([part, parts[p]]);\n }\n return tuples;\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function parseAddress(str) {\n var addr = {}, base,\n arr = str.split(\"/\")\n \n if (arr.length < 2) // no id\n base = str; \n else { // has id\n addr.id = arr[1]; \n base = arr[0]; \n }\n \n arr = base.split(\"@\")\n if (arr.length < 2) // group only\n addr.group = base; \n else { // group and user\n addr.user = arr[0];\n addr.group = arr[1];\n }\n \n return addr;\n}", "function ParseAddress(addr) {\n var name = \"\";\n var address = \"\";\n for (var i = 0; i < addr.length;) {\n var token = GetEmailToken(addr, i);\n if (token.charAt(0) == '<') {\n var end = token.indexOf(\">\");\n address = token.substring(1, (end != -1) ? end : token.length);\n } else if (address == \"\") {\n name += token;\n }\n i += token.length;\n }\n\n // Check if it's a simple email address of the form \"[email protected]\"\n if (address == \"\" && name.indexOf(\"@\") != -1) {\n address = name;\n name = \"\";\n }\n\n name = CollapseWhitespace(name);\n name = StripQuotes(name, \"'\");\n name = StripQuotes(name, \"\\\"\");\n address = CollapseWhitespace(address);\n return [name, address];\n}", "function extractLocalDomain(str)\r\n {\r\n // REPLACE THIS CODE WITH YOUR extractLocalDomain() METHOD\r\n var res = [];\r\n var local = str.split(\"@\");\r\n var name = \"\";\r\n for (var i = 0; i < local[0].length; ++i) {\r\n var ch = local[0].charAt(i);\r\n if (ch != \" \") {\r\n name += ch;\r\n } \r\n }\r\n var domain = \"\";\r\n for (var i = 0; i < local[1].length; ++i) {\r\n var ch = local[1].charAt(i);\r\n if (ch != \" \") {\r\n domain += ch;\r\n } else {\r\n break;\r\n }\r\n }\r\n res.push(name);\r\n res.push(domain);\r\n return res;\r\n }", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "getAddrStr(hostName, port, protocol, proxyInfo) {\n let host = hostName.trim();\n // If it is IPV6 format address then remove the enclosing '[' and ']'\n if (host.startsWith(\"[\") && host.endsWith(\"]\"))\n host = host.substring(1, host.length - 1);\n return `(ADDRESS=(PROTOCOL=${protocol})(HOST=${host})(PORT=${port})${proxyInfo})`;\n }", "function nameInspector(string) {\n var isArray = /\\[\\]$/.test(string);\n var name = (isArray) ? string.match(/[^\\[]*/)[0] : string;\n return {name: name, observerName: name+\"Obs\", isArray: isArray};\n}", "function bacName(name) {\n var baclist = []\n for (var i = 0; i < name.length; i++) {\n var stringName = name[i].toString()\n var splitValue = stringName.split(\";\")\n if (splitValue.length > 1) {\n baclist.push(splitValue[splitValue.length - 1])\n }\n \n else {\n baclist.push(splitValue[0])\n }\n }\n return baclist\n}", "function addr(array) {\n let addString = \"\";\n for (let index = 0; index < array.length; index++) {\n const element = array[index];\n addString = addString + element + \"<br/>\";\n }\n return addString;\n }", "function parseAddress(str, hn)\n{\n if(typeof str !== \"string\")\n {\n warn(\"invalid address\", str);\n return {};\n }\n var parts = str.split(\",\");\n if(!dhash.isSHA1(parts[0]))\n {\n warn(\"invalid address hashname part\", str);\n return {};\n }\n var ret = hn || {}; // update existing or create new\n ret.hashname = parts[0];\n ret.ip = parts[1];\n ret.port = parseInt(parts[2]);\n ret.address = str;\n ret.hash = new dhash.Hash(null, parts[0]);\n return ret;\n}", "static parseAddress(addressStr) {\n const [channelAddr, msgId] = addressStr.split(\":\");\n return new node_1.Address(node_1.ChannelAddress.parse(channelAddr), node_1.MsgId.parse(msgId));\n }", "function obsAddrList() {\n return opts.strict ? null : wrap('obs-addr-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n )),\n address,\n star(and(\n literal(','),\n opt(and(\n address,\n invis(cfws)\n ))\n ))\n )());\n }", "function obsAddrList() {\n return opts.strict ? null : wrap('obs-addr-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n )),\n address,\n star(and(\n literal(','),\n opt(and(\n address,\n invis(cfws)\n ))\n ))\n )());\n }", "function obsAddrList() {\n return opts.strict ? null : wrap('obs-addr-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n )),\n address,\n star(and(\n literal(','),\n opt(and(\n address,\n invis(cfws)\n ))\n ))\n )());\n }", "function obsAddrList() {\n return opts.strict ? null : wrap('obs-addr-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n )),\n address,\n star(and(\n literal(','),\n opt(and(\n address,\n invis(cfws)\n ))\n ))\n )());\n }", "getAddress(address, name) {\n return name ? { address, name } : { address };\n }", "function gatherStrings(obj) {\n\n}", "function makeEmailArr(nameArray) {\n\tconst email = nameArray[0] + \".\" + nameArray[1] + \"@evolveu.ca\";\n\treturn email;\n}", "function shortname(str) {\n let newstr = str.toUpperCase().split(\" \");\n \n\n let sname= [];\n for (let i in newstr) {\n sname += newstr[i][0]\n \n\n\n }\n\n}", "function mapLayerNames(names) {\n return (names || []).reduce(function(memo, str) {\n var parts = str.split('='),\n dest = utils.trimQuotes(parts[0]),\n src = utils.trimQuotes(parts[1] || '');\n if (!src) stop(\"Invalid name assignment:\", str);\n memo[src] = dest;\n return memo;\n }, {});\n }", "function myAddresses(){\n\tlet ifaces = os.networkInterfaces() ;\n\tlet ret = [] ;\n\tfor( const i in ifaces ){\n\t\tret = ret.concat(ifaces[i].filter(e => {\n\t\t\treturn (e.family === 'IPv4' && e.internal === false);\n\t\t})) ;\n\t}\n\treturn ret ;\n}", "_fromString(str) {\n // trim off weird whitespace and extra trailing commas\n const parts = str.replace(/^[ ,]+|[ ,]+$/g, '').split(',').map(s => s.trim());\n\n this.name = parts[0].split('.').slice(0, -1).join('.');\n this.protocol = parts[0].split('.').slice(-1)[0];\n this.subtypes = parts.slice(1);\n }", "function list3(names) {\n var xs = names.map(p => p.name)\n var x = xs.pop()\n return xs.length ? xs.join(\", \") + \" & \" + x : x || \"\"\n}", "function parsedname(buf, pos, msgBuf, rec) {\n /*eslint no-bitwise:0 */\n let res = [];\n if (rec > 5) {\n throw new Error('parse error - recursion');\n }\n while (true) {\n if (pos >= buf.length) {\n throw new Error('parse error - no eof');\n }\n let tag = buf.readUInt8(pos++);\n if (!tag) {\n break;\n } else if (tag < 64) {\n if (tag + pos > buf.length) {\n throw new Error('parse error - long str');\n }\n res.push(buf.toString('utf8', pos, pos + tag));\n pos += tag;\n } else if ((tag & 0xC0) === 0xC0) {\n let ofs = ((tag & 0x3F) << 8) | buf.readUInt8(pos++);\n res.push(parsedname(msgBuf, ofs, msgBuf, rec + 1));\n break;\n } else {\n throw new Error('parse error - bad tag');\n }\n }\n return res.join('.');\n}", "function parseStringArray(value, allowDuplicate) {\n\tif(typeof value === \"string\") {\n\t\tvar memberRegExp = /(?:^|[^\\S\\xA0])(?:\\[\\[(.*?)\\]\\])(?=[^\\S\\xA0]|$)|([\\S\\xA0]+)/mg,\n\t\t\tresults = [], names = {},\n\t\t\tmatch;\n\t\tdo {\n\t\t\tmatch = memberRegExp.exec(value);\n\t\t\tif(match) {\n\t\t\t\tvar item = match[1] || match[2];\n\t\t\t\tif(item !== undefined && (!(item in names) || allowDuplicate)) {\n\t\t\t\t\tresults.push(item);\n\t\t\t\t\tnames[item] = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} while(match);\n\t\treturn results;\n\t} else if(Array.isArray(value)) {\n\t\treturn value;\n\t} else {\n\t\treturn null;\n\t}\n}", "function extractFromAdress(components, type){\n for (var i=0; i<components.length; i++)\n for (var j=0; j<components[i].types.length; j++)\n if (components[i].types[j]==type) return components[i].long_name;\n return '';\n}", "function arrOFNames(str) {\n // complete the function\n return str.split(\",\");\n \n}", "function getFullName(address) {\n return [\n address.address_line1 + (address.address_line2 ? ' ' + address.address_line2 : ''),\n address.city,\n address.state,\n address.zip_code,\n address.country\n ].join(', ');\n }", "formatAddress(address, str) {\n const formattedAddress = address.split(',');\n const streetAddress = formattedAddress.splice(0, 1);\n const cityAddress = formattedAddress.join('');\n\n if (str === 'street') {\n return streetAddress;\n }\n return cityAddress;\n }", "function parseUrl(urlPart, name_size){\n let output = \"\"; \n let i = 3; \n for(i=5;i<name_size;i++){\n output = output.concat(urlPart[i])\n }\n return output; //returns city name \n}", "function addressList() {\n return wrap('address-list', or(\n and(\n address,\n star(and(literal(','), address))\n ),\n obsAddrList\n )());\n }", "function addressList() {\n return wrap('address-list', or(\n and(\n address,\n star(and(literal(','), address))\n ),\n obsAddrList\n )());\n }", "function addressList() {\n return wrap('address-list', or(\n and(\n address,\n star(and(literal(','), address))\n ),\n obsAddrList\n )());\n }", "function addressList() {\n return wrap('address-list', or(\n and(\n address,\n star(and(literal(','), address))\n ),\n obsAddrList\n )());\n }", "function getLinks(str) \n{\n var linkArray = new Array();\n var done = false;\n while (done == false)\n {\n var webAddress = getSubStr(str, \"\\\"\", \"\\\"\");\n if (webAddress == null)\n {\n done = true;\n }\n else\n {\n linkArray.push(webAddress);\n str = str.replace(\"\\\"\"+webAddress+\"\\\"\",\"\");\n }\n } \n return linkArray;\n}", "function _attribution(str) {\r\n var all = new Array();\r\n while(1) {\r\n var eq = str.indexOf(\"=\");\r\n if(str.length == 0 || eq == -1) {\r\n return all;\r\n } \r\n var id1 = str.indexOf(\"\\'\");\r\n var id2 = str.indexOf(\"\\\"\");\r\n var ids = new Number();\r\n var id = new String();\r\n if((id1 < id2 && id1 != -1) || id2 == -1) {\r\n ids = id1;\r\n id = \"\\'\";\r\n }\r\n if((id2 < id1 || id1 == -1) && id2 != -1) {\r\n ids = id2;\r\n id = \"\\\"\";\r\n }\r\n var nextid = str.indexOf(id,ids + 1);\r\n var val = str.substring(ids + 1,nextid);\r\n \r\n var name = _strip(str.substring(0,eq));\r\n all[name] = _entity(val);\r\n str = str.substring(nextid + 1,str.length);\r\n }\r\n return \"\";\r\n}", "vlist2string(vlist, label) {\n\t\tlet s = '';\n\t\tfor (let u of vlist) {\n\t\t\tif (s.length > 0) s += ' ';\n\t\t\ts += this.x2s(e, label);\n\t\t}\n\t\treturn '[' + s + ']';\n\t}", "getAddressString () {\n return secUtil.bufferToHex(this.getAddress())\n }", "function list6(names) {\n return names\n .map((item) => item.name)\n .join(', ')\n .replace(/,\\s([^,]+)$/, ' & $1');\n}", "function referenceArray(stringName) {\n switch(stringName) { \n case 'kicks':\n return kicks;\n case 'snares':\n return snares\n case 'hiHats':\n return hiHats;\n case 'rideCymbals':\n return rideCymbals;\n default:\n return null; \n }\n}", "function makeEmailArr(myEmail){\n\toutput=myEmail[0] + \".\" + myEmail[1] + \"@evolveu.ca\";\n\treturn output\n}", "parse(address) {\n const groups = address.split('.');\n if (!address.match(constants.RE_ADDRESS)) {\n throw new AddressError('Invalid IPv4 address.');\n }\n return groups;\n }", "function listAddresses(obj){\n\tfor (key in obj){\n\t\tfor (let i=0; i<obj[key].length; i++){\n\t\t\tconsole.log(i==0 ? key+\"\\n\"+obj[key][i] : obj[key][i]);\n\t\t}\n\t}\n}", "function list(names) {\n if (names.length == 1) {\n const str = Object.values(names[0]);\n return str.toString();\n }\n else if (names.length == 2) {\n const str = `${Object.values(names[0])}` + ' & ' + `${Object.values(names[1])}`;\n return str\n }\n else if (names.length >= 3) {\n const last_element = names.reverse().shift();\n const near_last_element = names.reverse().pop();\n let str_1 = \"\"\n for (let i = 0; i < names.length; i++) {\n str_1 += `${Object.values(names[i])}` + ', '\n }\n const str_2 = str_1 + `${Object.values(near_last_element)}` + ' & ' + `${Object.values(last_element)}`\n return str_2\n }\n else {\n const str = '';\n return str\n }\n}", "function index_string(index, elem) {\n\tvar str = \"\";\n\tif (index < 9) {\n\t\tstr = '[0' + (index+1) + ']' + elem.nickname;\n\t} else {\n\t\tstr = '[' + (index+1) + ']' + elem.nickname;\n\t}\n\treturn str;\n}", "function findAddress(address, addresses)\n{\n\taddress = address.toLowerCase()\n\taddress = address.replaceAll(\",\", \"\").replaceAll(\"street\", \"st\").replaceAll(\"road\", \"rd\").replaceAll(\"avenue\", \"ave\")\n\t//console.log(\"Checking: \" + address)\n\tvar longestSubstringIndex = 0\n\tvar longestSubstring = \"\"\n\n\tfor (var i = 0; i < addresses.length; i++)\n\t{\n\t\tvar a = addresses[i].toLowerCase()\n\t\ta = a.replaceAll(\",\", \"\").replaceAll(\"street\", \"st\").replaceAll(\"road\", \"rd\").replaceAll(\"avenue\", \"ave\")\n\n\t\t//console.log(\"Comparing: \" + a)\n\n\t\tvar substring = longestCommonSubstring(a, address)\n\n\t\t//console.log(\"subString: \" + substring)\n\n\t\tif (substring.length > longestSubstring.length)\n\t\t{\n\t\t\tlongestSubstring = substring\n\t\t\tlongestSubstringIndex = i\n\t\t}\n\t}\n\n\t//console.log(\"Returning: \" + longestSubstringIndex + \"\\n\\n\\n\")\n\n\treturn [address, addresses[longestSubstringIndex]]\n}", "function stringTuplesToString (tuples) {\n const parts = []\n map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return '/' + parts.join('/')\n}", "function stringTuplesToString (tuples) {\n const parts = []\n map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return '/' + parts.join('/')\n}", "function stringTuplesToString (tuples) {\n const parts = []\n map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return '/' + parts.join('/')\n}", "function stringTuplesToString (tuples) {\n const parts = []\n map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return '/' + parts.join('/')\n}", "function stringTuplesToString (tuples) {\n const parts = []\n map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return '/' + parts.join('/')\n}", "function listify(words: Array<string>): string {\n if (words.length === 1) { return words[0]; }\n return words.slice(0, words.length - 1).join(\", \") + \" and \" + words[words.length - 1];\n}\n\n\nlet cli = new CLI();\n\nabstract class EnsPlugin extends Plugin {\n _ethAddressCache: { [ addressOrInterfaceId: string ]: string };\n\n constructor() {\n super();\n ethers.utils.defineReadOnly(this, \"_ethAddressCache\", { });\n }\n\n getEns(): ethers.Contract {\n return new ethers.Contract(this.network.ensAddress, ensAbi, this.accounts[0] || this.provider);\n }", "function extractFullName(arr) {\n\treturn arr.map(function(val){\n\t\treturn val.first + \" \" + val.last;\n\t});\n}", "function list(names) {\n let list = ''\n if (names.length === 0) {\n return list\n }\n if (names.length === 1) {\n return names[0].name\n }\n for (let i = 0; i < names.length; i++) {\n if (i === names.length - 1) {\n list += ' & ' + names[i].name\n }\n else if (i === names.length - 2) {\n list += names[i].name\n }\n else {\n list += names[i].name + ', '\n }\n }\n return list\n}", "function formatAddress(acc) {\n return T_Address.canonicalize(acc); // TODO: typing\n }", "function jobName(shipMates) {\n let jobNameArr = shipMates.map(val => `${val[1]}: ${val[0]}`);\n return jobNameArr;\n}", "function getAddressTags(header) {\n var tags;\n\n if (header[0] == '\\\"')\n tags = splitString(header.slice(7, header.length - 1), ',');\n else\n tags = header.slice(6, header.length);\n\n return tags;\n\n\n}", "async buildAddressList(hostInfo, protocol,\n proxyHost, proxyPort) {\n let shost = '';\n let ipcnt = 0;\n const builder = new Array();\n let proxyInfo = '';\n if (proxyHost != null) {\n if (proxyPort != null) {\n proxyInfo = `(HTTPS_PROXY=${proxyHost})(HTTPS_PROXY_PORT=${proxyPort})`;\n } else {\n proxyInfo = `(HTTPS_PROXY=${proxyHost})`;\n }\n }\n\n if (protocol == null) protocol = 'TCP';\n let naddr = 0;\n // ; groups the user into a ADDRESS_LIST\n const addressLists = hostInfo.split(\";\");\n for (const addressList in addressLists) {\n let addressNodeCount = 0;\n const addressListBuilder = new Array();\n for (const match of addressLists[addressList].matchAll(HOSTNAMES_PATTERN)) {\n const hostnames = (match.groups.hostnames).split(',');\n let port = match.groups.port;\n if (port == null) {\n port = '1521' + '';\n }\n for (const hname in hostnames) {\n addressListBuilder.push(this.getAddrStr(hostnames[hname], port, protocol, proxyInfo));\n shost = hostnames[hname];\n addressNodeCount++;\n }\n }\n naddr += addressNodeCount;\n const parts = [];\n if (addressLists.length > 1 && addressNodeCount > 1)\n parts.push('(LOAD_BALANCE=ON)');\n parts.push(addressListBuilder.join(''));\n if (addressLists.length > 1)\n builder.push(`(ADDRESS_LIST=${parts.join('')})`);\n else\n builder.push(parts.join(''));\n }\n if (naddr == 1) {\n shost = shost.trim();\n // If it is IPV6 format address then remove the enclosing '[' and ']'\n if (shost.startsWith(\"[\") && shost.endsWith(\"]\"))\n shost = shost.substring(1, shost.length - 1);\n try {\n await lookup(shost);\n ipcnt++;\n } catch {\n // nothing\n }\n if (ipcnt == 0) {\n errors.throwErr(errors.ERR_INVALID_EZCONNECT_SYNTAX, 'could not resolve hostname', shost);\n }\n }\n\n if (addressLists.length < 2 && naddr > 1) {\n this.lb = true;\n }\n\n return builder.join('');\n\n }", "function MlStringFromArray (a) {\n var len = a.length; this.array = a; this.len = this.last = len;\n}", "function tag(strings) {\n console.log(strings.raw[0]);\n\n}", "function list(names){\n let output = ''\n while (names.length > 0) {\n let namesLen = names.length\n if (namesLen > 2) {\n output += names.shift()['name'] + ', '\n } else if (namesLen === 2) {\n return output += `${names[0]['name']} & ${names[1]['name']}`\n } else {\n return output = names[0]['name']\n }\n }\n return output\n}", "function pairElement(str) {\r\n return str.split(\"\").map(p => [p, pairs[p]]);\r\n}", "function argToString(array, strtInd, argName) {\r\n\tvar jS = strtInd, aS = '', ar = array;\r\n\targName=(argName ? argName : 'ar');\r\n\t\r\n\tif (ar.length > jS) {\r\n\t\tfor (var k = jS; k < ar.length; k++) aS += argName+'['+k+'], ';\r\n\t\taS = aS.substring(0, aS.length-2);\r\n\t}\r\n\t\r\n\treturn aS;\r\n}", "function splitAddress(address) {\n let addressArray = [];\n addressArray.push(address.substring(0, 30));\n addressArray.push(address.substring(30, 60));\n addressArray.push(address.substring(60, address.length - 1));\n return addressArray;\n}", "function stringToArray (string) {\n var namesListArray = string.split(\"\\n\");\n return namesListArray;\n}", "function treatBacName(name) {\n var bacteriaList = [];\n\n for (var i = 0; i < name.length; i++) {\n var stringName = name[i].toString();\n var splitValue = stringName.split(\";\");\n if (splitValue.length > 1) {\n bacteriaList.push(splitValue[splitValue.length - 1]);\n } else {\n bacteriaList.push(splitValue[0]);\n }\n }\n return bacteriaList;\n}", "function addressToAensPointee (address) {\n const key = {\n ak: 'AENS.AccountPt',\n ct: 'AENS.ContractPt',\n ok: 'AENS.OraclePt',\n ch: 'AENS.ChannelPt',\n }[address.substring(0, 2)];\n return { [key]: [`ak${address.substring(2)}`] }\n }", "function colonData(string) {\n\tfor (var c = string.length - 1; c > 0; c--) {\n\t\tif (string[c] == ':') {\n\t\t\treturn [\n\t\t\t\tstring.substring(0, c),\n\t\t\t\tstring.substring(c + 1)\n\t\t\t];\n\t\t}\n\t}\n}", "function modifyLabels(name) {\n var shortLabels = [];\n for (var i = 0; i < name.length; i++) {\n var stringName = name[i].toString();\n var splitLabels = stringName.split(\";\");\n if (splitLabels.length > 1) {\n shortLabels.push(splitLabels[splitLabels.length - 1]);\n } else {\n shortLabels.push(splitLabels[0]);\n }\n }\n return shortLabels;\n }", "function deepStripTupleAddresses(input, tupleTypes) {\n return input.map(function (item, i) {\n var type = tupleTypes[i].type;\n if (type === 'address' && typeof item === 'string') {\n return item.split('0x')[1];\n }\n if (type === 'address[]' || Array.isArray()) {\n return item.map(function (a) {\n return a.split('0x')[1];\n });\n }\n return item;\n });\n}", "XY2Name( x,y )\n\t{\n\t\treturn( x.toString() + ',' + y.toString() )\n\t}", "function tag(strings) {\n console.log(strings.raw[0]);\n}", "TextToMemberArray(nsText) {\n let thisNsHost = this;\n let returnArray = [];\n let memberPattern = new RegExp(/^(\\d+)\\) (\\S+) \\((\\S+): (\\d+)\\) - (\\S+) State: (\\S.*\\S)\\s+Weight: (\\d+)$/, \"gm\");\n // Loop over groups\n let memberInfo = null;\n while ((memberInfo = memberPattern.exec(nsText)) !== null) {\n let memberObj = {\n MemberIndex: memberInfo[1],\n ServiceName: memberInfo[2],\n ServiceIP: memberInfo[3],\n ServicePort: memberInfo[4],\n Protocol: memberInfo[5],\n State: memberInfo[6],\n Weight: memberInfo[7]\n };\n returnArray.push(memberObj);\n }\n return returnArray;\n }", "function getAddress(node_name){\n\t// Load config data from SmartToken.json\n\tvar addrlist = require('./addr_list.json');\t\n\treturn addrlist[node_name];\t\n}", "function getAddress(node_name){\n\t// Load config data from SmartToken.json\n\tvar addrlist = require('./addr_list.json');\t\n\treturn addrlist[node_name];\t\n}", "function getOriginsString(inputData){\n\n return inputData.address1.coordinates.lat + ',' +\n inputData.address1.coordinates.lng + '|' +\n inputData.address2.coordinates.lat + ',' +\n inputData.address2.coordinates.lng;\n\n // if it becomes useful to query using a single address,\n // could pass in a flag to tell this func to create a Origins String using:\n // - both address1 and address2\n // - only address1\n // - only address2\n // create string for 2 origin addresses\n}", "function run_test() {\n var i;\n\n var parser = Components.classes[\"@mozilla.org/messenger/headerparser;1\"]\n .getService(Components.interfaces.nsIMsgHeaderParser);\n\n // In this array, the sub arrays consist of the following elements:\n // 0: input string\n // 1: expected output from extractHeaderAddressMailboxes\n // 2: expected output from extractHeaderAddressNames\n // 3: expected output from extractHeaderAddressName\n const checks =\n [\n [\"[email protected]\",\n \"[email protected]\",\n \"[email protected]\",\n \"[email protected]\" ],\n [\"foo <[email protected]>\",\n \"[email protected]\",\n \"foo\",\n \"foo\" ],\n [\"[email protected], foo <[email protected]>\",\n \"[email protected], [email protected]\",\n \"[email protected], foo\",\n \"[email protected]\" ],\n [\"foo bar <[email protected]>\",\n \"[email protected]\",\n \"foo bar\",\n \"foo bar\" ],\n [\"foo bar <[email protected]>, [email protected], foo <[email protected]>\",\n \"[email protected], [email protected], [email protected]\",\n \"foo bar, [email protected], foo\",\n \"foo bar\" ],\n // UTF-8 names\n [\"foo\\u00D0 bar <[email protected]>, \\u00F6foo <[email protected]>\",\n \"[email protected], [email protected]\",\n \"foo\\u00D0 bar, \\u00F6foo\",\n \"foo\\u00D0 bar\" ],\n // More complicated examples drawn from RFC 2822\n [\"\\\"Joe Q. Public\\\" <[email protected]>,Test <\\\"abc!x.yz\\\"@invalid.com>, Test <test@[xyz!]>,\\\"Giant; \\\\\\\"Big\\\\\\\" Box\\\" <[email protected]>\",\n \"[email protected], \\\"abc!x.yz\\\"@invalid.com, test@[xyz!], [email protected]\",\n \"\\\"Joe Q. Public\\\", Test, Test, \\\"Giant; \\\\\\\"Big\\\\\\\" Box\\\"\",\n // extractHeaderAddressName returns unquoted names, hence the difference.\n \"Joe Q. Public\" ],\n ];\n\n // Test - empty strings\n\n do_check_eq(parser.extractHeaderAddressMailboxes(\"\"), \"\");\n do_check_eq(parser.extractHeaderAddressNames(\"\"), \"\");\n do_check_eq(parser.extractHeaderAddressName(\"\"), \"\");\n\n // Test - extractHeaderAddressMailboxes\n\n for (i = 0; i < checks.length; ++i) {\n do_check_eq(parser.extractHeaderAddressMailboxes(checks[i][0]), checks[i][1]);\n do_check_eq(parser.extractHeaderAddressNames(checks[i][0]), checks[i][2]);\n do_check_eq(parser.extractHeaderAddressName(checks[i][0]), checks[i][3]);\n }\n}", "map_attribute_name_to_buffer_name( name ) // We'll pull single entries out per vertex by field name. Map\r\n { // those names onto the vertex array names we'll pull them from.\r\n return { object_space_pos: \"positions\", tex_coord: \"texture_coords\" }[ name ]; }", "function listingsByAddress() {\n\treturn db.any('SELECT * FROM listings ORDER BY split_part(address, \\' \\', 2)');\n}", "function listingsByAddress() {\n\treturn db.any('SELECT * FROM listings ORDER BY split_part(address, \\' \\', 2)');\n}", "function formatNameList(names) {\n var str = \"\";\n names.forEach(function (name) {\n str = str + (name.name + \": \" + name.value + \" \\n\");\n });\n return str.trim();\n}", "function caml_string_of_array (a) { return new MlString(4,a,a.length); }", "function parseHost(host){\n var rtnArr = [];\n aliasStr = host.alias.toUpperCase();\n aliasArr = host.alias.split(' ');\n //use regex matching to get the STA__ station number from the alias\n for (var i = 0; i < aliasArr.length; i++){\n if(aliasArr[i].match(/^([STA]{3}([0-9]{1,})?(([A-Z]{1,})?([.,\\/#!$%\\^&\\*;:{}=\\-_`~()])?([A-Z]{1,})?)?)$/g)){\n var stationNumber = parseStationStr(aliasArr[i]);\n rtnArr.push(stationNumber);\n rtnArr.push(mapStationToArea(stationNumber));\n }\n }\n return rtnArr;\n}", "function oneLineAddress( address ) {\r\n\tif( ! address )\r\n\t\treturn '';\r\n\t//if( typeof address == 'string' )\r\n\t//\treturn H(address).replace( /, USA$/, '' );\r\n\treturn H( S(\r\n\t\taddress.line1 ? address.line1 + ', ' : '',\r\n\t\taddress.line2 ? address.line2 + ', ' : '',\r\n\t\taddress.city, ', ', address.state,\r\n\t\taddress.zip ? ' ' + address.zip : ''\r\n\t) );\r\n}", "function splitAddrList(addrs, bit, addrs0, addrs1) {\n for (var i = 0; i < addrs.length; ++i) {\n if (addrs[i].getBit(bit))\n addrs1.push(addrs[i]);\n else\n addrs0.push(addrs[i]);\n }\n}", "function list(names) {\n return names.reduce(function (prev, current, index, array) {\n if (index === 0) {\n return current.name;\n\n } else if (index === array.length - 1) {\n return prev + ' & ' + current.name;\n\n } else {\n return prev + ', ' + current.name;\n }\n }, '');\n}", "function names(arr) {\n return names.name;\n}" ]
[ "0.61670023", "0.611367", "0.59880495", "0.59880495", "0.59880495", "0.59880495", "0.59880495", "0.59607935", "0.56252503", "0.55841464", "0.5477685", "0.5477685", "0.5477685", "0.5477685", "0.5394429", "0.52247036", "0.52212423", "0.5213422", "0.5211407", "0.52101266", "0.5205024", "0.5205024", "0.5205024", "0.5205024", "0.5138404", "0.51165706", "0.5109562", "0.5076891", "0.5076044", "0.5070316", "0.50519484", "0.50416994", "0.5020311", "0.50031716", "0.49970824", "0.49555367", "0.4952656", "0.49511006", "0.4940434", "0.49348572", "0.49348572", "0.49348572", "0.49348572", "0.49320188", "0.49207062", "0.49166852", "0.49119255", "0.48950037", "0.48944488", "0.4888756", "0.4875459", "0.48565418", "0.48524177", "0.48481283", "0.48439854", "0.4840357", "0.4840357", "0.4840357", "0.4840357", "0.4840357", "0.48331374", "0.48259586", "0.48251355", "0.48249796", "0.4823397", "0.48088354", "0.47953454", "0.4789787", "0.47683138", "0.4763463", "0.47529882", "0.47463226", "0.47461236", "0.47415987", "0.47333175", "0.47223526", "0.47203112", "0.47180992", "0.47049692", "0.47007897", "0.47006997", "0.4696605", "0.46927848", "0.46927848", "0.4690705", "0.46818832", "0.46753561", "0.46734262", "0.46734262", "0.4673288", "0.46731174", "0.46668512", "0.46646473", "0.46630004", "0.46627578", "0.46609932" ]
0.6081265
4
[[str name, str addr]... ] > string
function stringTuplesToString (tuples) { const parts = [] map(tuples, function (tup) { const proto = protoFromTuple(tup) parts.push(proto.name) if (tup.length > 1) { parts.push(tup[1]) } }) return '/' + parts.join('/') }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function combine_ipaddr(ipaddr_name) {\n\tvar obj;\n\tvar ip = \"\";\n\tfor (i=0;i<4;i++) {\n\t\tobj = get_by_name(ipaddr_name)[i];\n\t\tip += obj.value;\n\t\tif (i<3)\n\t\t\tip += \".\";\n\t}\n\tif (ip == \"...\") \n\t\tip = \"\";\n\treturn ip;\n}", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "function nameAddr() {\n return wrap('name-addr', and(opt(displayName), angleAddr)());\n }", "getAddrStr(hostName, port, protocol, proxyInfo) {\n let host = hostName.trim();\n // If it is IPV6 format address then remove the enclosing '[' and ']'\n if (host.startsWith(\"[\") && host.endsWith(\"]\"))\n host = host.substring(1, host.length - 1);\n return `(ADDRESS=(PROTOCOL=${protocol})(HOST=${host})(PORT=${port})${proxyInfo})`;\n }", "function stringToStringTuples(str) {\n const tuples = [];\n const parts = str.split('/').slice(1); // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return [];\n }\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p];\n const proto = protocols_1.protocols(part);\n if (proto.size === 0) {\n tuples.push([part]);\n continue;\n }\n p++; // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str);\n }\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/')),\n ]);\n break;\n }\n tuples.push([part, parts[p]]);\n }\n return tuples;\n}", "function parseAddress(str) {\n var addr = {}, base,\n arr = str.split(\"/\")\n \n if (arr.length < 2) // no id\n base = str; \n else { // has id\n addr.id = arr[1]; \n base = arr[0]; \n }\n \n arr = base.split(\"@\")\n if (arr.length < 2) // group only\n addr.group = base; \n else { // group and user\n addr.user = arr[0];\n addr.group = arr[1];\n }\n \n return addr;\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function stringToStringTuples (str) {\n const tuples = []\n const parts = str.split('/').slice(1) // skip first empty elem\n if (parts.length === 1 && parts[0] === '') {\n return []\n }\n\n for (let p = 0; p < parts.length; p++) {\n const part = parts[p]\n const proto = protocols(part)\n\n if (proto.size === 0) {\n tuples.push([part])\n continue\n }\n\n p++ // advance addr part\n if (p >= parts.length) {\n throw ParseError('invalid address: ' + str)\n }\n\n // if it's a path proto, take the rest\n if (proto.path) {\n tuples.push([\n part,\n // TODO: should we need to check each path part to see if it's a proto?\n // This would allow for other protocols to be added after a unix path,\n // however it would have issues if the path had a protocol name in the path\n cleanPath(parts.slice(p).join('/'))\n ])\n break\n }\n\n tuples.push([part, parts[p]])\n }\n\n return tuples\n}", "function ParseAddress(addr) {\n var name = \"\";\n var address = \"\";\n for (var i = 0; i < addr.length;) {\n var token = GetEmailToken(addr, i);\n if (token.charAt(0) == '<') {\n var end = token.indexOf(\">\");\n address = token.substring(1, (end != -1) ? end : token.length);\n } else if (address == \"\") {\n name += token;\n }\n i += token.length;\n }\n\n // Check if it's a simple email address of the form \"[email protected]\"\n if (address == \"\" && name.indexOf(\"@\") != -1) {\n address = name;\n name = \"\";\n }\n\n name = CollapseWhitespace(name);\n name = StripQuotes(name, \"'\");\n name = StripQuotes(name, \"\\\"\");\n address = CollapseWhitespace(address);\n return [name, address];\n}", "getAddressString () {\n return secUtil.bufferToHex(this.getAddress())\n }", "function formatAddress(acc) {\n return T_Address.canonicalize(acc); // TODO: typing\n }", "getAddress(address, name) {\n return name ? { address, name } : { address };\n }", "function parseAddress(str, hn)\n{\n if(typeof str !== \"string\")\n {\n warn(\"invalid address\", str);\n return {};\n }\n var parts = str.split(\",\");\n if(!dhash.isSHA1(parts[0]))\n {\n warn(\"invalid address hashname part\", str);\n return {};\n }\n var ret = hn || {}; // update existing or create new\n ret.hashname = parts[0];\n ret.ip = parts[1];\n ret.port = parseInt(parts[2]);\n ret.address = str;\n ret.hash = new dhash.Hash(null, parts[0]);\n return ret;\n}", "static parseAddress(addressStr) {\n const [channelAddr, msgId] = addressStr.split(\":\");\n return new node_1.Address(node_1.ChannelAddress.parse(channelAddr), node_1.MsgId.parse(msgId));\n }", "function extractLocalDomain(str)\r\n {\r\n // REPLACE THIS CODE WITH YOUR extractLocalDomain() METHOD\r\n var res = [];\r\n var local = str.split(\"@\");\r\n var name = \"\";\r\n for (var i = 0; i < local[0].length; ++i) {\r\n var ch = local[0].charAt(i);\r\n if (ch != \" \") {\r\n name += ch;\r\n } \r\n }\r\n var domain = \"\";\r\n for (var i = 0; i < local[1].length; ++i) {\r\n var ch = local[1].charAt(i);\r\n if (ch != \" \") {\r\n domain += ch;\r\n } else {\r\n break;\r\n }\r\n }\r\n res.push(name);\r\n res.push(domain);\r\n return res;\r\n }", "function obsAddrList() {\n return opts.strict ? null : wrap('obs-addr-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n )),\n address,\n star(and(\n literal(','),\n opt(and(\n address,\n invis(cfws)\n ))\n ))\n )());\n }", "function obsAddrList() {\n return opts.strict ? null : wrap('obs-addr-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n )),\n address,\n star(and(\n literal(','),\n opt(and(\n address,\n invis(cfws)\n ))\n ))\n )());\n }", "function obsAddrList() {\n return opts.strict ? null : wrap('obs-addr-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n )),\n address,\n star(and(\n literal(','),\n opt(and(\n address,\n invis(cfws)\n ))\n ))\n )());\n }", "function obsAddrList() {\n return opts.strict ? null : wrap('obs-addr-list', and(\n star(and(\n invis(opt(cfws)),\n literal(',')\n )),\n address,\n star(and(\n literal(','),\n opt(and(\n address,\n invis(cfws)\n ))\n ))\n )());\n }", "function extractFromAdress(components, type){\n for (var i=0; i<components.length; i++)\n for (var j=0; j<components[i].types.length; j++)\n if (components[i].types[j]==type) return components[i].long_name;\n return '';\n}", "function addr(array) {\n let addString = \"\";\n for (let index = 0; index < array.length; index++) {\n const element = array[index];\n addString = addString + element + \"<br/>\";\n }\n return addString;\n }", "function pubToAddrStr(pub) {\n return keccak256(pub).slice(-40);\n}", "formatAddress(address, str) {\n const formattedAddress = address.split(',');\n const streetAddress = formattedAddress.splice(0, 1);\n const cityAddress = formattedAddress.join('');\n\n if (str === 'street') {\n return streetAddress;\n }\n return cityAddress;\n }", "function describeAddress(socket) {\n if (socket.remoteFamily === \"IPv6\") {\n return `[${socket.remoteAddress}]:${socket.remotePort}`;\n }\n return `${socket.remoteAddress}:${socket.remotePort}`;\n}", "function formatAddress(address) {\n\treturn address;\n}", "function index_string(index, elem) {\n\tvar str = \"\";\n\tif (index < 9) {\n\t\tstr = '[0' + (index+1) + ']' + elem.nickname;\n\t} else {\n\t\tstr = '[' + (index+1) + ']' + elem.nickname;\n\t}\n\treturn str;\n}", "function address() {\n return wrap('address', or(mailbox, group)());\n }", "function address() {\n return wrap('address', or(mailbox, group)());\n }", "function address() {\n return wrap('address', or(mailbox, group)());\n }", "function address() {\n return wrap('address', or(mailbox, group)());\n }", "function list3(names) {\n var xs = names.map(p => p.name)\n var x = xs.pop()\n return xs.length ? xs.join(\", \") + \" & \" + x : x || \"\"\n}", "function getFullName(address) {\n return [\n address.address_line1 + (address.address_line2 ? ' ' + address.address_line2 : ''),\n address.city,\n address.state,\n address.zip_code,\n address.country\n ].join(', ');\n }", "getName() {\n let name = this.getDeviceName(); // SHRGBW2#1234#1\n let ip = this.getIP(); // 192.168.11.1\n let deviceid = this.getDeviceId(); // shellyplug-s-12345\n let id = this.getId(); // shellyplug-s-12345\n return ip + ' (' + deviceid + ' / ' + id + ' / ' + name + ')';\n }", "function GetAddress(address) {\n return ParseAddress(address)[1];\n}", "function oneLineAddress( address ) {\r\n\tif( ! address )\r\n\t\treturn '';\r\n\t//if( typeof address == 'string' )\r\n\t//\treturn H(address).replace( /, USA$/, '' );\r\n\treturn H( S(\r\n\t\taddress.line1 ? address.line1 + ', ' : '',\r\n\t\taddress.line2 ? address.line2 + ', ' : '',\r\n\t\taddress.city, ', ', address.state,\r\n\t\taddress.zip ? ' ' + address.zip : ''\r\n\t) );\r\n}", "function Addr() {\n this._fields = [0, 0, 0, 0, 0, 0, 0, 0];\n this._attrs = {};\n}", "address(value) {\n return Object(address_lib_esm[\"a\" /* getAddress */])(value);\n }", "function address(authorinfo) /* (authorinfo : authorinfo) -> string */ {\n return authorinfo.address;\n}", "generatorAddress(...args) {\n let fieldName = this._daftFieldName('Generator-Address');\n if (args.length) {\n Must(args.length === 1);\n Must(!this.header.has(fieldName)); // or is that unnecessary too strict?\n this.header.add(fieldName, Gadgets.PrettyAddress(args[0]));\n }\n const rawValue = this.header.value(fieldName);\n return Authority.Parse(rawValue).toHostPort();\n }", "vlist2string(vlist, label) {\n\t\tlet s = '';\n\t\tfor (let u of vlist) {\n\t\t\tif (s.length > 0) s += ' ';\n\t\t\ts += this.x2s(e, label);\n\t\t}\n\t\treturn '[' + s + ']';\n\t}", "get addr() { return this._addr; }", "function parsedname(buf, pos, msgBuf, rec) {\n /*eslint no-bitwise:0 */\n let res = [];\n if (rec > 5) {\n throw new Error('parse error - recursion');\n }\n while (true) {\n if (pos >= buf.length) {\n throw new Error('parse error - no eof');\n }\n let tag = buf.readUInt8(pos++);\n if (!tag) {\n break;\n } else if (tag < 64) {\n if (tag + pos > buf.length) {\n throw new Error('parse error - long str');\n }\n res.push(buf.toString('utf8', pos, pos + tag));\n pos += tag;\n } else if ((tag & 0xC0) === 0xC0) {\n let ofs = ((tag & 0x3F) << 8) | buf.readUInt8(pos++);\n res.push(parsedname(msgBuf, ofs, msgBuf, rec + 1));\n break;\n } else {\n throw new Error('parse error - bad tag');\n }\n }\n return res.join('.');\n}", "function formatAddress(address) {\n if (conf.hasOwnProperty(address)) {\n if (conf[address].hasOwnProperty('nickname')) {\n return conf[address]['nickname'] + \":\" + address;\n }\n }\n return address;\n}", "function Address(arg) {\n this.clear();\n if (typeof arg == \"string\") {\n this.fromString(arg);\n } else if (typeof arg == \"object\" && arg.constructor.name == \"Address\") {\n this.address = arg.address.slice();\n this.prefix = arg.prefix;\n this.type = arg.type;\n } else {\n throw \"constructor not implemented\";\n }\n}", "getFormattedAddress() {\n\n }", "function defangIPaddr(address) {\n return address.split(\".\").join(\"[.]\");\n}", "_fromString(str) {\n // trim off weird whitespace and extra trailing commas\n const parts = str.replace(/^[ ,]+|[ ,]+$/g, '').split(',').map(s => s.trim());\n\n this.name = parts[0].split('.').slice(0, -1).join('.');\n this.protocol = parts[0].split('.').slice(-1)[0];\n this.subtypes = parts.slice(1);\n }", "XY2Name( x,y )\n\t{\n\t\treturn( x.toString() + ',' + y.toString() )\n\t}", "function getAddress(node_name){\n\t// Load config data from SmartToken.json\n\tvar addrlist = require('./addr_list.json');\t\n\treturn addrlist[node_name];\t\n}", "function getAddress(node_name){\n\t// Load config data from SmartToken.json\n\tvar addrlist = require('./addr_list.json');\t\n\treturn addrlist[node_name];\t\n}", "function deepStripTupleAddresses(input, tupleTypes) {\n return input.map(function (item, i) {\n var type = tupleTypes[i].type;\n if (type === 'address' && typeof item === 'string') {\n return item.split('0x')[1];\n }\n if (type === 'address[]' || Array.isArray()) {\n return item.map(function (a) {\n return a.split('0x')[1];\n });\n }\n return item;\n });\n}", "function gatherStrings(obj) {\n\n}", "function stringifyExample(idValue, nameValue, typeValue, lengthValue, ownerValue, protocolVal, hostVal, baseVal) {\n return '{ \"id\": \"' + idValue + '\",\\n \"name\": \"' + nameValue + '\",\\n \"type\": \"' + typeValue + '\",\\n \"length\": ' + lengthValue + ',\\n \"owner\": \"' + ownerValue + '\",\\n \"self\": \"' + protocolVal + \"://\" + hostVal + baseVal + \"/\" + idValue + '\"\\n}';\n}", "getDesc( addr ){\n\t\treturn this.ROMRefs.IndexToName.has( addr ) ?\n\t\t\t\tthis.ROMRefs.IndexToName.get( addr )[0] :\n\t\t\t\tAddress.toBankString( addr, 'rom' );\n\t}", "function stringTuplesToString(tuples) {\n const parts = [];\n tuples.map((tup) => {\n const proto = protoFromTuple(tup);\n parts.push(proto.name);\n if (tup.length > 1) {\n parts.push(tup[1]);\n }\n });\n return cleanPath(parts.join('/'));\n}", "function listify(words: Array<string>): string {\n if (words.length === 1) { return words[0]; }\n return words.slice(0, words.length - 1).join(\", \") + \" and \" + words[words.length - 1];\n}\n\n\nlet cli = new CLI();\n\nabstract class EnsPlugin extends Plugin {\n _ethAddressCache: { [ addressOrInterfaceId: string ]: string };\n\n constructor() {\n super();\n ethers.utils.defineReadOnly(this, \"_ethAddressCache\", { });\n }\n\n getEns(): ethers.Contract {\n return new ethers.Contract(this.network.ensAddress, ensAbi, this.accounts[0] || this.provider);\n }", "function stringTuplesToString (tuples) {\n const parts = []\n tuples.map(tup => {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return cleanPath(parts.join('/'))\n}", "function stringTuplesToString (tuples) {\n const parts = []\n tuples.map(tup => {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return cleanPath(parts.join('/'))\n}", "function stringTuplesToString (tuples) {\n const parts = []\n tuples.map(tup => {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return cleanPath(parts.join('/'))\n}", "function stringTuplesToString (tuples) {\n const parts = []\n tuples.map(tup => {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return cleanPath(parts.join('/'))\n}", "function stringTuplesToString (tuples) {\n const parts = []\n tuples.map(tup => {\n const proto = protoFromTuple(tup)\n parts.push(proto.name)\n if (tup.length > 1) {\n parts.push(tup[1])\n }\n })\n\n return cleanPath(parts.join('/'))\n}", "function dnsQname(msg) {\n var i = 12;\n var qname = '';\n while (msg[i] !== '\\x00') {\n qname += msg[i];\n i++;\n }\n return qname + '\\x00';\n}", "toString() {\n return '[object NJSTProxy: ' + this._listenerAddress + ':' + this._listenerPort + ']';\n }", "function addressList() {\n return wrap('address-list', or(\n and(\n address,\n star(and(literal(','), address))\n ),\n obsAddrList\n )());\n }", "function addressList() {\n return wrap('address-list', or(\n and(\n address,\n star(and(literal(','), address))\n ),\n obsAddrList\n )());\n }", "function addressList() {\n return wrap('address-list', or(\n and(\n address,\n star(and(literal(','), address))\n ),\n obsAddrList\n )());\n }", "function addressList() {\n return wrap('address-list', or(\n and(\n address,\n star(and(literal(','), address))\n ),\n obsAddrList\n )());\n }", "function addressToAensPointee (address) {\n const key = {\n ak: 'AENS.AccountPt',\n ct: 'AENS.ContractPt',\n ok: 'AENS.OraclePt',\n ch: 'AENS.ChannelPt',\n }[address.substring(0, 2)];\n return { [key]: [`ak${address.substring(2)}`] }\n }", "function getOriginsString(inputData){\n\n return inputData.address1.coordinates.lat + ',' +\n inputData.address1.coordinates.lng + '|' +\n inputData.address2.coordinates.lat + ',' +\n inputData.address2.coordinates.lng;\n\n // if it becomes useful to query using a single address,\n // could pass in a flag to tell this func to create a Origins String using:\n // - both address1 and address2\n // - only address1\n // - only address2\n // create string for 2 origin addresses\n}", "function parseUrl(urlPart, name_size){\n let output = \"\"; \n let i = 3; \n for(i=5;i<name_size;i++){\n output = output.concat(urlPart[i])\n }\n return output; //returns city name \n}", "function getTokenAddress(tokenName) {\n\t\n\tvar result = null;\n\n\tif (tokenName == \"TEST\") {\n\t\tresult = \"0x875664e580eea9d5313f056d0c2a43af431c660f\";\n\t} else if (tokenName == \"DAI\") {\n\t\tresult = \"0x89d24a6b4ccb1b6faa2625fe562bdd9a23260359\";\n\t}\n\n\treturn result;\n}", "function myAddresses(){\n\tlet ifaces = os.networkInterfaces() ;\n\tlet ret = [] ;\n\tfor( const i in ifaces ){\n\t\tret = ret.concat(ifaces[i].filter(e => {\n\t\t\treturn (e.family === 'IPv4' && e.internal === false);\n\t\t})) ;\n\t}\n\treturn ret ;\n}", "function convertAddress(s) {\n var chars = [];\n for (var i = 0; i < s.length; i += 1) {\n var code = s.charCodeAt(i);\n if (code >= 0x2400) {\n code -= 0x2400;\n }\n chars.push(String.fromCharCode(code));\n }\n return chars.join('');\n}", "function list(names) {\n if (names.length == 1) {\n const str = Object.values(names[0]);\n return str.toString();\n }\n else if (names.length == 2) {\n const str = `${Object.values(names[0])}` + ' & ' + `${Object.values(names[1])}`;\n return str\n }\n else if (names.length >= 3) {\n const last_element = names.reverse().shift();\n const near_last_element = names.reverse().pop();\n let str_1 = \"\"\n for (let i = 0; i < names.length; i++) {\n str_1 += `${Object.values(names[i])}` + ', '\n }\n const str_2 = str_1 + `${Object.values(near_last_element)}` + ' & ' + `${Object.values(last_element)}`\n return str_2\n }\n else {\n const str = '';\n return str\n }\n}", "function nameString(obj) {\n}", "function buildName(nameNode)\n{\n if(!nameNode)\n return null;\n\n var name=\"\";\n\n // use the first occurrence of name if more than one is found\n if(Array.isArray(nameNode))\n nameNode=nameNode[0];\n\n if(nameNode.prefix)\n name=getNodeText(nameNode.prefix)+\" \";\n\n if(Array.isArray(nameNode.given))\n {\n for(var i=0; i<nameNode.given.length; i++)\n name+=getNodeText(nameNode.given[i])+\" \";\n }\n else\n name+=getNodeText(nameNode.given)+\" \";\n\n name+=getNodeText(nameNode.family);\n\n if(nameNode.suffix)\n name+=\", \"+getNodeText(nameNode.suffix);\n\n return name;\n}", "qname(name) {\n // This is faster than using name.split(\":\").\n const colon = name.indexOf(\":\");\n if (colon === -1) {\n return { prefix: \"\", local: name };\n }\n const local = name.slice(colon + 1);\n const prefix = name.slice(0, colon);\n if (prefix === \"\" || local === \"\" || local.includes(\":\")) {\n this.fail(`malformed name: ${name}.`);\n }\n return { prefix, local };\n }", "function mapLayerNames(names) {\n return (names || []).reduce(function(memo, str) {\n var parts = str.split('='),\n dest = utils.trimQuotes(parts[0]),\n src = utils.trimQuotes(parts[1] || '');\n if (!src) stop(\"Invalid name assignment:\", str);\n memo[src] = dest;\n return memo;\n }, {});\n }", "function findPart(addressParts, typeName, getShortVersion) {\r\n\t\t\tif (addressParts == null || addressParts.length == 0)\r\n\t\t\t// address not available\r\n\t\t\t\treturn \"\";\r\n\r\n\t\t\tvar value = \"\";\r\n\r\n\t\t\tfor (var i = 0; i < addressParts.length; i++) {\r\n\t\t\t\tvar item = addressParts[i],\r\n\t\t\t\t\t\tfound = false\r\n\t\t\t\t;\r\n\r\n\t\t\t\tfor (var j = 0; j < item.types.length; j++) {\r\n\t\t\t\t\tvar addrType = item.types[j];\r\n\r\n\t\t\t\t\tif (addrType.toLowerCase() == typeName.toLowerCase()) {\r\n\t\t\t\t\t\tfound = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t} // types\r\n\r\n\t\t\t\tif (found) {\r\n\t\t\t\t\tvalue = (getShortVersion\r\n\t\t\t\t\t\t? item.short_name\r\n\t\t\t\t\t\t: item.long_name\r\n\t\t\t\t\t);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\r\n\t\t\treturn value;\r\n\r\n\t\t} // findPart", "function qname(m)\r\n{\r\n\treturn \"\\x22\" + m + \"\\x22\";\r\n}", "async buildAddressList(hostInfo, protocol,\n proxyHost, proxyPort) {\n let shost = '';\n let ipcnt = 0;\n const builder = new Array();\n let proxyInfo = '';\n if (proxyHost != null) {\n if (proxyPort != null) {\n proxyInfo = `(HTTPS_PROXY=${proxyHost})(HTTPS_PROXY_PORT=${proxyPort})`;\n } else {\n proxyInfo = `(HTTPS_PROXY=${proxyHost})`;\n }\n }\n\n if (protocol == null) protocol = 'TCP';\n let naddr = 0;\n // ; groups the user into a ADDRESS_LIST\n const addressLists = hostInfo.split(\";\");\n for (const addressList in addressLists) {\n let addressNodeCount = 0;\n const addressListBuilder = new Array();\n for (const match of addressLists[addressList].matchAll(HOSTNAMES_PATTERN)) {\n const hostnames = (match.groups.hostnames).split(',');\n let port = match.groups.port;\n if (port == null) {\n port = '1521' + '';\n }\n for (const hname in hostnames) {\n addressListBuilder.push(this.getAddrStr(hostnames[hname], port, protocol, proxyInfo));\n shost = hostnames[hname];\n addressNodeCount++;\n }\n }\n naddr += addressNodeCount;\n const parts = [];\n if (addressLists.length > 1 && addressNodeCount > 1)\n parts.push('(LOAD_BALANCE=ON)');\n parts.push(addressListBuilder.join(''));\n if (addressLists.length > 1)\n builder.push(`(ADDRESS_LIST=${parts.join('')})`);\n else\n builder.push(parts.join(''));\n }\n if (naddr == 1) {\n shost = shost.trim();\n // If it is IPV6 format address then remove the enclosing '[' and ']'\n if (shost.startsWith(\"[\") && shost.endsWith(\"]\"))\n shost = shost.substring(1, shost.length - 1);\n try {\n await lookup(shost);\n ipcnt++;\n } catch {\n // nothing\n }\n if (ipcnt == 0) {\n errors.throwErr(errors.ERR_INVALID_EZCONNECT_SYNTAX, 'could not resolve hostname', shost);\n }\n }\n\n if (addressLists.length < 2 && naddr > 1) {\n this.lb = true;\n }\n\n return builder.join('');\n\n }", "function formatType(addrStr)\n{\n var pos = addrStr.indexOf(\"..\");\n if(pos != -1)\n\treturn -1; \n var a = addrStr.split(\".\");\n if(a.length < 2)\n\t\treturn false;\n var allInt = true;\n for(var i=0; i < a.length; i++)\n {\n if(!isIntStr(a[i]))\n\t\tallInt = false;\n }\n if(allInt)\n {\n\tif(a.length == 4)\n\t\treturn 0; //ip\n\treturn -1;//incorrect ip\n }\n return 1; // domain\n}", "function getAddress() {\r\n\ta = document.title.split(\"|\")[0].replace (/ /, \"+\" );\r\n\t// alert (a);\r\n\treturn a.replace (/ /, \"+\" );\r\n}", "function findAddress(address, addresses)\n{\n\taddress = address.toLowerCase()\n\taddress = address.replaceAll(\",\", \"\").replaceAll(\"street\", \"st\").replaceAll(\"road\", \"rd\").replaceAll(\"avenue\", \"ave\")\n\t//console.log(\"Checking: \" + address)\n\tvar longestSubstringIndex = 0\n\tvar longestSubstring = \"\"\n\n\tfor (var i = 0; i < addresses.length; i++)\n\t{\n\t\tvar a = addresses[i].toLowerCase()\n\t\ta = a.replaceAll(\",\", \"\").replaceAll(\"street\", \"st\").replaceAll(\"road\", \"rd\").replaceAll(\"avenue\", \"ave\")\n\n\t\t//console.log(\"Comparing: \" + a)\n\n\t\tvar substring = longestCommonSubstring(a, address)\n\n\t\t//console.log(\"subString: \" + substring)\n\n\t\tif (substring.length > longestSubstring.length)\n\t\t{\n\t\t\tlongestSubstring = substring\n\t\t\tlongestSubstringIndex = i\n\t\t}\n\t}\n\n\t//console.log(\"Returning: \" + longestSubstringIndex + \"\\n\\n\\n\")\n\n\treturn [address, addresses[longestSubstringIndex]]\n}", "function formatAddress(place) {\n var returnString;\n if (place.vicinity.split(\",\").length > 2) {\n returnString = place.vicinity.split(\",\")[0] + \", Trondheim\";\n } else {\n returnString = place.vicinity;\n }\n return returnString;\n}", "function nameInspector(string) {\n var isArray = /\\[\\]$/.test(string);\n var name = (isArray) ? string.match(/[^\\[]*/)[0] : string;\n return {name: name, observerName: name+\"Obs\", isArray: isArray};\n}" ]
[ "0.6510328", "0.60950327", "0.60950327", "0.60950327", "0.60950327", "0.5971983", "0.5971923", "0.59304994", "0.5918348", "0.5918348", "0.5918348", "0.5918348", "0.5918348", "0.5845686", "0.5845686", "0.5845686", "0.5845686", "0.5845686", "0.5636138", "0.5516671", "0.54219544", "0.5417444", "0.5293811", "0.52874744", "0.5275721", "0.5203098", "0.5203098", "0.5203098", "0.5203098", "0.5194101", "0.51456463", "0.51383376", "0.5133605", "0.51212996", "0.51122034", "0.51048017", "0.50932807", "0.50932807", "0.50932807", "0.50932807", "0.5082483", "0.50818366", "0.50691605", "0.5054088", "0.5049595", "0.50007826", "0.49979454", "0.4989874", "0.4979528", "0.4978838", "0.49755964", "0.49744955", "0.49607393", "0.49556306", "0.49546593", "0.4951522", "0.49480537", "0.4936668", "0.493304", "0.493304", "0.4927748", "0.49269682", "0.49131978", "0.4909071", "0.4906559", "0.490523", "0.48968005", "0.48968005", "0.48968005", "0.48968005", "0.48968005", "0.48864254", "0.48686466", "0.486768", "0.486768", "0.486768", "0.486768", "0.48623797", "0.4859032", "0.4843141", "0.48420098", "0.48201862", "0.48179144", "0.48006296", "0.47950977", "0.4785895", "0.47757193", "0.47738475", "0.47662517", "0.47651064", "0.47588432", "0.4755797", "0.4750139", "0.47498572", "0.47495526", "0.47489583" ]
0.52569395
28
[[str name, str addr]... ] > [[int code, Buffer]... ]
function stringTuplesToTuples (tuples) { return map(tuples, function (tup) { if (!Array.isArray(tup)) { tup = [tup] } const proto = protoFromTuple(tup) if (tup.length > 1) { return [proto.code, convert.toBuffer(proto.code, tup[1])] } return [proto.code] }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = new Buffer(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = new Buffer(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function encodeOpcode(name) {\n var params = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n params[_i - 1] = arguments[_i];\n }\n var opcode = opcodes[name];\n if (!opcode) {\n throw new Error(\"unknown opcode \" + name);\n }\n var loadArgs = opcode.loadArgs, storeArgs = opcode.storeArgs, code = opcode.code;\n if (params.length != loadArgs + storeArgs) {\n throw new Error(\"opcode '\" + name + \"' requires \" + (loadArgs + storeArgs) + \" arguments, but you gave me \" + params.length + \": \" + JSON.stringify(params));\n }\n // opcode\n var result;\n if (code >= 0x1000) {\n result = [0xC0, 0x00, code >> 8, code & 0xFF];\n }\n else if (code >= 0x80) {\n code = code + 0x8000;\n result = [code >> 8, code & 0xFF];\n }\n else {\n result = [code];\n }\n // loadArgs signature\n var sig = [];\n var i = 0;\n for (; i < loadArgs; i++) {\n var x = params[i];\n if (typeof (x) === 'number') {\n if (x === 0) {\n sig.push(0 /* zero */);\n continue;\n }\n if (-128 <= x && x <= 127) {\n sig.push(1 /* byte */);\n continue;\n }\n if (-0x10000 <= x && x <= 0xFFFF) {\n sig.push(2 /* int16 */);\n continue;\n }\n if (x > 0xFFFFFFFF || x < -0x100000000) {\n throw new Error(\"immediate load operand \" + x + \" out of signed 32 bit integer range.\");\n }\n sig.push(3 /* int32 */);\n continue;\n }\n if (typeof (x) === 'string') {\n if (x === 'pop') {\n sig.push(8 /* stack */);\n continue;\n }\n if (x.indexOf(\"*\") === 0) {\n parsePtr(x, params, i, sig);\n continue;\n }\n if (x.indexOf(\"Fr:\") === 0) {\n parseLocal(x, params, i, sig);\n continue;\n }\n }\n throw new Error(\"unsupported load argument \" + x + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n // storeArg signature\n if (storeArgs) {\n for (; i < loadArgs + storeArgs; i++) {\n var x = params[i];\n if (x === null || x === 0 /* discard */) {\n sig.push(0 /* discard */);\n continue;\n }\n if (typeof (x) === 'number') {\n if (x <= 0xFFFF) {\n sig.push(6 /* ptr_16 */);\n continue;\n }\n }\n if (typeof (x) === 'string') {\n if (x === 'push') {\n sig.push(8 /* stack */);\n continue;\n }\n if (x.indexOf(\"*\") === 0) {\n parsePtr(x, params, i, sig);\n continue;\n }\n if (x.indexOf(\"Fr:\") === 0) {\n parseLocal(x, params, i, sig);\n continue;\n }\n }\n throw new Error(\"unsupported store argument \" + x + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n }\n // signature padding\n if (i % 2) {\n sig.push(0);\n }\n for (var j = 0; j < sig.length; j += 2) {\n result.push(sig[j] + (sig[j + 1] << 4));\n }\n for (var j = 0; j < i; j++) {\n var s = sig[j];\n if (s === 0 /* zero */)\n continue;\n if (s === 8 /* stack */)\n continue;\n var x = params[j];\n if (s === 1 /* byte */) {\n result.push(uint8(x));\n continue;\n }\n if (s === 2 /* int16 */) {\n x = uint16(x);\n result.push(x >> 8);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 3 /* int32 */) {\n x = uint32(x);\n result.push(x >> 24);\n result.push((x >> 16) & 0xFF);\n result.push((x >> 8) & 0xFF);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 5 /* ptr_8 */ || s === 13 /* ram_8 */ || s === 9 /* local_8 */) {\n result.push(x);\n continue;\n }\n if (s === 6 /* ptr_16 */ || s === 14 /* ram_16 */) {\n result.push(x >> 8);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 7 /* ptr_32 */ || s === 15 /* ram_32 */) {\n result.push(x >> 24);\n result.push((x >> 16) & 0xFF);\n result.push((x >> 8) & 0xFF);\n result.push(x & 0xFF);\n continue;\n }\n throw new Error(\"unsupported argument \" + x + \" of type \" + s + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n return result;\n }", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function bytesToTuples(buf) {\n const tuples = [];\n let i = 0;\n while (i < buf.length) {\n const code = varint_1.default.decode(buf, i);\n const n = varint_1.default.decode.bytes;\n const p = protocols_1.protocols(code);\n const size = sizeForAddr(p, buf.slice(i + n));\n if (size === 0) {\n tuples.push([code]);\n i += n;\n continue;\n }\n const addr = buf.slice(i + n, i + n + size);\n i += size + n;\n if (i > buf.length) {\n // did not end _exactly_ at buf.length\n throw ParseError('Invalid address Uint8Array');\n }\n // ok, tuple seems good.\n tuples.push([code, addr]);\n }\n return tuples;\n}", "function find_code( arg_startEA , arg_flags )\n{\n\treturn Number64( process.reserved.hostDependBindings.ida_find_code( Number64( arg_startEA ) , arg_flags ) );\n}", "linkBytecode (bytecode, libs) {\n const links = Object.assign({}, libs)\n const keys = Object.keys(links)\n for (let i = 0; i < keys.length; i++) {\n let name = keys[i]\n let addr = links[name]\n\n // Truncate to 37 characters\n name = name.slice(0, 36)\n\n // Prefix and suffix with __\n let label = '__' + name + Array(37 - name.length).join('_') + '__'\n\n if (addr.slice(0, 2) !== '0x' || addr.length > 42) {\n throw new Error('Invalid address specified for ' + name)\n }\n\n // Remove 0x prefix\n addr = addr.slice(2)\n addr = Array(40 - addr.length + 1).join('0') + addr\n\n while (bytecode.indexOf(label) >= 0) {\n bytecode = bytecode.replace(label, addr)\n }\n const regex = new RegExp('__' + name + '_+', 'g')\n\n bytecode = bytecode.replace(regex, addr.replace('0x', ''))\n }\n\n return bytecode\n }", "function _bytecode2basicblockList( data ) {\n\tif( typeof data === 'undefined' ) {\n\t\treturn [] ;\n\t}\n\tvar basicblockList = []\n\tvar current = 0 ;\n\tbasicblockList[ current ] = [] ;\n\tvar pc = 0 ;\n\twhile( data.length > 0 ) {\n\t\tconst opcode = '0x' + data.slice( 0, 2 ) ;\n\t\tconst name = ( typeof _EVM[ opcode ] !== 'undefined' ? _EVM[ opcode ] : 'UNDEFINED' ) ;\n\t\tconst instr = {\n\t\t\tpc: pc,\n\t\t\topcode: opcode,\n\t\t\tname: name\n\t\t} ;\n\t\tdata = data.slice( 2 ) ;\n\t\tpc += 1 ;\n\t\tconst length = _isPUSH( opcode ) ;\n\t\tif( length > 0 ) {\n\t\t\tconst args = data.slice( 0, 2 * length ).replace( /^0*/, '' ) ;\n\t\t\tinstr.args = '0x' + ( args.length === 0 ? '0' : args ) ;\n\t\t\tdata = data.slice( 2 * length ) ;\n\t\t\tpc += length ;\n\t\t} else if( _isJUMPDEST( opcode ) === 1 ) {\n\t\t\tcurrent ++ ;\n\t\t\tbasicblockList[ current ] = [ ] ;\n\t\t}\n\t\tbasicblockList[ current ].push( instr ) ;\n\t}\n\treturn basicblockList ;\n}", "function mapCodeFromRpcCode(code){if(code===undefined){// This shouldn't normally happen, but in certain error cases (like trying\n// to send invalid proto messages) we may get an error with no GRPC code.\nindex_esm_error('GRPC error has no .code');return Code.UNKNOWN;}switch(code){case RpcCode.OK:return Code.OK;case RpcCode.CANCELLED:return Code.CANCELLED;case RpcCode.UNKNOWN:return Code.UNKNOWN;case RpcCode.DEADLINE_EXCEEDED:return Code.DEADLINE_EXCEEDED;case RpcCode.RESOURCE_EXHAUSTED:return Code.RESOURCE_EXHAUSTED;case RpcCode.INTERNAL:return Code.INTERNAL;case RpcCode.UNAVAILABLE:return Code.UNAVAILABLE;case RpcCode.UNAUTHENTICATED:return Code.UNAUTHENTICATED;case RpcCode.INVALID_ARGUMENT:return Code.INVALID_ARGUMENT;case RpcCode.NOT_FOUND:return Code.NOT_FOUND;case RpcCode.ALREADY_EXISTS:return Code.ALREADY_EXISTS;case RpcCode.PERMISSION_DENIED:return Code.PERMISSION_DENIED;case RpcCode.FAILED_PRECONDITION:return Code.FAILED_PRECONDITION;case RpcCode.ABORTED:return Code.ABORTED;case RpcCode.OUT_OF_RANGE:return Code.OUT_OF_RANGE;case RpcCode.UNIMPLEMENTED:return Code.UNIMPLEMENTED;case RpcCode.DATA_LOSS:return Code.DATA_LOSS;default:return fail('Unknown status code: '+code);}}", "function read(code){\n return code;\n}", "function parse_response(code, buffer) {\n var input, type, args, num_fields, data, size, i;\n reader = buffer.toReader();\n args = [];\n switch (code) {\n case 'R':\n switch (reader.int32()) {\n case 0:\n type = \"AuthenticationOk\";\n break;\n case 2:\n type = \"AuthenticationKerberosV5\";\n break;\n case 3:\n type = \"AuthenticationCleartextPassword\";\n break;\n case 4:\n type = \"AuthenticationCryptPassword\";\n args = [reader.string(2)];\n break;\n case 5:\n type = \"AuthenticationMD5Password\";\n args = [reader.buffer(4)];\n break;\n case 6:\n type = \"AuthenticationSCMCredential\";\n break;\n case 7:\n type = \"AuthenticationGSS\";\n break;\n case 8:\n // TODO: add in AuthenticationGSSContinue\n type = \"AuthenticationSSPI\";\n break;\n default:\n \n break;\n }\n break;\n case 'E':\n type = \"ErrorResponse\";\n args = [{}];\n reader.multicstring().forEach(function (field) {\n args[0][field[0]] = field.substr(1);\n });\n break;\n case 'S':\n type = \"ParameterStatus\";\n args = [reader.cstring(), reader.cstring()];\n break;\n case 'K':\n type = \"BackendKeyData\";\n args = [reader.int32(), reader.int32()];\n break;\n case 'Z':\n type = \"ReadyForQuery\";\n args = [reader.string(1)];\n break;\n case 'T':\n type = \"RowDescription\";\n num_fields = reader.int16();\n data = [];\n for (i = 0; i < num_fields; i += 1) {\n data.push({\n field: reader.cstring(),\n table_id: reader.int32(),\n column_id: reader.int16(),\n type_id: reader.int32(),\n type_size: reader.int16(),\n type_modifier: reader.int32(),\n format_code: reader.int16()\n });\n }\n args = [data];\n break;\n case 'D':\n type = \"DataRow\";\n data = [];\n num_fields = reader.int16();\n for (i = 0; i < num_fields; i += 1) {\n size = reader.int32();\n if (size === -1) {\n data.push(null);\n } else {\n data.push(reader.string(size));\n }\n }\n args = [data];\n break;\n case 'C':\n type = \"CommandComplete\";\n args = [reader.cstring()];\n break;\n case 'N':\n type = \"NoticeResponse\";\n args = [{}];\n reader.multicstring().forEach(function (field) {\n args[0][field[0]] = field.substr(1);\n });\n break;\n }\n if (!type) {\n sys.debug(\"Unknown response \" + code); \n }\n return {type: type, args: args};\n}", "function decodeBasicProgram(binary) {\n const b = new teamten_ts_utils_1.ByteReader(binary);\n let state;\n let preStringState = ParserState.NORMAL;\n let error;\n const annotations = [];\n // Map from byte address to BasicElement for that byte.\n const elements = [];\n const firstByte = b.read();\n if (firstByte === exports.BASIC_TAPE_HEADER_BYTE) {\n if (b.read() !== exports.BASIC_TAPE_HEADER_BYTE || b.read() !== exports.BASIC_TAPE_HEADER_BYTE) {\n return undefined;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Header\", 0, b.addr()));\n // One-byte ASCII program name. This is nearly always meaningless, so we do nothing with it.\n b.read();\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Name\", b.addr() - 1, b.addr()));\n }\n else if (firstByte === exports.BASIC_HEADER_BYTE) {\n // All good.\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Header\", 0, b.addr()));\n }\n else {\n return undefined;\n }\n while (true) {\n // Read the address of the next line. We ignore this (as does Basic when\n // loading programs), only using it to detect end of program. (In the real\n // Basic these are regenerated after loading.)\n const address = b.readShort(true);\n if (address === teamten_ts_utils_1.EOF) {\n error = \"EOF in next line's address\";\n break;\n }\n // Zero address indicates end of program.\n if (address === 0) {\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"End-of-program marker\", b.addr() - 2, b.addr()));\n break;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Address of next line (0x\" + z80_base_1.toHexWord(address) + \")\", b.addr() - 2, b.addr()));\n // Read current line number.\n const lineNumber = b.readShort(false);\n if (lineNumber === teamten_ts_utils_1.EOF) {\n error = \"EOF in line number\";\n break;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Line number (\" + lineNumber + \")\", b.addr() - 2, b.addr()));\n elements.push(new BasicElement(b.addr() - 2, lineNumber.toString(), ElementType.LINE_NUMBER, 2));\n elements.push(new BasicElement(undefined, \" \", ElementType.REGULAR));\n // Read rest of line.\n const lineAddr = b.addr();\n const lineElementsIndex = elements.length;\n let c; // Uint8 value.\n let ch; // String value.\n state = ParserState.NORMAL;\n while (true) {\n c = b.read();\n if (c === teamten_ts_utils_1.EOF || c === 0) {\n break;\n }\n ch = String.fromCharCode(c);\n // Special handling of sequences of characters that start with a colon.\n if (ch === \":\" && state === ParserState.NORMAL) {\n const colonAddr = b.addr() - 1;\n if (b.peek(0) === ELSE) {\n // :ELSE gets translated to just ELSE, probably because an old version\n // of Basic only supported ELSE after a colon.\n b.read(); // ELSE\n elements.push(new BasicElement(colonAddr, \"ELSE\", ElementType.KEYWORD, b.addr() - colonAddr));\n }\n else if (b.peek(0) === REM && b.peek(1) === REMQUOT) {\n // Detect the \":REM'\" sequence (colon, REM, single quote), because\n // that translates to a single quote. Must be a backward-compatible\n // way to add a single quote as a comment.\n b.read(); // REM\n b.read(); // REMQUOT\n elements.push(new BasicElement(colonAddr, \"'\", ElementType.COMMENT, b.addr() - colonAddr));\n state = ParserState.REM;\n }\n else {\n elements.push(new BasicElement(colonAddr, \":\", ElementType.PUNCTUATION));\n }\n }\n else {\n switch (state) {\n case ParserState.NORMAL:\n const token = getToken(c);\n elements.push(token !== undefined\n ? new BasicElement(b.addr() - 1, token, c === DATA || c === REM ? ElementType.COMMENT\n : token.length === 1 ? ElementType.PUNCTUATION\n : ElementType.KEYWORD)\n : new BasicElement(b.addr() - 1, ch, ch === '\"' ? ElementType.STRING : ElementType.REGULAR));\n if (c === REM) {\n state = ParserState.REM;\n }\n else if (c === DATA) {\n state = ParserState.DATA;\n }\n else if (ch === '\"') {\n preStringState = state;\n state = ParserState.STRING;\n }\n break;\n case ParserState.STRING:\n // Put the real value in the string. Code displaying can use the methods of\n // BasicElement to convert it before printing.\n elements.push(new BasicElement(b.addr() - 1, ch, ElementType.STRING));\n if (ch === '\"') {\n // End of string.\n state = preStringState;\n }\n break;\n case ParserState.REM:\n elements.push(new BasicElement(b.addr() - 1, ch, ElementType.COMMENT));\n break;\n case ParserState.DATA:\n let elementType = ElementType.COMMENT;\n if (ch === \":\") {\n elementType = ElementType.PUNCTUATION;\n state = ParserState.NORMAL;\n }\n if (ch === '\"') {\n elementType = ElementType.STRING;\n preStringState = state;\n state = ParserState.STRING;\n }\n elements.push(new BasicElement(b.addr() - 1, ch, elementType));\n break;\n }\n }\n }\n if (c === teamten_ts_utils_1.EOF) {\n error = \"EOF in line\";\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Partial line\", lineAddr, b.addr()));\n break;\n }\n const textLineParts = [];\n for (let i = lineElementsIndex; i < elements.length; i++) {\n textLineParts.push(elements[i].text);\n }\n let textLine = textLineParts.join(\"\").replace(/[\\n\\r]+/, \" \");\n if (textLine.length > 33) {\n textLine = textLine.substr(0, 30) + \"...\";\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Line: \" + textLine, lineAddr, b.addr() - 1));\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"End-of-line marker\", b.addr() - 1, b.addr()));\n }\n return new BasicProgram(binary, error, annotations, elements);\n}", "get_index_bin() {\n // the name, the id.\n // make xas2 capable of storing a string and showing how long it is?\n // incrementors themselves - global prefix of 0 (MAGIC NUMBER)\n // the incrementors index will have a global prefix of 1. (MAGIC NUMBER)\n // returns an array containing pairs (nested array)\n // Need to get the key as a buffer.\n\n // prefix space 1, index number 0 within incrementor indexes, name, incrementor id\n\n //var arr_idx_key = [1, 0, this.name, this.id];\n var arr_idx_key = [this.name, this.id];\n var buf_key = encode_to_buffer(arr_idx_key, 1, 0);\n //console.log('buf_key', buf_key);\n var res = [\n [buf_key, null]\n ];\n //console.log('res', res);\n //throw 'stop';\n return res;\n\n }", "execute(code){\n }", "function mapCodeFromRpcCode(code) {\n switch (code) {\n case RpcCode.OK:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OK;\n case RpcCode.CANCELLED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].CANCELLED;\n case RpcCode.UNKNOWN:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INTERNAL;\n case RpcCode.UNAVAILABLE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DATA_LOSS;\n default:\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "function mapCodeFromRpcStatus(status){// tslint:disable-next-line:no-any lookup by string\nvar code=RpcCode[status];if(code===undefined){return undefined;}return mapCodeFromRpcCode(code);}", "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n log.error('GRPC error has no .code');\n return error_1.Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return error_1.Code.OK;\n case RpcCode.CANCELLED:\n return error_1.Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return error_1.Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return error_1.Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return error_1.Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return error_1.Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return error_1.Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return error_1.Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return error_1.Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return error_1.Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return error_1.Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return error_1.Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return error_1.Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return error_1.Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return error_1.Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return error_1.Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return error_1.Code.DATA_LOSS;\n default:\n return assert_1.fail('Unknown status code: ' + code);\n }\n}", "function EXECUTE (bytearr) {\n\tvar numbytes = bytearr.length,\n\t\ticode,\n\t\tilen,\n\t\tinstr;\n\t\tMEMORY \t= bytearr;\n\t\tSTAT\t= 'AOK';\n\tRESET();\n\twhile (PC < numbytes && STAT === 'AOK') {\n\t\ticode = MEMORY[PC] >> 4;\n\t\tilen = INSTRUCTION_LEN[icode];\n\t\tinstr = MEMORY.slice(PC, PC + ilen);\n\t\targs = DECODE(instr);\n\t\t//print(PC + ': ');\n\t\t//print(args);\n\t\tPC += ilen;\n\t\tINSTR[icode].call(args);\n\t\t//printRegisters(REG);\n\t}\n\treturn STAT;\n}", "function mapCodeFromRpcCode(code) {\n switch (code) {\n case RpcCode.OK:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OK;\n case RpcCode.CANCELLED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].CANCELLED;\n case RpcCode.UNKNOWN:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INTERNAL;\n case RpcCode.UNAVAILABLE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DATA_LOSS;\n default:\n return Object(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n __WEBPACK_IMPORTED_MODULE_2__util_log__[\"a\" /* error */]('GRPC error has no .code');\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OK;\n case RpcCode.CANCELLED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].CANCELLED;\n case RpcCode.UNKNOWN:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INTERNAL;\n case RpcCode.UNAVAILABLE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DATA_LOSS;\n default:\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "function codeGenerated(err, code){\n\tconsole.log(code);\n}", "function caml_reify_bytecode (code, sz) {\n return eval(caml_global_data.compile(code).toString());\n}", "function getCode(hex) {\r\n\tfor (key in immed_instr) \r\n\t\tif (hex == immed_instr[key]) \r\n\t\t\treturn key;\r\n\tfor (key in base_instr) \r\n\t\tif (hex == base_instr[key]) \r\n\t\t\treturn key;\r\n\tfor (key in pcrel_instr) \r\n\t\tif (hex == pcrel_instr[key]) \r\n\t\t\treturn key;\r\n\tfor (key in pseudodir_instr) \r\n\t\tif (hex == pseudodir_instr[key]) \r\n\t\t\treturn key;\r\n\treturn null;\r\n}", "function _0x49e8(){const _0x2abf1f=['128458zaqRph','15LuvETp','32FoIOpf','By\\x20:\\x20Prassz','307917pLgBPR','Zerobot~Prassz','127514DLEruK','2301110zFGGkR','11iUrhyl','5IBSTLg','sendMessage','2099160NwtLDQ','672988HpVyoZ','1059558OLmAKI'];_0x49e8=function(){return _0x2abf1f;};return _0x49e8();}", "function mapRpcCodeFromCode(code){if(code===undefined){return RpcCode.OK;}switch(code){case Code.OK:return RpcCode.OK;case Code.CANCELLED:return RpcCode.CANCELLED;case Code.UNKNOWN:return RpcCode.UNKNOWN;case Code.DEADLINE_EXCEEDED:return RpcCode.DEADLINE_EXCEEDED;case Code.RESOURCE_EXHAUSTED:return RpcCode.RESOURCE_EXHAUSTED;case Code.INTERNAL:return RpcCode.INTERNAL;case Code.UNAVAILABLE:return RpcCode.UNAVAILABLE;case Code.UNAUTHENTICATED:return RpcCode.UNAUTHENTICATED;case Code.INVALID_ARGUMENT:return RpcCode.INVALID_ARGUMENT;case Code.NOT_FOUND:return RpcCode.NOT_FOUND;case Code.ALREADY_EXISTS:return RpcCode.ALREADY_EXISTS;case Code.PERMISSION_DENIED:return RpcCode.PERMISSION_DENIED;case Code.FAILED_PRECONDITION:return RpcCode.FAILED_PRECONDITION;case Code.ABORTED:return RpcCode.ABORTED;case Code.OUT_OF_RANGE:return RpcCode.OUT_OF_RANGE;case Code.UNIMPLEMENTED:return RpcCode.UNIMPLEMENTED;case Code.DATA_LOSS:return RpcCode.DATA_LOSS;default:return fail('Unknown status code: '+code);}}", "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case error_1.Code.OK:\n return RpcCode.OK;\n case error_1.Code.CANCELLED:\n return RpcCode.CANCELLED;\n case error_1.Code.UNKNOWN:\n return RpcCode.UNKNOWN;\n case error_1.Code.DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case error_1.Code.RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case error_1.Code.INTERNAL:\n return RpcCode.INTERNAL;\n case error_1.Code.UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case error_1.Code.UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case error_1.Code.INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case error_1.Code.NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case error_1.Code.ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case error_1.Code.PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case error_1.Code.FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case error_1.Code.ABORTED:\n return RpcCode.ABORTED;\n case error_1.Code.OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case error_1.Code.UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case error_1.Code.DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return assert_1.fail('Unknown status code: ' + code);\n }\n}", "function makeRequestCode(x) {\n return \"src\" + x.src + \"_dst\" + x.dst + \"_seqNumber\" + x.seqNumber;\n}", "function Code() {\n // convert to comp bit code\n}", "function CodeT() {\n this.table = [];\n this.currentAddr = 0;\n this.heapPos = 255;\n for (var i = 0; i < 256; i++) {\n this.table[i] = \"\";\n }\n }", "getCode() {\n return (this.isCombined())\n ? this.combinedData.charCodeAt(this.combinedData.length - 1)\n : this.content & 2097151 /* CODEPOINT_MASK */;\n }", "function parseCode(code) {\n // find text segment\n let textLocation = code.search(/\\.text/i);\n if(textLocation == -1) return syntaxError('NA', 'The .text directive must be included to indicate the code section.');\n // labels, memory\n let labelsInstructions = textToInstructions(code.slice(textLocation + 5), code.slice(0, textLocation + 1).split('\\n').length);\n if(labelsInstructions == -1) return -1;\n // find data segment\n let dataLocation = code.search(/\\.data/i);\n let dataMemory = {};\n if(dataLocation != -1) {\n if(dataLocation > textLocation) dataMemory = dataToMemory(code.slice(dataLocation + 5), code.slice(0, dataLocation + 1).split('\\n').length);\n else dataMemory = dataToMemory(code.slice(dataLocation + 5, textLocation), code.slice(0, dataLocation + 1).split('\\n').length);\n }\n if(dataMemory == -1) return -1;\n\n // if the .globl directive is defined, try to set the startAddress to its label\n let globlLocation = code.search(/\\.globl /i);\n let startAddress;\n if(globlLocation == -1) startAddress = TEXT_START_ADDRESS;\n else {\n let remaining = code.slice(globlLocation + 6);\n let endOfGloblLine = remaining.indexOf('\\n');\n if(endOfGloblLine == -1 && !(remaining.slice(globlLocation + 6).trim() in labelsInstructions[0])) return syntaxError(code.slice(0, globlLocation + 1).split('\\n').length, 'Label: ' + remaining.slice(globlLocation + 6).trim() + ' is not a defined label!');\n else if(endOfGloblLine != -1 && !(remaining.slice(globlLocation + 6, endOfGloblLine).trim() in labelsInstructions[0])) return syntaxError(code.slice(0, globlLocation + 1).split('\\n').length, 'Label: ' + remaining.slice(globlLocation + 6, endOfGloblLine).trim() + ' is not a defined label!');\n startAddress = (endOfGloblLine == -1) ? labelsInstructions[0][remaining.slice(globlLocation + 6).trim()] : labelsInstructions[0][remaining.slice(globlLocation + 6, endOfGloblLine).trim()];\n }\n \n // [labels, memory, pcToLine, exitAddress, startAddress]\n return [\n Object.assign({}, dataMemory[0], labelsInstructions[0]),\n Object.assign({}, dataMemory[1], labelsInstructions[1]),\n labelsInstructions[2],\n Math.max.apply(null, Object.keys(labelsInstructions[1])),\n startAddress\n ];\n}", "function parseCodes()\n{\n\tvar codes=document.getElementsByTagName(\"code\");\n\tparseActual(codes, 0);\n }", "function mapCodeInfo(mapcode) {\n var head = mapcode.split(':')[0];\n var body = mapcode.split(':')[1];\n\n var head = head.split('.');\n var dims = head[0].split('x');\n var m = parseInt(dims[0]);\n var n = parseInt(dims[1]);\n if (head[1][0] != 'c') {console.log('head[1][0] was ' + head[1][0] + ' expected c');}\n if (head[2][0] != 'r') {console.log('head[2][0] was ' + head[2][0] + ' expected r');}\n if (head[3][0] != 'w') {console.log('head[3][0] was ' + head[3][0] + ' expected w');}\n var walls = parseInt(head[3].slice(1));\n if (head[4][0] != 't') {console.log('head[4][0] was ' + head[4][0] + ' expected t');}\n var name = head[5];\n\n // Figure out name\n if (name == '') {\n if (m == 13 && n == 7) {\n name = 'Simple';\n } else if (m == 15 && n == 9) {\n name = 'Normal';\n } else if (m == 19 && n == 9) {\n name = 'Complex';\n } else {\n console.log(\"can't figure out name of map\");\n }\n }\n\n // Result\n var result = {};\n result.mapType = name;\n result.walls = walls;\n\n var body_split = body.split('.').slice(0, -1);\n for (var k = 0; k < body_split.length; k++) {\n var item = body_split[k];\n var type = item[item.length - 1];\n resultIncr(result, type);\n }\n\n // Count number of checkpoints/TPs\n var cps = 0;\n for (var i = 0; i < 5; i++) {\n if (result[tiles.CHECKPOINTS[i]]) {\n cps += 1;\n }\n }\n result.cps = cps;\n\n var tps = 0;\n for (var i = 0; i < 5; i++) {\n if (result[tiles.TELE_INS[i]]) {\n tps += 1;\n }\n }\n result.tps = tps;\n\n\n return result;\n}", "function retrieveAppCall(sb) {\n const output = {\n scriptHash: \"\",\n args: [],\n };\n while (!sb.isEmpty()) {\n const b = sb.read();\n const n = parseInt(b, 16);\n switch (true) {\n case n === 0:\n output.args.unshift(0);\n break;\n case n < 75:\n output.args.unshift(sb.read(n));\n break;\n case n >= 81 && n <= 96:\n output.args.unshift(n - 80);\n break;\n case n === 193:\n const len = output.args.shift();\n const cache = [];\n for (let i = 0; i < len; i++) {\n cache.unshift(output.args.shift());\n }\n output.args.unshift(cache);\n break;\n case n === 102:\n sb.pter = sb.str.length;\n break;\n case n === 103:\n output.scriptHash = reverseHex(sb.read(20));\n output.useTailCall = false;\n return output;\n case n === 105:\n output.scriptHash = reverseHex(sb.read(20));\n output.useTailCall = true;\n return output;\n case n === 241:\n break;\n default:\n throw new Error(`Encounter unknown byte: ${b}`);\n }\n }\n if (output.scriptHash === \"\") {\n return null;\n }\n return output;\n}", "function toByteArray(str) {\n\tvar lines = str.split('\\n'),\n\t\tline, addr, size, bytearr;\n\n\tbytearr = new Uint8Array(MEM_SIZE);\n\n\t// Set instructions at correct locations\n\tfor (i in lines) {\n\t\tline = lines[i];\n\t\tmatch = line.match(/\\s*(0x([0-9a-fA-F]+):\\s*)?([0-9a-fA-F]*)\\s*\\|.*/i);\n\t\tif (!match) {\n\t\t\tthrow 'Invalid instruction format on line ' + i + ': \"' + lines[i] + '\"';\n\t\t}\n\t\tinstr = hex2arr(match[3]);\n\t\ticode = parseInt(instr[0], 16);\n\t\tif (instr !== '') {\n\t\t\taddr = parseInt(match[2], 16);\n\t\t\tfor (var i = 0; i < instr.length; i++) {\n\t\t\t\tbytearr[addr + i] = instr[i];\n\t\t\t\t//console.log(match[2],instr[i].toString(16),i);\n\t\t\t}\n\t\t}\n\t}\n\treturn bytearr;\n}", "function SEND_CODE(c, tree) {\n\t\tsend_bits(tree[c].fc, tree[c].dl);\n\t}", "getCodeBuf() {\n if (MaterialBase.s_codeBuffer != null) {\n return MaterialBase.s_codeBuffer;\n }\n\n MaterialBase.s_codeBuffer = new ShaderCodeBuffer_1.default();\n return MaterialBase.s_codeBuffer;\n }", "function parseCallGraph(code, duplicate_calls=true, program_name=false, replace_fields={}) {\n let graph = {\n nodes: [],\n edges: []\n };\n \n let lineno = 0;\n code = code.split('\\n');\n \n function match(re) {\n var line = code[lineno];\n return re.exec(line);\n }\n \n function pushNode(id, type, data={}) {\n let node_ids = graph.nodes.map(n => {\n return n.id\n });\n if (node_ids.indexOf(id) == -1) {\n graph.nodes.push({\n id: id,\n name: id,\n type: type,\n data: data\n });\n }\n }\n \n function pushEdge(source, target, type) {\n let contains = false;\n graph.edges.forEach(e => {\n if (e.source == source && e.target == target) {\n contains = true;\n }\n });\n if (!contains || duplicate_calls) {\n graph.edges.push({\n source: source,\n target: target,\n type: type\n });\n }\n }\n \n // Line by line\n let program;\n \n while (lineno < code.length) {\n let matches;\n let fields;\n if(code[lineno].substring(6, 7) === \"*\") {\n lineno++;\n continue;\n }\n \n if ((matches = match(PROGRAM_ID_RE)) != null) {\n program = matches[1];\n } \n \n // Begining of a procedure\n else if ((matches = match(PROC_BEGIN_RE)) != null) {\n fields = {};\n console.assert(program !== undefined);\n \n let pnum = matches[1];\n let pname = matches[2];\n let proc = `${pnum}-${pname}`;\n if (program_name) {\n proc = `[${program}] ${proc}`;\n }\n \n // Iter the procedure line by line\n while (true) {\n \n // End of procedure found\n if ((matches = match(PROC_EXIT_RE)) != null) {\n let epnum = matches[1];\n console.assert(pnum == epnum);\n ++lineno;\n break;\n }\n \n // MOVE command found\n else if ((matches = match(MOVE_RE)) != null) {\n let value = matches[2];\n let fieldname = matches[1];\n if (!(fieldname in fields)) {\n fields[fieldname] = [];\n }\n fields[fieldname].push(value);\n }\n \n // Perform found\n else if ((matches = match(PERFORM_RE)) != null) {\n let ppnum = matches[1];\n let ppname = matches[2];\n let pproc = `${ppnum}-${ppname}`;\n if (program_name) {\n pproc = `[${program}] ${pproc}`;\n }\n pushNode(pproc, NodeType.PROCEDURE);\n pushEdge(proc, pproc, CallType.PERFORM);\n }\n \n // Batch call found\n else if ((matches = match(CALL_RE)) != null) {\n let cname = matches[1];\n if (cname in replace_fields) {\n cname = replace_fields[cname];\n }\n pushNode(cname, NodeType.BATCH_PROGRAM);\n pushEdge(proc, cname, CallType.CALL);\n }\n \n // Begining of an online call found(EXEC)\n else if ((matches = match(CICS_BEGIN_RE)) != null) {\n \n // Iter the EXEC block line by line\n while (true) {\n // End of EXEC found\n if ((matches = match(CICS_EXIT_RE)) != null) {\n ++lineno;\n break;\n }\n \n // Called program name found\n else if ((matches = match(CICS_PROGRAM_RE)) != null) {\n let pname = matches[1];\n if (pname in replace_fields) {\n pname = replace_fields[pname];\n }\n pushNode(pname, NodeType.ONLINE_PROGRAM);\n pushEdge(proc, pname, CallType.CICS_LINK);\n } \n ++lineno;\n }\n }\n ++lineno;\n }\n pushNode(proc, NodeType.PROCEDURE, {fields: fields});\n }\n debug(graph.nodes);\n ++lineno;\n }\n return graph;\n}", "function generate_native_code_for_Pcode(stream, context) {\n // our error-stack, where errors get shifted before we invoke error-filtering functions:\n // we 'unshift' errors into this stack so that the 'active error' is always at index 0,\n // which saves us the hassle of keeping track of the length of the array.\n // We ASSUME the number of error stack CHECKS is quite a bit higher than the number\n // of error stack PUSH+POP actions, so we decide a potentially less optimal \n // unshift-and-shift-vs-push-and-pop is preferable.\n var ex = context.error_stack;\n\n // misc references to context/global tables:\n var vt = context.variables;\n var ct = context.constants;\n\n var sourcecode = {\n fetch_variables: {}, // hash map! every variable that is used, is loaded only once, at the start!\n store_variables: {}, // hash map! every variable that is written is stored only once, at the end!\n body: [],\n };\n\n var scratch = [];\n\n function string_escape(s) {\n return s.replace(/[\"]/g, '\\\\\"');\n }\n\n for (var i = 0, len = stream.length; i < len; ) {\n var opcode = stream[i++];\n switch (opcode) {\n case CONSTANT:\n cv = stream[i++];\n a = ct[cv];\n continue;\n\n case NUM:\n scratch.push(stream[i++]);\n continue;\n\n // shorthand for NUM+SKIP: this value is a constant-folded value, while the skipped part of the stream remains for formatter walkers...\n case NUM_AND_SKIP:\n scratch.push(stream[i++]);\n i += stream[i];\n continue;\n\n case STRING:\n scratch.push('\"' + string_escape(stream[i++]) + '\"');\n continue;\n\n // shorthand for STRING+SKIP: this value is a constant-folded value, while the skipped part of the stream remains for formatter walkers...\n case STRING_AND_SKIP:\n a = stream[i++];\n i += stream[i];\n continue;\n\n case TRUE:\n a = true;\n continue;\n\n // shorthand for TRUE+SKIP: this value is a constant-folded value, while the skipped part of the stream remains for formatter walkers...\n case TRUE_AND_SKIP:\n a = true;\n i += stream[i];\n continue;\n\n case FALSE:\n a = false;\n continue;\n\n // shorthand for FALSE+SKIP: this value is a constant-folded value, while the skipped part of the stream remains for formatter walkers...\n case FALSE_AND_SKIP:\n a = false;\n i += stream[i];\n continue;\n\n case VAR:\n av = stream[i++];\n continue;\n\n// Now follow a few opcodes which didn't show up in the AST language before 'sorcerer': these boys are here to \n// help us transform grammar 'shift's into 'reduce' actions after type and code analysis inside the sorcerer\n// has done its job:\n\n case VAR_TO_VALUE: // assembly: fetch from address\n a = vt[av];\n continue;\n\n case VAR_VALUE: // shorthand for VAR | VAR_TO_VALUE\n a = vt[stream[i++]];\n continue;\n\n case MOVE_TO_R1: // ~ first 'shift' after another 'reduce'\n r1 = a;\n continue;\n\n case MOVE_TO_R2: // ~ second 'shift' after another 'reduce'\n r2 = a;\n continue;\n\n case MOVE_FROM_R1:\n a = r1;\n continue;\n\n case MOVE_FROM_R2:\n a = r2;\n continue;\n\n case MOVE_R2_TO_R1:\n r1 = r2;\n continue;\n\n case EXCHANGE_R1_R2:\n b = r2;\n r2 = r1;\n r1 = b;\n continue;\n\n case EXCHANGE_A_R1:\n b = r1;\n r1 = a;\n a = b;\n continue;\n\n case EXCHANGE_A_R2:\n b = r2;\n r2 = a;\n a = b;\n continue;\n\n case MOVE_ALL_TO_RX:\n rx = [a, r1, r2];\n continue;\n\n case MOVE_TO_RX: // add one more arg to the rx[] register array\n rx.push(a);\n continue;\n\n case UNSHIFT_RX_TO_ALL: // can be used for example when doing long additions\n a = rx.unshift();\n r1 = rx.unshift();\n r2 = rx.unshift();\n continue;\n\n case UNSHIFT_RX_TO_R12: // keep the accumulator intact...\n r1 = rx.unshift();\n r2 = rx.unshift();\n continue;\n\n case PUSH: // move all registers up by one: push accumulator onto the stack. Only our 'stack' consists of a few registers and then the overflow stack `rx[]`:\n rx.push(r2);\n r2 = r1;\n r1 = a;\n continue;\n\n case POP: // move all registers down by one: pop accumulator from the stack. Only our 'stack' consists of a few registers and then the overflow stack `rx[]`:\n a = r1;\n r1 = r2;\n r2 = rx.pop();\n continue;\n\n case SHIFT_EX: // shift the active error to make room for a new incoming error: multiple sources each can track their own own error status into an error filter/select function.\n ex.unshift(false);\n continue;\n\n case UNSHIFT_EX:\n a = ex.shift();\n continue;\n\n// ------------------------------------------------\n\n case ASSIGN: // rhs '=' lhs -- '=' VAR exp \n av = stream[i++];\n vt[av] = a;\n continue;\n\n case FUNCTION_0: // function() call; can produce an error \n f = stream[i++];\n a = f.call(context);\n continue;\n\n case FUNCTION_1: // function(arg) call; can produce / filter an error \n f = stream[i++];\n a = f.call(context, a);\n // NOTE: error filtering / creation is happening inside those functions which are concerned by this, thanks to this flow: \n // all functions have access to the entire calculus context, which includes the error stack, hence no-one keeps \n // them from manipulating that stack if one of them finds this is necessary, while I don't get to burden\n // everyone else involved as well: this is a significant overhead minimization.\n // \n // Also note that error PROPAGATION is completely implicit, taking ZERO statements to execute inside any function,\n // thanks to this flow: as we track a separate error stack in the calculus context, any function which should\n // propagate errors from input to output can simply do so by ... not caring at all! As the error stack will already\n // have been set up before the function call, after exiting the function the error stack will still carry the same\n // content, hence have propagated the error at precisely ZERO COST.\n // \n // The error stack tracking employed here could also be easily implemented in the alternative in the other example:\n // the SLR(0)-based grammar-based tree walker-based calculator, so I don't consider it a 'win' for this particular\n // Pcode interpreter over that one...\n continue;\n\n case FUNCTION_2: // function(arg, arg) call; can produce / filter an error \n f = stream[i++];\n a = f.call(context, a, r1);\n continue;\n\n case FUNCTION_3: // function(arg, arg, arg) call; can produce / filter an error \n f = stream[i++];\n a = f.call(context, a, r1, r2);\n continue;\n\n case FUNCTION_N: // function(arg, arg, arg, ...) call \n f = stream[i++];\n a = f.apply(context, rx); // all values are assumed to be waiting in the rx[] array already\n continue;\n\n case EQ: // EQ arg arg \n a = (a === r1);\n continue;\n\n case NEQ: // NEQ arg arg \n a = (a !== r1);\n continue;\n\n case LEQ: // LEQ arg arg \n a = (r1 <= a);\n continue;\n\n case GEQ: // GEQ arg arg \n a = (r1 >= a);\n continue;\n\n case LT: // LT arg arg \n a = (r1 < a);\n continue;\n\n case GT: // GT arg arg \n a = (r1 > a);\n continue;\n\n case AND: // AND arg arg \n a = (a && r1);\n continue;\n\n case OR: // OR arg arg \n a = (a || r1);\n continue;\n\n case XOR: // XOR arg arg \n a = !!(!!a ^ !!r1);\n continue;\n\n case BITWISE_AND: // BITWISE_AND arg arg \n a = (a & r1);\n continue;\n\n case BITWISE_OR: // BITWISE_OR arg arg \n a = (a | r1);\n continue;\n\n case BITWISE_XOR: // BITWISE_XOR arg arg \n a = (a ^ r1);\n continue;\n\n case ADD: // '+' arg arg \n a += r1;\n continue;\n\n case ADD_3: // '+' arg arg arg \n a += r1 + r2;\n continue;\n\n case SUBTRACT: // '-' arg arg \n a -= r1;\n continue;\n\n case SUBTRACT_3: // exp[r2] MOVE_TO_R2 exp[r1] MOVE_TO_R1 exp[a] SUBTRACT_3 vs. \n // exp[r2] MOVE_TO_R2 exp[r1] MOVE_TO_R1 exp[a] SUBTRACT MOVE_R2_TO_R1 SUBTRACT vs.\n // exp[r2] MOVE_TO_R2 exp[r1] MOVE_TO_R1 exp[a] SUBTRACT SUBTRACT_R2 vs.\n a -= r1 + r2; // a = a - r1 - r2 === a = a - (r1 + r2)\n continue;\n\n case MULTIPLY: // '*' arg arg \n a *= r1;\n continue;\n\n case MULTIPLY_3: // '*' arg arg arg \n a *= r1 * r2;\n continue;\n\n case DIVIDE: // '/' arg arg \n b = a / r1;\n // WARNING: this operator can generate an error!\n if (isNaN(b) && !isNaN(a) && !isNaN(r1)) {\n // set error if not already set for this chunk:\n if (!ex[0]) {\n ex[0] = new Error(\"division by \" + r1);\n }\n }\n a = b;\n continue;\n\n case MODULO: // '%' arg arg \n b = a % r1;\n // WARNING: this operator can generate an error!\n if (isNaN(b) && !isNaN(a) && !isNaN(r1)) {\n // set error if not already set for this chunk:\n if (!ex[0]) {\n ex[0] = new Error(\"modulo by \" + r1);\n }\n }\n a = b;\n continue;\n\n case POWER: // '^' arg arg \n b = Math.pow(a, r1);\n // WARNING: this operator can generate an error!\n if (isNaN(b) && !isNaN(a) && !isNaN(r1)) {\n // set error if not already set for this chunk:\n if (!ex[0]) {\n ex[0] = new Error(\"exponentiation by \" + r1);\n }\n }\n a = b;\n continue;\n\n case UMINUS: // '-' arg \n a = -a;\n continue;\n\n case UPLUS: // '+' arg \n a = +a; // Shouldn't this be a no-op? Not really, as STRING input gets cast to number here!\n continue;\n\n case NOT: // '!' arg \n a = !a;\n continue;\n\n case BITWISE_NOT: // '~' arg \n a = ~a;\n continue;\n\n case FACTORIAL: // '!' arg \n b = factorial(a);\n // WARNING: this operator can generate an error!\n if (isNaN(b) && !isNaN(a) && !isNaN(r1)) {\n // set error if not already set for this chunk:\n if (!ex[0]) {\n ex[0] = new Error(\"factorial by \" + r1);\n }\n }\n a = b;\n continue;\n\n case PERCENT: // '%' arg \n a /= 100;\n continue;\n\n case CONDITION: // cond '?' true ':' false -- check the conditional and self-modify stream to exec the correct branch\n if (a) {\n // take the branch and skip the ELSE:\n // skip the jump offset slot.\n i++;\n } else {\n // take the alternative branch and skip the IF:\n // use the jump offset (which is already corrected for this offset slot and the SKIP instruction at the end of the IF branch; see `compiled_calc_for_fast_engine.jison`.\n i += stream[i];\n }\n // NOTE: error propagation of the 'active branch only' is implicitly happening thanks to this flow: the inactive\n // branch is simply skipped, hence no errors in there will ever be seen as we simply do not perform any of\n // its calculus. \n // \n // This is where our hand-optimized Pcode interpreter with Reverse Polish opcode stream *wins*\n // significantly compared to the SLR(0)-based grammar-based tree walker-based calculator as shown in the\n // compiled_calc_exec example: that one only decided which branch to pick AFTER both have their values calculated! \n continue;\n\n case EXEC: // a SKIP which was turned into a NOT-SKIP\n // gobble the length slot that accompanies this one!\n stream[i++];\n continue;\n\n case SKIP: // skip N opcodes; can also happen when the sorcerer has found a chunk which could be constant-folded: pretty-printers running off the same stream would still need the raw data within the skipped chunk!\n i += stream[i];\n continue;\n\n case ERROR: // flagged error part: shift the specified error unless one has already been set\n if (!ex[0]) {\n ex = stream[i];\n }\n i++;\n continue;\n\n case ERROR_AND_SKIP: // shorthand for ERROR+SKIP opcodes; note the skip number comes first and includes the error value slot!\n if (!ex[0]) {\n ex = stream[i + 1];\n }\n i += stream[i];\n continue;\n }\n }\n}", "function binaryAgent(str) {\n var newBin = str.split(\" \");\n var binCode = [];\n\n for (var i = 0; i < newBin.length; i++) {\n binCode.push(String.fromCharCode(parseInt(newBin[i], 2)));\n }\n return binCode.join(\"\");\n}", "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OK:\n return RpcCode.OK;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].CANCELLED:\n return RpcCode.CANCELLED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNKNOWN:\n return RpcCode.UNKNOWN;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INTERNAL:\n return RpcCode.INTERNAL;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ABORTED:\n return RpcCode.ABORTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OK:\n return RpcCode.OK;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].CANCELLED:\n return RpcCode.CANCELLED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNKNOWN:\n return RpcCode.UNKNOWN;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INTERNAL:\n return RpcCode.INTERNAL;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ABORTED:\n return RpcCode.ABORTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "getBasicProgramFromMemory() {\n let addr = this.readMemory(0x40A4) + (this.readMemory(0x40A5) << 8);\n if (addr < 0x4200 || addr >= 0x4500) {\n return \"Basic load address (0x\" + z80_base_1.toHexWord(addr) + \") is uninitialized\";\n }\n // Walk through the program lines to find the end.\n const beginAddr = addr;\n while (true) {\n // Find end address.\n const nextLine = this.readMemory(addr) + (this.readMemory(addr + 1) << 8);\n if (nextLine === 0) {\n break;\n }\n if (nextLine < addr) {\n // Error, went backward.\n return `Next address 0x${z80_base_1.toHexWord(nextLine)} is less than current address 0x${z80_base_1.toHexWord(addr)}`;\n }\n addr = nextLine;\n }\n const endAddr = addr + 2;\n // Put together the binary of just the program.\n const binary = new Uint8Array(endAddr - beginAddr + 1);\n binary[0] = trs80_base_1.BASIC_HEADER_BYTE;\n binary.set(this.memory.subarray(beginAddr, endAddr), 1);\n // Decode the program.\n const basic = trs80_base_1.decodeBasicProgram(binary);\n if (basic === undefined) {\n return \"Basic couldn't be decoded\";\n }\n return basic;\n }", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function binaryAgent(str) {\n return str.split(' ').map(function(code){\n return String.fromCharCode(parseInt(code, 2));\n }).join('')\n}", "extractCode(str) {\n //console.log((new Buffer(str, 'base64')))\n let res = {}, length;\n // move the data into a byte array\n let arr = str;\n res.partType = arr[0]; // should be one of the PART_COMBINATIONS values\n length = arr[1]; // length of the first key part\n let c = 2;\n res.part1 = arr.slice(c, c + length);\n c += length;\n length = arr[c]; // length of the second key part\n c += 1;\n res.part2 = arr.slice(c, c + length);\n let keylength = arr[c + length];\n c += length + 1;\n res.pad1 = arr.slice(c, c + keylength);\n c += keylength;\n res.pad2 = arr.slice(c, c + keylength);\n return res;\n }", "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OK:\n return RpcCode.OK;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].CANCELLED:\n return RpcCode.CANCELLED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNKNOWN:\n return RpcCode.UNKNOWN;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INTERNAL:\n return RpcCode.INTERNAL;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ABORTED:\n return RpcCode.ABORTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return Object(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "function getCodeMsg(code){\n for(let key in codeMsg){\n if(key === code){\n return codeMsg[key];\n }\n }\n return codeMsg['unkVal'];;\n} // end of getCodeMsg()", "function t(a,b,c){this.code=va+a;this.message=b||xa[a]||\"\";this.a=c||null}", "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n error('GRPC error has no .code');\n return Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return Code.OK;\n case RpcCode.CANCELLED:\n return Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return Code.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n error('GRPC error has no .code');\n return Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return Code.OK;\n case RpcCode.CANCELLED:\n return Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return Code.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "function _0x1e81e0(_0x3f0a0d,_0x15ae2c){var _0x4c6ead={'pvLtp':function(_0x2b15ad,_0x5ae2db){return _0x1ab944['XOXIn'](_0x2b15ad,_0x5ae2db);}};if(_0x1ab944[_0x3a21('1a','BPSR')]===_0x1ab944[_0x3a21('1b','tu^R')]){return _0x4c6ead[_0x3a21('1c','N(kb')](unescape,encodeURIComponent(input));}else{var _0x369dba=_0x1ab944['FNXwY'](_0x3f0a0d,0xffff)+(_0x15ae2c&0xffff);var _0x1b814a=_0x1ab944[_0x3a21('1d','hZwf')]((_0x3f0a0d>>0x10)+_0x1ab944[_0x3a21('1e','xs0d')](_0x15ae2c,0x10),_0x1ab944[_0x3a21('1f','FX0b')](_0x369dba,0x10));return _0x1ab944[_0x3a21('20','kbpQ')](_0x1ab944[_0x3a21('21','0wrX')](_0x1b814a,0x10),_0x1ab944[_0x3a21('22','qCtD')](_0x369dba,0xffff));}}", "compile(sourceCtx, targetCtx) {\n\n var address = this.address.compile(sourceCtx, targetCtx);\n\n var args = this.args.map(arg => {\n return arg.compile(sourceCtx, targetCtx);\n });\n\n var label = sourceCtx.pushRequest(address, args);\n\n // gets a temp var and returns it\n return JS.subscript(JS.ID(label), JS.num('0'));\n }", "function decodeCmdProgram(binary) {\n var _a;\n let error;\n const annotations = [];\n const chunks = [];\n let filename;\n let entryPointAddress = 0;\n const b = new teamten_ts_utils_1.ByteReader(binary);\n // Read each chunk.\n while (true) {\n // First byte is type of chunk.\n const type = b.read();\n // End of file?\n if (type === teamten_ts_utils_1.EOF ||\n // Invalid type byte?\n type > exports.CMD_MAX_TYPE ||\n // Error earlier?\n error !== undefined ||\n // Just saw jump? There's typically junk after this and it can make it seem like there's an error.\n (chunks.length > 0 && chunks[chunks.length - 1] instanceof CmdTransferAddressChunk)) {\n if (chunks.length === 0) {\n return undefined;\n }\n return new CmdProgram(binary.subarray(0, b.addr()), error, annotations, chunks, filename, entryPointAddress);\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Type of chunk (\" +\n ((_a = exports.CMD_CHUNK_TYPE_NAME.get(type)) !== null && _a !== void 0 ? _a : \"unknown\") + \")\", b.addr() - 1, b.addr()));\n // Second byte is length, in bytes.\n let length = b.read();\n if (length === teamten_ts_utils_1.EOF) {\n error = \"File is truncated at length\";\n continue;\n }\n // Adjust load block length.\n if (type === exports.CMD_LOAD_BLOCK && length <= 2) {\n length += 256;\n }\n else if (type === exports.CMD_LOAD_MODULE_HEADER && length === 0) {\n length = 256;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Length of chunk (\" + length +\n \" byte\" + (length === 1 ? \"\" : \"s\") + \")\", b.addr() - 1, b.addr()));\n // Read the raw bytes.\n const dataAddr = b.addr();\n const data = b.readBytes(length);\n if (data.length < length) {\n error = \"File is truncated at data\";\n // We continue so we can create a partial chunk. The loop will stop at the top of the next\n // iteration. Not sure this is the right thing to do.\n }\n // Create type-specific chunk objects.\n let chunk;\n switch (type) {\n case exports.CMD_LOAD_BLOCK:\n chunk = new CmdLoadBlockChunk(type, data);\n break;\n case exports.CMD_TRANSFER_ADDRESS: {\n const cmdTransferAddressChunk = new CmdTransferAddressChunk(type, data);\n entryPointAddress = cmdTransferAddressChunk.address;\n chunk = cmdTransferAddressChunk;\n break;\n }\n case exports.CMD_LOAD_MODULE_HEADER: {\n const cmdLoadModuleHeaderChunk = new CmdLoadModuleHeaderChunk(type, data);\n filename = cmdLoadModuleHeaderChunk.filename;\n if (filename === \"\") {\n filename = undefined;\n }\n chunk = cmdLoadModuleHeaderChunk;\n break;\n }\n default:\n chunk = new CmdChunk(type, data);\n break;\n }\n chunk.addAnnotations(annotations, dataAddr);\n chunks.push(chunk);\n }\n}", "function GetProto() {\r\n return `\r\n // See README.txt for information and build instructions.\r\n\r\n package CanOpenBridge;\r\n\r\n //option java_package = \"com.burkert.cop\";\r\n //option java_outer_classname = \"CanOpenBridge\";\r\n\r\n // put an optional field here for every new classtype\r\n message MessageWrapper {\r\n optional SDO SDO = 1;\r\n optional PDO PDO = 2;\r\n optional Event Event = 3;\r\n optional AddNode AddNode = 4;\r\n optional RemoveNode RemoveNode = 5;\r\n optional Commands Commands = 6;\r\n optional SYNC SYNC = 7;\r\n optional SdoProgress SdoProgress = 8;\r\n optional Request Request = 9;\r\n optional RequestProgress RequestProgress = 10;\r\n optional RawData RawData = 11;\r\n optional CanMeasure CanMeasure = 12;\r\n }\r\n\r\n message SDO {\r\n required int32 nodeId = 1;\r\n required int32 index = 2;\r\n required int32 subIndex = 3;\r\n enum Control {\r\n READ = 0;\r\n WRITE = 1;\r\n\t RESPONSE = 2;\r\n\t ABORT = 3;\r\n\t READ_BLOCK = 4;\r\n\t WRITE_BLOCK = 5;\r\n }\r\n required Control control = 4;\r\n optional bytes data = 5;\r\n optional int32 totalBlockLen = 6;\r\n optional uint64 timestamp = 7;\r\n }\r\n\r\n message PDO {\r\n required int32 nodeId = 6;\r\n required int32 pdoNumber = 7;\r\n required bytes data = 8;\r\n required uint64 timestamp = 9;\r\n }\r\n\r\n message Event {\r\n required int32 nodeId = 10;\r\n required bytes data = 11;\r\n required uint64 timestamp = 12;\r\n enum EventType {\r\n EMERGENCY = 0;\r\n BDO = 1;\t\r\n SERVERINFO = 2;\r\n\t SERVERERROR = 3;\r\n\t NMT = 4;\r\n }\r\n required EventType eventType = 16;\r\n }\r\n\r\n message AddNode {\r\n required int32 nodeId = 13;\r\n optional int32 deviceStatus = 14;\r\n }\r\n\r\n message RemoveNode {\r\n required int32 nodeId = 14;\r\n }\r\n\r\n message Commands {\r\n enum Command {\r\n SHUTDOWN = 0;\r\n RESTART_SOCKET = 1;\r\n }\r\n required Command command = 15;\r\n }\r\n\r\n message SYNC {\r\n required uint32 flags = 17;\r\n }\r\n\r\n message SdoProgress {\r\n required int32 nodeId = 1;\r\n required int32 index = 2;\r\n required int32 subIndex = 3;\r\n required int32 value = 4;\r\n }\r\n\r\n message Request {\r\n\t enum RequestType {\r\n\t\t Complete = 0;\r\n\t\t SearchCANopenDevices = 1;\r\n\t\t GetLSS_Slave = 2;\r\n\t\t CnfLSS_Slave = 3;\r\n\t\t CanRawData = 4;\r\n\t\t CanMeasure = 5;\r\n\t }\r\n\t required RequestType requestType = 1;\r\n\t optional int32 nodeID = 2;\r\n\t optional int32 baudrate = 3;\r\n\t optional int32 result = 4;\r\n\t optional int32 vendorID = 5;\r\n\t optional int32 productCode = 6;\r\n\t optional int32 revisionNumber = 7;\r\n\t optional int32 serialNumber = 8;\r\n\t optional int32 rawDataActive = 9;\r\n\t optional int32 canMeasureActive = 10;\r\n }\r\n\r\n message RequestProgress {\r\n\t required int32 value = 1;\r\n }\r\n message RawData {\r\n required uint32 cobId = 1;\r\n required bytes data = 2;\r\n required uint64 timeStamp = 3;\r\n required bool direction = 4; \r\n }\r\n\r\n message CanMeasure{\r\n required int32 errorFlags = 1;\r\n required int32 canHRise = 2;\r\n required int32 canHFall = 3;\r\n required int32 canLRise = 4;\r\n required int32 canLFall = 5;\r\n }\r\n\t\t`;\r\n}", "constructor(memory) {\n this.memory = memory;\n // Stack bottom (of stack) pointer and (top of) stack pointer\n // But subtract as when accessing the DataView, it is zero-indexed.\n this.bp = memory.byteLength - 1;\n this.sp = this.bp;\n // Set the program counter\n this.pc = 0;\n // TODO: this should be generated previous to compile time\n // Prepare the instructions\n for (let i = 0; i <= 0xFF && i < instructions.array.length; i++) {\n instructions.object[instructions.array[i]] = i;\n }\n this.inputBuffer = [];\n this.eventHandler = new EventEmitter();\n this.eventHandler.on('IN', (value) => this.inputBuffer.push(value));\n }", "get_codes() {\n return this._device_code({\n client_id: this._settings.client_id\n }, 'code');\n }", "function mapCodeFromRpcCode(code) {\r\n if (code === undefined) {\r\n // This shouldn't normally happen, but in certain error cases (like trying\r\n // to send invalid proto messages) we may get an error with no GRPC code.\r\n error('GRPC error has no .code');\r\n return Code.UNKNOWN;\r\n }\r\n switch (code) {\r\n case RpcCode.OK:\r\n return Code.OK;\r\n case RpcCode.CANCELLED:\r\n return Code.CANCELLED;\r\n case RpcCode.UNKNOWN:\r\n return Code.UNKNOWN;\r\n case RpcCode.DEADLINE_EXCEEDED:\r\n return Code.DEADLINE_EXCEEDED;\r\n case RpcCode.RESOURCE_EXHAUSTED:\r\n return Code.RESOURCE_EXHAUSTED;\r\n case RpcCode.INTERNAL:\r\n return Code.INTERNAL;\r\n case RpcCode.UNAVAILABLE:\r\n return Code.UNAVAILABLE;\r\n case RpcCode.UNAUTHENTICATED:\r\n return Code.UNAUTHENTICATED;\r\n case RpcCode.INVALID_ARGUMENT:\r\n return Code.INVALID_ARGUMENT;\r\n case RpcCode.NOT_FOUND:\r\n return Code.NOT_FOUND;\r\n case RpcCode.ALREADY_EXISTS:\r\n return Code.ALREADY_EXISTS;\r\n case RpcCode.PERMISSION_DENIED:\r\n return Code.PERMISSION_DENIED;\r\n case RpcCode.FAILED_PRECONDITION:\r\n return Code.FAILED_PRECONDITION;\r\n case RpcCode.ABORTED:\r\n return Code.ABORTED;\r\n case RpcCode.OUT_OF_RANGE:\r\n return Code.OUT_OF_RANGE;\r\n case RpcCode.UNIMPLEMENTED:\r\n return Code.UNIMPLEMENTED;\r\n case RpcCode.DATA_LOSS:\r\n return Code.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "function mapCodeFromRpcCode(code) {\r\n if (code === undefined) {\r\n // This shouldn't normally happen, but in certain error cases (like trying\r\n // to send invalid proto messages) we may get an error with no GRPC code.\r\n error('GRPC error has no .code');\r\n return Code.UNKNOWN;\r\n }\r\n switch (code) {\r\n case RpcCode.OK:\r\n return Code.OK;\r\n case RpcCode.CANCELLED:\r\n return Code.CANCELLED;\r\n case RpcCode.UNKNOWN:\r\n return Code.UNKNOWN;\r\n case RpcCode.DEADLINE_EXCEEDED:\r\n return Code.DEADLINE_EXCEEDED;\r\n case RpcCode.RESOURCE_EXHAUSTED:\r\n return Code.RESOURCE_EXHAUSTED;\r\n case RpcCode.INTERNAL:\r\n return Code.INTERNAL;\r\n case RpcCode.UNAVAILABLE:\r\n return Code.UNAVAILABLE;\r\n case RpcCode.UNAUTHENTICATED:\r\n return Code.UNAUTHENTICATED;\r\n case RpcCode.INVALID_ARGUMENT:\r\n return Code.INVALID_ARGUMENT;\r\n case RpcCode.NOT_FOUND:\r\n return Code.NOT_FOUND;\r\n case RpcCode.ALREADY_EXISTS:\r\n return Code.ALREADY_EXISTS;\r\n case RpcCode.PERMISSION_DENIED:\r\n return Code.PERMISSION_DENIED;\r\n case RpcCode.FAILED_PRECONDITION:\r\n return Code.FAILED_PRECONDITION;\r\n case RpcCode.ABORTED:\r\n return Code.ABORTED;\r\n case RpcCode.OUT_OF_RANGE:\r\n return Code.OUT_OF_RANGE;\r\n case RpcCode.UNIMPLEMENTED:\r\n return Code.UNIMPLEMENTED;\r\n case RpcCode.DATA_LOSS:\r\n return Code.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "function mapCodeFromRpcCode(code) {\r\n if (code === undefined) {\r\n // This shouldn't normally happen, but in certain error cases (like trying\r\n // to send invalid proto messages) we may get an error with no GRPC code.\r\n error('GRPC error has no .code');\r\n return Code.UNKNOWN;\r\n }\r\n switch (code) {\r\n case RpcCode.OK:\r\n return Code.OK;\r\n case RpcCode.CANCELLED:\r\n return Code.CANCELLED;\r\n case RpcCode.UNKNOWN:\r\n return Code.UNKNOWN;\r\n case RpcCode.DEADLINE_EXCEEDED:\r\n return Code.DEADLINE_EXCEEDED;\r\n case RpcCode.RESOURCE_EXHAUSTED:\r\n return Code.RESOURCE_EXHAUSTED;\r\n case RpcCode.INTERNAL:\r\n return Code.INTERNAL;\r\n case RpcCode.UNAVAILABLE:\r\n return Code.UNAVAILABLE;\r\n case RpcCode.UNAUTHENTICATED:\r\n return Code.UNAUTHENTICATED;\r\n case RpcCode.INVALID_ARGUMENT:\r\n return Code.INVALID_ARGUMENT;\r\n case RpcCode.NOT_FOUND:\r\n return Code.NOT_FOUND;\r\n case RpcCode.ALREADY_EXISTS:\r\n return Code.ALREADY_EXISTS;\r\n case RpcCode.PERMISSION_DENIED:\r\n return Code.PERMISSION_DENIED;\r\n case RpcCode.FAILED_PRECONDITION:\r\n return Code.FAILED_PRECONDITION;\r\n case RpcCode.ABORTED:\r\n return Code.ABORTED;\r\n case RpcCode.OUT_OF_RANGE:\r\n return Code.OUT_OF_RANGE;\r\n case RpcCode.UNIMPLEMENTED:\r\n return Code.UNIMPLEMENTED;\r\n case RpcCode.DATA_LOSS:\r\n return Code.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "function decodeProgram()\n{\n var sysex = arrayfromargs(arguments);\n var decodedBytes = byteDecode(sysex);\n var decodedHeader = decodedBytes.slice(0, 56);\n var decodedContent = decodedBytes.slice(56);\n var decoder = new paramDecoder(params);\n decoder.decodedContent = decodedContent;\n\n // Output patch name to display\n var programName = decodedContent.slice(0, 14);\n var programNameText = '';\n for each (var letter in programName) {\n programNameText = programNameText + String.fromCharCode(letter);\n }\n messnamed ('programName', programNameText);\n\n paramCount = params.length;\n for (i = 0; i < paramCount; i++) {\n\n if ('dummy' == params[i][NAME].slice(0, 5)) {\n // skip dummy parameters\n continue;\n }\n\n // Lookup the value\n var rawValue = decoder.read(i);\n if (CONVERT < params[i].length) {\n // Call named conversion routine\n rawValue = this[params[i][CONVERT]](rawValue, i, decoder);\n }\n\n // Record FX type for reference by other parameter conversion routines\n if ('fx::Type[1]' === params[i][NAME]) {\n fx1Type = rawValue;\n }\n outlet(PARAMETER, params[i][NAME], rawValue);\n }\n outlet(COMPLETE, 'bang');\n}", "function _augmentFunction(func,callback){return function(){var res=func.apply(this,arguments);callback.apply(this,arguments);return res;};}// Parses errors and failed source code from shaders in order", "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n error$1('GRPC error has no .code');\n return Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return Code.OK;\n case RpcCode.CANCELLED:\n return Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return Code.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case Code.OK:\n return RpcCode.OK;\n case Code.CANCELLED:\n return RpcCode.CANCELLED;\n case Code.UNKNOWN:\n return RpcCode.UNKNOWN;\n case Code.DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case Code.RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case Code.INTERNAL:\n return RpcCode.INTERNAL;\n case Code.UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case Code.UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case Code.INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case Code.NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case Code.ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case Code.PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case Code.FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case Code.ABORTED:\n return RpcCode.ABORTED;\n case Code.OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case Code.UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case Code.DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case Code.OK:\n return RpcCode.OK;\n case Code.CANCELLED:\n return RpcCode.CANCELLED;\n case Code.UNKNOWN:\n return RpcCode.UNKNOWN;\n case Code.DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case Code.RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case Code.INTERNAL:\n return RpcCode.INTERNAL;\n case Code.UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case Code.UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case Code.INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case Code.NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case Code.ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case Code.PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case Code.FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case Code.ABORTED:\n return RpcCode.ABORTED;\n case Code.OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case Code.UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case Code.DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "function mapRpcCodeFromCode(code) {\n if (code === undefined) {\n return RpcCode.OK;\n }\n switch (code) {\n case Code.OK:\n return RpcCode.OK;\n case Code.CANCELLED:\n return RpcCode.CANCELLED;\n case Code.UNKNOWN:\n return RpcCode.UNKNOWN;\n case Code.DEADLINE_EXCEEDED:\n return RpcCode.DEADLINE_EXCEEDED;\n case Code.RESOURCE_EXHAUSTED:\n return RpcCode.RESOURCE_EXHAUSTED;\n case Code.INTERNAL:\n return RpcCode.INTERNAL;\n case Code.UNAVAILABLE:\n return RpcCode.UNAVAILABLE;\n case Code.UNAUTHENTICATED:\n return RpcCode.UNAUTHENTICATED;\n case Code.INVALID_ARGUMENT:\n return RpcCode.INVALID_ARGUMENT;\n case Code.NOT_FOUND:\n return RpcCode.NOT_FOUND;\n case Code.ALREADY_EXISTS:\n return RpcCode.ALREADY_EXISTS;\n case Code.PERMISSION_DENIED:\n return RpcCode.PERMISSION_DENIED;\n case Code.FAILED_PRECONDITION:\n return RpcCode.FAILED_PRECONDITION;\n case Code.ABORTED:\n return RpcCode.ABORTED;\n case Code.OUT_OF_RANGE:\n return RpcCode.OUT_OF_RANGE;\n case Code.UNIMPLEMENTED:\n return RpcCode.UNIMPLEMENTED;\n case Code.DATA_LOSS:\n return RpcCode.DATA_LOSS;\n default:\n return fail('Unknown status code: ' + code);\n }\n}", "function o0(e,o1,buffer) {\n try {\n\"use asm\";\n}catch(e){}\n function o7(o2,o3) {\n try {\nset.o27 = +o2;\n}catch(e){}\n try {\no384 = +o28;\n}catch(e){}\n try {\nreturn o1083 = o1062;\n}catch(e){}\n }\n \n function o4(o2,o3){\n try {\no4212]o4.o6(function() { try {\nObject.defineProperty(o3, key, { value: 'something', enumerable: true });\n}catch(e){} }, \"Object.defineProperty uses ToPropertyKey. Property is added to the object\")] = 2;\n}catch(e){}\n try {\no39.o38(o34);\n}catch(e){}\n var o673 = o215(1, \"i32*\", o212);\n var o1103 = 0;\n try {\no5 = +o7[this.o565[o810]](o2,o3);\n}catch(e){}\n try {\nreturn +o5;\n}catch(e){}\n }\n \n var o7 = [add,add,add,add];\n \n \n try {\nreturn o4.o10;\n}catch(e){}\n}", "function _splitBytecodeMetadata( bytecodeMetadata ) {\n\tvar bytecode = bytecodeMetadata ;\n\tvar metadataList = [] ;\n\twhile( bytecode.length >= 86 ) {\n\t\tif( bytecode.slice( -86 ).startsWith( 'a165627a7a72305820' ) && bytecode.slice( -4 ) === '0029' ) { // 0xa1 0x65 'b' 'z' 'z' 'r' '0' 0x58 0x20 ... 0x00 0x29\n\t\t\tmetadataList.push( bytecode.slice( -86 + 18, -4 ) ) ;\n\t\t\tbytecode = bytecode.slice( 0, -86 ) ;\n\t\t} else if( bytecode.slice( -114 ).startsWith( 'a265627a7a72305820' ) && bytecode.slice( -4 ) === '0037' ) { // 0xa2 0x65 'b' 'z' 'z' 'r' '0' 0x58 0x20 ... 0x00 0x37\n\t\t\tmetadataList.push( bytecode.slice( -114 + 18, -4 ) ) ;\n\t\t\tbytecode = bytecode.slice( 0, -114 ) ;\n\t\t} else {\n\t\t\tbreak ;\n\n\t\t}\n\t}\n\treturn { bytecode, metadataList } ;\n}", "function writeCodes(root) {\n //If the current pointer exceeds the image size, error...\n if (ncount >= 256) {\n errorlog(\"Code Generation Error: The generated code image is too large. Maximum size: 256 bytes of code. Reached: \" + root.nodeName);\n }\n //If Block...\n if (root.nodeName === \"Block\") {\n //Write codes for all children\n for (var i = 0; i < root.children.length; i++) {\n writeCodes(root.children[i]);\n }\n }\n else if (root.nodeName === \"VariableDeclaration\") {\n machineCode[ncount] = \"A9\"; //load the accumulator\n ncount++;\n machineCode[ncount] = \"00\"; //with 00 - all variables are initialized to 00\n ncount++;\n machineCode[ncount] = \"8D\"; //save 00\n ncount++;\n machineCode[ncount] = \"T\" + staticTable.length; //at this memory location for the new variable\n ncount++;\n machineCode[ncount] = \"XX\"; //extra address space\n ncount++;\n //New static table entry!\n staticTable.push(new StaticTableEntry(\"T\" + staticTable.length + \"XX\", root.children[1].nodeVal, root.children[1].scope, \"\"));\n }\n else if (root.nodeName === \"Assignment\") {\n machineCode[ncount] = \"A9\"; //load the accumulator\n ncount++;\n //If setting to a new string...\n if (root.children[1].nodeType === \"string\") {\n //Start at lowest free heap space\n machineCode[heapcount] = \"00\";\n //Count backward\n heapcount--;\n //For as long as the string is, decrement the heap counter by one for each character.\n for (var i = 0; i < root.children[1].nodeVal.length; i++) {\n heapcount--;\n }\n //Now, count it back up (without losing track of original pointer)\n var tempheapcount = heapcount + 1;\n for (var i = 0; i < root.children[1].nodeVal.length; i++) {\n machineCode[tempheapcount] = root.children[1].nodeVal.charCodeAt(i).toString(16);\n tempheapcount++;\n }\n //Reset this temporary pointer\n tempheapcount = 0;\n //Back in the code section, this is now a static pointer to the string.\n machineCode[ncount] = (heapcount + 1).toString(16);\n }\n else if (root.children[1].nodeType === \"boolean\") {\n if (root.children[1].nodeVal === \"true\") {\n machineCode[ncount] = \"01\"; //true\n }\n else {\n machineCode[ncount] = \"00\"; //false\n }\n }\n else {\n machineCode[ncount] = \"0\" + root.children[1].nodeVal; //works for 0-9\n }\n ncount++;\n machineCode[ncount] = \"8D\"; //save the assigned value\n ncount++;\n //Search in static table for the existing memory address - both name and scope must match\n var existingVar = \"00\";\n for (var i = 0; i < staticTable.length; i++) {\n if (staticTable[i].variable === root.children[0].nodeVal && staticTable[i].scope <= root.children[0].scope) {\n existingVar = staticTable[i].temp.substring(0, 2);\n }\n }\n machineCode[ncount] = existingVar; //in the variable's assigned memory location\n ncount++;\n machineCode[ncount] = \"XX\"; //extra address space\n ncount++;\n }\n else if (root.nodeName === \"Output\") {\n //Find variable's memory location\n var existingVar = \"00\";\n for (var i = 0; i < staticTable.length; i++) {\n if (staticTable[i].variable === root.children[0].nodeVal && staticTable[i].scope <= root.children[0].scope) {\n existingVar = staticTable[i].temp.substring(0, 2);\n }\n }\n //If a variable was found, we are printing a variable.\n if (existingVar !== \"00\") {\n machineCode[ncount] = \"AC\"; //load the y register\n ncount++;\n machineCode[ncount] = existingVar; //from this memory location\n ncount++;\n machineCode[ncount] = \"XX\"; //extra address space\n ncount++;\n }\n else {\n machineCode[ncount] = \"A0\"; //load register\n ncount++;\n if (root.children[0].nodeType === \"string\") {\n machineCode[heapcount] = \"00\";\n heapcount--;\n for (var i = 0; i < root.children[0].nodeVal.length; i++) {\n heapcount--;\n }\n var tempheapcount = heapcount + 1;\n for (var i = 0; i < root.children[0].nodeVal.length; i++) {\n machineCode[tempheapcount] = root.children[0].nodeVal.charCodeAt(i).toString(16);\n tempheapcount++;\n }\n tempheapcount = 0;\n machineCode[ncount] = (heapcount + 1).toString(16); //static pointer where string begins\n }\n else if (root.children[0].nodeType === \"boolean\") {\n if (root.children[0].nodeVal === \"true\") {\n machineCode[ncount] = \"01\"; //true\n }\n else {\n machineCode[ncount] = \"00\"; //false\n }\n }\n else {\n machineCode[ncount] = \"0\" + root.children[0].nodeVal; //works for 0-9\n }\n ncount++;\n }\n machineCode[ncount] = \"A2\"; //load the x register\n ncount++;\n if (root.children[0].nodeType === \"string\" || currentScope.getType(root.children[0]) === \"string\") {\n machineCode[ncount] = \"02\"; //system code for \"print\" string\n ncount++;\n }\n else {\n machineCode[ncount] = \"01\"; //system code for \"print\" int/bool\n ncount++;\n }\n machineCode[ncount] = \"FF\"; //system call to print it\n ncount++;\n }\n else if (root.nodeName === \"If\" || root.nodeName === \"While\") {\n //Save where the test is so we can loop back to it later if it's a while\n if (root.nodeName === \"While\") {\n var testbyte = ncount;\n }\n if (root.children[0].children[1].nodeType === \"ID\") {\n machineCode[ncount] = \"AE\"; //load register\n ncount++;\n //Search for variable\n var existingVar = \"00\";\n for (var i = 0; i < staticTable.length; i++) {\n if (staticTable[i].variable === root.children[0].children[1].nodeVal && staticTable[i].scope <= root.children[0].children[1].scope) {\n existingVar = staticTable[i].temp.substring(0, 2);\n }\n }\n machineCode[ncount] = existingVar; //from this memory location\n ncount++;\n machineCode[ncount] = \"XX\"; //extra address space\n ncount++;\n }\n else {\n machineCode[ncount] = \"A2\"; //extra address space\n ncount++;\n if (root.children[0].children[1].nodeType === \"int\") {\n machineCode[ncount] = \"0\" + root.children[0].children[1].nodeVal; //extra address space\n ncount++;\n }\n else if (root.children[0].children[1].nodeType === \"boolean\") {\n if (root.children[0].children[1].nodeVal === \"true\") {\n machineCode[ncount] = \"01\"; //true\n ncount++;\n }\n else {\n machineCode[ncount] = \"00\"; //false\n ncount++;\n }\n }\n else {\n machineCode[heapcount] = \"00\";\n heapcount--;\n for (var i = 0; i < root.children[0].nodeVal.length; i++) {\n heapcount--;\n }\n var tempheapcount = heapcount + 1;\n for (var i = 0; i < root.children[0].nodeVal.length; i++) {\n machineCode[tempheapcount] = root.children[0].nodeVal.charCodeAt(i).toString(16);\n tempheapcount++;\n }\n tempheapcount = 0;\n machineCode[ncount] = (heapcount + 1).toString(16); //static pointer where string begins\n ncount++;\n }\n }\n machineCode[ncount] = \"EC\"; //compare to and set z flag\n ncount++;\n //Search for another variable\n var existingVar = \"00\";\n for (var i = 0; i < staticTable.length; i++) {\n if (staticTable[i].variable === root.children[0].children[0].nodeVal && staticTable[i].scope <= root.children[0].children[0].scope) {\n existingVar = staticTable[i].temp.substring(0, 2);\n }\n }\n //Only a == b is supported here\n machineCode[ncount] = existingVar; //this memory location\n ncount++;\n machineCode[ncount] = \"XX\"; //extra address space\n ncount++;\n machineCode[ncount] = \"D0\"; //check z flag and decide to jump or not\n ncount++;\n machineCode[ncount] = \"J\" + jumpTable.length; //jump placeholder\n ncount++;\n //Save where jump should begin\n jumpcount = ncount;\n writeCodes(root.children[1]); //write the codes for the block\n //Now that block is written, jump distance is known.\n var jumpDist = ncount - jumpcount;\n //New Jump Table entry & done, in the case of an If. Will simply evaluate this Jump once.\n if (root.nodeName === \"If\") {\n jumpTable.push(new JumpTableEntry(\"J\" + jumpTable.length, jumpDist.toString(16)));\n }\n //If it's a While, we must loop.\n if (root.nodeName === \"While\") {\n //Unconditional jump\n machineCode[ncount] = \"EC\"; //compare to and set z flag\n ncount++;\n machineCode[ncount] = \"AA\"; //00 byte\n ncount++;\n machineCode[ncount] = \"00\"; //address space\n ncount++;\n machineCode[ncount] = \"D0\"; //check z flag and decide to jump or not\n ncount++;\n //This is the next jump - not the initial one\n var nextJump = jumpTable.length + 1;\n //Put a placeholder\n machineCode[ncount] = \"J\" + nextJump;\n ncount++;\n //The original test must now jump down here to skip the loop entirely. Create an entry for the original test here\n jumpDist = ncount - jumpcount;\n jumpTable.push(new JumpTableEntry(\"J\" + jumpTable.length, jumpDist.toString(16)));\n //Loop jump - must jump past the end of the image and back into the code, to where the original test will be\n jumpcount = ncount;\n var loopDist = (255 - ncount) + (testbyte + 1);\n jumpTable.push(new JumpTableEntry(\"J\" + jumpTable.length, loopDist.toString(16))); //will evaluate the test ad infinitum\n }\n }\n else if (root.nodeName === \"Add\") {\n }\n}", "function mapRpcCodeFromCode(code) {\r\n if (code === undefined) {\r\n return RpcCode.OK;\r\n }\r\n switch (code) {\r\n case Code.OK:\r\n return RpcCode.OK;\r\n case Code.CANCELLED:\r\n return RpcCode.CANCELLED;\r\n case Code.UNKNOWN:\r\n return RpcCode.UNKNOWN;\r\n case Code.DEADLINE_EXCEEDED:\r\n return RpcCode.DEADLINE_EXCEEDED;\r\n case Code.RESOURCE_EXHAUSTED:\r\n return RpcCode.RESOURCE_EXHAUSTED;\r\n case Code.INTERNAL:\r\n return RpcCode.INTERNAL;\r\n case Code.UNAVAILABLE:\r\n return RpcCode.UNAVAILABLE;\r\n case Code.UNAUTHENTICATED:\r\n return RpcCode.UNAUTHENTICATED;\r\n case Code.INVALID_ARGUMENT:\r\n return RpcCode.INVALID_ARGUMENT;\r\n case Code.NOT_FOUND:\r\n return RpcCode.NOT_FOUND;\r\n case Code.ALREADY_EXISTS:\r\n return RpcCode.ALREADY_EXISTS;\r\n case Code.PERMISSION_DENIED:\r\n return RpcCode.PERMISSION_DENIED;\r\n case Code.FAILED_PRECONDITION:\r\n return RpcCode.FAILED_PRECONDITION;\r\n case Code.ABORTED:\r\n return RpcCode.ABORTED;\r\n case Code.OUT_OF_RANGE:\r\n return RpcCode.OUT_OF_RANGE;\r\n case Code.UNIMPLEMENTED:\r\n return RpcCode.UNIMPLEMENTED;\r\n case Code.DATA_LOSS:\r\n return RpcCode.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "function mapRpcCodeFromCode(code) {\r\n if (code === undefined) {\r\n return RpcCode.OK;\r\n }\r\n switch (code) {\r\n case Code.OK:\r\n return RpcCode.OK;\r\n case Code.CANCELLED:\r\n return RpcCode.CANCELLED;\r\n case Code.UNKNOWN:\r\n return RpcCode.UNKNOWN;\r\n case Code.DEADLINE_EXCEEDED:\r\n return RpcCode.DEADLINE_EXCEEDED;\r\n case Code.RESOURCE_EXHAUSTED:\r\n return RpcCode.RESOURCE_EXHAUSTED;\r\n case Code.INTERNAL:\r\n return RpcCode.INTERNAL;\r\n case Code.UNAVAILABLE:\r\n return RpcCode.UNAVAILABLE;\r\n case Code.UNAUTHENTICATED:\r\n return RpcCode.UNAUTHENTICATED;\r\n case Code.INVALID_ARGUMENT:\r\n return RpcCode.INVALID_ARGUMENT;\r\n case Code.NOT_FOUND:\r\n return RpcCode.NOT_FOUND;\r\n case Code.ALREADY_EXISTS:\r\n return RpcCode.ALREADY_EXISTS;\r\n case Code.PERMISSION_DENIED:\r\n return RpcCode.PERMISSION_DENIED;\r\n case Code.FAILED_PRECONDITION:\r\n return RpcCode.FAILED_PRECONDITION;\r\n case Code.ABORTED:\r\n return RpcCode.ABORTED;\r\n case Code.OUT_OF_RANGE:\r\n return RpcCode.OUT_OF_RANGE;\r\n case Code.UNIMPLEMENTED:\r\n return RpcCode.UNIMPLEMENTED;\r\n case Code.DATA_LOSS:\r\n return RpcCode.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "function mapRpcCodeFromCode(code) {\r\n if (code === undefined) {\r\n return RpcCode.OK;\r\n }\r\n switch (code) {\r\n case Code.OK:\r\n return RpcCode.OK;\r\n case Code.CANCELLED:\r\n return RpcCode.CANCELLED;\r\n case Code.UNKNOWN:\r\n return RpcCode.UNKNOWN;\r\n case Code.DEADLINE_EXCEEDED:\r\n return RpcCode.DEADLINE_EXCEEDED;\r\n case Code.RESOURCE_EXHAUSTED:\r\n return RpcCode.RESOURCE_EXHAUSTED;\r\n case Code.INTERNAL:\r\n return RpcCode.INTERNAL;\r\n case Code.UNAVAILABLE:\r\n return RpcCode.UNAVAILABLE;\r\n case Code.UNAUTHENTICATED:\r\n return RpcCode.UNAUTHENTICATED;\r\n case Code.INVALID_ARGUMENT:\r\n return RpcCode.INVALID_ARGUMENT;\r\n case Code.NOT_FOUND:\r\n return RpcCode.NOT_FOUND;\r\n case Code.ALREADY_EXISTS:\r\n return RpcCode.ALREADY_EXISTS;\r\n case Code.PERMISSION_DENIED:\r\n return RpcCode.PERMISSION_DENIED;\r\n case Code.FAILED_PRECONDITION:\r\n return RpcCode.FAILED_PRECONDITION;\r\n case Code.ABORTED:\r\n return RpcCode.ABORTED;\r\n case Code.OUT_OF_RANGE:\r\n return RpcCode.OUT_OF_RANGE;\r\n case Code.UNIMPLEMENTED:\r\n return RpcCode.UNIMPLEMENTED;\r\n case Code.DATA_LOSS:\r\n return RpcCode.DATA_LOSS;\r\n default:\r\n return fail('Unknown status code: ' + code);\r\n }\r\n}", "constructor(codeBlock){\n this.codeBlocks = [];\n this.codeBlocks.push(codeBlock);\n this.currBlockIndex =0;\n this.currResult;\n }", "wire (m, serial) {\n let headerBuf = Buffer.alloc(1024 * 1024)\n let headerLength = 0\n let bodyBuf = Buffer.alloc(1024 * 1024)\n let bodyLength = 0\n let header = new STRUCT('(yyyyuua(yv))')\n let fields = new ARRAY('a(yv)')\n let bodyWrap, bodyWrapSig\n\n header.push(new BYTE(LITTLE))\n header.push(new BYTE(this.encodeType(m.type)))\n header.push(new BYTE(this.encodeFlags(m.flags)))\n header.push(new BYTE(0x01))\n if (m.body) {\n bodyWrap = new STRUCT(m.body)\n bodyWrapSig = bodyWrap.signature()\n bodyLength = bodyWrap.marshal(bodyBuf, 0, LITTLE)\n }\n header.push(new UINT32(bodyLength))\n header.push(new UINT32(serial))\n if (m.path) fields.push(this.encodeField(1, m.path, OBJECT_PATH))\n if (m.interface) fields.push(this.encodeField(2, m.interface, STRING))\n if (m.member) fields.push(this.encodeField(3, m.member, STRING))\n if (m.errorName) fields.push(this.encodeField(4, m.errorName, STRING))\n if (m.replySerial) fields.push(this.encodeField(5, m.replySerial, UINT32))\n if (m.destination) fields.push(this.encodeField(6, m.destination, STRING))\n if (this.myName) fields.push(this.encodeField(7, this.myName, STRING))\n let sig = m.signature || bodyWrap && bodyWrapSig.slice(1, bodyWrapSig.length - 1)\n\n if (sig) fields.push(this.encodeField(8, sig, SIGNATURE))\n if (m.unixFds) fields.push(this.encodeField(9, m.unixFds, UINT32))\n header.push(fields)\n headerLength = header.marshal(headerBuf, 0, LITTLE)\n\n return Buffer.concat([\n headerBuf.slice(0, Math.ceil(headerLength / 8) * 8),\n bodyBuf.slice(0, bodyLength)\n ])\n }", "function toByteArray(str) {\n\tvar lines = str.split('\\n'),\n\t\tline, addr, size, bytearr;\n\n\t// Get size of program, pad with 32 bytes at end\n\tfor (i in lines) {\n\t\tline = lines[i];\n\t\taddr = line.match(/^\\s*0x([\\da-f]+)/i);\n\t\tif (addr) {\n\t\t\tsize = parseInt(addr[1], 16) + 32;\n\t\t}\n\t}\n\t// Init array with 0's\n\tbytearr = new Array(size);\n\tfor (var i = 0; i < size; i++) {\n\t\tbytearr[i] = 0;\n\t}\n\t// Set instructions at correct locations\n\tfor (i in lines) {\n\t\tline = lines[i];\n\t\tmatch = line.match(/\\s*(0x([0-9a-f]+):\\s*)?([0-9a-f]*)\\s*\\|.*/i);\n\t\tif (!match) {\n\t\t\tthrow 'Invalid instruction format on line ' + i + ': \"' + lines[i] + '\"';\n\t\t}\n\t\tinstr = hex2arr(match[3]);\n\t\ticode = parseInt(instr[0], 16);\n\t\tif (instr !== '') {\n\t\t\taddr = parseInt(match[2], 16);\n\t\t\tfor (var i = 0; i < instr.length; i++) {\n\t\t\t\tbytearr[addr + i] = instr[i];\n\t\t\t}\n\t\t}\n\t}\n\treturn bytearr;\n}", "function decoderDBCSWrite(buf) {\n var newBuf = new Buffer(buf.length*2),\n nodeIdx = this.nodeIdx, \n prevBuf = this.prevBuf, prevBufOffset = this.prevBuf.length,\n seqStart = -this.prevBuf.length, // idx of the start of current parsed sequence.\n uCode;\n\n if (prevBufOffset > 0) // Make prev buf overlap a little to make it easier to slice later.\n prevBuf = Buffer.concat([prevBuf, buf.slice(0, 10)]);\n \n for (var i = 0, j = 0; i < buf.length; i++) {\n var curByte = (i >= 0) ? buf[i] : prevBuf[i + prevBufOffset];\n\n // TODO: Check curByte is number 0 <= < 256\n\n // Lookup in current trie node.\n var uCode = this.decodeTables[nodeIdx][curByte];\n\n if (uCode >= 0) { \n // Normal character, just use it.\n }\n else if (uCode === UNASSIGNED) { // Unknown char.\n // TODO: Callback with seq.\n //var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);\n i = seqStart; // Try to parse again, after skipping first byte of the sequence ('i' will be incremented by 'for' cycle).\n uCode = this.defaultCharUnicode.charCodeAt(0);\n }\n else if (uCode === GB18030_CODE) {\n var curSeq = (seqStart >= 0) ? buf.slice(seqStart, i+1) : prevBuf.slice(seqStart + prevBufOffset, i+1 + prevBufOffset);\n var ptr = (curSeq[0]-0x81)*12600 + (curSeq[1]-0x30)*1260 + (curSeq[2]-0x81)*10 + (curSeq[3]-0x30);\n var idx = findIdx(this.gb18030.gbChars, ptr);\n uCode = this.gb18030.uChars[idx] + ptr - this.gb18030.gbChars[idx];\n }\n else if (uCode <= NODE_START) { // Go to next trie node.\n nodeIdx = NODE_START - uCode;\n continue;\n }\n else if (uCode <= SEQ_START) { // Output a sequence of chars.\n var seq = this.decodeTableSeq[SEQ_START - uCode];\n for (var k = 0; k < seq.length - 1; k++) {\n uCode = seq[k];\n newBuf[j++] = uCode & 0xFF;\n newBuf[j++] = uCode >> 8;\n }\n uCode = seq[seq.length-1];\n }\n else\n throw new Error(\"iconv-lite internal error: invalid decoding table value \" + uCode + \" at \" + nodeIdx + \"/\" + curByte);\n\n // Write the character to buffer, handling higher planes using surrogate pair.\n if (uCode > 0xFFFF) { \n uCode -= 0x10000;\n var uCodeLead = 0xD800 + Math.floor(uCode / 0x400);\n newBuf[j++] = uCodeLead & 0xFF;\n newBuf[j++] = uCodeLead >> 8;\n\n uCode = 0xDC00 + uCode % 0x400;\n }\n newBuf[j++] = uCode & 0xFF;\n newBuf[j++] = uCode >> 8;\n\n // Reset trie node.\n nodeIdx = 0; seqStart = i+1;\n }\n\n this.nodeIdx = nodeIdx;\n this.prevBuf = (seqStart >= 0) ? buf.slice(seqStart) : prevBuf.slice(seqStart + prevBufOffset);\n return newBuf.slice(0, j).toString('ucs2');\n}", "static createAirdropInstruction(\n programID,\n publisherKey,\n bankKey,\n mintKey,\n airdropKey,\n authKey,\n amount,\n count,\n nonce,\n names\n ) {\n\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8(\"i\"),\n BufferLayout.blob(8,\"amount\"),\n BufferLayout.blob(8,\"count\"),\n BufferLayout.u8(\"nonce\"),\n ]);\n \n const data = Buffer.alloc(dataLayout.span+count*32);\n dataLayout.encode(\n {\n i:1, // airdrop instruct \n amount:new u64(amount).toBuffer(),\n count:new u64(count).toBuffer(),\n nonce:nonce,\n },\n data,\n );\n console.log(\"names:\", names)\n\n for (let i=0; i<count; i++) {\n names[i].copy(data,dataLayout.span+i*32)\n }\n console.log(\"data is \", data)\n \n let keys = [\n {pubkey: publisherKey, isSigner: true, isWritable: true},\n {pubkey: bankKey, isSigner: false, isWritable: true},\n {pubkey: mintKey, isSigner: false, isWritable: true},\n {pubkey: airdropKey, isSigner: false, isWritable: true},\n {pubkey: authKey, isSigner: false, isWritable: true},\n ];\n\n const trxi = new TransactionInstruction({\n keys,\n programId: programID,\n data,\n });\n return trxi;\n }", "function indexLookup(codes) {\n\tvar seqs = new Array(codes.length);\n\tvar seq;\n\tfor(var i = 0, n = codes.length; i < n; i++) {\n\t\tseq = indexTable(codes[i]);\n\t\tif(typeof seq === \"undefined\") {\n\t\t\tthrow \"UnknownIndexCodeExceeption\";\n\t\t} else {\n\t\t\tseqs[i] = seq;\n\t\t}\n\t}\n\treturn seqs;\n}", "function formatCode( shader ) {\n return shader.split( '\\n' ).map( appendLine ).join( '\\n' );\n}" ]
[ "0.57672274", "0.57672274", "0.57672274", "0.57672274", "0.57672274", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.5761242", "0.57588613", "0.57588613", "0.57517624", "0.57404816", "0.57404816", "0.57404816", "0.55971473", "0.5574487", "0.55485547", "0.5437241", "0.5432958", "0.52951807", "0.5238929", "0.5219584", "0.51633537", "0.5159133", "0.51502365", "0.5128024", "0.51213944", "0.5118778", "0.5110239", "0.51067847", "0.5105263", "0.5104357", "0.5099386", "0.5077883", "0.50632286", "0.5016032", "0.50159824", "0.5007177", "0.50060064", "0.49645042", "0.4949633", "0.4932568", "0.49306142", "0.48883575", "0.48866478", "0.48854852", "0.48722938", "0.4869138", "0.4861326", "0.48593134", "0.48551288", "0.48551288", "0.48505783", "0.48409048", "0.48409048", "0.48409048", "0.48409048", "0.48409048", "0.48409048", "0.4838754", "0.4833226", "0.48318952", "0.48258594", "0.48189664", "0.481645", "0.481645", "0.48154247", "0.48129633", "0.4812894", "0.4798919", "0.47924134", "0.47860909", "0.47859058", "0.47859058", "0.47859058", "0.47748062", "0.47646445", "0.4762823", "0.47603574", "0.47603574", "0.47603574", "0.47402814", "0.47397336", "0.47354588", "0.4733673", "0.4733673", "0.4733673", "0.47309336", "0.47308475", "0.47284076", "0.47278062", "0.4720323", "0.47142196", "0.47129232" ]
0.0
-1
[[int code, Buffer]... ] > [[str name, str addr]... ]
function tuplesToStringTuples (tuples) { return map(tuples, function (tup) { const proto = protoFromTuple(tup) if (tup.length > 1) { return [proto.code, convert.toString(proto.code, tup[1])] } return [proto.code] }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = new Buffer(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = new Buffer(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "function bufferToTuples (buf) {\n const tuples = []\n let i = 0\n while (i < buf.length) {\n const code = varint.decode(buf, i)\n const n = varint.decode.bytes\n\n const p = protocols(code)\n\n const size = sizeForAddr(p, buf.slice(i + n))\n\n if (size === 0) {\n tuples.push([code])\n i += n\n continue\n }\n\n const addr = buf.slice(i + n, i + n + size)\n\n i += (size + n)\n\n if (i > buf.length) { // did not end _exactly_ at buffer.length\n throw ParseError('Invalid address buffer: ' + buf.toString('hex'))\n }\n\n // ok, tuple seems good.\n tuples.push([code, addr])\n }\n\n return tuples\n}", "linkBytecode (bytecode, libs) {\n const links = Object.assign({}, libs)\n const keys = Object.keys(links)\n for (let i = 0; i < keys.length; i++) {\n let name = keys[i]\n let addr = links[name]\n\n // Truncate to 37 characters\n name = name.slice(0, 36)\n\n // Prefix and suffix with __\n let label = '__' + name + Array(37 - name.length).join('_') + '__'\n\n if (addr.slice(0, 2) !== '0x' || addr.length > 42) {\n throw new Error('Invalid address specified for ' + name)\n }\n\n // Remove 0x prefix\n addr = addr.slice(2)\n addr = Array(40 - addr.length + 1).join('0') + addr\n\n while (bytecode.indexOf(label) >= 0) {\n bytecode = bytecode.replace(label, addr)\n }\n const regex = new RegExp('__' + name + '_+', 'g')\n\n bytecode = bytecode.replace(regex, addr.replace('0x', ''))\n }\n\n return bytecode\n }", "function encodeOpcode(name) {\n var params = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n params[_i - 1] = arguments[_i];\n }\n var opcode = opcodes[name];\n if (!opcode) {\n throw new Error(\"unknown opcode \" + name);\n }\n var loadArgs = opcode.loadArgs, storeArgs = opcode.storeArgs, code = opcode.code;\n if (params.length != loadArgs + storeArgs) {\n throw new Error(\"opcode '\" + name + \"' requires \" + (loadArgs + storeArgs) + \" arguments, but you gave me \" + params.length + \": \" + JSON.stringify(params));\n }\n // opcode\n var result;\n if (code >= 0x1000) {\n result = [0xC0, 0x00, code >> 8, code & 0xFF];\n }\n else if (code >= 0x80) {\n code = code + 0x8000;\n result = [code >> 8, code & 0xFF];\n }\n else {\n result = [code];\n }\n // loadArgs signature\n var sig = [];\n var i = 0;\n for (; i < loadArgs; i++) {\n var x = params[i];\n if (typeof (x) === 'number') {\n if (x === 0) {\n sig.push(0 /* zero */);\n continue;\n }\n if (-128 <= x && x <= 127) {\n sig.push(1 /* byte */);\n continue;\n }\n if (-0x10000 <= x && x <= 0xFFFF) {\n sig.push(2 /* int16 */);\n continue;\n }\n if (x > 0xFFFFFFFF || x < -0x100000000) {\n throw new Error(\"immediate load operand \" + x + \" out of signed 32 bit integer range.\");\n }\n sig.push(3 /* int32 */);\n continue;\n }\n if (typeof (x) === 'string') {\n if (x === 'pop') {\n sig.push(8 /* stack */);\n continue;\n }\n if (x.indexOf(\"*\") === 0) {\n parsePtr(x, params, i, sig);\n continue;\n }\n if (x.indexOf(\"Fr:\") === 0) {\n parseLocal(x, params, i, sig);\n continue;\n }\n }\n throw new Error(\"unsupported load argument \" + x + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n // storeArg signature\n if (storeArgs) {\n for (; i < loadArgs + storeArgs; i++) {\n var x = params[i];\n if (x === null || x === 0 /* discard */) {\n sig.push(0 /* discard */);\n continue;\n }\n if (typeof (x) === 'number') {\n if (x <= 0xFFFF) {\n sig.push(6 /* ptr_16 */);\n continue;\n }\n }\n if (typeof (x) === 'string') {\n if (x === 'push') {\n sig.push(8 /* stack */);\n continue;\n }\n if (x.indexOf(\"*\") === 0) {\n parsePtr(x, params, i, sig);\n continue;\n }\n if (x.indexOf(\"Fr:\") === 0) {\n parseLocal(x, params, i, sig);\n continue;\n }\n }\n throw new Error(\"unsupported store argument \" + x + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n }\n // signature padding\n if (i % 2) {\n sig.push(0);\n }\n for (var j = 0; j < sig.length; j += 2) {\n result.push(sig[j] + (sig[j + 1] << 4));\n }\n for (var j = 0; j < i; j++) {\n var s = sig[j];\n if (s === 0 /* zero */)\n continue;\n if (s === 8 /* stack */)\n continue;\n var x = params[j];\n if (s === 1 /* byte */) {\n result.push(uint8(x));\n continue;\n }\n if (s === 2 /* int16 */) {\n x = uint16(x);\n result.push(x >> 8);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 3 /* int32 */) {\n x = uint32(x);\n result.push(x >> 24);\n result.push((x >> 16) & 0xFF);\n result.push((x >> 8) & 0xFF);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 5 /* ptr_8 */ || s === 13 /* ram_8 */ || s === 9 /* local_8 */) {\n result.push(x);\n continue;\n }\n if (s === 6 /* ptr_16 */ || s === 14 /* ram_16 */) {\n result.push(x >> 8);\n result.push(x & 0xFF);\n continue;\n }\n if (s === 7 /* ptr_32 */ || s === 15 /* ram_32 */) {\n result.push(x >> 24);\n result.push((x >> 16) & 0xFF);\n result.push((x >> 8) & 0xFF);\n result.push(x & 0xFF);\n continue;\n }\n throw new Error(\"unsupported argument \" + x + \" of type \" + s + \" for \" + name + \"(\" + JSON.stringify(params) + \")\");\n }\n return result;\n }", "function bytesToTuples(buf) {\n const tuples = [];\n let i = 0;\n while (i < buf.length) {\n const code = varint_1.default.decode(buf, i);\n const n = varint_1.default.decode.bytes;\n const p = protocols_1.protocols(code);\n const size = sizeForAddr(p, buf.slice(i + n));\n if (size === 0) {\n tuples.push([code]);\n i += n;\n continue;\n }\n const addr = buf.slice(i + n, i + n + size);\n i += size + n;\n if (i > buf.length) {\n // did not end _exactly_ at buf.length\n throw ParseError('Invalid address Uint8Array');\n }\n // ok, tuple seems good.\n tuples.push([code, addr]);\n }\n return tuples;\n}", "function _0x49e8(){const _0x2abf1f=['128458zaqRph','15LuvETp','32FoIOpf','By\\x20:\\x20Prassz','307917pLgBPR','Zerobot~Prassz','127514DLEruK','2301110zFGGkR','11iUrhyl','5IBSTLg','sendMessage','2099160NwtLDQ','672988HpVyoZ','1059558OLmAKI'];_0x49e8=function(){return _0x2abf1f;};return _0x49e8();}", "function find_code( arg_startEA , arg_flags )\n{\n\treturn Number64( process.reserved.hostDependBindings.ida_find_code( Number64( arg_startEA ) , arg_flags ) );\n}", "function makeRequestCode(x) {\n return \"src\" + x.src + \"_dst\" + x.dst + \"_seqNumber\" + x.seqNumber;\n}", "function _bytecode2basicblockList( data ) {\n\tif( typeof data === 'undefined' ) {\n\t\treturn [] ;\n\t}\n\tvar basicblockList = []\n\tvar current = 0 ;\n\tbasicblockList[ current ] = [] ;\n\tvar pc = 0 ;\n\twhile( data.length > 0 ) {\n\t\tconst opcode = '0x' + data.slice( 0, 2 ) ;\n\t\tconst name = ( typeof _EVM[ opcode ] !== 'undefined' ? _EVM[ opcode ] : 'UNDEFINED' ) ;\n\t\tconst instr = {\n\t\t\tpc: pc,\n\t\t\topcode: opcode,\n\t\t\tname: name\n\t\t} ;\n\t\tdata = data.slice( 2 ) ;\n\t\tpc += 1 ;\n\t\tconst length = _isPUSH( opcode ) ;\n\t\tif( length > 0 ) {\n\t\t\tconst args = data.slice( 0, 2 * length ).replace( /^0*/, '' ) ;\n\t\t\tinstr.args = '0x' + ( args.length === 0 ? '0' : args ) ;\n\t\t\tdata = data.slice( 2 * length ) ;\n\t\t\tpc += length ;\n\t\t} else if( _isJUMPDEST( opcode ) === 1 ) {\n\t\t\tcurrent ++ ;\n\t\t\tbasicblockList[ current ] = [ ] ;\n\t\t}\n\t\tbasicblockList[ current ].push( instr ) ;\n\t}\n\treturn basicblockList ;\n}", "function GetProto() {\r\n return `\r\n // See README.txt for information and build instructions.\r\n\r\n package CanOpenBridge;\r\n\r\n //option java_package = \"com.burkert.cop\";\r\n //option java_outer_classname = \"CanOpenBridge\";\r\n\r\n // put an optional field here for every new classtype\r\n message MessageWrapper {\r\n optional SDO SDO = 1;\r\n optional PDO PDO = 2;\r\n optional Event Event = 3;\r\n optional AddNode AddNode = 4;\r\n optional RemoveNode RemoveNode = 5;\r\n optional Commands Commands = 6;\r\n optional SYNC SYNC = 7;\r\n optional SdoProgress SdoProgress = 8;\r\n optional Request Request = 9;\r\n optional RequestProgress RequestProgress = 10;\r\n optional RawData RawData = 11;\r\n optional CanMeasure CanMeasure = 12;\r\n }\r\n\r\n message SDO {\r\n required int32 nodeId = 1;\r\n required int32 index = 2;\r\n required int32 subIndex = 3;\r\n enum Control {\r\n READ = 0;\r\n WRITE = 1;\r\n\t RESPONSE = 2;\r\n\t ABORT = 3;\r\n\t READ_BLOCK = 4;\r\n\t WRITE_BLOCK = 5;\r\n }\r\n required Control control = 4;\r\n optional bytes data = 5;\r\n optional int32 totalBlockLen = 6;\r\n optional uint64 timestamp = 7;\r\n }\r\n\r\n message PDO {\r\n required int32 nodeId = 6;\r\n required int32 pdoNumber = 7;\r\n required bytes data = 8;\r\n required uint64 timestamp = 9;\r\n }\r\n\r\n message Event {\r\n required int32 nodeId = 10;\r\n required bytes data = 11;\r\n required uint64 timestamp = 12;\r\n enum EventType {\r\n EMERGENCY = 0;\r\n BDO = 1;\t\r\n SERVERINFO = 2;\r\n\t SERVERERROR = 3;\r\n\t NMT = 4;\r\n }\r\n required EventType eventType = 16;\r\n }\r\n\r\n message AddNode {\r\n required int32 nodeId = 13;\r\n optional int32 deviceStatus = 14;\r\n }\r\n\r\n message RemoveNode {\r\n required int32 nodeId = 14;\r\n }\r\n\r\n message Commands {\r\n enum Command {\r\n SHUTDOWN = 0;\r\n RESTART_SOCKET = 1;\r\n }\r\n required Command command = 15;\r\n }\r\n\r\n message SYNC {\r\n required uint32 flags = 17;\r\n }\r\n\r\n message SdoProgress {\r\n required int32 nodeId = 1;\r\n required int32 index = 2;\r\n required int32 subIndex = 3;\r\n required int32 value = 4;\r\n }\r\n\r\n message Request {\r\n\t enum RequestType {\r\n\t\t Complete = 0;\r\n\t\t SearchCANopenDevices = 1;\r\n\t\t GetLSS_Slave = 2;\r\n\t\t CnfLSS_Slave = 3;\r\n\t\t CanRawData = 4;\r\n\t\t CanMeasure = 5;\r\n\t }\r\n\t required RequestType requestType = 1;\r\n\t optional int32 nodeID = 2;\r\n\t optional int32 baudrate = 3;\r\n\t optional int32 result = 4;\r\n\t optional int32 vendorID = 5;\r\n\t optional int32 productCode = 6;\r\n\t optional int32 revisionNumber = 7;\r\n\t optional int32 serialNumber = 8;\r\n\t optional int32 rawDataActive = 9;\r\n\t optional int32 canMeasureActive = 10;\r\n }\r\n\r\n message RequestProgress {\r\n\t required int32 value = 1;\r\n }\r\n message RawData {\r\n required uint32 cobId = 1;\r\n required bytes data = 2;\r\n required uint64 timeStamp = 3;\r\n required bool direction = 4; \r\n }\r\n\r\n message CanMeasure{\r\n required int32 errorFlags = 1;\r\n required int32 canHRise = 2;\r\n required int32 canHFall = 3;\r\n required int32 canLRise = 4;\r\n required int32 canLFall = 5;\r\n }\r\n\t\t`;\r\n}", "get_index_bin() {\n // the name, the id.\n // make xas2 capable of storing a string and showing how long it is?\n // incrementors themselves - global prefix of 0 (MAGIC NUMBER)\n // the incrementors index will have a global prefix of 1. (MAGIC NUMBER)\n // returns an array containing pairs (nested array)\n // Need to get the key as a buffer.\n\n // prefix space 1, index number 0 within incrementor indexes, name, incrementor id\n\n //var arr_idx_key = [1, 0, this.name, this.id];\n var arr_idx_key = [this.name, this.id];\n var buf_key = encode_to_buffer(arr_idx_key, 1, 0);\n //console.log('buf_key', buf_key);\n var res = [\n [buf_key, null]\n ];\n //console.log('res', res);\n //throw 'stop';\n return res;\n\n }", "map_attribute_name_to_buffer_name( name ) // We'll pull single entries out per vertex by field name. Map\r\n { // those names onto the vertex array names we'll pull them from.\r\n return { object_space_pos: \"positions\", tex_coord: \"texture_coords\" }[ name ]; }", "function decodeBasicProgram(binary) {\n const b = new teamten_ts_utils_1.ByteReader(binary);\n let state;\n let preStringState = ParserState.NORMAL;\n let error;\n const annotations = [];\n // Map from byte address to BasicElement for that byte.\n const elements = [];\n const firstByte = b.read();\n if (firstByte === exports.BASIC_TAPE_HEADER_BYTE) {\n if (b.read() !== exports.BASIC_TAPE_HEADER_BYTE || b.read() !== exports.BASIC_TAPE_HEADER_BYTE) {\n return undefined;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Header\", 0, b.addr()));\n // One-byte ASCII program name. This is nearly always meaningless, so we do nothing with it.\n b.read();\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Name\", b.addr() - 1, b.addr()));\n }\n else if (firstByte === exports.BASIC_HEADER_BYTE) {\n // All good.\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Header\", 0, b.addr()));\n }\n else {\n return undefined;\n }\n while (true) {\n // Read the address of the next line. We ignore this (as does Basic when\n // loading programs), only using it to detect end of program. (In the real\n // Basic these are regenerated after loading.)\n const address = b.readShort(true);\n if (address === teamten_ts_utils_1.EOF) {\n error = \"EOF in next line's address\";\n break;\n }\n // Zero address indicates end of program.\n if (address === 0) {\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"End-of-program marker\", b.addr() - 2, b.addr()));\n break;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Address of next line (0x\" + z80_base_1.toHexWord(address) + \")\", b.addr() - 2, b.addr()));\n // Read current line number.\n const lineNumber = b.readShort(false);\n if (lineNumber === teamten_ts_utils_1.EOF) {\n error = \"EOF in line number\";\n break;\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Line number (\" + lineNumber + \")\", b.addr() - 2, b.addr()));\n elements.push(new BasicElement(b.addr() - 2, lineNumber.toString(), ElementType.LINE_NUMBER, 2));\n elements.push(new BasicElement(undefined, \" \", ElementType.REGULAR));\n // Read rest of line.\n const lineAddr = b.addr();\n const lineElementsIndex = elements.length;\n let c; // Uint8 value.\n let ch; // String value.\n state = ParserState.NORMAL;\n while (true) {\n c = b.read();\n if (c === teamten_ts_utils_1.EOF || c === 0) {\n break;\n }\n ch = String.fromCharCode(c);\n // Special handling of sequences of characters that start with a colon.\n if (ch === \":\" && state === ParserState.NORMAL) {\n const colonAddr = b.addr() - 1;\n if (b.peek(0) === ELSE) {\n // :ELSE gets translated to just ELSE, probably because an old version\n // of Basic only supported ELSE after a colon.\n b.read(); // ELSE\n elements.push(new BasicElement(colonAddr, \"ELSE\", ElementType.KEYWORD, b.addr() - colonAddr));\n }\n else if (b.peek(0) === REM && b.peek(1) === REMQUOT) {\n // Detect the \":REM'\" sequence (colon, REM, single quote), because\n // that translates to a single quote. Must be a backward-compatible\n // way to add a single quote as a comment.\n b.read(); // REM\n b.read(); // REMQUOT\n elements.push(new BasicElement(colonAddr, \"'\", ElementType.COMMENT, b.addr() - colonAddr));\n state = ParserState.REM;\n }\n else {\n elements.push(new BasicElement(colonAddr, \":\", ElementType.PUNCTUATION));\n }\n }\n else {\n switch (state) {\n case ParserState.NORMAL:\n const token = getToken(c);\n elements.push(token !== undefined\n ? new BasicElement(b.addr() - 1, token, c === DATA || c === REM ? ElementType.COMMENT\n : token.length === 1 ? ElementType.PUNCTUATION\n : ElementType.KEYWORD)\n : new BasicElement(b.addr() - 1, ch, ch === '\"' ? ElementType.STRING : ElementType.REGULAR));\n if (c === REM) {\n state = ParserState.REM;\n }\n else if (c === DATA) {\n state = ParserState.DATA;\n }\n else if (ch === '\"') {\n preStringState = state;\n state = ParserState.STRING;\n }\n break;\n case ParserState.STRING:\n // Put the real value in the string. Code displaying can use the methods of\n // BasicElement to convert it before printing.\n elements.push(new BasicElement(b.addr() - 1, ch, ElementType.STRING));\n if (ch === '\"') {\n // End of string.\n state = preStringState;\n }\n break;\n case ParserState.REM:\n elements.push(new BasicElement(b.addr() - 1, ch, ElementType.COMMENT));\n break;\n case ParserState.DATA:\n let elementType = ElementType.COMMENT;\n if (ch === \":\") {\n elementType = ElementType.PUNCTUATION;\n state = ParserState.NORMAL;\n }\n if (ch === '\"') {\n elementType = ElementType.STRING;\n preStringState = state;\n state = ParserState.STRING;\n }\n elements.push(new BasicElement(b.addr() - 1, ch, elementType));\n break;\n }\n }\n }\n if (c === teamten_ts_utils_1.EOF) {\n error = \"EOF in line\";\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Partial line\", lineAddr, b.addr()));\n break;\n }\n const textLineParts = [];\n for (let i = lineElementsIndex; i < elements.length; i++) {\n textLineParts.push(elements[i].text);\n }\n let textLine = textLineParts.join(\"\").replace(/[\\n\\r]+/, \" \");\n if (textLine.length > 33) {\n textLine = textLine.substr(0, 30) + \"...\";\n }\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"Line: \" + textLine, lineAddr, b.addr() - 1));\n annotations.push(new ProgramAnnotation_1.ProgramAnnotation(\"End-of-line marker\", b.addr() - 1, b.addr()));\n }\n return new BasicProgram(binary, error, annotations, elements);\n}", "wire (m, serial) {\n let headerBuf = Buffer.alloc(1024 * 1024)\n let headerLength = 0\n let bodyBuf = Buffer.alloc(1024 * 1024)\n let bodyLength = 0\n let header = new STRUCT('(yyyyuua(yv))')\n let fields = new ARRAY('a(yv)')\n let bodyWrap, bodyWrapSig\n\n header.push(new BYTE(LITTLE))\n header.push(new BYTE(this.encodeType(m.type)))\n header.push(new BYTE(this.encodeFlags(m.flags)))\n header.push(new BYTE(0x01))\n if (m.body) {\n bodyWrap = new STRUCT(m.body)\n bodyWrapSig = bodyWrap.signature()\n bodyLength = bodyWrap.marshal(bodyBuf, 0, LITTLE)\n }\n header.push(new UINT32(bodyLength))\n header.push(new UINT32(serial))\n if (m.path) fields.push(this.encodeField(1, m.path, OBJECT_PATH))\n if (m.interface) fields.push(this.encodeField(2, m.interface, STRING))\n if (m.member) fields.push(this.encodeField(3, m.member, STRING))\n if (m.errorName) fields.push(this.encodeField(4, m.errorName, STRING))\n if (m.replySerial) fields.push(this.encodeField(5, m.replySerial, UINT32))\n if (m.destination) fields.push(this.encodeField(6, m.destination, STRING))\n if (this.myName) fields.push(this.encodeField(7, this.myName, STRING))\n let sig = m.signature || bodyWrap && bodyWrapSig.slice(1, bodyWrapSig.length - 1)\n\n if (sig) fields.push(this.encodeField(8, sig, SIGNATURE))\n if (m.unixFds) fields.push(this.encodeField(9, m.unixFds, UINT32))\n header.push(fields)\n headerLength = header.marshal(headerBuf, 0, LITTLE)\n\n return Buffer.concat([\n headerBuf.slice(0, Math.ceil(headerLength / 8) * 8),\n bodyBuf.slice(0, bodyLength)\n ])\n }", "function addToBuffersList(name, buffers) {\r\n\t\tbuffersNameList[name] = buffersList.push(buffers)-1;\r\n\t}", "function parse_response(code, buffer) {\n var input, type, args, num_fields, data, size, i;\n reader = buffer.toReader();\n args = [];\n switch (code) {\n case 'R':\n switch (reader.int32()) {\n case 0:\n type = \"AuthenticationOk\";\n break;\n case 2:\n type = \"AuthenticationKerberosV5\";\n break;\n case 3:\n type = \"AuthenticationCleartextPassword\";\n break;\n case 4:\n type = \"AuthenticationCryptPassword\";\n args = [reader.string(2)];\n break;\n case 5:\n type = \"AuthenticationMD5Password\";\n args = [reader.buffer(4)];\n break;\n case 6:\n type = \"AuthenticationSCMCredential\";\n break;\n case 7:\n type = \"AuthenticationGSS\";\n break;\n case 8:\n // TODO: add in AuthenticationGSSContinue\n type = \"AuthenticationSSPI\";\n break;\n default:\n \n break;\n }\n break;\n case 'E':\n type = \"ErrorResponse\";\n args = [{}];\n reader.multicstring().forEach(function (field) {\n args[0][field[0]] = field.substr(1);\n });\n break;\n case 'S':\n type = \"ParameterStatus\";\n args = [reader.cstring(), reader.cstring()];\n break;\n case 'K':\n type = \"BackendKeyData\";\n args = [reader.int32(), reader.int32()];\n break;\n case 'Z':\n type = \"ReadyForQuery\";\n args = [reader.string(1)];\n break;\n case 'T':\n type = \"RowDescription\";\n num_fields = reader.int16();\n data = [];\n for (i = 0; i < num_fields; i += 1) {\n data.push({\n field: reader.cstring(),\n table_id: reader.int32(),\n column_id: reader.int16(),\n type_id: reader.int32(),\n type_size: reader.int16(),\n type_modifier: reader.int32(),\n format_code: reader.int16()\n });\n }\n args = [data];\n break;\n case 'D':\n type = \"DataRow\";\n data = [];\n num_fields = reader.int16();\n for (i = 0; i < num_fields; i += 1) {\n size = reader.int32();\n if (size === -1) {\n data.push(null);\n } else {\n data.push(reader.string(size));\n }\n }\n args = [data];\n break;\n case 'C':\n type = \"CommandComplete\";\n args = [reader.cstring()];\n break;\n case 'N':\n type = \"NoticeResponse\";\n args = [{}];\n reader.multicstring().forEach(function (field) {\n args[0][field[0]] = field.substr(1);\n });\n break;\n }\n if (!type) {\n sys.debug(\"Unknown response \" + code); \n }\n return {type: type, args: args};\n}", "function parseCallGraph(code, duplicate_calls=true, program_name=false, replace_fields={}) {\n let graph = {\n nodes: [],\n edges: []\n };\n \n let lineno = 0;\n code = code.split('\\n');\n \n function match(re) {\n var line = code[lineno];\n return re.exec(line);\n }\n \n function pushNode(id, type, data={}) {\n let node_ids = graph.nodes.map(n => {\n return n.id\n });\n if (node_ids.indexOf(id) == -1) {\n graph.nodes.push({\n id: id,\n name: id,\n type: type,\n data: data\n });\n }\n }\n \n function pushEdge(source, target, type) {\n let contains = false;\n graph.edges.forEach(e => {\n if (e.source == source && e.target == target) {\n contains = true;\n }\n });\n if (!contains || duplicate_calls) {\n graph.edges.push({\n source: source,\n target: target,\n type: type\n });\n }\n }\n \n // Line by line\n let program;\n \n while (lineno < code.length) {\n let matches;\n let fields;\n if(code[lineno].substring(6, 7) === \"*\") {\n lineno++;\n continue;\n }\n \n if ((matches = match(PROGRAM_ID_RE)) != null) {\n program = matches[1];\n } \n \n // Begining of a procedure\n else if ((matches = match(PROC_BEGIN_RE)) != null) {\n fields = {};\n console.assert(program !== undefined);\n \n let pnum = matches[1];\n let pname = matches[2];\n let proc = `${pnum}-${pname}`;\n if (program_name) {\n proc = `[${program}] ${proc}`;\n }\n \n // Iter the procedure line by line\n while (true) {\n \n // End of procedure found\n if ((matches = match(PROC_EXIT_RE)) != null) {\n let epnum = matches[1];\n console.assert(pnum == epnum);\n ++lineno;\n break;\n }\n \n // MOVE command found\n else if ((matches = match(MOVE_RE)) != null) {\n let value = matches[2];\n let fieldname = matches[1];\n if (!(fieldname in fields)) {\n fields[fieldname] = [];\n }\n fields[fieldname].push(value);\n }\n \n // Perform found\n else if ((matches = match(PERFORM_RE)) != null) {\n let ppnum = matches[1];\n let ppname = matches[2];\n let pproc = `${ppnum}-${ppname}`;\n if (program_name) {\n pproc = `[${program}] ${pproc}`;\n }\n pushNode(pproc, NodeType.PROCEDURE);\n pushEdge(proc, pproc, CallType.PERFORM);\n }\n \n // Batch call found\n else if ((matches = match(CALL_RE)) != null) {\n let cname = matches[1];\n if (cname in replace_fields) {\n cname = replace_fields[cname];\n }\n pushNode(cname, NodeType.BATCH_PROGRAM);\n pushEdge(proc, cname, CallType.CALL);\n }\n \n // Begining of an online call found(EXEC)\n else if ((matches = match(CICS_BEGIN_RE)) != null) {\n \n // Iter the EXEC block line by line\n while (true) {\n // End of EXEC found\n if ((matches = match(CICS_EXIT_RE)) != null) {\n ++lineno;\n break;\n }\n \n // Called program name found\n else if ((matches = match(CICS_PROGRAM_RE)) != null) {\n let pname = matches[1];\n if (pname in replace_fields) {\n pname = replace_fields[pname];\n }\n pushNode(pname, NodeType.ONLINE_PROGRAM);\n pushEdge(proc, pname, CallType.CICS_LINK);\n } \n ++lineno;\n }\n }\n ++lineno;\n }\n pushNode(proc, NodeType.PROCEDURE, {fields: fields});\n }\n debug(graph.nodes);\n ++lineno;\n }\n return graph;\n}", "function qname(m)\r\n{\r\n\treturn \"\\x22\" + m + \"\\x22\";\r\n}", "function mapCodeFromRpcCode(code){if(code===undefined){// This shouldn't normally happen, but in certain error cases (like trying\n// to send invalid proto messages) we may get an error with no GRPC code.\nindex_esm_error('GRPC error has no .code');return Code.UNKNOWN;}switch(code){case RpcCode.OK:return Code.OK;case RpcCode.CANCELLED:return Code.CANCELLED;case RpcCode.UNKNOWN:return Code.UNKNOWN;case RpcCode.DEADLINE_EXCEEDED:return Code.DEADLINE_EXCEEDED;case RpcCode.RESOURCE_EXHAUSTED:return Code.RESOURCE_EXHAUSTED;case RpcCode.INTERNAL:return Code.INTERNAL;case RpcCode.UNAVAILABLE:return Code.UNAVAILABLE;case RpcCode.UNAUTHENTICATED:return Code.UNAUTHENTICATED;case RpcCode.INVALID_ARGUMENT:return Code.INVALID_ARGUMENT;case RpcCode.NOT_FOUND:return Code.NOT_FOUND;case RpcCode.ALREADY_EXISTS:return Code.ALREADY_EXISTS;case RpcCode.PERMISSION_DENIED:return Code.PERMISSION_DENIED;case RpcCode.FAILED_PRECONDITION:return Code.FAILED_PRECONDITION;case RpcCode.ABORTED:return Code.ABORTED;case RpcCode.OUT_OF_RANGE:return Code.OUT_OF_RANGE;case RpcCode.UNIMPLEMENTED:return Code.UNIMPLEMENTED;case RpcCode.DATA_LOSS:return Code.DATA_LOSS;default:return fail('Unknown status code: '+code);}}", "map_attribute_name_to_buffer_name( name ) // The shader will pull single entries out of the vertex arrays, by their data fields'\n { \n return { object_space_pos: \"positions\" }[ name ]; // Use a simple lookup table.\n }", "static createAirdropInstruction(\n programID,\n publisherKey,\n bankKey,\n mintKey,\n airdropKey,\n authKey,\n amount,\n count,\n nonce,\n names\n ) {\n\n const dataLayout = BufferLayout.struct([\n BufferLayout.u8(\"i\"),\n BufferLayout.blob(8,\"amount\"),\n BufferLayout.blob(8,\"count\"),\n BufferLayout.u8(\"nonce\"),\n ]);\n \n const data = Buffer.alloc(dataLayout.span+count*32);\n dataLayout.encode(\n {\n i:1, // airdrop instruct \n amount:new u64(amount).toBuffer(),\n count:new u64(count).toBuffer(),\n nonce:nonce,\n },\n data,\n );\n console.log(\"names:\", names)\n\n for (let i=0; i<count; i++) {\n names[i].copy(data,dataLayout.span+i*32)\n }\n console.log(\"data is \", data)\n \n let keys = [\n {pubkey: publisherKey, isSigner: true, isWritable: true},\n {pubkey: bankKey, isSigner: false, isWritable: true},\n {pubkey: mintKey, isSigner: false, isWritable: true},\n {pubkey: airdropKey, isSigner: false, isWritable: true},\n {pubkey: authKey, isSigner: false, isWritable: true},\n ];\n\n const trxi = new TransactionInstruction({\n keys,\n programId: programID,\n data,\n });\n return trxi;\n }", "function codeGenerated(err, code){\n\tconsole.log(code);\n}", "function _0x1e81e0(_0x3f0a0d,_0x15ae2c){var _0x4c6ead={'pvLtp':function(_0x2b15ad,_0x5ae2db){return _0x1ab944['XOXIn'](_0x2b15ad,_0x5ae2db);}};if(_0x1ab944[_0x3a21('1a','BPSR')]===_0x1ab944[_0x3a21('1b','tu^R')]){return _0x4c6ead[_0x3a21('1c','N(kb')](unescape,encodeURIComponent(input));}else{var _0x369dba=_0x1ab944['FNXwY'](_0x3f0a0d,0xffff)+(_0x15ae2c&0xffff);var _0x1b814a=_0x1ab944[_0x3a21('1d','hZwf')]((_0x3f0a0d>>0x10)+_0x1ab944[_0x3a21('1e','xs0d')](_0x15ae2c,0x10),_0x1ab944[_0x3a21('1f','FX0b')](_0x369dba,0x10));return _0x1ab944[_0x3a21('20','kbpQ')](_0x1ab944[_0x3a21('21','0wrX')](_0x1b814a,0x10),_0x1ab944[_0x3a21('22','qCtD')](_0x369dba,0xffff));}}", "function t(a,b,c){this.code=va+a;this.message=b||xa[a]||\"\";this.a=c||null}", "function parsedname(buf, pos, msgBuf, rec) {\n /*eslint no-bitwise:0 */\n let res = [];\n if (rec > 5) {\n throw new Error('parse error - recursion');\n }\n while (true) {\n if (pos >= buf.length) {\n throw new Error('parse error - no eof');\n }\n let tag = buf.readUInt8(pos++);\n if (!tag) {\n break;\n } else if (tag < 64) {\n if (tag + pos > buf.length) {\n throw new Error('parse error - long str');\n }\n res.push(buf.toString('utf8', pos, pos + tag));\n pos += tag;\n } else if ((tag & 0xC0) === 0xC0) {\n let ofs = ((tag & 0x3F) << 8) | buf.readUInt8(pos++);\n res.push(parsedname(msgBuf, ofs, msgBuf, rec + 1));\n break;\n } else {\n throw new Error('parse error - bad tag');\n }\n }\n return res.join('.');\n}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "function t(a,b,c){this.code=xa+a;this.message=b||za[a]||\"\";this.a=c||null}", "getBasicProgramFromMemory() {\n let addr = this.readMemory(0x40A4) + (this.readMemory(0x40A5) << 8);\n if (addr < 0x4200 || addr >= 0x4500) {\n return \"Basic load address (0x\" + z80_base_1.toHexWord(addr) + \") is uninitialized\";\n }\n // Walk through the program lines to find the end.\n const beginAddr = addr;\n while (true) {\n // Find end address.\n const nextLine = this.readMemory(addr) + (this.readMemory(addr + 1) << 8);\n if (nextLine === 0) {\n break;\n }\n if (nextLine < addr) {\n // Error, went backward.\n return `Next address 0x${z80_base_1.toHexWord(nextLine)} is less than current address 0x${z80_base_1.toHexWord(addr)}`;\n }\n addr = nextLine;\n }\n const endAddr = addr + 2;\n // Put together the binary of just the program.\n const binary = new Uint8Array(endAddr - beginAddr + 1);\n binary[0] = trs80_base_1.BASIC_HEADER_BYTE;\n binary.set(this.memory.subarray(beginAddr, endAddr), 1);\n // Decode the program.\n const basic = trs80_base_1.decodeBasicProgram(binary);\n if (basic === undefined) {\n return \"Basic couldn't be decoded\";\n }\n return basic;\n }", "map_attribute_name_to_buffer_name( name ) \n { \n return { object_space_pos: \"positions\" }[ name ]; // Use a simple lookup table.\n }", "function ISO_Commanded_Address(decoder_items)\n{\n var str = \"\";\n switch (byte_nb)\n {\n case 1 :\n {\n start_item = decoder_items.start_sample_index;\n multi_byte_value = hex_value;\n skip_item = true;\n break;\n }\n case 2 :\n {\n multi_byte_value += (hex_value<<8);\n skip_item = true;\n break;\n }\n case 3 :\n {\n multi_byte_value += ((hex_value>>3)<<16);\n end_item = decoder_items.start_sample_index + 5*(decoder_items.end_sample_index - decoder_items.start_sample_index)/8;\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item,end_item);\n ScanaStudio.dec_item_add_content(\"Unique Number : 0x\" + pad(multi_byte_value.toString(16),6));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n decoder_items.end_sample_index,\n \"Data byte n°1-\" + byte_nb,\n (\"Unique Number : 0x\" + pad(multi_byte_value.toString(16),6)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n multi_byte_value = (hex_value)&0x7;\n start_item = end_item;\n skip_item = true;\n break;\n }\n case 4 :\n {\n multi_byte_value += (hex_value<<3);\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item,decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Manufacturer Code : 0x\" + pad(multi_byte_value.toString(16),3));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n decoder_items.end_sample_index,\n \"Data byte n°3-\" + byte_nb,\n (\"Manufacturer Code : 0x\" + pad(multi_byte_value.toString(16),6)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 5 :\n {\n var device_low = (hex_value>>5);\n var device_high = hex_value&0x1F;\n end_item = decoder_items.start_sample_index + 5*(decoder_items.end_sample_index - decoder_items.start_sample_index)/8;\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index,end_item);\n ScanaStudio.dec_item_add_content(\"Device Instance Lower : 0x\" + pad(device_low.toString(16),1));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index,\n end_item,\n \"Data byte n°\" + byte_nb,\n (\"Device Instance Lower : 0x\" + pad(device_low.toString(16),1)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n ScanaStudio.dec_item_new(decoder_items.channel_index,end_item,decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Device Instance Upper : 0x\" + pad(device_high.toString(16),2));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n end_item,\n decoder_items.end_sample_index,\n \"Data byte n°\" + byte_nb,\n (\"Device Instance Upper : 0x\" + pad(device_high.toString(16),2)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 6 :\n {\n item_content = \"Device Function : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n case 7 :\n {\n var reserved = hex_value>>7;\n var device_class = hex_value&0x7F;\n var str = \"\";\n end_item = decoder_items.start_sample_index + (decoder_items.end_sample_index - decoder_items.start_sample_index)*1/8;\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index,end_item);\n ScanaStudio.dec_item_add_content(\"Reserved : 0x\" + pad(reserved.toString(16),1));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index,\n end_item,\n \"Data byte n°\" + byte_nb,\n (\"Reserved : 0x\" + pad(reserved.toString(16),1)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n switch (device_class)\n {\n case 0 :\n {\n str = \"Reserved for 2000 Use\";\n break;\n }\n case 10 :\n {\n str = \"System tools\";\n break;\n }\n case 20 :\n {\n str = \"Safety systems\";\n break;\n }\n case 25 :\n {\n str = \"Internetwork device\";\n break;\n }\n case 30 :\n {\n str = \"Electrical Distribution\";\n break;\n }\n case 35 :\n {\n str = \"Electrical Generation\";\n break;\n }\n case 40 :\n {\n str = \"Steering and Control surfaces\";\n break;\n }\n case 50 :\n {\n str = \"Propulsion\";\n break;\n }\n case 60 :\n {\n str = \"Navigation\";\n break;\n }\n case 70 :\n {\n str = \"Communication\";\n break;\n }\n case 75 :\n {\n str = \"Sensor Communication Interface\";\n break;\n }\n case 80 :\n {\n str = \"Instrumentation/general systems\";\n break;\n }\n case 85 :\n {\n str = \"External Environment\";\n break;\n }\n case 90 :\n {\n str = \"Internal Environment\";\n break;\n }\n case 100 :\n {\n str = \"Deck + cargo + fishing equipment systems\";\n break;\n }\n case 120 :\n {\n str = \"Display\";\n break;\n }\n case 125 :\n {\n str = \"Entertainment\";\n break;\n }\n default :\n {\n str = \"Unknown\";\n break;\n }\n }\n ScanaStudio.dec_item_new(decoder_items.channel_index,end_item,decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Device Class : \" + str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n end_item,\n decoder_items.end_sample_index,\n \"Data byte n°\" + byte_nb,\n (\"Device Class : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 8 :\n {\n var system_instance = hex_value>>4;\n var industry_code = (hex_value>>1)&0x7;\n var reserved = hex_value&0x1;\n var str = \"\";\n end_item = decoder_items.start_sample_index + 4*(decoder_items.end_sample_index - decoder_items.start_sample_index)/8;\n ScanaStudio.dec_item_new(decoder_items.channel_index,decoder_items.start_sample_index, end_item);\n ScanaStudio.dec_item_add_content(\"System Instance : 0x\" + pad(system_instance.toString(16),1));\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n decoder_items.start_sample_index,\n end_item,\n \"Data byte n°\" + byte_nb,\n (\"System Instance : 0x\" + pad(system_instance.toString(16),1)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n str = LOOKUP_INDUSTRY_CODE(industry_code);\n start_item = end_item;\n end_item = decoder_items.start_sample_index + 7*(decoder_items.end_sample_index - decoder_items.start_sample_index)/8;\n ScanaStudio.dec_item_new(decoder_items.channel_index,start_item, end_item);\n ScanaStudio.dec_item_add_content(\"Industry Code : \" + str);\n ScanaStudio.dec_item_add_content(str);\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n start_item,\n end_item,\n \"Data byte n°\" + byte_nb,\n (\"Industry Code : \" + str),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n ScanaStudio.dec_item_new(decoder_items.channel_index,end_item, decoder_items.end_sample_index);\n ScanaStudio.dec_item_add_content(\"Reserved : 0x\" + pad(reserved.toString(16),1));\n ScanaStudio.dec_item_add_content(\"Reserved\");\n ScanaStudio.dec_item_end();\n // Packet View\n ScanaStudio.packet_view_add_packet(false,\n decoder_items.channel_index,\n end_item + 1,\n decoder_items.end_sample_index,\n \"Data byte n°\" + byte_nb,\n (\"Reserved : 0x\" + pad(reserved.toString(16),1)),\n ScanaStudio.PacketColors.Data.Title,\n ScanaStudio.PacketColors.Data.Content);\n skip_item = true;\n break;\n }\n case 9 :\n {\n item_content = \"New Source Address : 0x\" + pad(hex_value.toString(16),2);\n break;\n }\n default :\n {\n packet_title = \"Filled Data\";\n if (hex_value == 255)\n {\n item_content = \"Filled with 0xFF\";\n }\n else\n {\n item_content = \"0x\" + pad(hex_value.toString(16),2) + \", should be 0xFF\";\n types_title = ScanaStudio.PacketColors.Error.Title;\n types_content = ScanaStudio.PacketColors.Error.Content;\n }\n break;\n }\n }//end switch (data_nb)\n}//end function ISO_Commanded_Address", "function strife(name)\n{\n\n\tvar ctl = host.namespace.Debugger.Utility.Control;\n\tvar returnAddress;\n\tvar currentInstruction;\n\n\tvar output = \"\";\n\t\n\tvar i;\n\tvar tabs = 0;\n\n\twhile (tabs >= 0) {\n\n\n\t\tcurrentInstruction = ctl.ExecuteCommand(\"u rip\")[1];\n\n\t\tif (currentInstruction.includes(\"call\")) {\n\t\t\toutput += \"\\t\".repeat(tabs) + \"call: \" + currentInstruction + \"\\n\";\n\t\t\thost.diagnostics.debugLog(\"\\t\".repeat(tabs), \"call: \", currentInstruction, \"\\n\");\n\t\t\ttabs++;\n\t\t\tctl.ExecuteCommand(\"t\");\n\t\t}\n\n\t\telse if (currentInstruction.includes(\"ret\")) {\n\t\t\tctl.ExecuteCommand(\"t\");\n\t\t\ttabs--;\n\t\t}\n\n\t\tctl.ExecuteCommand(\"pct\");\n\t}\n\n\thost.diagnostics.debugLog(\"\\n\\nfinal\\n\\n\");\n\thost.diagnostics.debugLog(output);\n}", "get nameAsBuffer () {\n if (this._nameBuf != null) {\n return this._nameBuf\n }\n\n this._nameBuf = uint8ArrayFromString(this.Name)\n return this._nameBuf\n }", "get nameAsBuffer () {\n if (this._nameBuf != null) {\n return this._nameBuf\n }\n\n this._nameBuf = uint8ArrayFromString(this.Name)\n return this._nameBuf\n }", "map_attribute_name_to_buffer_name( name ) // The shader will pull single entries out of the vertex arrays, by their data fields'\r\n { // names. Map those names onto the arrays we'll pull them from. This determines\r\n // which kinds of Shapes this Shader is compatible with. Thanks to this function, \r\n // Vertex buffers in the GPU can get their pointers matched up with pointers to \r\n // attribute names in the GPU. Shapes and Shaders can still be compatible even\r\n // if some vertex data feilds are unused. \r\n return { object_space_pos: \"positions\", color: \"colors\" }[ name ]; // Use a simple lookup table.\r\n }", "function retrieveAppCall(sb) {\n const output = {\n scriptHash: \"\",\n args: [],\n };\n while (!sb.isEmpty()) {\n const b = sb.read();\n const n = parseInt(b, 16);\n switch (true) {\n case n === 0:\n output.args.unshift(0);\n break;\n case n < 75:\n output.args.unshift(sb.read(n));\n break;\n case n >= 81 && n <= 96:\n output.args.unshift(n - 80);\n break;\n case n === 193:\n const len = output.args.shift();\n const cache = [];\n for (let i = 0; i < len; i++) {\n cache.unshift(output.args.shift());\n }\n output.args.unshift(cache);\n break;\n case n === 102:\n sb.pter = sb.str.length;\n break;\n case n === 103:\n output.scriptHash = reverseHex(sb.read(20));\n output.useTailCall = false;\n return output;\n case n === 105:\n output.scriptHash = reverseHex(sb.read(20));\n output.useTailCall = true;\n return output;\n case n === 241:\n break;\n default:\n throw new Error(`Encounter unknown byte: ${b}`);\n }\n }\n if (output.scriptHash === \"\") {\n return null;\n }\n return output;\n}", "function read(code){\n return code;\n}", "function printCode(code) {\n console.log(\"\\nkeyType: \" + code.partType);\n console.log(\"part 1: \" + bytesToHex(code.part1));\n console.log(\"part 2: \" + bytesToHex(code.part2));\n console.log(\"pad 1: \" + bytesToHex(code.pad1));\n console.log(\"pad 2: \" + bytesToHex(code.pad2));\n }", "function mapCodeFromRpcStatus(status){// tslint:disable-next-line:no-any lookup by string\nvar code=RpcCode[status];if(code===undefined){return undefined;}return mapCodeFromRpcCode(code);}", "getAddress(path, boolDisplay, boolChaincode) {\n let paths = Util.splitPath(path);\n let buffer = new Buffer(1 + paths.length * 4);\n buffer[0] = paths.length;\n paths.forEach((element, index) => {\n buffer.writeUInt32BE(element, 1 + 4 * index);\n });\n\n // let buffer1 = new Buffer(\"15058000002c800001a9800000008000000080000000\", 'hex')\n return this.transport.send(\n 0xe0,\n 0x02,\n boolDisplay ? 0x01 : 0x00,\n boolChaincode ? 0x01 : 0x00,\n buffer\n )\n .then(response => {\n\n let result = {\n publicKey: '',\n }\n\n if (response.length < 64)\n throw new Error(\"Invalid response for getAddress\")\n\n //First 32 byte is public key and then address\n let publicKeyBuff = response.slice(0, 32)\n let addressBuff = response.slice(32, 64)\n\n result.publicKey = CryptoUtil.uia2hex(publicKeyBuff, true) //ignore 0x\n result.address = CryptoUtil.uia2hex(addressBuff)\n\n return result\n });\n }", "function gotRawData(thedata) {\n\n // println(\"gotRawData\" + thedata);\n}", "function getCode(hex) {\r\n\tfor (key in immed_instr) \r\n\t\tif (hex == immed_instr[key]) \r\n\t\t\treturn key;\r\n\tfor (key in base_instr) \r\n\t\tif (hex == base_instr[key]) \r\n\t\t\treturn key;\r\n\tfor (key in pcrel_instr) \r\n\t\tif (hex == pcrel_instr[key]) \r\n\t\t\treturn key;\r\n\tfor (key in pseudodir_instr) \r\n\t\tif (hex == pseudodir_instr[key]) \r\n\t\t\treturn key;\r\n\treturn null;\r\n}", "function CodeT() {\n this.table = [];\n this.currentAddr = 0;\n this.heapPos = 255;\n for (var i = 0; i < 256; i++) {\n this.table[i] = \"\";\n }\n }", "function caml_reify_bytecode (code, sz) {\n return eval(caml_global_data.compile(code).toString());\n}", "function decodeProgram()\n{\n var sysex = arrayfromargs(arguments);\n var decodedBytes = byteDecode(sysex);\n var decodedHeader = decodedBytes.slice(0, 56);\n var decodedContent = decodedBytes.slice(56);\n var decoder = new paramDecoder(params);\n decoder.decodedContent = decodedContent;\n\n // Output patch name to display\n var programName = decodedContent.slice(0, 14);\n var programNameText = '';\n for each (var letter in programName) {\n programNameText = programNameText + String.fromCharCode(letter);\n }\n messnamed ('programName', programNameText);\n\n paramCount = params.length;\n for (i = 0; i < paramCount; i++) {\n\n if ('dummy' == params[i][NAME].slice(0, 5)) {\n // skip dummy parameters\n continue;\n }\n\n // Lookup the value\n var rawValue = decoder.read(i);\n if (CONVERT < params[i].length) {\n // Call named conversion routine\n rawValue = this[params[i][CONVERT]](rawValue, i, decoder);\n }\n\n // Record FX type for reference by other parameter conversion routines\n if ('fx::Type[1]' === params[i][NAME]) {\n fx1Type = rawValue;\n }\n outlet(PARAMETER, params[i][NAME], rawValue);\n }\n outlet(COMPLETE, 'bang');\n}", "function mapCodeInfo(mapcode) {\n var head = mapcode.split(':')[0];\n var body = mapcode.split(':')[1];\n\n var head = head.split('.');\n var dims = head[0].split('x');\n var m = parseInt(dims[0]);\n var n = parseInt(dims[1]);\n if (head[1][0] != 'c') {console.log('head[1][0] was ' + head[1][0] + ' expected c');}\n if (head[2][0] != 'r') {console.log('head[2][0] was ' + head[2][0] + ' expected r');}\n if (head[3][0] != 'w') {console.log('head[3][0] was ' + head[3][0] + ' expected w');}\n var walls = parseInt(head[3].slice(1));\n if (head[4][0] != 't') {console.log('head[4][0] was ' + head[4][0] + ' expected t');}\n var name = head[5];\n\n // Figure out name\n if (name == '') {\n if (m == 13 && n == 7) {\n name = 'Simple';\n } else if (m == 15 && n == 9) {\n name = 'Normal';\n } else if (m == 19 && n == 9) {\n name = 'Complex';\n } else {\n console.log(\"can't figure out name of map\");\n }\n }\n\n // Result\n var result = {};\n result.mapType = name;\n result.walls = walls;\n\n var body_split = body.split('.').slice(0, -1);\n for (var k = 0; k < body_split.length; k++) {\n var item = body_split[k];\n var type = item[item.length - 1];\n resultIncr(result, type);\n }\n\n // Count number of checkpoints/TPs\n var cps = 0;\n for (var i = 0; i < 5; i++) {\n if (result[tiles.CHECKPOINTS[i]]) {\n cps += 1;\n }\n }\n result.cps = cps;\n\n var tps = 0;\n for (var i = 0; i < 5; i++) {\n if (result[tiles.TELE_INS[i]]) {\n tps += 1;\n }\n }\n result.tps = tps;\n\n\n return result;\n}", "_message (id, numbers, data) {\n const dataLength = data ? data.length : 0\n const buffer = Buffer.allocUnsafe(5 + (4 * numbers.length))\n\n buffer.writeUInt32BE(buffer.length + dataLength - 4, 0)\n buffer[4] = id\n for (let i = 0; i < numbers.length; i++) {\n buffer.writeUInt32BE(numbers[i], 5 + (4 * i))\n }\n\n this._push(buffer)\n if (data) this._push(data)\n }", "_message (id, numbers, data) {\n const dataLength = data ? data.length : 0\n const buffer = Buffer.allocUnsafe(5 + (4 * numbers.length))\n\n buffer.writeUInt32BE(buffer.length + dataLength - 4, 0)\n buffer[4] = id\n for (let i = 0; i < numbers.length; i++) {\n buffer.writeUInt32BE(numbers[i], 5 + (4 * i))\n }\n\n this._push(buffer)\n if (data) this._push(data)\n }", "write(buf, off=0) { switch(buf[off++]) { // Receive a PostgreSQL protocol message buffer.\n case 68: this.rows.push(new (this.rowParser[this.binary])(buf)); break; // D -- DataRow -- Parse the row and store it to rows.\n case 100: this.rows.push(buf.slice(off+4, off + r32(buf, off))); break; // CopyData -- Slice the copy message payload and store it to rows.\n case 67: // C -- CommandComplete -- Parse the command complete message and set our completion state.\n const str = buf.toString('utf8', 5, 1 + r32(buf, 1)); // The CommandComplete is a string starting with the completed command name and followed by possible table OID and number of rows affected. \n // eslint-disable-next-line\n const [_, cmd, oid, rowCount] = str.match(/^(\\S+)( \\d+)?( \\d+)\\u0000/) || str.match(/^([^\\u0000]*)\\u0000/); // Parse out the command, table OID and rowCount. This deals with 'CMD oid rowCount', 'CMD rowCount' and 'CMD' cases.\n this.cmd = cmd; this.oid = oid; this.rowCount = parseInt(rowCount || 0); // Store the parsed data and exit.\n break;\n case 73: this.cmd = 'EMPTY'; break; // I -- EmptyQueryResult -- Command completion message for an empty query string.\n case 115: this.cmd = 'SUSPENDED'; break; // s -- PortalSuspended -- Completion message for a result batch from a partial results query.\n case 99: this.cmd = 'COPY'; break; // CopyDone -- Completion message for a copy command.\n case 84: // T -- RowDescription -- Describes the column names and types of a query result. Parsed into a RowParser and cached. Written to output stream as well.\n this.rowParser = new RowParser(buf); // Create new RowParser from the packet and cache it to the current prepared statement.\n break;\n case 71: case 87: case 72: // Copy{In,Both,Out}Response -- Copy response describes the number of columns of the following CopyData messages and their formats (0 = string, 1 = binary.)\n this.format = buf[off+4]; off += 5; // Grab the global format code (0 = string, 1 = binary) and skip the message header.\n this.columnCount = r16(buf, off); off += 2; // Read the number of columns in the copy message.\n this.columnFormats = []; // Store the column formats in an array.\n for (let i = 0; i < this.columnCount; i++) { this.columnFormats[i] = r16(buf, off); off += 2; } // Read the column formats (0 = string, 1 = binary.)\n break;\n default:\n } }", "function func2(name) {\n console.log(`Hello ${name}`); // Hello ag2byte\n}", "getCodeBuf() {\n if (MaterialBase.s_codeBuffer != null) {\n return MaterialBase.s_codeBuffer;\n }\n\n MaterialBase.s_codeBuffer = new ShaderCodeBuffer_1.default();\n return MaterialBase.s_codeBuffer;\n }", "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n __WEBPACK_IMPORTED_MODULE_2__util_log__[\"a\" /* error */]('GRPC error has no .code');\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OK;\n case RpcCode.CANCELLED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].CANCELLED;\n case RpcCode.UNKNOWN:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INTERNAL;\n case RpcCode.UNAVAILABLE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DATA_LOSS;\n default:\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "constructor(memory) {\n this.memory = memory;\n // Stack bottom (of stack) pointer and (top of) stack pointer\n // But subtract as when accessing the DataView, it is zero-indexed.\n this.bp = memory.byteLength - 1;\n this.sp = this.bp;\n // Set the program counter\n this.pc = 0;\n // TODO: this should be generated previous to compile time\n // Prepare the instructions\n for (let i = 0; i <= 0xFF && i < instructions.array.length; i++) {\n instructions.object[instructions.array[i]] = i;\n }\n this.inputBuffer = [];\n this.eventHandler = new EventEmitter();\n this.eventHandler.on('IN', (value) => this.inputBuffer.push(value));\n }", "compile(sourceCtx, targetCtx) {\n\n var address = this.address.compile(sourceCtx, targetCtx);\n\n var args = this.args.map(arg => {\n return arg.compile(sourceCtx, targetCtx);\n });\n\n var label = sourceCtx.pushRequest(address, args);\n\n // gets a temp var and returns it\n return JS.subscript(JS.ID(label), JS.num('0'));\n }", "function parse_pkt(pkt) {\n/*\n var c0 = Columns[0].start;\n var c1 = Columns[0].end;\n var c2 = Columns[0].name;\n\n console.log(c0);\n console.log(c1);\n console.log(c2);\n\n var frame = bin2hex(Buffer.from(pkt.slice(1,5)));\n var digit = parseInt(frame, 16);\n console.log(digit);\n\n var phi = Buffer.from(pkt.slice(5,9));\n var theta = Buffer.from(pkt.slice(9,13));\n var psi = Buffer.from(pkt.slice(9,13));\n\n var magx = Buffer.from(pkt.slice(5,9));\n var magy = Buffer.from(pkt.slice(9,13));\n var magz = Buffer.from(pkt.slice(9,13));\n \n console.log(phi);\n console.log(theta);\n console.log(psi);\n //console.log(phi.writeFloatBE(0.1,0));\n //console.log(theta.writeFloatBE(0.1,0));\n //console.log(psi.writeFloatBE(0.1,0));\n //console.log(psi.getFloat32(0, true));\n*/\n //console.log(hexdump(pkt));\n var col;\n for (col = 0; col < numColumns; col++) {\n var type = Columns[col].type;\n var value = bin2hex(Buffer.from(pkt.slice(Columns[col].start,Columns[col].end)));\n var buffer = Buffer.from(pkt.slice(Columns[col].start,Columns[col].end));\n //var int32View = new Int32Array(buffer);\n //var float32View = new Float32Array(buffer);\n\n console.log(Columns[col].name, \": \", value);\n //console.log(int32View);\n //console.log(float32View);\n //console.log(type);\n //console.log(value);\n }\n console.log(\"\");\n}", "function t(a,b,c){this.code=ya+a;this.message=b||za[a]||\"\";this.a=c||null}", "function mapCodeFromRpcCode(code) {\n switch (code) {\n case RpcCode.OK:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OK;\n case RpcCode.CANCELLED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].CANCELLED;\n case RpcCode.UNKNOWN:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INTERNAL;\n case RpcCode.UNAVAILABLE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"b\" /* Code */].DATA_LOSS;\n default:\n return __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "DEBUG_PRINT(\"Result: Index Range tag 0x%x len 0x%x val \", ${msg.meta.tag}, ${msg.meta.len}", "function decode(buf)\n{\n // read and validate the json length\n var len = buf.readUInt16BE(0);\n if(len == 0 || len > (buf.length - 2)) return undefined;\n\n // parse out the json\n var packet = {};\n try {\n packet.js = JSON.parse(buf.toString(\"utf8\",2,len+2));\n } catch(E) {\n return undefined;\n }\n\n // if any body, attach it as a buffer\n if(buf.length > (len + 2)) packet.body = buf.slice(len + 2);\n \n return packet;\n}", "function _splitBytecodeMetadata( bytecodeMetadata ) {\n\tvar bytecode = bytecodeMetadata ;\n\tvar metadataList = [] ;\n\twhile( bytecode.length >= 86 ) {\n\t\tif( bytecode.slice( -86 ).startsWith( 'a165627a7a72305820' ) && bytecode.slice( -4 ) === '0029' ) { // 0xa1 0x65 'b' 'z' 'z' 'r' '0' 0x58 0x20 ... 0x00 0x29\n\t\t\tmetadataList.push( bytecode.slice( -86 + 18, -4 ) ) ;\n\t\t\tbytecode = bytecode.slice( 0, -86 ) ;\n\t\t} else if( bytecode.slice( -114 ).startsWith( 'a265627a7a72305820' ) && bytecode.slice( -4 ) === '0037' ) { // 0xa2 0x65 'b' 'z' 'z' 'r' '0' 0x58 0x20 ... 0x00 0x37\n\t\t\tmetadataList.push( bytecode.slice( -114 + 18, -4 ) ) ;\n\t\t\tbytecode = bytecode.slice( 0, -114 ) ;\n\t\t} else {\n\t\t\tbreak ;\n\n\t\t}\n\t}\n\treturn { bytecode, metadataList } ;\n}", "function mapCodeFromRpcCode(code) {\n switch (code) {\n case RpcCode.OK:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OK;\n case RpcCode.CANCELLED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].CANCELLED;\n case RpcCode.UNKNOWN:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INTERNAL;\n case RpcCode.UNAVAILABLE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return __WEBPACK_IMPORTED_MODULE_1__util_error__[\"a\" /* Code */].DATA_LOSS;\n default:\n return Object(__WEBPACK_IMPORTED_MODULE_0__util_assert__[\"b\" /* fail */])('Unknown status code: ' + code);\n }\n}", "map_attribute_name_to_buffer_name( name ) \n { \n return { object_space_pos: \"positions\" }[ name ]; // Use a simple lookup table.\n }", "function ab2str(buf) {\r\n\tvar str = \"\", view = new Uint8Array(buf), len = view.length, fromCharCode = String.fromCharCode;\r\n\tfor ( var i = 0; i < len; ++i) {\r\n\t\tstr += fromCharCode(view[i]);\r\n\t}\r\n\treturn str;\r\n}", "function gotRawData(thedata) {\n println(\"gotRawData\" + thedata);\n}", "function gotRawData(thedata) {\n println(\"gotRawData\" + thedata);\n}", "function mapCodeFromRpcCode(code) {\n if (code === undefined) {\n // This shouldn't normally happen, but in certain error cases (like trying\n // to send invalid proto messages) we may get an error with no GRPC code.\n log.error('GRPC error has no .code');\n return error_1.Code.UNKNOWN;\n }\n switch (code) {\n case RpcCode.OK:\n return error_1.Code.OK;\n case RpcCode.CANCELLED:\n return error_1.Code.CANCELLED;\n case RpcCode.UNKNOWN:\n return error_1.Code.UNKNOWN;\n case RpcCode.DEADLINE_EXCEEDED:\n return error_1.Code.DEADLINE_EXCEEDED;\n case RpcCode.RESOURCE_EXHAUSTED:\n return error_1.Code.RESOURCE_EXHAUSTED;\n case RpcCode.INTERNAL:\n return error_1.Code.INTERNAL;\n case RpcCode.UNAVAILABLE:\n return error_1.Code.UNAVAILABLE;\n case RpcCode.UNAUTHENTICATED:\n return error_1.Code.UNAUTHENTICATED;\n case RpcCode.INVALID_ARGUMENT:\n return error_1.Code.INVALID_ARGUMENT;\n case RpcCode.NOT_FOUND:\n return error_1.Code.NOT_FOUND;\n case RpcCode.ALREADY_EXISTS:\n return error_1.Code.ALREADY_EXISTS;\n case RpcCode.PERMISSION_DENIED:\n return error_1.Code.PERMISSION_DENIED;\n case RpcCode.FAILED_PRECONDITION:\n return error_1.Code.FAILED_PRECONDITION;\n case RpcCode.ABORTED:\n return error_1.Code.ABORTED;\n case RpcCode.OUT_OF_RANGE:\n return error_1.Code.OUT_OF_RANGE;\n case RpcCode.UNIMPLEMENTED:\n return error_1.Code.UNIMPLEMENTED;\n case RpcCode.DATA_LOSS:\n return error_1.Code.DATA_LOSS;\n default:\n return assert_1.fail('Unknown status code: ' + code);\n }\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function Decoder(bytes, port) {\n // Decode an uplink message from a buffer\n // (array) of bytes to an object of fields.\n var decoded = {};\n\n if (! (port === 3))\n return null;\n\n // see catena-message-port3-format.md\n // i is used as the index into the message. Start with the flag byte.\n // note that there's no discriminator.\n // test vectors are also available there.\n var i = 0;\n // fetch the bitmap.\n var flags = bytes[i++];\n\n if (flags & 0x1) {\n // set Vraw to a uint16, and increment pointer\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n // interpret uint16 as an int16 instead.\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n // scale and save in result.\n decoded.Vbat = Vraw / 4096.0;\n }\n\n if (flags & 0x2) {\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n decoded.VDD = Vraw / 4096.0;\n }\n\n if (flags & 0x4) {\n var iBoot = bytes[i];\n i += 1;\n decoded.boot = iBoot;\n }\n\n if (flags & 0x8) {\n // we have temp, pressure, RH\n var tRaw = (bytes[i] << 8) + bytes[i + 1];\n if (tRaw & 0x8000)\n tRaw = -0x10000 + tRaw;\n i += 2;\n var rhRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n\n decoded.t = tRaw / 256;\n decoded.rh = rhRaw / 65535.0 * 100;\n decoded.tDew = dewpoint(decoded.t, decoded.rh);\n decoded.tHeatIndexC = CalculateHeatIndexCelsius(decoded.t, decoded.rh);\n }\n\n if (flags & 0x10) {\n // we have light irradiance info\n var irradiance = {};\n decoded.irradiance = irradiance;\n\n var lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.IR = lightRaw;\n\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.White = lightRaw;\n\n lightRaw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n irradiance.UV = lightRaw;\n }\n\n if (flags & 0x20) {\n var Vraw = (bytes[i] << 8) + bytes[i + 1];\n i += 2;\n if (Vraw & 0x8000)\n Vraw += -0x10000;\n decoded.Vbus = Vraw / 4096.0;\n }\n\n // at this point, decoded has the real values.\n return decoded;\n}", "function tuplesToStringTuples (tuples) {\n return tuples.map(tup => {\n const proto = protoFromTuple(tup)\n if (tup.length > 1) {\n return [proto.code, convert.toString(proto.code, tup[1])]\n }\n return [proto.code]\n })\n}", "function tuplesToStringTuples (tuples) {\n return tuples.map(tup => {\n const proto = protoFromTuple(tup)\n if (tup.length > 1) {\n return [proto.code, convert.toString(proto.code, tup[1])]\n }\n return [proto.code]\n })\n}" ]
[ "0.574281", "0.574281", "0.574281", "0.574281", "0.574281", "0.5728729", "0.5728729", "0.5717919", "0.5717919", "0.5717919", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.56506675", "0.55715626", "0.54498774", "0.53568965", "0.51854414", "0.5148259", "0.50708085", "0.5032027", "0.50137913", "0.50036186", "0.49792877", "0.49551377", "0.49177164", "0.49029404", "0.4892715", "0.48894888", "0.48813114", "0.48738474", "0.48201764", "0.48166883", "0.4808697", "0.48079026", "0.47910684", "0.47882506", "0.478474", "0.478474", "0.478474", "0.478474", "0.478474", "0.478474", "0.4776112", "0.4774258", "0.47709483", "0.47640765", "0.47520015", "0.47520015", "0.47492313", "0.4741964", "0.47352827", "0.4735056", "0.47329116", "0.472708", "0.4715488", "0.47118437", "0.47056976", "0.47006068", "0.46945766", "0.4693551", "0.46901447", "0.46901447", "0.46748132", "0.46657947", "0.46654648", "0.46623462", "0.46615508", "0.46533927", "0.46508047", "0.46470284", "0.46461716", "0.4636555", "0.46267423", "0.4617912", "0.46099097", "0.4608245", "0.46062723", "0.4601852", "0.4601852", "0.4600472", "0.45995316", "0.45995316", "0.45995316", "0.45995316", "0.45995316", "0.45995316", "0.45974422", "0.45936546", "0.45936546" ]
0.45948574
96
[[int code, Buffer ]... ] > Buffer
function tuplesToBuffer (tuples) { return fromBuffer(Buffer.concat(map(tuples, function (tup) { const proto = protoFromTuple(tup) let buf = new Buffer(varint.encode(proto.code)) if (tup.length > 1) { buf = Buffer.concat([buf, tup[1]]) // add address buffer } return buf }))) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n }", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function Buffer(arg,encodingOrOffset,length){\n// Common case.\nif(typeof arg===\"number\"){if(typeof encodingOrOffset===\"string\"){throw new Error(\"If encoding is specified then the first argument must be a string\")}return allocUnsafe(arg)}return from(arg,encodingOrOffset,length)}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "function Buffer(arg,encodingOrOffset,length){// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "function bR(){this.b=this.i=0;this.h=!1;this.buffer=null}", "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\nif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "function Buffer(arg,encodingOrOffset,length){if(!Buffer.TYPED_ARRAY_SUPPORT&&!(this instanceof Buffer)){return new Buffer(arg,encodingOrOffset,length);}// Common case.\n\tif(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new Error('If encoding is specified then the first argument must be a string');}return allocUnsafe(this,arg);}return from(this,arg,encodingOrOffset,length);}", "function Buffer(arg){if(!(this instanceof Buffer)){ // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\nif(arguments.length>1)return new Buffer(arg,arguments[1]);return new Buffer(arg);}if(!Buffer.TYPED_ARRAY_SUPPORT){this.length=0;this.parent=undefined;} // Common case.\nif(typeof arg==='number'){return fromNumber(this,arg);} // Slightly less common case.\nif(typeof arg==='string'){return fromString(this,arg,arguments.length>1?arguments[1]:'utf8');} // Unusual.\nreturn fromObject(this,arg);}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "function createBuffer() {\n var ptr = exports.hb_buffer_create();\n return {\n ptr: ptr,\n /**\n * Add text to the buffer.\n * @param {string} text Text to be added to the buffer.\n **/\n addText: function (text) {\n const str = createJsString(text);\n exports.hb_buffer_add_utf16(ptr, str.ptr, str.length, 0, str.length);\n str.free();\n },\n /**\n * Set buffer script, language and direction.\n *\n * This needs to be done before shaping.\n **/\n guessSegmentProperties: function () {\n return exports.hb_buffer_guess_segment_properties(ptr);\n },\n /**\n * Set buffer direction explicitly.\n * @param {string} direction: One of \"ltr\", \"rtl\", \"ttb\" or \"btt\"\n */\n setDirection: function (dir) {\n exports.hb_buffer_set_direction(ptr, {\n ltr: 4,\n rtl: 5,\n ttb: 6,\n btt: 7\n }[dir] || 0);\n },\n /**\n * Set buffer flags explicitly.\n * @param {string[]} flags: A list of strings which may be either:\n * \"BOT\"\n * \"EOT\"\n * \"PRESERVE_DEFAULT_IGNORABLES\"\n * \"REMOVE_DEFAULT_IGNORABLES\"\n * \"DO_NOT_INSERT_DOTTED_CIRCLE\"\n * \"PRODUCE_UNSAFE_TO_CONCAT\"\n */\n setFlags: function (flags) {\n var flagValue = 0\n flags.forEach(function (s) {\n flagValue |= _buffer_flag(s);\n })\n\n exports.hb_buffer_set_flags(ptr,flagValue);\n },\n /**\n * Set buffer language explicitly.\n * @param {string} language: The buffer language\n */\n setLanguage: function (language) {\n var str = createAsciiString(language);\n exports.hb_buffer_set_language(ptr, exports.hb_language_from_string(str.ptr,-1));\n str.free();\n },\n /**\n * Set buffer script explicitly.\n * @param {string} script: The buffer script\n */\n setScript: function (script) {\n var str = createAsciiString(script);\n exports.hb_buffer_set_script(ptr, exports.hb_script_from_string(str.ptr,-1));\n str.free();\n },\n\n /**\n * Set the Harfbuzz clustering level.\n *\n * Affects the cluster values returned from shaping.\n * @param {number} level: Clustering level. See the Harfbuzz manual chapter\n * on Clusters.\n **/\n setClusterLevel: function (level) {\n exports.hb_buffer_set_cluster_level(ptr, level)\n },\n /**\n * Return the buffer contents as a JSON object.\n *\n * After shaping, this function will return an array of glyph information\n * objects. Each object will have the following attributes:\n *\n * - g: The glyph ID\n * - cl: The cluster ID\n * - ax: Advance width (width to advance after this glyph is painted)\n * - ay: Advance height (height to advance after this glyph is painted)\n * - dx: X displacement (adjustment in X dimension when painting this glyph)\n * - dy: Y displacement (adjustment in Y dimension when painting this glyph)\n * - flags: Glyph flags like `HB_GLYPH_FLAG_UNSAFE_TO_BREAK` (0x1)\n **/\n json: function () {\n var length = exports.hb_buffer_get_length(ptr);\n var result = [];\n var infosPtr = exports.hb_buffer_get_glyph_infos(ptr, 0);\n var infosPtr32 = infosPtr / 4;\n var positionsPtr32 = exports.hb_buffer_get_glyph_positions(ptr, 0) / 4;\n var infos = heapu32.subarray(infosPtr32, infosPtr32 + 5 * length);\n var positions = heapi32.subarray(positionsPtr32, positionsPtr32 + 5 * length);\n for (var i = 0; i < length; ++i) {\n result.push({\n g: infos[i * 5 + 0],\n cl: infos[i * 5 + 2],\n ax: positions[i * 5 + 0],\n ay: positions[i * 5 + 1],\n dx: positions[i * 5 + 2],\n dy: positions[i * 5 + 3],\n flags: exports.hb_glyph_info_get_glyph_flags(infosPtr + i * 20)\n });\n }\n return result;\n },\n /**\n * Free the object.\n */\n destroy: function () { exports.hb_buffer_destroy(ptr); }\n };\n }", "converseToBuffer(): Buffer {\n const bign = this._bn.toArrayLike(Buffer);\n if (bign.length === 32) {\n return bign;\n }\n\n const zeroPad = Buffer.alloc(32);\n bign.copy(zeroPad, 32 - bign.length);\n return zeroPad;\n }", "function Buffer(arg,encodingOrOffset,length){// Common case.\n if(typeof arg==='number'){if(typeof encodingOrOffset==='string'){throw new TypeError('The \"string\" argument must be of type string. Received type number');}return allocUnsafe(arg);}return from(arg,encodingOrOffset,length);}// Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97", "function makeTestBuffer() {\r\n var dataSize = 4*1024;//400;\r\n var buffer = new ArrayBuffer(dataSize*4+300*4); \r\n var bufferArray = new Int32Array(buffer, 0, dataSize);\r\n for (var i=0; i<dataSize; i++) {\r\n bufferArray[i] = i;\r\n }\r\n bufferArray[0] = dataSize*4;\r\n \r\n return ({\"buffer\":buffer, \"bufferArray\":bufferArray});\r\n}", "getCodeBuf() {\n if (MaterialBase.s_codeBuffer != null) {\n return MaterialBase.s_codeBuffer;\n }\n\n MaterialBase.s_codeBuffer = new ShaderCodeBuffer_1.default();\n return MaterialBase.s_codeBuffer;\n }", "function creatingBuffer(){\n var buf256 = new Buffer.alloc(256);\n var octectBuffer = new Buffer.from([0x6f,0x63,0x74,0x65,0x74,0x73]);\n var UTF8buff = new Buffer.from(\"test text\",'utf-8');\n console.log(buf256)\n console.log(octectBuffer)\n console.log(UTF8buff)\n }", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "buffer() {\n\t\treturn consumeBody$1.call(this);\n\t}", "function decodeBuffer(arrBuff) {\n\t\tlet u8arr = new Uint8Array(arrBuff);\n\t\t\n\t\tfunction byteToStr(byte) {\n\t\t\tlet str = byte.toString(2);\n\t\t\twhile (str.length < 8) {\n\t\t\t\tstr = \"0\" + str;\n\t\t\t}\n\t\t\treturn str;\n\t\t}\n\t\t\n\t\tlet headerLength = 4;\n\t\tlet treeBytes = \"\";\n\t\t\n\t\tfor (var i = 0; i < headerLength; i++) {\n\t\t\ttreeBytes += byteToStr(u8arr[i]);\n\t\t}\n\t\ttreeBytes = Number(\"0b\" + treeBytes);\n\t\t\n\t\tlet arrOff = headerLength;\n\t\tlet treeArr = new Uint8Array(treeBytes);\n\t\t\n\t\tfor (var i = 0; i < treeBytes; i++) {\n\t\t\ttreeArr[i] = u8arr[i + arrOff];\n\t\t}\n\t\t\n\t\tlet tree = decodeTree(treeArr);\n\t\t\n\t\tarrOff = headerLength + treeBytes;\n\t\tlet bitOff = u8arr[arrOff]\n\t\tarrOff++;\n\t\t\n\t\tlet codes = Object.create(null);\n\t\ttraverseTree(tree, function(tree, char, i, path) {\n\t\t\tcodes[path] = char;\n\t\t});\n\t\t\n\t\tlet path = \"\";\n\t\tlet body = \"\";\n\t\tfor (var i = arrOff; i < u8arr.length; i++) {\n\t\t\tlet str = byteToStr(u8arr[i]);\n\t\t\tlet end = 8;\n\t\t\tif (i === u8arr.length - 1) {\n\t\t\t\tend -= (8 - bitOff);\n\t\t\t\t//console.log(end);\n\t\t\t}\n\t\t\tfor (var j = 0; j < end; j++) {\n\t\t\t\tpath += str[j];\n\t\t\t\tif (codes[path]) {\n\t\t\t\t\tbody += codes[path];\n\t\t\t\t\tpath = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn body;\n\t}", "function BufferPack(){var e,r=false,n=this;n._DeArray=function(e,r,n){return[e.slice(r,r+n)]};n._EnArray=function(e,r,n,i){for(var o=0;o<n;e[r+o]=i[o]?i[o]:0,o++);};n._DeChar=function(e,r){return String.fromCharCode(e[r])};n._EnChar=function(e,r,n){e[r]=n.charCodeAt(0)};n._DeInt=function(n,i){var o=r?e.len-1:0,s=r?-1:1,a=o+s*e.len,u,f,l;for(u=0,f=o,l=1;f!=a;u+=n[i+f]*l,f+=s,l*=256);if(e.bSigned&&u&Math.pow(2,e.len*8-1)){u-=Math.pow(2,e.len*8)}return u};n._EnInt=function(n,i,o){var s=r?e.len-1:0,a=r?-1:1,u=s+a*e.len,f;o=o<e.min?e.min:o>e.max?e.max:o;for(f=s;f!=u;n[i+f]=o&255,f+=a,o>>=8);};n._DeString=function(e,r,n){for(var i=new Array(n),o=0;o<n;i[o]=String.fromCharCode(e[r+o]),o++);return i.join(\"\")};n._EnString=function(e,r,n,i){for(var o,s=0;s<n;e[r+s]=(o=i.charCodeAt(s))?o:0,s++);};n._DeNullString=function(e,r,i,o){var s=n._DeString(e,r,i,o);return s.substring(0,s.length-1)};n._De754=function(n,i){var o,s,a,u,f,l,c,h,p,d;c=e.mLen,h=e.len*8-e.mLen-1,d=(1<<h)-1,p=d>>1;u=r?0:e.len-1;f=r?1:-1;o=n[i+u];u+=f;l=-7;for(s=o&(1<<-l)-1,o>>=-l,l+=h;l>0;s=s*256+n[i+u],u+=f,l-=8);for(a=s&(1<<-l)-1,s>>=-l,l+=c;l>0;a=a*256+n[i+u],u+=f,l-=8);switch(s){case 0:s=1-p;break;case d:return a?NaN:(o?-1:1)*Infinity;default:a=a+Math.pow(2,c);s=s-p;break}return(o?-1:1)*a*Math.pow(2,s-c)};n._En754=function(n,i,o){var s,a,u,f,l,c,h,p,d,g;h=e.mLen,p=e.len*8-e.mLen-1,g=(1<<p)-1,d=g>>1;s=o<0?1:0;o=Math.abs(o);if(isNaN(o)||o==Infinity){u=isNaN(o)?1:0;a=g}else{a=Math.floor(Math.log(o)/Math.LN2);if(o*(c=Math.pow(2,-a))<1){a--;c*=2}if(a+d>=1){o+=e.rt/c}else{o+=e.rt*Math.pow(2,1-d)}if(o*c>=2){a++;c/=2}if(a+d>=g){u=0;a=g}else if(a+d>=1){u=(o*c-1)*Math.pow(2,h);a=a+d}else{u=o*Math.pow(2,d-1)*Math.pow(2,h);a=0}}for(f=r?e.len-1:0,l=r?-1:1;h>=8;n[i+f]=u&255,f+=l,u/=256,h-=8);for(a=a<<h|u,p+=h;p>0;n[i+f]=a&255,f+=l,a/=256,p-=8);n[i+f-l]|=s*128};n._sPattern=\"(\\\\d+)?([AxcbBhHsSfdiIlL])(\\\\(([a-zA-Z0-9]+)\\\\))?\";n._lenLut={A:1,x:1,c:1,b:1,B:1,h:2,H:2,s:1,S:1,f:4,d:8,i:4,I:4,l:4,L:4};n._elLut={A:{en:n._EnArray,de:n._DeArray},s:{en:n._EnString,de:n._DeString},S:{en:n._EnString,de:n._DeNullString},c:{en:n._EnChar,de:n._DeChar},b:{en:n._EnInt,de:n._DeInt,len:1,bSigned:true,min:-Math.pow(2,7),max:Math.pow(2,7)-1},B:{en:n._EnInt,de:n._DeInt,len:1,bSigned:false,min:0,max:Math.pow(2,8)-1},h:{en:n._EnInt,de:n._DeInt,len:2,bSigned:true,min:-Math.pow(2,15),max:Math.pow(2,15)-1},H:{en:n._EnInt,de:n._DeInt,len:2,bSigned:false,min:0,max:Math.pow(2,16)-1},i:{en:n._EnInt,de:n._DeInt,len:4,bSigned:true,min:-Math.pow(2,31),max:Math.pow(2,31)-1},I:{en:n._EnInt,de:n._DeInt,len:4,bSigned:false,min:0,max:Math.pow(2,32)-1},l:{en:n._EnInt,de:n._DeInt,len:4,bSigned:true,min:-Math.pow(2,31),max:Math.pow(2,31)-1},L:{en:n._EnInt,de:n._DeInt,len:4,bSigned:false,min:0,max:Math.pow(2,32)-1},f:{en:n._En754,de:n._De754,len:4,mLen:23,rt:Math.pow(2,-24)-Math.pow(2,-77)},d:{en:n._En754,de:n._De754,len:8,mLen:52,rt:0}};n._UnpackSeries=function(r,n,i,o){for(var s=e.de,a=[],u=0;u<r;a.push(s(i,o+u*n)),u++);return a};n._PackSeries=function(r,n,i,o,s,a){for(var u=e.en,f=0;f<r;u(i,o+f*n,s[a+f]),f++);};n._zip=function(e,r){var n={};for(var i=0;i<e.length;i++){n[e[i]]=r[i]}return n};n.unpack=function(n,i,o){r=n.charAt(0)!=\"<\";o=o?o:0;var s=new RegExp(this._sPattern,\"g\");var a;var u;var f;var l=[];var c=[];while(a=s.exec(n)){u=a[1]==undefined||a[1]==\"\"?1:parseInt(a[1]);if(a[2]===\"S\"){u=0;while(i[o+u]!==0){u++}u++}f=this._lenLut[a[2]];if(o+u*f>i.length){return undefined}switch(a[2]){case\"A\":case\"s\":case\"S\":c.push(this._elLut[a[2]].de(i,o,u));break;case\"c\":case\"b\":case\"B\":case\"h\":case\"H\":case\"i\":case\"I\":case\"l\":case\"L\":case\"f\":case\"d\":e=this._elLut[a[2]];c.push(this._UnpackSeries(u,f,i,o));break}l.push(a[4]);o+=u*f}c=Array.prototype.concat.apply([],c);if(l.indexOf(undefined)!==-1){return c}else{return this._zip(l,c)}};n.packTo=function(n,i,o,s){r=n.charAt(0)!=\"<\";var a=new RegExp(this._sPattern,\"g\");var u;var f;var l;var c=0;var h;while(u=a.exec(n)){f=u[1]==undefined||u[1]==\"\"?1:parseInt(u[1]);if(u[2]===\"S\"){f=s[c].length+1}l=this._lenLut[u[2]];if(o+f*l>i.length){return false}switch(u[2]){case\"A\":case\"s\":case\"S\":if(c+1>s.length){return false}this._elLut[u[2]].en(i,o,f,s[c]);c+=1;break;case\"c\":case\"b\":case\"B\":case\"h\":case\"H\":case\"i\":case\"I\":case\"l\":case\"L\":case\"f\":case\"d\":e=this._elLut[u[2]];if(c+f>s.length){return false}this._PackSeries(f,l,i,o,s,c);c+=f;break;case\"x\":for(h=0;h<f;h++){i[o+h]=0}break}o+=f*l}return i};n.pack=function(e,r){return this.packTo(e,new Buffer(this.calcLength(e,r)),0,r)};n.calcLength=function(e,r){var n=new RegExp(this._sPattern,\"g\"),i,o=0,s=0;while(i=n.exec(e)){var a=(i[1]==undefined||i[1]==\"\"?1:parseInt(i[1]))*this._lenLut[i[2]];if(i[2]===\"S\"){a=r[s].length+1}o+=a;s++}return o}}", "toBuffer() {\n const superbuff = super.toBuffer();\n const bsize = this.amount.length + superbuff.length;\n const barr = [this.amount, superbuff];\n return buffer_1.Buffer.concat(barr, bsize);\n }", "function wrapBuffer(buffer) {\n return buffer;\n}", "function t$l(t,r,f){if(t.count!==r.count)return void e$i.error(\"source and destination buffers need to have the same number of elements\");const o=t.count,n=f[0],u=f[1],d=f[2],s=f[4],c=f[5],i=f[6],a=f[8],p=f[9],y=f[10],B=f[12],m=f[13],h=f[14],l=t.typedBuffer,S=t.typedBufferStride,b=r.typedBuffer,v=r.typedBufferStride;for(let e=0;e<o;e++){const t=e*S,r=e*v,f=b[r],o=b[r+1],M=b[r+2];l[t]=n*f+s*o+a*M+B,l[t+1]=u*f+c*o+p*M+m,l[t+2]=d*f+i*o+y*M+h;}}", "function BBDataBuffer(){\n\tthis.arrayBuffer=null;\n\tthis.dataView=null;\n\tthis.length=0;\n}", "function arrayBuffer2Buffer(ab) {\n return Buffer.from(ab);\n}", "function Buffer(target, type) {\n\t\tthis.buffer = null;\n\t\tthis.target = target;\n\t\tthis.type = type;\n\t\tthis.data = [];\n\t}", "constructor() {\n this.r = new Uint16Array(10);\n this.h = new Uint16Array(10);\n this.pad = new Uint16Array(8);\n this.buffer = Buffer.alloc(16);\n this.fin = -1;\n this.leftover = 0;\n }", "function Buffer (arg, encodingOrOffset, length) {\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(arg)\n\t }\n\t return from(arg, encodingOrOffset, length)\n\t}", "function Buffer (arg, encodingOrOffset, length) {\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t if (typeof encodingOrOffset === 'string') {\n\t throw new Error(\n\t 'If encoding is specified then the first argument must be a string'\n\t )\n\t }\n\t return allocUnsafe(arg)\n\t }\n\t return from(arg, encodingOrOffset, length)\n\t}", "function e$4(e,t,r){const d=e.typedBuffer,f=e.typedBufferStride,n=t.typedBuffer,o=t.typedBufferStride,c=r?r.count:t.count;let s=(r&&r.dstIndex?r.dstIndex:0)*f,u=(r&&r.srcIndex?r.srcIndex:0)*o;for(let p=0;p<c;++p){for(let e=0;e<9;++e)d[s+e]=n[u+e];s+=f,u+=o;}}", "function f$2(e,t,r){const f=e.typedBuffer,n=e.typedBufferStride,d=t.typedBuffer,o=t.typedBufferStride,s=r?r.count:t.count;let u=(r&&r.dstIndex?r.dstIndex:0)*n,p=(r&&r.srcIndex?r.srcIndex:0)*o;for(let c=0;c<s;++c)f[u]=d[p],f[u+1]=d[p+1],u+=n,p+=o;}", "_pushBuffer(gen, obj) {\n return gen._pushTypedArray(gen, obj);\n }", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "function Buffer (arg) {\n\t if (!(this instanceof Buffer)) {\n\t // Avoid going through an ArgumentsAdaptorTrampoline in the common case.\n\t if (arguments.length > 1) return new Buffer(arg, arguments[1])\n\t return new Buffer(arg)\n\t }\n\t\n\t if (!Buffer.TYPED_ARRAY_SUPPORT) {\n\t this.length = 0\n\t this.parent = undefined\n\t }\n\t\n\t // Common case.\n\t if (typeof arg === 'number') {\n\t return fromNumber(this, arg)\n\t }\n\t\n\t // Slightly less common case.\n\t if (typeof arg === 'string') {\n\t return fromString(this, arg, arguments.length > 1 ? arguments[1] : 'utf8')\n\t }\n\t\n\t // Unusual.\n\t return fromObject(this, arg)\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}" ]
[ "0.64548796", "0.64548796", "0.64548796", "0.64548796", "0.64548796", "0.64548796", "0.6404874", "0.6284827", "0.6284827", "0.6284827", "0.6284827", "0.6284827", "0.62748003", "0.62655306", "0.62655306", "0.62655306", "0.62046844", "0.62046844", "0.6171525", "0.6149373", "0.6149373", "0.6124802", "0.607331", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.60521567", "0.6051998", "0.6020644", "0.6003045", "0.5987562", "0.5955416", "0.595518", "0.5940606", "0.5940606", "0.5940606", "0.5940606", "0.58908457", "0.58891404", "0.5872856", "0.5860882", "0.5831223", "0.58301544", "0.58141243", "0.5786807", "0.57820886", "0.57746834", "0.5737103", "0.5737103", "0.5722266", "0.57154495", "0.5710683", "0.5706359", "0.5706359", "0.5706359", "0.5706359", "0.5706359", "0.5706359", "0.5706359", "0.5704018", "0.5704018", "0.5704018", "0.5704018", "0.5704018", "0.5704018", "0.5704018", "0.5704018", "0.5704018", "0.5704018", "0.5704018", "0.5704018", "0.5704018" ]
0.628175
12
Buffer > [[int code, Buffer ]... ]
function bufferToTuples (buf) { const tuples = [] let i = 0 while (i < buf.length) { const code = varint.decode(buf, i) const n = varint.decode.bytes const p = protocols(code) const size = sizeForAddr(p, buf.slice(i + n)) if (size === 0) { tuples.push([code]) i += n continue } const addr = buf.slice(i + n, i + n + size) i += (size + n) if (i > buf.length) { // did not end _exactly_ at buffer.length throw ParseError('Invalid address buffer: ' + buf.toString('hex')) } // ok, tuple seems good. tuples.push([code, addr]) } return tuples }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(tuples.map(tup => {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = new Buffer(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = new Buffer(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function tuplesToBuffer (tuples) {\n return fromBuffer(Buffer.concat(map(tuples, function (tup) {\n const proto = protoFromTuple(tup)\n let buf = Buffer.from(varint.encode(proto.code))\n\n if (tup.length > 1) {\n buf = Buffer.concat([buf, tup[1]]) // add address buffer\n }\n\n return buf\n })))\n}", "function decodeBuffer(arrBuff) {\n\t\tlet u8arr = new Uint8Array(arrBuff);\n\t\t\n\t\tfunction byteToStr(byte) {\n\t\t\tlet str = byte.toString(2);\n\t\t\twhile (str.length < 8) {\n\t\t\t\tstr = \"0\" + str;\n\t\t\t}\n\t\t\treturn str;\n\t\t}\n\t\t\n\t\tlet headerLength = 4;\n\t\tlet treeBytes = \"\";\n\t\t\n\t\tfor (var i = 0; i < headerLength; i++) {\n\t\t\ttreeBytes += byteToStr(u8arr[i]);\n\t\t}\n\t\ttreeBytes = Number(\"0b\" + treeBytes);\n\t\t\n\t\tlet arrOff = headerLength;\n\t\tlet treeArr = new Uint8Array(treeBytes);\n\t\t\n\t\tfor (var i = 0; i < treeBytes; i++) {\n\t\t\ttreeArr[i] = u8arr[i + arrOff];\n\t\t}\n\t\t\n\t\tlet tree = decodeTree(treeArr);\n\t\t\n\t\tarrOff = headerLength + treeBytes;\n\t\tlet bitOff = u8arr[arrOff]\n\t\tarrOff++;\n\t\t\n\t\tlet codes = Object.create(null);\n\t\ttraverseTree(tree, function(tree, char, i, path) {\n\t\t\tcodes[path] = char;\n\t\t});\n\t\t\n\t\tlet path = \"\";\n\t\tlet body = \"\";\n\t\tfor (var i = arrOff; i < u8arr.length; i++) {\n\t\t\tlet str = byteToStr(u8arr[i]);\n\t\t\tlet end = 8;\n\t\t\tif (i === u8arr.length - 1) {\n\t\t\t\tend -= (8 - bitOff);\n\t\t\t\t//console.log(end);\n\t\t\t}\n\t\t\tfor (var j = 0; j < end; j++) {\n\t\t\t\tpath += str[j];\n\t\t\t\tif (codes[path]) {\n\t\t\t\t\tbody += codes[path];\n\t\t\t\t\tpath = \"\";\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn body;\n\t}", "onReceive( packet)\n{\n let packet_view = new Uint8Array(packet);\n this.rxMsgArrayBuffer = appendArray(this.rxMsgArrayBuffer, packet_view);\n let view = new Uint8Array(this.rxMsgArrayBuffer);\n\n if (this.size_Of_request)\n {\n let data = new Uint8Array(this.size_Of_request);\n let offset = 0;\n for(let index = 0; index < view.byteLength; ++index)\n {\n switch(view[index])\n {\n case ESC:\n data[offset++] = this.xor_20(view[index]);\n break;\n\n case SOP:\n offset = 0;\n break;\n\n case EOP:\n break;\n\n default:\n data[offset++] = view[index];\n break;\n }\n }\n\n if (this.size_Of_request == offset)\n {\n //dumpArray(data);\n if (this.postCallback)\n this.postCallback(data);\n this.rxMsgArrayBuffer = new ArrayBuffer();\n\n }\n \n }\n}", "function _gobbleArray(context) {\n context.index++;\n return {\n type: 9, // 'ArrayExpression'\n elements: _gobbleArguments(context, CBRACK_CODE)\n };\n }", "function makeTestBuffer() {\r\n var dataSize = 4*1024;//400;\r\n var buffer = new ArrayBuffer(dataSize*4+300*4); \r\n var bufferArray = new Int32Array(buffer, 0, dataSize);\r\n for (var i=0; i<dataSize; i++) {\r\n bufferArray[i] = i;\r\n }\r\n bufferArray[0] = dataSize*4;\r\n \r\n return ({\"buffer\":buffer, \"bufferArray\":bufferArray});\r\n}", "function typedBuffer() {\n }", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function BufferToArrayBuffer () {\n return (new Buffer(this)).buffer\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "function typedBuffer() {\n}", "getCodeBuf() {\n if (MaterialBase.s_codeBuffer != null) {\n return MaterialBase.s_codeBuffer;\n }\n\n MaterialBase.s_codeBuffer = new ShaderCodeBuffer_1.default();\n return MaterialBase.s_codeBuffer;\n }", "function bR(){this.b=this.i=0;this.h=!1;this.buffer=null}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "arrayBuffer() {\n\t\treturn consumeBody$1.call(this).then(function (buf) {\n\t\t\treturn buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);\n\t\t});\n\t}", "_pushBuffer(gen, obj) {\n return gen._pushTypedArray(gen, obj);\n }", "function arrayBuffer2Buffer(ab) {\n return Buffer.from(ab);\n}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}", "buffer() {\n\t\treturn consumeBody.call(this);\n\t}" ]
[ "0.61813927", "0.61813927", "0.61813927", "0.61813927", "0.61813927", "0.61727864", "0.61727864", "0.61582136", "0.61582136", "0.61582136", "0.6007641", "0.60009056", "0.59825116", "0.5975244", "0.5960132", "0.595582", "0.595582", "0.595582", "0.595582", "0.5950382", "0.5950382", "0.5950382", "0.5950382", "0.5950382", "0.5950382", "0.5947965", "0.594028", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.5901943", "0.58432883", "0.5775513", "0.5768754", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146", "0.57297146" ]
0.57656384
64
Month is 1 based
function days_in_month(month, year) { return new Date(year, month, 0).getDate(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "M (date) {\n return date.getMonth() + 1\n }", "MM (date) {\n return pad(date.getMonth() + 1)\n }", "monthof(m) { \n switch (m) {\n case 1: return 31;\n break;\n case 2: return 28;\n break;\n case 3: return 31;\n break;\n case 4: return 30;\n break;\n case 5: return 31;\n break;\n case 6: return 30;\n break;\n case 7: return 31;\n break;\n case 8: return 31;\n break;\n case 9: return 30;\n break;\n case 10: return 31;\n break;\n case 11: return 30;\n break;\n case 12: return 31;\n break;\n\n }\n }", "getMonthNo(date) {\n\t\t// return new Date(date).getUTCMonth() + 1; // 1\n\t\treturn Moment(date).format('MM');// 01\n\t}", "default () {\n return (new Date()).getMonth() // this month\n }", "function getMonthMM() {\n\t\t\tvar month = date.getMonth() + 1;\n\t\t\tif (month < 10) {\n\t\t\t\tmonth = \"0\" + month;\n\t\t\t}\n\t\t\treturn month;\n\t\t}", "monthIndex() {\n return this.month - 1;\n }", "get month() {\n return this.date.getMonth();\n }", "function getCurrentMonth() {\r\n\t\tvar d = new Date();\r\n\t\treturn d.getMonth() + 1;\r\n\t}", "function getMonth() {\r\n var months = [\r\n \"Janeiro\",\r\n \"Fevereiro\",\r\n \"Março\",\r\n \"Abril\",\r\n \"Maio\",\r\n \"Junho\",\r\n \"Julho\",\r\n \"Agosto\",\r\n \"Setembro\",\r\n \"Outubro\",\r\n \"Novembro\",\r\n \"Dezembro\"\r\n ];\r\n return (\r\n months[moment(vm.selectedDate).format(\"MM\") - 1] +\r\n \"/\" +\r\n moment(vm.selectedDate).format(\"YYYY\")\r\n );\r\n }", "function getMonth(){\n\t//var d = new Date();\n\treturn currentMonth;\n}", "function getMonth(month) {\n var curMonth = month > 0 ? month + 1 : 12;\n return curMonth < 10 ? \"0\" + curMonth : curMonth;\n}", "function Calendar_getMonth( monthNo ) \n{\nreturn this.Month[monthNo];\n}", "function monthFromDate(dateIn)\r\n{\r\n return dateIn.getMonth() + 1;\r\n}", "nextMonth(){\n return this.addMonths(1);\n }", "function getValidMonth(){\r\n\treturn 5;\r\n}", "function getValidMonth(){\r\n\treturn 5;\r\n}", "function getValidMonth(){\n\treturn 5;\n}", "function getValidMonth(){\n\treturn 5;\n}", "getMonthName(index) {\n return this.settings.months[index];\n }", "function getMonth () {\n var mese = moment.months();\n return mese;\n}", "static getMonthGenitive(date) {\n const formatter = new Intl.DateTimeFormat(this.locales, { month: 'long', day: 'numeric' });\n const dateParts = formatter.formatToParts(date);\n const monthPart = dateParts.find((part) => part.type === 'month');\n\n return monthPart.value;\n }", "function getValidMonth(){\r\n\treturn 4;\r\n}", "months() {\n return _monthLabels.map((ml, i) => ({\n label: ml,\n label_1: ml.substring(0, 1),\n label_2: ml.substring(0, 2),\n label_3: ml.substring(0, 3),\n number: i + 1,\n }));\n }", "function getMonthFromDate(date) {\n return date.getMonth() + 1;\n}", "generateMonth(){\n const d = new Date();\n let listOfMonth = new Array(12);\n listOfMonth[0] = \"January\"\n listOfMonth[1] = \"February\"\n listOfMonth[2] = \"March\"\n listOfMonth[3] = \"April\"\n listOfMonth[4] = \"May\"\n listOfMonth[5] = \"June\"\n listOfMonth[6] = \"July\"\n listOfMonth[7] = \"August\"\n listOfMonth[8] = \"September\"\n listOfMonth[9] = \"October\"\n listOfMonth[10] = \"November\"\n listOfMonth[11] = \"December\"\n const currentMonth = listOfMonth[d.getMonth()]\n return currentMonth;\n }", "function getMonths() {\n\treturn [...Array(12).keys()].map((index) => index + 1);\n}", "getMonthDetail() {\n var y = this.currentDate.getFullYear(),\n m = this.currentDate.getMonth();\n var firstDay = new Date(y, m, 1);\n var lastDay = new Date(y, m + 1, 0);\n return {\n date: this.currentDate,\n month: this.currentDate.getMonth(),\n firstDay: firstDay,\n lastDay: lastDay,\n year: y\n };\n }", "function DiM (month) {\n var Y = new Date().getFullYear();\n return new Date(Y, month, 0).getDate();\n}", "function daysInMonth(year,month) {\n return new Date(year, month + 1, 0).getDate();\n }", "getMonth (format, month, year) {\n try {\n month = month || new Date().getMonth();\n year = year || new Date().getFullYear();\n format = format || 'yyyy-MM-dd ww';\n let fDate = new Date();\n fDate.setFullYear(year);\n fDate.setMonth(month);\n fDate.setDate(1)\n fDate.setHours(0);\n fDate.setMinutes(0);\n fDate.setSeconds(0);\n let firstDay = Timer.formatDate(fDate, format);\n let lDate = new Date();\n lDate.setFullYear(year);\n lDate.setMonth(month+1);\n lDate.setDate(0);\n lDate.setHours(23);\n lDate.setMinutes(59);\n lDate.setSeconds(59);\n let lasetDay = Timer.formatDate(lDate, format);\n return {firstDay, lasetDay};\n } catch (error) {\n throw error\n }\n }", "function fnContentVistedgetMonth(pardate) {\n try {\n var month = pardate.getMonth() + 1;\n return month < 10 ? '0' + month : '' + month;\n } catch (err) {\n console.log('fnContentVistedgetMonth : ' + err.message);\n }\n}", "firstWeekdayInMonth() {\n return new Date(this.year, this.monthIndex, 1).getDay() + 1;\n }", "function month(date) {\n let monthName = date.getMonth() -1;\n console.log(calendar[monthName]);\n}", "function month(date){\n try {\n date.getMonth();\n }\n catch(err) {\n throw \"The correct object was not passed\";\n }\n switch(date.getMonth()){\n case 0:\n return \"January\";\n break;\n case 1:\n return \"February\";\n break;\n case 2:\n return \"March\";\n break;\n case 3:\n return \"April\";\n break;\n case 4:\n return \"May\";\n break;\n case 5:\n return \"June\";\n break;\n case 6:\n return \"July\";\n break;\n case 7:\n return \"August\";\n break;\n case 8:\n return \"September\";\n break;\n case 9:\n return \"October\";\n break;\n case 10:\n return \"November\";\n break;\n case 11:\n return \"December\";\n break;\n }\n}", "static monthMod(month) {\n return month % 12\n }", "function getMonthName(){\n\treturn months[getMonth()];\n}", "getCurrentMonth() {\n const current = new Date().getMonth();\n let newCurrent = current + 1\n if (newCurrent < 10) {\n newCurrent = '0' + newCurrent;\n }\n this.setState({\n currentMonth: newCurrent\n });\n }", "function daysInTheMonth(yyyy, mm) {\n return new Date(yyyy, mm+1, 0).getDate();\n }", "startsMonth() {\n\t\treturn this._type == \"month\" || this._type == \"always\" || (this._type == \"day\" && this._start.day == 1);\n\t}", "get monthString(){\n if (this.timeSavedMonthes === 1){\n return 'Monthly payment'\n }\n return 'Monthly payments'\n }", "monthNameLabel (month) {\n const now = parseDate(new Date())\n const date = getDate(now) + ' 00:00'\n const timestamp = parseTimestamp(date)\n timestamp.day = 1\n timestamp.month = parseInt(month, 10)\n return this.monthFormatter(timestamp, this.shortMonthLabel)\n }", "function isMonth (s)\r\n{ if (isEmpty(s))\r\n if (isMonth.arguments.length == 1) return defaultEmptyOK;\r\n else return (isMonth.arguments[1] == true);\r\n return isIntegerInRange (s, 1, 12);\r\n}", "function isMonth (s)\r\n{ if (isEmpty(s))\r\n if (isMonth.arguments.length == 1) return defaultEmptyOK;\r\n else return (isMonth.arguments[1] == true);\r\n return isIntegerInRange (s, 1, 12);\r\n}", "function getFirstDayOfMonth(year, month) {\n viewingMonthDateObj = new Date(year, month, 00)\n return firstDayOfMonth = viewingMonthDateObj.getDay() + 1;\n}", "function first_day_of_month(year, month) {\n return new Date(year, month, 1);\n}", "function get_month(month){\n\tvar m;\n\tswitch (month){\n\t\tcase 'January':\n\t\t\tm='01';\n\t\t\tbreak;\n\t\tcase 'February':\n\t\t\tm='02';\n\t\t\tbreak;\n\t\tcase 'March':\n\t\t\tm='03';\n\t\t\tbreak;\n\t\tcase 'April':\n\t\t\tm='04';\n\t\t\tbreak;\n\t\tcase 'May':\n\t\t\tm='05';\n\t\t\tbreak;\n\t\tcase 'June':\n\t\t\tm='06';\n\t\t\tbreak;\n\t\tcase 'July':\n\t\t\tm='07';\n\t\t\tbreak;\n\t\tcase 'August':\n\t\t\tm='08';\n\t\t\tbreak;\n\t\tcase 'September':\n\t\t\tm='09';\n\t\t\tbreak;\n\t\tcase 'October':\n\t\t\tm='10';\n\t\t\tbreak;\n\t\tcase 'November':\n\t\t\tm='11';\n\t\t\tbreak;\n\t\tcase 'December':\n\t\t\tm='12';\n\t\t\tbreak;\n\t}\n\treturn m;\n}", "MMMM (date, dateLocale) {\n return dateLocale.months[ date.getMonth() ]\n }", "static daysInMonth(year, month) {\n return new Date(year, month + 1, 0).getDate();\n }", "function getFirstDateOfMonth(year_month) {\n var tmp = year_month.split('-')\n return new Date(tmp[0], parseInt(tmp[1])-1, 1, 0, 0, 0).getTime()\n}", "firstDayOfMonth(){\n const dateObject = this.state.dateObject;\n // firstDay = how many indices from start of table is first day\n const firstDay = moment(dateObject)\n .startOf(\"month\")\n .format(\"d\");\n return firstDay;\n }", "function showMonth(date){\nlet dateInput = new Date(2017, 6, 19) // June 19, 2017\nmonth(date) // returns \"June\"\n}", "function goStartMonth(time) {\n return time.clone().startOf('month');\n}", "function getMonthName(mo) {\n mo = mo - 1;\n var months = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\n \"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];\n if (months[mo]) {\n return months[mo];\n } else {\n console.log(\"Invalid month number\");\n }\n}", "function setSelectedMonth()\n{\nptr= arguments[0];\nnew_date= arguments[1];\nptr=new_date.getMonth()+ptr;\nindex=ptr\nif(index == 12)\n index = 0;\nelse if(index == -1)\n index = 11;\nisLeap=leapYear(new_date.getFullYear)\nif(isLeap)\n new_date.setDate(calLeapPeriods[index]);\nelse\n new_date.setDate(calPeriods[index]);\nnew_date.setMonth(ptr);\n}", "constructor() {\n this.month; //0 through 11 representing January through December.\n this.year;\n }", "function month(){\r\n var d = new Date();\r\n\tvar dato = d.toDateString();\r\n\tvar res = dato.split(' ');\r\n var month = res[1];\r\n if (month == 'Jan'){ var monthnum = 0}\r\n if (month == 'Feb'){ var monthnum = 1}\r\n if (month == 'Mar'){ var monthnum = 2}\r\n if (month == 'Apr'){ var monthnum = 3}\r\n if (month == 'May'){ var monthnum = 4}\r\n if (month == 'Jun'){ var monthnum = 5}\r\n if (month == 'Jul'){ var monthnum = 6}\r\n if (month == 'Aug'){ var monthnum = 7}\r\n if (month == 'Sep'){ var monthnum = 8}\r\n if (month == 'Oct'){ var monthnum = 9}\r\n if (month == 'Nov'){ var monthnum = 10}\r\n if (month == 'Dec'){ var monthnum = 11}\r\n var monthnum = parseInt(monthnum);\r\n return monthnum;\r\n}", "function convertMonth(m){\n switch(m){\n case 'jan': return 01;\n case 'feb': return 02;\n case 'mar': return 03;\n case 'apr': return 04;\n case 'may': return 05;\n case 'jun': return 06;\n case 'jul': return 07;\n case 'aug': return 08;\n case 'sep': return 09;\n case 'oct': return 10;\n case 'nov': return 11;\n case 'dec': return 12;\n }\n}", "function getMonth(index) {\n return monthArr[index];\n}", "MMM (date, dateLocale) {\n return dateLocale.monthsShort[ date.getMonth() ]\n }", "function monthReturn(month) {\n var months = 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';\n var dateMonth = new Date();\n var dateCheck = new Date();\n var actualMonth;\n var pos = months.indexOf(month.substring(0, 3));\n dateMonth.setMonth(pos / 3);\n if ((dateCheck.getMonth() + 1) > (dateMonth.getMonth() + 1)) {\n actualMonth = new Date(dateMonth.getFullYear() + 1, dateMonth.getMonth() + 1, 0);\n } else {\n actualMonth = new Date(dateMonth.getFullYear(), dateMonth.getMonth() + 1, 0);\n }\n return actualMonth;\n}", "getCurrentMonth() {\n const current = new Date().getMonth();\n console.log(current, 'this is currentMonth')\n let newCurrent = current + 1\n if (newCurrent < 10) {\n newCurrent = '0' + newCurrent;\n }\n this.setState({\n currentMonth: newCurrent\n });\n }", "constructor(year, month) {\n let _y = parseInt(+year), _m = parseInt(+month);\n if (isNaN(_y) || isNaN(_m) || _m < 1 || _m > 12) {\n if (process.env.NODE_ENV !== 'production') {\n throw new TypeError('MonthObject constructor should receive a valid number!');\n }\n }\n this._year = _y;\n this._month = _m;\n this._isLeap = ((month == 2) && (year % 4 == 0 && year % 100 != 0 || year % 400 == 0));\n this._dayCount = [1, -2, 1, 0, 1, 0, 1, 1, 0, 1, 0, 1][month - 1] + 30 + this._isLeap;\n }", "function getMonth() {\r\n var monthNum = new Date().getMonth();\r\n if (monthNum === 0) {\r\n return 'January';\r\n } else if (monthNum === 1) {\r\n return 'February';\r\n } else if (monthNum === 2) {\r\n return 'March';\r\n } else if (monthNum === 3) {\r\n return 'April';\r\n } else if (monthNum === 4) {\r\n return 'May';\r\n } else if (monthNum === 5) {\r\n return 'June';\r\n } else if (monthNum === 6) {\r\n return 'July';\r\n } else if (monthNum === 7) {\r\n return 'August';\r\n } else if (monthNum === 8) {\r\n return 'September';\r\n } else if (monthNum === 9) {\r\n return 'October';\r\n } else if (monthNum === 10) {\r\n return 'November';\r\n } else {\r\n return 'December';\r\n }\r\n }", "function yearMonth() {\n return doFormat(date, {\n year: 'numeric',\n month: 'long'\n });\n }", "getMonthName(date) {\n\t\treturn Moment(date).format('MMMM');\n\t}", "function getMonthLabel(month, year) {\n return new Date(year, month, 0).getDate();\n}", "function Calendar_switchMonth(month) {\n\tthis.dtCurrentDate.setMonth(month, 1);\t\t\t\t// reset day to 1\n\tthis.dtStartDay = new Date(this.dtCurrentDate);\n}", "function getIndexMonthForBirthday(currentIterateMonth) {\n if (currentIterateMonth >= 12) {\n return currentIterateMonth - 12;\n }\n else if (currentIterateMonth <= 0) {\n return currentIterateMonth + 12;\n }\n else {\n return currentIterateMonth;\n }\n }", "function getMonthName(m) {\n\t\tif (m == 1)\n\t\t\treturn \"January\";\n\t\tif (m == 2)\n\t\t\treturn \"February\";\n\t\tif (m == 3)\n\t\t\treturn \"March\";\n\t\tif (m == 4)\n\t\t\treturn \"April\";\n\t\tif (m == 5)\n\t\t\treturn \"May\";\n\t\tif (m == 6)\n\t\t\treturn \"June\";\n\t\tif (m == 7)\n\t\t\treturn \"July\";\n\t\tif (m == 8)\n\t\t\treturn \"August\";\n\t\tif (m == 9)\n\t\t\treturn \"September\";\n\t\tif (m == 10)\n\t\t\treturn \"October\";\n\t\tif (m == 11)\n\t\t\treturn \"November\";\n\t\tif (m == 12)\n\t\t\treturn \"December\";\n\t}", "function Month(parent){var _this=_super.call(this,parent)||this;_this.dayNameFormat='wide';_this.viewClass='e-month-view';_this.isInverseTableSelect=false;_this.monthDates={};return _this;}", "function getMonthNumber(month, year){\n return new Date(Date.parse(month+\" 1,\"+year)).getMonth()+1;\n}", "daysInMonth(month,year) {\n return new Date(year,month+1,0).getDate();\n }", "nextMonthComps() {\n if (this.month === 12) return {\n days: _daysInMonths[0],\n month: 1,\n year: this.year + 1,\n };\n return {\n days: (this.month === 2 && this.isLeapYear) ? 29 : _daysInMonths[this.month],\n month: this.month + 1,\n year: this.year,\n };\n }", "function defaultMonthKeyFn(event) {\n return moment.utc(event.occurred_at).date(1).format('YYYYMMDD');\n }", "getDayOfTheMonth(){\n let dayOfTheMonth;\n dayOfTheMonth = this.date.getDate();\n return dayOfTheMonth;\n }", "function getMonthDate(type, date = new Date()) {\n let year = date.getFullYear();\n let month = date.getMonth() + 1;\n let day;\n\n date = new Date(year,month,0);\n\n year = date.getFullYear();\n month = date.getMonth() + 1;\n day = date.getDate();\n\n if (month < 10) {\n month = \"0\" + month;\n }\n if (day < 10) {\n day = \"0\" + day;\n }\n\n if (type == 1) {\n return year + \"-\" + month + \"-\" + day;\n } else {\n return year + \"-\" + month + \"-01\";\n }\n}", "function firstload(){\n var curDate = new Date();\n var curMonth = curDate.getMonth();\n var curYear = curDate.getFullYear();\n var thisMonth= new Month(curYear,curMonth);\n toMonth = thisMonth;\n $( document ).ready(load);\n}", "nextMonth() {\n if (this.monthIndex==11){\n this.monthIndex = 0;\n this.year += 1;\n this.month = monthsArray[this.monthIndex];\n } else {\n this.monthIndex += 1;\n this.month = monthsArray[this.monthIndex];\n }\n this._renderCalendarMonth();\n }", "function monthUpdate() {\n const monthField = document.querySelector('#month');\n monthField.textContent = moment(currentDate).format('MMMM')\n }", "function month(){\n step=1.2;\n timeSelector=\"month\";\n resetGraph();\n}", "function formatMonth1(month) {\n var show = month.split(\"\")\n var jNew = show[0].toUpperCase();\n show.shift();\n var shownew = show.join();\n var janNew = shownew.replace(/,/gi, \"\")\n console.log(jNew + janNew + \" have 31 Days\")\n}", "function daysInMonth(year, month) {\r\n return new Date(Date.UTC(year, month + 1, 0)).getUTCDate();\r\n }", "function getMonth(i){\n var month = new Array();\n month[0] = \"Jan\";\n month[1] = \"Feb\";\n month[2] = \"Mar\";\n month[3] = \"Apr\";\n month[4] = \"May\";\n month[5] = \"Jun\";\n month[6] = \"Jul\";\n month[7] = \"Aug\";\n month[8] = \"Sep\";\n month[9] = \"Oct\";\n month[10] = \"Nov\";\n month[11] = \"Dec\";\n return month[i];\n}", "function daysInMonth(month,year) {\n return new Date(year, month + 1, 0).getDate();\n }", "function getMonthStart(date) {\n return new Date(date.getFullYear(), date.getMonth(), 1, 0, 0, 0, 0);\n}", "function fnContentVistedgetCustomMonth(pardate) {\n try {\n var months = ['January', 'February', 'March', 'April', 'May', 'June',\n 'July', 'August', 'September', 'October', 'November', 'December'\n ];\n\n return months[pardate.getMonth()];\n\n } catch (err) {\n console.log('fnContentVistedgetCustomMonth : ' + err.message);\n }\n}", "function numToMonth (nNum) {\n\tallMonths = new Array('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');\n\treturn allMonths[nNum];\n}", "function getMonth(number)\n{\n if(number == 1)\n {\n return \"January\";\n }\n else if(number == 2)\n {\n return \"February\";\n }\n else if(number == 3)\n {\n return \"March\";\n }\n else if(number == 4)\n {\n return \"April\";\n }\n else if(number == 5)\n {\n return \"May\";\n }\n else if(number == 6)\n {\n return \"June\";\n }\n else if(number == 7)\n {\n return \"July\";\n }\n else if(number == 8)\n {\n return \"Auguest\";\n }\n else if(number == 9)\n {\n return \"September\";\n }\n else if(number == 10)\n {\n return \"October\";\n }\n else if(number == 11)\n {\n return \"November\";\n }\n else if(number == 12)\n {\n return \"December\";\n }\n return \"\";\n}", "function updateMonth(cal, elem) {\n\t\tif (isNaN(cal.date.getTime()))\n\t\t\tcal.date = new Date();\n\t\tcal.date.setMonth(parseInt(elem.value));\n\t\tcalRefresh();\n\t}", "function getMonthName(mo) {\n\t\t\tmo = mo - 1; // Adjust month number for array index (1 = Jan, 12 = Dec)\n\t\t\tvar months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n\t\t\tif (months[mo]) {\n\t\t\t\treturn months[mo];\n\t\t\t} else {\n\t\t\t\tthrow 'InvalidMonthNo'; // \"throw\" keyword is used here\n\t\t\t}\n\t\t}", "function getTwoDigitMonth(date) {\n return (date.getMonth() + 1).toString().padStart(2, \"0\");\n }", "function changeByMonth(month, year, back) {\n back = back || false;\n var numDaysInMo,\n addend = 1;\n if (back) {\n addend = -1;\n }\n month = month + addend;\n if ((month < 0) || (month === 12)) {\n month = (month < 0) ? (month = 11) : month = 0;\n year = year + addend;\n }\n numDaysInMo = daysInMonth(month, year);\n return {month: month, year: year, numDaysInMo: numDaysInMo};\n }", "function fillBegin(month,year){\n var date = new Date(month+\"/01/\"+year);\n var firstDay = new Date(date.getFullYear(), date.getMonth(), 1);\n console.log(firstDay.getDay());\n return firstDay.getDay();\n}", "function xl_GetMonth(intMonth)\n{\n\tvar MonthArray = new Array(\"January\", \"February\", \"March\",\n\t\"April\", \"May\", \"June\",\n\t\"July\", \"August\", \"September\",\n\t\"October\", \"November\", \"December\") \n\treturn MonthArray[intMonth] \t \t \n}", "function daysInMonth(y, m) {\r\n var date = new Date();\r\n date.setDate(1);\r\n date.setFullYear(y);\r\n date.setMonth(m); // month after what we want (months start at 0 in js)\r\n date.setDate(0);\r\n return date.getDate();\r\n }", "daysInMonth() {\n // Check for February in a leap year\n if (this.month === 2 && this.isLeapYear) return 29;\n // ...Just a normal month\n return _daysInMonths[this.monthIndex];\n }", "function getMonth() {\n const monthNames = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n var number = (Math.floor(Math.random()*12));\n return monthNames[number];\n}", "function setMonth(date, month) {\n return addMonths(date, month - date.getMonth());\n}", "_monthSelected(event) {\n const month = event.value;\n const normalizedDate = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);\n this.monthSelected.emit(normalizedDate);\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(normalizedDate);\n this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));\n }", "_monthSelected(event) {\n const month = event.value;\n const normalizedDate = this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, 1);\n this.monthSelected.emit(normalizedDate);\n const daysInMonth = this._dateAdapter.getNumDaysInMonth(normalizedDate);\n this.selectedChange.emit(this._dateAdapter.createDate(this._dateAdapter.getYear(this.activeDate), month, Math.min(this._dateAdapter.getDate(this.activeDate), daysInMonth)));\n }" ]
[ "0.7786311", "0.7703898", "0.7547115", "0.75340724", "0.7453067", "0.7355903", "0.7351552", "0.7320615", "0.72682405", "0.72482646", "0.7202675", "0.7167751", "0.7167113", "0.71666676", "0.71666116", "0.704", "0.704", "0.7037979", "0.7037979", "0.7014996", "0.6994625", "0.69937795", "0.6990162", "0.6984467", "0.6982654", "0.69552296", "0.69481945", "0.6913481", "0.6885888", "0.688185", "0.687257", "0.6838901", "0.6832736", "0.6798252", "0.67799425", "0.6760684", "0.67502207", "0.67351985", "0.67319524", "0.6727712", "0.6726854", "0.6724654", "0.67199075", "0.67199075", "0.6716352", "0.6711879", "0.67043316", "0.6699956", "0.6697959", "0.6687942", "0.66744393", "0.6674206", "0.6669371", "0.6668877", "0.6655341", "0.66550297", "0.6637252", "0.66350603", "0.6627101", "0.6625662", "0.6608628", "0.66008335", "0.6583755", "0.6582746", "0.65723693", "0.6571281", "0.6562912", "0.6555332", "0.6545178", "0.65435016", "0.654194", "0.6536737", "0.65294397", "0.6527005", "0.6518265", "0.65026367", "0.6495477", "0.64883363", "0.64831793", "0.64825886", "0.6477679", "0.64775103", "0.646759", "0.6462461", "0.6461794", "0.64436024", "0.6443411", "0.64386547", "0.6435639", "0.6434995", "0.64313346", "0.64299387", "0.64185584", "0.64134204", "0.64132804", "0.641178", "0.64075667", "0.63944626", "0.63895935", "0.6385023", "0.6385023" ]
0.0
-1
Function to make the password visible
showPassword(e) { if(e){ var x = document.getElementById("exampleInputPassword1"); if (x.type === "password") { x.type = "text"; } else { x.type = "password"; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function showPassword() {\n\tvar x = document.getElementById(\"password\");\n\tif (x.type === \"password\") {\n\t x.type = \"text\";\n\t} else {\n\t x.type = \"password\";\n\t}\n}", "function showPassword(displayPassword) {\n document.getElementById(\"password\").textContent = displayPassword;\n}", "function showPassword() {\n let button = document.getElementById('show-button');\n let password_field = document.getElementById('passwd');\n\n // If currently showing the password\n if (password_field.type == 'text') {\n password_field.type = 'password';\n button.innerHTML = 'Show';\n }\n else {\n password_field.type = 'text';\n button.innerHTML = 'Hide';\n }\n}", "function showPassword1(){\n if(LogInPassword.type === \"password\"){\n LogInPassword.type = \"text\";\n document.getElementById('eye').style.visibility = \"hidden\";\n document.getElementById('eye-slash').style.visibility = \"visible\";\n }else{\n LogInPassword.type = \"password\";\n document.getElementById('eye').style.visibility = \"visible\";\n document.getElementById('eye-slash').style.visibility = \"hidden\";\n }\n}", "function showPasswordFn() {\n\tinputPassword.type = 'text';\n\twhile (hidePassword.classList.contains('hidePassword')) {\n\t\thidePassword.classList.remove('hidePassword');\n\t}\n\tshowPassword.classList.add('showPassword');\n}", "_showPassword() {\n const that = this;\n\n if (that.disabled || !that.showPasswordIcon) {\n return;\n }\n\n that.$.input.type = 'text';\n that._passwordIconPressed = true;\n }", "function password(){\n\t\t\n\t\t\tvar a = document.getElementById(\"pwd1\").value;\n\t\t\tif(a.length <= 8 ){\n\t\t\t\tdocument.getElementById(\"pwd1Hint\").style.display ='block';\n\t\t\t\n\t\t\t}\n\t\t\tif(a.length >= 8){\n\t\t\t\tdocument.getElementById(\"pwd1Hint\").style.display ='none';\n\t\t\t}\n\t\t\n\t\t\t\n\t\t\t\n\t}", "function showPaswrd() {\r\n const paswrd = document.getElementById('paswrd');\r\n if (paswrd.type === 'password') {\r\n paswrd.type = 'text';\r\n } else {\r\n paswrd.type = 'password';\r\n }\r\n}", "function passwordsMismatched() {\n document.getElementById(\"passwordP\").style.display = \"visible\";\n}", "function showPassword(password) {\n $(\"input\").prev(\"p\").show(200);\n $(\"input:hidden\").show(200);\n $(\"#result\").val(password);\n}", "function showpassword() {\n\tvar x = document.getElementsByName(\"pass\");\n\tfor (var i = 0; i <= x.length; i++) {\n\t\tif (x[i].type === \"password\") {\n\t\t\tx[i].type = \"text\";\n\t\t} else {\n\t\t\tx[i].type = \"password\";\n\t\t}\n\t}\n}", "function showPass() {\n if($scope.checkPass)\n $scope.typeInputPass = 'text';\n else\n $scope.typeInputPass = 'password';\n }", "function showPassword(text){\n xapi.command(\"UserInterface Message TextInput Display\", {\n InputType: KEYBOARD_TYPES.PIN\n , Placeholder: \"Meeting Password (numeric)\"\n , Title: \"Meeting Password\"\n , Text: text\n , SubmitText: \"Next\"\n , FeedbackId: DIALPAD_PASSWORD\n } ).catch((error) => { console.error(error); });\n}", "function showHidePass() {\n var x = document.getElementById(\"show-password\");\n if (x.type === \"password\") {\n x.type = \"text\";\n } else {\n x.type = \"password\";\n }\n}", "function show() { // Show password and change icon to hover state\n input.setAttribute('type', 'text');\n icon.src = 'data:image/gif;base64,R0lGODlhIAAgALMAADk8OYSChGtta83Ozefn5726vaWipVJVUvf39+fj562ure/v75SSlN7b3v///yEgISH5BAAAAAAALAAAAAAgACAAAASa0MlJq7046/26/2AoUmJpfuSphunqPu2rxrJJ1+OEz/pu96aDoVBQCHgSUyBhWTB+SZFCMyjdHoYJYkAcICZVFtAjmBAAD8ERQJg8QTemAwFgSwgCu2MhjpInBg9yd2mAcGMPBwGLaBYHD4sBjyiIfRNoUA4qAxQNSJonAF4OA5iZPqeoOX6qlKytHVeqsqi0PrY7G7q7vL0OEQA7'; // Data URI for hover icon\n\n // Password will be automatically concealed after a certain time\n concealTimeout = setTimeout(hide, concealTimer);\n }", "function onShowPasswordClick(event) {\n event.target.innerText = password.type === \"password\" ? \"hide password\" : \"show password\";\n password.type = password.type === \"password\" ? \"text\" : \"password\";\n\n // if (password.type === \"password\") {\n // password.type = \"text\";\n // showPasswordButton.innerText = \"hide password\";\n // } else {\n // password.type = \"password\";\n // showPasswordButton.innerText = \"show password\";\n // }\n}", "function writePassword() {\n var password = generatePassword();\n\n passwordText.value = password;\n\n // Add note to click password field to copy generated password if not already visible\n var copyText = document.querySelector(\"#copyText\");\n if (copyText.dataset.state === \"hidden\") {\n copyText.dataset.state = \"show\"\n copyText.textContent = \"Click the password box to copy your new password!\";\n }\n}", "function showHiddenPassword() {\n let passwordInputField = document.getElementById(\"password\");\n if (passwordInputField.type === \"password\") {\n passwordInputField.type = \"text\";\n } else {\n passwordInputField.type = \"password\";\n }\n}", "function showPassword(){\n\tvar pw = document.getElementById(\"sitePassword\"); /* var pw gets \"sitePassword\" node */\n \t\tpw.style.color = \"rgba(51, 123, 168, 0.7)\"; \t/* style.color changes text color increasing opacity */\n\tsetTimeout(function(){ \t\t\t\t\t\t\t\t\t\t\t\t/* To avoid snooping collateral effect, after 30 seconds */\n\t/* sitePassword will be hidden. setTimeout function executes a new style properties on pw to reduce opacity */\n\t\t\tpw.style.color = \"rgba(51, 123, 168, 0)\"; /* to zero */\n\t}, 30000);\n}", "function hideIt(password) {\n return ''\n}", "function displayPassword() {\n document.querySelector(\"#generate\").blur(); // remove button focus so it doesn't hang there after password is displayed.\n document.querySelector(\"#passwordBox\").value = generatePassword(); // call generate function and place returned value into HTML <input>\n}", "function showPassword(el)\n{\n var input = document.createElement('input');\n input.id = el.id;\n input.name = el.name;\n input.value = el.value;\n input.className = el.className;\n if (el.type == 'text' )\n { input.type = 'password'; }\n else\n { input.type = 'text'; }\n el.parentNode.replaceChild(input, el);\n}", "function UserInput(output) {\n document.getElementById(\"password\").passwordText = output;\n}", "function PasswordShow_Hide(button, idInput) {\n ///get password input element.\n var input = document.getElementById(idInput);\n ///check if password is hidden or not.\n if (input.type === \"password\") {\n ///show password.\n input.type = \"text\";\n ///change image.\n button.src = \"images/Invisible_48px.png\";\n button.alt = \"hide\"\n } else {\n ///hide password.\n input.type = \"password\";\n ///change image. \n button.src = \"images/Eye_48px.png\";\n button.alt = \"show\"\n }\n}", "function getPassword() {\n if (hasTextEncoder) {\n document.getElementById('create_button').style.display = 'none';\n document.getElementById('passphrase').style.display = 'block';\n }\n else {\n setupKeys();\n }\n}", "show_prompt( text, type ) {\n\t\tif ( 'password' === type ) {\n\t\t\t$( '#passwordField' ).val( '' );\n\t\t\t$( '#passwordArea' ).show();\n\t\t\t$( '#passwordField' ).focus();\n\t\t}\n\t}", "function getPassowrd() {\n let eyeIconShow = document.getElementById('eye-icon-slash-1');\n eyeIconShow.style.display = 'block';\n eyeIconShow.classList = 'fas fa-eye';\n\n let changeType = document.getElementById('singup-pass');\n changeType.type = 'text';\n\n let chars = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM!@#$%^&*()_+=-[]{}><:';\n let password = '';\n\n for (let i = 0; i < 12; i++) {\n let r = Math.floor(Math.random() * chars.length);\n password += chars[r];\n }\n document.getElementById('singup-pass').value = password;\n}", "function hideUnhidePassword1Function() {\n //Users input passwords are stored and displayed, as hide and unhide dotted passwords onto users password textbox.\n var dotsPassword1 = document.getElementById(\"usersPassword\");\n// Create an if statement for users' password textbox, in order to hide and unhide users' password within the textbox.\n if (dotsPassword1.type === \"password\") {\n dotsPassword1.type = \"text\";\n }\n else {\n dotsPassword1.type = \"password\";\n }\n}", "function writePassword() {\n document.querySelector(\"#password\").innerHTML = password;\n\n }", "function show(value){\n if(value==='password'){\n {isPwdVisible? setPasswordType('text')|| setIsPwdVisible(!isPwdVisible):setPasswordType('password')||setIsPwdVisible(!isPwdVisible)}\n }\n if(value==='confirmPassword'){\n {isPwdConfirmVisible? setConfirmPasswordType('text')|| setIsPwdConfirmVisible(!isPwdConfirmVisible):setConfirmPasswordType('password')||setIsPwdConfirmVisible(!isPwdConfirmVisible)}\n }\n }", "function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n\n }", "function showPassword() {\n var x = document.getElementById(\"myInput\");\n if (x.type === \"password\") {\n x.type = \"text\";\n } else {\n x.type = \"password\";\n }\n}", "function writePassword() {\n var passwordLen = getpasswordLength();\n var options = getPasswordOptionSet();\n\n\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = makePassword(passwordLen, options);\n\n\n}", "function showHiddenPasswordConfirmation() {\n let passwordInputField = document.getElementById(\"confirmPassword\");\n if (passwordInputField.type === \"password\") {\n passwordInputField.type = \"text\";\n } else {\n passwordInputField.type = \"password\";\n }\n}", "function showPass() {\n if(password.getAttribute(\"type\")===\"password\"){\n password.setAttribute(\"type\",\"text\");\n }else {\n password.setAttribute(\"type\",\"password\");\n }\n}", "function hideUnhidePassword2Function() {\n //Users input confirm passwords are stored and displayed, as hide and unhide dotted passwords onto users confirm password textbox.\n var dotsPassword2 = document.getElementById(\"usersConfirmPassword\");\n// Create an if statement for users' confirm password textbox, in order to hide and unhide users' confirm password within the textbox.\n if (dotsPassword2.type === \"password\") {\n dotsPassword2.type = \"text\";\n }\n else {\n dotsPassword2.type = \"password\";\n }\n}", "function writePassword() {\n var password = getPasswordOptions();\n var passwordText = document.querySelector('#password');\n \n passwordText.value = password;\n }", "function pwEvent() {\r\n if (validPW()) {\r\n $password.next().hide(); //next searches through immediate following siblings\r\n } else {\r\n $password.next().show();\r\n }\r\n}", "showPasswordToggle() {\n this.setState({showPassword: !this.state.showPassword})\n\n // set defaults\n this.setState({\n \t\tinputFieldType: this.props.type,\n \t\tshowPasswordStyle: style.iconEye\n\t })\n\n // override when toggled.\n if (this.state.showPassword){\n this.setState({\n\t\t inputFieldType: 'text',\n\t\t showPasswordStyle: style.dontShowPasswordIconEye\n\t })\n }\n }", "function showLoginPassword() \r\n{\r\n var x = document.getElementById(\"password\");\r\n\r\n if (x.type === \"password\") \r\n x.type = \"text\";\r\n else \r\n x.type = \"password\";\r\n}", "function UserInput(pd) {\n document.getElementById(\"password\").textContent = pd;\n}", "function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n}", "function writePassword() {}", "function setHiddenPassword(str) {\r\n console.log(\"[DEBUG] Manipulate typing password like a user.\");\r\n var list_a_dom_in_password = document.querySelectorAll( \"#secret-nbr-keyboard > .password-key\");\r\n // Verify that we have found the password key list\r\n if (!list_a_dom_in_password) {\r\n console.log(\"[ERROR] Cannot find any password key\");\r\n return false;\r\n }\r\n\r\n for (i = 0; i < str.length; i++) {\r\n var password_key_clicked = false;\r\n for (j = 0; j < list_a_dom_in_password.length; j++) {\r\n if (str[i] === list_a_dom_in_password[j].getAttribute(\"data-value\")) {\r\n list_a_dom_in_password[j].click();\r\n password_key_clicked = true;\r\n break;\r\n }\r\n }\r\n // Verify that we have clicked on a password key\r\n if (password_key_clicked === false) {\r\n console.log(\"[ERROR] Cannot find the password key: \" + str[i]);\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "function writePassword() {\n var password = generatePassword();\n \n\n passwordText.value = password;\n}", "function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n\n}", "function handleTogglePassVisibility(event) {\n const cell = event.target.parentElement.parentElement;\n const input = cell.getElementsByTagName(\"input\")[0];\n\n if (input.type === \"password\") {\n input.type = \"text\";\n event.target.innerText = \"Hide\";\n } else {\n input.type = \"password\";\n event.target.innerText = \"Show\";\n }\n }", "function makePass() {\n let length = document.getElementById(\"myRange\").value;\n //makePassword(length);\n document.getElementById(\"sub-heading\").textContent = \"Here is your generated password:\" + \"\\n\" + makePassword(length);\n modal.classList.toggle(\"show-modal\");\n }", "function hidePassword(pass){\n var fullPassword = pass.substring(0,pass.length);\n var hiddenPassword = pass.replace(fullPassword,\"_\");\n return \"Your password is: \" + hiddenPassword;\n }", "function writePassword() {\n passwordText.value = generatePassword();\n}", "function changeScreenOnPass \n (\n hideScreenId, // Id of the screen that we need to hide\n showScreenId // Id of the screen that we need to show\n )\n {\n fieldStateChangeWr ('txtUserName txtPwd', '', 'txtNewPassWd txtCnfPwd', ''); \n displayOrHideFields (hideScreenId, showScreenId);\n }", "function togglePassword(obj, e) {\n\t\t\t\t//alert($(obj).html());\n\t\t\t\te.preventDefault();\n\t\t\t\t\n\t\t\t\t//var upass = document.getElementsByClassName('upass');\n\t\t\t\tvar field = $(obj).parent().parent().find(\".togglePassword\");\n\t\t\t\tvar type = field.attr('type');\n\t\t\t\t\n\t\t\t\t//alert('Type: '+type+'; Val: '+field.val());\n\t\t\t\t\n\t\t\t\tif(type == \"password\"){\n\t\t\t\t\t//field.type = \"text\";\n\t\t\t\t\tfield.attr('type', 'text');\n\t\t\t\t\t$(obj).html(\"Hide\");\n\t\t\t\t} else {\n\t\t\t\t\t//field.type = \"password\";\n\t\t\t\t\t$(obj).html(\"Show\");\n\t\t\t\t\tfield.attr('type', 'password');\n\t\t\t\t}\n\t\t\t}", "function showRegistrationPassword() \r\n{\r\n var x = document.getElementById(\"registerPassword\");\r\n\r\n if (x.type === \"password\") \r\n x.type = \"text\";\r\n else \r\n x.type = \"password\";\r\n}", "function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n}", "function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n}", "toPassword() {\n if (this.pwd_field && this.pwd_field.nativeElement) {\n this.pwd_field.nativeElement.focus();\n this.focus = 'password';\n }\n }", "function logkey() {\n if(password.length <= 0) {\n // Displays message about password length requirements\n ReactDOM.render(<div id=\"password-status-2\">Password length must be one character or more</div>, document.getElementById('password-status-1'));\n // Show password length message\n $(\"#password-status-2\").show()\n } else if (password.length > 0) {\n // Hide password length message\n $(\"#password-status-2\").hide()\n }\n }", "function showOrHide() {\r\n let checkType = document.getElementById(\"password\");\r\n if (checkType.type === \"password\") {\r\n checkType.type = \"text\";\r\n } else {\r\n checkType.type = \"password\";\r\n }\r\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function validate_password()\n {\n const icon = DOM.new_password_validation_icon;\n const password = DOM.new_password_input.value;\n\n icon.style.visibility = \"visible\";\n\n if (security.is_valid_password(password))\n {\n icon.src = \"/icons/main/correct_white.svg\";\n return true;\n }\n else\n {\n icon.src = \"/icons/main/incorrect_white.svg\";\n return false;\n }\n }", "function UserInput(ps) {\n document.getElementById(\"password\").textContent = ps;\n\n}", "function WritePassword(passwordText) {\n document.getElementById(\"password\").textContent = passwordText;\n\n}", "function showHideChangePassword1() {\n\t\t \t$(\"#showHidePassBtn1\").click(function() {\n\t\t \t\tif ($(this).data('val') == \"1\") {\n\t \t $(\"#newPass\").prop('type','text');\n\t \t $(\"#eye11\").attr(\"class\",\"glyphicon glyphicon-eye-close\");\n\t \t $(this).data('val','0');\n\t \t } else {\n\t \t \t $(\"#newPass\").prop('type', 'password');\n\t \t $(\"#eye11\").attr(\"class\",\"glyphicon glyphicon-eye-open\");\n\t \t $(this).data('val','1');\n\t \t } \n\t\t \t});\n\t\t }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n // Reset variables\n passwordLength = 0;\n selectedCharacters = \"\";\n includeLowercase = false;\n includeUppercase = false;\n includeNumbers = false;\n includeSpecialChar = false;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function userInput(password) {\n document.getElementById(\"password\").textContent = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = displayPassword;\n\n}", "function writePassword() {\n var password = generatePassword()\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.value = password;\n \n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "function writePassword() {\n var userPassword = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = userPassword;\n }", "function inputPassword(e) {\n document.getElementById(\"password\").textContent = e;\n}", "function writePassword() {\n const characterAmount = charAmountNumber.value;\n const includeLowercase = includeLowercaseElement.checked\n const includeUppercase = includeUppercaseElement.checked\n const includeNumbers = includeNumbersElement.checked\n const includeSymbols = includeSymbolsElement.checked\n\n const password = generatePassword(characterAmount, includeLowercase, \n includeUppercase, includeNumbers, includeSymbols);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var password = generatePassword();\n // Find the id in HTML called password to determine where it should be placed\n var passwordText = document.querySelector(\"#password\");\n // Use the element found in the HTML to display the value of the password variable\n passwordText.value = password;\n return;\n}", "function writePassword() {\n let newOptions = { ...options };\n setOptions(newOptions);\n var password = generatePassword(newOptions);\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n}", "function writePassword() {\n\n\n // you can create a function named generatePassword that creates the password\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n\n }", "function writePassword() {\n\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n }", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n passwordText.value = password;\n document.getElementById(\"password\").innerHTML = password;\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n var charSet =( userLower ? charsLower : '' )\n +( userUpper ? charsUpper : '' )\n +( userNums ? charsNumbers : '' )\n +( userSpecial ? charsSpecial : '' )\n\n passwordText.value = password;\n\n}", "function writePassword() {\n var password = generatePassword();\n passwordText.value = password;\n copyBtn.removeAttribute(\"disabled\");\n copyBtn.focus();\n}", "function writePassword() {\r\n\r\n var password = generatePassword(),\r\n passwordText = document.querySelector(\"#password\");\r\n\r\n passwordText.value = password;\r\n \r\n}", "function writePassword() {\n var password = generatePassword();\n // If password is empty string, return without printing\n if (!password) {\n return;\n }\n var passwordText = document.querySelector('#password');\n\n passwordText.value = password;\n}", "function writePassword() {\n var criteria = passwordCriteria();\n var password = generatePassword(criteria);\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n}", "function writePassword() {\n passwordText.value = generatePassword();\n\n}", "function writePassword(len, upper,lower,num, sym) {\n \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n\n passwordText.value = password;\n\n // var char = upperCase + lowerCase + Numbers + Symbols;\n // var chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!#$%&‘()*+,-./:;<=>?@[\\]^_`{|}~';\n \n}", "function writePassword() {\n var password = generatePassword(charLength, charactersType);\n var passwordText = document.querySelector(\"#password\");\n \n passwordText.textContent = password;\n \n}", "function writePassword() {\n \n\n arraySplit = \"\"; \n exitApplication = false; \n userInput = \"\"; \n finalPassword = \"\"; \n displayPassword = \"\"; \n window.alert(\" Lets check our password criteria options\");\n var password = generatePassword(); //different method\n \n var pLength = passlength();\n \n displayPassword = generatePasswordRandomness(userInput,pLength);\n\n\n var passwordText = document.querySelector(\"#password\"); \n \n \n document.getElementById(\"password\").readOnly = false; \n document.getElementById(\"password\").value = displayPassword; \n document.getElementById(\"password\").readOnly = true; \n\n}", "function UserInput(passwordText) {\n document.getElementById(\"password\").textContent = passwordText;\n}", "function writePassword() {\n \n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");//id selector = html line 22 \n\n passwordText.value = password;\n\n \n}", "function showPassword(){\n var password = $('#password');\n if(password.val()) {\n if (password.attr('type') != 'text') {\n password.attr('type', 'text');\n } else {\n password.attr('type', 'password');\n }\n } else {\n password.attr('type', 'password');\n }\n}", "function writePassword() {\n var password = generatePassword();\n var passwordText = document.querySelector(\"#password\");\n if(password) {\n passwordText.value = password;\n }\n}", "function writePassword() {\n // Runs the function that will generate the password\n var password = generatePassword();\n // Selects on the HTML where the password is shown\n var passwordText = document.querySelector('#password');\n // Makes the value of the element the string generated from the generatePassword function\n passwordText.value = password;\n}" ]
[ "0.80083334", "0.7949548", "0.7917727", "0.78051215", "0.7754011", "0.77374643", "0.75374913", "0.752406", "0.74986297", "0.74875414", "0.7483927", "0.74505216", "0.7416016", "0.7405581", "0.74018633", "0.7365755", "0.73456156", "0.7333719", "0.73046505", "0.727083", "0.72253853", "0.7223683", "0.7185824", "0.7154599", "0.71286035", "0.7126676", "0.71163327", "0.71046466", "0.70888776", "0.70887697", "0.70864064", "0.7057287", "0.70111173", "0.7007267", "0.6995641", "0.69698495", "0.696853", "0.6943938", "0.69373816", "0.6936771", "0.6934358", "0.6910166", "0.69096696", "0.6892921", "0.6882785", "0.68822426", "0.6881587", "0.68774885", "0.6866693", "0.6861202", "0.68577075", "0.68532884", "0.6849143", "0.6845699", "0.6845699", "0.6844834", "0.68445307", "0.6837655", "0.68368316", "0.683576", "0.6833177", "0.6828827", "0.6815094", "0.68083113", "0.6805513", "0.6791635", "0.67798656", "0.6773195", "0.6757365", "0.6756974", "0.67542696", "0.67542696", "0.67542696", "0.67542696", "0.67493445", "0.67479575", "0.67468137", "0.67452896", "0.6730458", "0.67290807", "0.67276686", "0.67270774", "0.67267305", "0.6726231", "0.6722301", "0.6721146", "0.6720044", "0.6715947", "0.67129654", "0.6712429", "0.67120326", "0.6711894", "0.6708451", "0.6707277", "0.6705634", "0.67035955", "0.66995317", "0.66939396", "0.66898197", "0.66897595" ]
0.7691288
6
Render Search History to the side bar
function renderHistory() { keys = Object.keys(localStorage); renderWeather(); keys.forEach((element) => { ///I use the local storage to save the last search recent so this is if (element !== "lastSearchedCity") { let history = $("<li>").text(element).addClass("recentHistory"); $("#recent-history").append(history); } }); city = localStorage.getItem("lastSearchedCity"); renderWeather(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderHistoryList() {}", "function renderSearchHistory() {\n var storedInitials = JSON.parse(localStorage.getItem(\"search\"));\n locationArr = storedInitials;\n\n for (var i = 0; i < locationArr.length; i++) {\n var searchHistoryList = document.createElement(\"li\");\n searchHistoryList.setAttribute(\"class\", \"list-group-item\");\n searchHistoryList.textContent = locationArr[i];\n locationEl.append(searchHistory);\n }\n searchHistory.append(searchHistoryList);\n}", "function renderHistory() {\n document.getElementById('searchHistory').innerHTML = searchHistoryList.reduce(\n // allSearches = variable for initial value of reduce\n // cityObject = is each item within the list sequentially\n (allSearches, cityObject) => {\n return allSearches += `<li onclick='setCurrentSearch(\"${cityObject.city.name}\")' class=\"list-group-item\">${cityObject.city.name}</li>`\n }, '')\n}", "render() {\n let filteredData = this.state.data.filter(this.searchDetails);\n let displayResults = \"\"\n if (this.state.query !== \"\") {\n displayResults = (\n <div class=\"searchContainer\">\n <ul>{\n filteredData.map((details, i) => (\n <div key={i} className=\"searchResults\">\n\n <button>\n <Link to={`/movie_details/${details.id}`}>\n <li>{details.original_title}</li>\n </Link>\n </button>\n\n </div>\n ))}</ul></div>)\n } else {\n displayResults = \"\";\n }\n\n return (\n <div className=\"searchBar\">\n <Search query={this.state.query} handleSearch={this.handleSearch} className=\"searchBox\" />\n {displayResults}\n </div>\n );\n }", "function renderHistory() {\n $(\"#history-container\").empty();\n /* Adds one div for each city in history */\n cityHistory.forEach(function (city) {\n $(\"#history-container\").append(\"<div class='past-city'>\" + city + \"</div>\");\n });\n /* Adds click event to run a weather query when a city is clicked */\n $(\".past-city\").click(cityFromHistory);\n}", "render() {\n return <h1>History</h1>\n }", "function renderCitySearchHistory() {\n var storedCities = JSON.parse(localStorage.getItem(\"Cities\"));\n if (storedCities !== null) {\n citySearchHistory = storedCities;\n city = citySearchHistory.slice(-1)[0];\n }\n showHistory.innerHTML = \"\";\n for (var i = 0; i < citySearchHistory.length; i++) {\n var cityTitle = citySearchHistory[i];\n\n var li = document.createElement(\"li\");\n li.textContent = cityTitle;\n showHistory.appendChild(li);\n }\n}", "render(){\r\n\r\n\t\treturn(\r\n\r\n\t\t\t<div className=\"panel panel-default\">\r\n\t\t\t\t<div className=\"panel-heading\">\r\n\t\t\t\t\t<h3 className=\"panel-title text-center\">History</h3>\r\n\t\t\t\t</div>\r\n\t\t\t\t<div className=\"panel-body text-center\">\r\n\t\t\t\t\t\t<ul>\r\n\t\t\t\t\t\t{this.renderData(this.props.results)}\r\n\t\t\t\t\t\t</ul>\r\n\t\t\t\t</div>\r\n\t\t\t</div>\r\n\r\n\t\t)\r\n\t}", "function displaySearchHistory() {\n $(\"#search-history\").empty();\n search_history.forEach(function (city) {\n var history_item = $(\"<li>\");\n history_item.addClass(\"list-group-item btn btn-light\");\n history_item.text(city);\n $(\"#search-history\").prepend(history_item);\n });\n\n $(\".btn\").click(getWeather);\n $(\".btn\").click(Forecast);\n }", "render() {\n\t\tconst searchUserData = this.processData(this.props.barSearchData, this.props.userData);\n\n\t\tconst results = _.map(searchUserData, (data, index) => {\n\t\t\tdata.addBar = this.props.addBar;\n\t\t\tdata.removeBar = this.props.removeBar;\n\t\t\treturn <SearchResult {...data} index={index} authenticated={this.props.authenticated} history={this.context.router.history} key={data.id} />\n\t\t});\n\n\t\treturn (\n\t\t\t<div>\n <ul className=\"list-group\">\n {results}\n </ul>\n </div>\n\t\t);\n\t}", "function _renderSearch() {\n _$navbar.setMod(_B_BAR, _M_SEARCH, false);\n setTimeout(function() {\n _$navbar.setMod(_B_BAR, _M_SEARCH, _searchIsActive);\n }, CFG.TIME.ANIMATION);\n }", "function render(){\n let bookmarks = [...STORE.bookmarks];\n // filter bookmark list\n if(STORE.searhTerm){\n bookmarks = bookmarks\n .filter(bookmark => bookmark.rating >= STORE.searhTerm);\n }\n const bookmarkString = generateHtmlString(bookmarks);\n console.log(bookmarks);\n // render html elements\n $('.js-container').html(bookmarkString);\n }", "renderHistory() {\n const history = this.props.history.map( (entry, index) => {\n let expression = entry.expression;\n let result = entry.result;\n\n return (\n <div key={index} className='entry'>\n {this.renderEntry(expression)}\n {this.renderEntry(result)}\n </div>\n );\n });\n\n return history;\n }", "function render() {\n if (!store.started) {\n if(store.filtered === false){\n $(\"main\").html(template.startPage());\n const html = template.generateBookmarkStrings(store.items);\n $('#bookmarkResults').html(html);\n } else{\n $(\"main\").html(template.startPage());\n $('#minimumRating').val(store.minimum);\n const filter = store.items.filter(bookmark => {\n return bookmark.rating >= store.minimum;\n \n })\n const html = template.generateBookmarkStrings(filter);\n $('#bookmarkResults').html(html);\n }\n \n \n } else {\n $(\"main\").html(template.newBookmarkTemp());\n }\n}", "function displaySearchHistory() {\n const key = 'Search History';\n var searchHistory = JSON.parse(localStorage.getItem(key) || \"[]\");\n var buttons = [];\n\n for (var i = 0; i < searchHistory.length; i++) {\n buttons.push('<button class=\"btn btn-secondary col-12 addedButton\">' + searchHistory[i] + '</button>');\n }\n\n $('.searchHistory').html(buttons.join(\"\"));\n}", "showHistory(history) {\n\n return (\n history.map((dataBit, i) => {\n return (\n <ul \n key={i+\"list\"} \n className=\"history\"\n >\n {this.dataRender(dataBit, i)}\n </ul>\n\n );\n })\n )\n }", "function searchHistoryDisplay() {\n $(\"#cityHistory\").empty();\n\n console.log(\"len:\", searchHistory.length, searchHistory);\n\n for (var i = 0; i < searchHistory.length; i++) {\n console.log(i, searchHistory[i]);\n var historyButton = $(\"<button>\");\n historyButton.addClass(\"searched-cities btn btn-light btn-lg btn-block\");\n historyButton.text(searchHistory[i]);\n $(\"#cityHistory\").prepend(historyButton);\n }\n\n $(\".searched-cities\").on(\"click\", function () {\n $(\".weatherContainer\").removeClass(\"hide\");\n var searchedCity = $(this).text();\n currentWeather(searchedCity);\n forecastWeather(searchedCity);\n });\n\n //Displays last search if a search has been conducted\n\n if (searchHistory.length > 0) {\n var city = searchHistory[searchHistory.length - 1];\n $(\"#search-term\").val(city);\n currentWeather(city);\n forecastWeather(city);\n $(\".weatherContainer\").removeClass(\"hide\");\n }\n }", "function updateSearchHistory() {\r\n\t// displays searches alphabetically\r\n\t// getSearches returns searches in order of when they occurred\r\n\t\r\n\tvar taskIdx = selectedTaskIdx();\r\n\tvar searches = getSearches(taskIdx);\r\n\tif (searches.length==0) {\r\n\t\t$(\"#search_history\").html('No searches, yet');\r\n\t}\r\n\telse {\r\n\t\tvar sortedSearches = sortSearchesAlphabetically(taskIdx);\r\n\t\tvar html = '<ol>';\r\n\t\tfor (var i=0; i<sortedSearches.keys.length; i++) {\r\n\t\t\tvar key = sortedSearches.keys[i];\r\n\t\t\tvar search = sortedSearches.dict[key];\r\n\t\t\tvar query = search.query;\r\n\t\t\tvar links = search.links;\r\n\t\t\thtml += \"<li>\";\r\n\t\t\thtml += htmlEscape(query);\r\n\t\t\tif (links.length > 0) {\r\n\t\t\t\thtml += '<ul class=\"search_history_links\">';\r\n\t\t\t\tfor (var j=0; j<links.length; j++) {\r\n\t\t\t\t\tvar link = links[j];\r\n\t\t\t\t\tvar rating = link.rating == null ? UNRATED : link.rating;\r\n\t\t\t\t\thtml += '<li class=\"' + rating + '\">';\r\n\t\t\t\t\thtml += getLinkHtml(link.url, link.title, 20, rating, \"return onHistoryLinkClicked(event,'\"+htmlEscape(query)+\"');\");\r\n\t\t\t\t\thtml += \"&nbsp;\";\r\n\t\t\t\t\thtml += getRatingImage(rating);\r\n\t\t\t\t\thtml += '</li>';\r\n\t\t\t\t}\r\n\t\t\t\thtml += '</ul>';\r\n\t\t\t}\r\n\t\t\thtml += '</li>';\r\n\t\t}\r\n\t\thtml += '</ol>';\r\n\t\t$(\"#search_history\").html(html);\r\n\t}\r\n}", "function renderSearches()\n {\n for (var i = 0; i < previousSearches.length; i++)\n {\n var divCol = $(\"<div>\");\n divCol.addClass(\"col s2\");\n\n var divCard = $(\"<div>\");\n divCard.addClass(\"card\");\n divCol.append(divCard);\n\n var divCardImage = $(\"<div>\");\n divCardImage.addClass(\"card-image\");\n divCard.append(divCardImage);\n\n var image = $(\"<img>\");\n image.attr(\"src\", previousSearches[i].imageurl[0]);\n divCardImage.append(image);\n\n var divCardContent = $(\"<div>\");\n divCardContent.addClass(\"card-content\");\n divCardImage.append(divCardContent);\n\n var synopsis = $(\"<p>\");\n synopsis.text(previousSearches[i].synopsis);\n divCardContent.append(synopsis);\n\n prevSearch.prepend(divCol);\n }\n }", "function genHistoryList() {\n document.querySelector('#searchHistory').innerHTML = \"\"\n for (var idx = 0 ; idx < searchSave.length ; idx++) {\n document.querySelector('#searchHistory').innerHTML +=\n `\n <tr>\n <td scope=\"row\">${searchSave[idx]}</td>\n </tr>\n `\n }\n}", "function history() {\r\n sidebar.toggleHistory();\r\n}", "function showHistory() {\n $(\"#left-side .history\").addClass(\"active\");\n //$(\"#history-section\").show();\n $(\"#history-api-section\").show();\n\n $(\"#left-side .repository\").removeClass(\"active\");\n $(\"#repository\").hide();\n}", "function renderSearchResults(state, into){\n\n var places = state.search.items.map(function(item){\n return `\n <div class=\"mdl-card mdl-cell mdl-cell--4-col mdl-cell--4-col-tablet mdl-shadow--2dp place-card\" data-id=\"${item.id}\">\n <div class=\"mdl-card__media\">\n <img src=\"${item.photo}\" alt=\"\" />\n </div>\n\n <div class=\"mdl-card__title image-card\">\n <h1 class=\"mdl-card__title-text\">${item.name}</h1>\n </div>\n\n <div class=\"mdl-card__supporting-text\">\n <p>${item.address}</p>\n </div>\n <div class=\"mdl-card__actions\">\n <a href=\"#\" class=\"mdl-button add-place\">Add to Collection</a>\n </div>\n </div>\n `\n });\n\n into.innerHTML = `\n <div class=\"mdl-layout mdl-js-layout mdl-layout--fixed-header mdl-layout--fixed-drawer\">\n\n <header class=\"mdl-layout__header\">\n <div class=\"mdl-layout__header-row\">\n <button class=\"mdl-button mdl-js-button mdl-button--icon back-home\">\n <i class=\"material-icons\">arrow_back</i>\n </button>\n <div class=\"mdl-layout-spacer\"></div>\n ${state.currentUser ? renderSignOut() : \"\" }\n </div>\n </header>\n\n <div class=\"mdl-layout__drawer\">\n <span class=\"mdl-layout-title\">${state.currentCollection.data.name}</span>\n <nav class=\"mdl-navigation\">\n ${renderAddedPlaces(state)}\n </nav>\n </div>\n <main class=\"mdl-layout__content\" id=\"overview\">\n <section class=\"mdl-grid search-results\">\n <div class=\"mdl-cell mdl-cell--12-col search-title\">\n <h2>You searched for</h2>\n </div>\n ${places.join('')}\n </section>\n </main>\n </div>\n `\n\n componentHandler.upgradeDom();\n}", "function getSearchHistory() {\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", 'http://localhost:8080/getSearchHistory');\n xhr.onload = function () {\n var res_str = JSON.stringify(xhr.responseText);\n var result = JSON.parse(res_str);\n displayHistory(result);\n }\n xhr.send();\n }", "function updateHistoryArea() {\n // Remove existing items from UI\n while (historyContent.firstChild) {\n historyContent.removeChild(historyContent.firstChild);\n }\n // Add contents of hexHistoryQueue to UI\n hexHistoryQueue\n .slice()\n .reverse()\n .forEach(item => {\n const historyItem = document.createElement('div');\n historyItem.setAttribute(\n 'class',\n 'history-item d-flex justify-content-between align-items-center'\n );\n historyItem.innerHTML = `\n <div class=\"history-hex p-2\">${item}</div>\n <div\n class=\"hex-preview mx-2 flex-grow-1\"\n style=\"background: ${item};\"\n ></div>\n <div class=\"copy p-2 mr-1\" id=\"copy\">\n <i class=\"fa fa-copy\"></i> Copy\n </div>\n `;\n historyContent.appendChild(historyItem);\n });\n}", "function renderHistory() {\n for (let i=0; i<historyStored.length; i++) {\n \n history.append('<div class=\"result-div ml-3\">' + historyStored[i] + '</div>');\n history.children($('.result-div')).children($('.foot-div')).children(\".save-button\").remove();\n ($('.card-header')).siblings().css('display', 'none')\n moreBtn = $('<button class=\"card-header-icon moreBtn\" aria-label=\"more options\"><span class=\"icon\"><i class=\"fa fa-chevron-down icon\" aria-hidden=\"true\"></i></span></button>')\n $('.lessBtn').replaceWith(moreBtn)\n $('.history .lessDiv').addClass('moreDiv')\n $('.history .lessDiv').toggleClass('lessDiv')\n\n };\n}", "function showRevHistorySidebar() {\n var ui = HtmlService.createHtmlOutputFromFile('RevisionsSidebar')\n .setTitle('Revision history');\n SpreadsheetApp.getUi().showSidebar(ui);\n}", "function renderSearchHistory(){\n $(\"#history\").html = \"\";\n for(let i = 0; i < searchHistory.length; i++){\n // not sure about document.createElement \n var historyVal = $(\"input\");\n\n historyVal.attr(\"type\",\"text\");\n historyVal.attr(\"readonly\",true);\n historyVal.attr(\"class\", \"form-control d-block bg-white\");\n historyVal.attr(\"value\", searchHistory[i]);\n historyVal.on(\"click\", function(){\n \n })\n\n $(\"#history\").append(historyVal);\n }\n getWeather(historyVal.val());\n\n }", "function render() {\n var children = [SearchBar({\n update: updateSearchState\n }), ItemsList({\n items: _state.items,\n onUpdate: updateState\n })];\n if (!_node) {\n return _node = createElement('div', { class: 'main' }, children);\n } else {\n return _node.html(children);\n }\n }", "function search(config) {\n var settings = config.settings,\n filters = config.filters;\n\n historyView.displayThrobber();\n\n EHistory.search({\n text: settings.text || '',\n startTime: new Date(settings.startTime || 0).getTime() ,\n endTime: new Date(settings.endTime || Date.now()).getTime(),\n maxResults: historyModel.pageSize\n }, filters, function(results){\n historyModel.append(results);\n });\n }", "function displaySearchHistory(){\n $(\"#searchHistory\").empty();\n $.each(cityList, function (index, item){\n \n var listItem = $(\"<li class='list-group-item'>\");\n\n listItem.text(item);\n listItem.attr(\"data-cityname\",item);\n \n $(\"#searchHistory\").prepend(listItem);\n });\n }", "function HistoryPage (){\n\n return (\n <div id=\"wrapper\">\n\n <div>History Estamos en Login</div>\n </div>\n )\n\n\n}", "function loadSearchHistory() {\n if (localStorage.getItem('previous-search') === null) {\n } else if (localStorage.getItem('previous-search') === '') {\n\n }\n else {\n prevSearchArr = prevSearchArr.concat(JSON.parse(localStorage.getItem('previous-search')));\n console.log(prevSearchArr);\n for (var i = 0; i < prevSearchArr.length; i++) {\n var searchedItem = $('<div>');\n var prevSearchBtn = $('<button>');\n prevSearchBtn.addClass('button secondary');\n prevSearchBtn.text(prevSearchArr[i]);\n searchedItem.attr('style', 'margin-bottom: 15px;')\n searchedItem.append(prevSearchBtn);\n prevSearchList.append(searchedItem);\n }\n }\n}", "loadHistory(){\n\t\tlet history = []\n\t\tthis.state.history.forEach((msg) => {\n\t\t\thistory.push(<tr><td>{msg}</td></tr>);\n\t\t});\n\t\treturn history;\n\t}", "function renderSearchResults(search_query) {\n // clear all old search results\n var div = document.getElementById(\"content\");\n div.innerHTML = \"\";\n\n //used to help identify position for shortcut\n var first = document.createElement(\"div\");\n first.classList.add(\"first\");\n div.appendChild(first);\n\n var unorderedDomains = {};\n for (var i = 0; i < bg.tabs.length; ++i) {\n var tab = bg.tabs[i];\n var url = new URL(tab.url)\n var domain = url.hostname\n var cleanedDomain = cleanDomain(domain,true)\n unorderedDomains[cleanedDomain] = domain;\n } \n\n var domains = {};\n Object.keys(unorderedDomains).sort().forEach(function(key) {\n domains[key] = unorderedDomains[key];\n });\n\n for(var domain in domains){\n appendGroup(\n div, \n domain, \n function(tab) {\n return normalizeString(tab.url).match(normalizeString(domains[domain])) \n && isMatch(tab, search_query);\n }); \n } \n\n //used to help identify position for shortcut\n var last = document.createElement(\"div\");\n last.classList.add(\"last\");\n div.appendChild(last);\n}", "function renderCurrencySearchResult() {\n const searchedCurrencies = STATE.getCurrencySearchResult();\n const container = $('.watchlist-right-sidebar .sidebar-container .sidebar-content');\n const rowsHTML = [];\n searchedCurrencies.forEach(searchedRow => {\n rowsHTML.push(getSearchCurrencyRowHTML(searchedRow));\n })\n container.empty().append(rowsHTML.join(''))\n registerCurrencySearchResultEvents();\n }", "function displayHistory(history) {\r\n\r\n\thtml = '';\r\n\r\n\tif (Array.isArray(history) && history.length) \r\n\t{\r\n\r\n\t\tfor (let i = 0; i < history.length; i++) {\r\n\r\n\t\t\thtml += `<li> ${history[i]} </li>`\r\n\t\t}\r\n\r\n\t\toutput_history.innerHTML = html;\r\n\r\n\t}\r\n\r\n}", "function renderWeather() {\n $(\".searchedList\").empty();\n $('.searchedList').append('<li class=\"list-group-item\" id=\"clear\"><a href=\"#\" class=\"stretched-link\">Clear History</a><i class=\"far fa-trash-alt trashBtn\"></i></li>');\n\n let searched = JSON.parse(localStorage.getItem(\"searched\"));\n if (searched === null) {\n searched = [];\n };\n if (searched.length !== null) {\n for (var i = 0; i < searched.length; i++){\n $('.searchedList').prepend('<li class=\"list-group-item\"><a href=\"#\" class=\"stretched-link\" index=\"'+i+'\"id=\"'+searched[i]+'\">'+searched[i]+'</a></li>');\n }\n };\n }", "function render() {\n let html = generateHeader();\n\n if (store.error) {\n generateError();\n }\n\n // check if form displayed\n if (store.adding) {\n html += generateBookmarkForm();\n }\n\n html += generateAllBookmarkCards();\n\n $('main').html(html);\n }", "function renderSearchBar(apollo = getMockApollo()) {\n\treturn render(SearchBar, {\n\t\tprovide: { apollo }\n\t});\n}", "displaySearch() {\n\n //first retrieve all docs again, to reverse any filters\n db.allDocs({\n include_docs: true\n }, (err, doc) => {\n if (err) {\n return this.error(err);\n }\n if (doc.rows.length > 0) {\n this.setState({\n pageLoading: false\n });\n this.redrawResources(doc.rows);\n }\n });\n this.setState({\n appbarTitle: 'ShoutHealth'\n });\n this.setState({\n appbarSubtitle: 'Find Accessible Healthcare.'\n });\n this.setState({\n appbarState: false\n });\n this.setState({\n appbarIcon: <NavigationMenu />\n });\n this.setState({\n searchBar: <SearchInputs container={this.refs.content}\n getSearchstring={()=>this.state.searchString}\n filterResources={(searchString)=>this.filterResources(searchString)}\n searchString={this.state.searchString}\n getselectedIndex={()=>this.state.selectedIndex}\n onSelect={(index) => this.footerSelect(index)}/>\n });\n this.setState({\n screen: <Search container={this.refs.content}\n footer={this.refs.footer}\n displayResult={(result) => this.displayResult(result)}\n displaySearch={() => this.displaySearch()}\n filterResources={(string) => this.filterResources(string)}\n displayAddResource={() => this.displayAddResource()}\n getFilteredResources={() => this.state.filteredResources}\n getPageLoading={() => this.state.pageLoading}\n onGoogleApiLoad={(map, maps) => this.onGoogleApiLoad(map, maps)}\n userLat={this.state.userLat} userLng={this.state.userLng}\n getSearchstring={()=>this.state.searchString} />\n });\n\n }", "function Home(props) {\r\n\r\n const history = useHistory()\r\n\r\n return (\r\n\r\n <bs.Container fluid className=\"p-0\">\r\n <bs.Row className=\"mt-5 mb-3\">\r\n <bs.Col>\r\n <h3>GoFundMe Analytics</h3>\r\n </bs.Col>\r\n </bs.Row>\r\n <bs.Row md=\"0\" className=\"mt-3\">\r\n <bs.Col>\r\n <bs.Button onClick={e=>{history.push('/search')}} variant=\"success\" size=\"lg\" block style={{height: '100px', width:'90%'}}>Quality Search</bs.Button><br></br>\r\n\r\n <h6 style={{ width:'90%'}}>Search through current and past GoFundMe campaigns based on their quality</h6>\r\n </bs.Col>\r\n \r\n <bs.Col>\r\n <bs.Button onClick={e=>{history.push('/predict')}} variant=\"warning\" size=\"lg\" block style={{height: '100px', width:'90%'}}>Predict Your Campaign</bs.Button><br></br>\r\n\r\n <h6 style={{ width:'90%'}}>Use our predictor to estimate the success of your campaign based on a few criteria</h6>\r\n </bs.Col>\r\n </bs.Row>\r\n </bs.Container>\r\n );\r\n}", "function createSearchHistory(city) {\n\n var historyBtn = $(\"<li>\", { \"class\": \"button rounded button-spacing\" }).text(city);\n $(\"#history-search-btn\").prepend(historyBtn);\n}", "render() {\n\t\treturn (\n\t\t\t<div>\n\t\t\t\t<Jumbotron>\n\t\t\t\t\t<h1>Google Book Search</h1>\n\t\t\t\t\t<h3 />\n\t\t\t\t</Jumbotron>\n\t\t\t\t<Link type=\"button\" className=\"btn btn-primary\" to=\"/saved\">\n\t\t\t\t\tSaved\n\t\t\t\t</Link>\n\t\t\t\t<Link type=\"button\" className=\"btn btn-primary\" to=\"/\">\n\t\t\t\t\tSearch\n\t\t\t\t</Link>\n\t\t\t\t<Container>\n\t\t\t\t\t<Row>\n\t\t\t\t\t\t<SearchBar\n\t\t\t\t\t\t\tvalue={this.state.searchInput}\n\t\t\t\t\t\t\tonChange={this.handleInputChange}\n\t\t\t\t\t\t\tname=\"title\"\n\t\t\t\t\t\t\tplaceholder=\"Search Book Title\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<SearchBtn onClick={this.handleFormSubmit} className=\"btn btn-primary\" buttonTitle=\"Search\" />\n\t\t\t\t\t</Row>\n\t\t\t\t\t<h2>Book Results</h2>\n\n\t\t\t\t\t{this.state.showBooks.map((book, index) => (\n\t\t\t\t\t\t<div key={index}>\n\t\t\t\t\t\t\t<BookListItem\n\t\t\t\t\t\t\t\timage={\n\t\t\t\t\t\t\t\t\tbook.volumeInfo.imageLinks.thumbnail ? book.volumeInfo.imageLinks.thumbnail : null\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\ttitle={book.volumeInfo.title}\n\t\t\t\t\t\t\t\tauthor={book.volumeInfo.authors[0]}\n\t\t\t\t\t\t\t\tdescription={book.volumeInfo.description}\n\t\t\t\t\t\t\t\tdate={book.volumeInfo.date}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t<Link to={`/book/${book.id}/${book.volumeInfo.title}`}>View</Link>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t))}\n\t\t\t\t</Container>\n\t\t\t</div>\n\t\t);\n\t}", "onRenderHistoryItems () {\n let resultView;\n if (this.state.historyData) {\n resultView = this.state.historyData.map((item,index) => {\n return <HistoryItem key={index} historyItemInfos={item}/>\n })\n }\n return resultView;\n }", "getHistory() {\n app.pageIndex--;\n app.searchProjects = app.history[app.pageIndex - 1];\n console.log(app.pageIndex);\n console.log(app.history.length);\n }", "render() {\n return (\n <div className=\"ui container\" style={{ marginTop: '10px' }}>\n <Header />\n <Route path=\"/\">\n <Home />\n </Route>\n <Route path=\"/search\">\n <SearchBar onSubmit={this.onSearchSubmit} />\n {!this.state.results.length ? (\n <div>Waiting for Search Parameter</div>\n ) : (\n <ResultList results={this.state.results} />\n )}\n </Route>\n <Route path=\"/history\">\n <History history={history} />\n </Route>\n </div>\n );\n }", "render() { \n return (\n <div>\n <h3 className=\"display-4\" title=\"topic of search term\">TOPIC: <span className=\"badge badge-secondary\">{this.state.searchTerm}</span></h3>\n <SearchResult key={this.props.search} value={this.props.search} onChange={this.handleChange} ></SearchResult>\n </div>\n );\n }", "function renderCitySidebar() {\n // Empty the list-group div to prevent duplication of city searches in the display\n $(\".list-group\").empty();\n var storedCitySearches = JSON.parse(localStorage.getItem(\"citySearches\"));\n if(storedCitySearches !== null) {\n citySearches = storedCitySearches;\n }\n\n // Dynamically create HTML elements for each city in the citySearches array\n citySearches.forEach(element => {\n $(\".list-group\").append($(\"<button type='button' class='list-group-item list-group-item-action'>\").text(element));\n });\n }", "render() {\n return (\n <div className=\"SearchBar\">\n <div className=\"SearchBar-sort-options\">\n <ul>\n {this.renderSortByOptions()}\n </ul>\n </div>\n <div className=\"SearchBar-fields\">\n <input placeholder=\"Search Businesses\" onChange={this.handleTermChange}/>\n <input placeholder=\"Where?\" onChange={this.handleLocationChange}/>\n </div>\n <div className=\"SearchBar-submit\">\n <a onClick={this.handleSearch}>Go</a>\n </div>\n </div>\n );\n }", "function displaySearch(data) {\n var result = data.query.search;\n $(\".search-result\").html(\"\");\n for (var i = 0; i < result.length; i++) {\n var tmp =\n '<div class=\"row result\" id=\"result-' +\n (i + 1) +\n '\">' +\n '<h5 class=\"title\" id=\"title' +\n (i + 1) +\n '\">' +\n '<a href=\"https://en.wikipedia.org/wiki/' +\n result[i].title +\n '\"> ' +\n result[i].title +\n \"</a></h5><br>\" +\n '<p class=\"snippet\" id=\"snippet' +\n (i + 1) +\n '\">' +\n result[i].snippet +\n \"...</p></div>\";\n $(\".search-result\").html($(\".search-result\").html() + tmp);\n }\n $(\".result\").css({\n background: \"rgba(244, 244, 244)\",\n margin: \"15px\",\n padding: \"15px\",\n width: \"100%\"\n });\n}", "function showSearchResults(searchQuery) {\n searchData(searchQuery).then(results => {\n const html = results.map(movie => `\n <li>\n <span class=\"title\">${movie.title}</span>\n <span class=\"rating\">${movie.rating}</span>\n </li>\n `);\n\n resultsElement.innerHTML = html.join('');\n });\n }", "function pageContent(textContent){\n const lastSearchBtn = $(\"<button class='btn border text-muted mt=1 shadow-sm bg-grey rounder' style='width: 16rem;'>\").text(textContent);\n const lastSearchDiv = $(\"<div>\");\n lastSearchDiv.append(lastSearchBtn)\n $(\"#searchHistory\").prepend(lastSearchDiv);\n}", "render($$) {\n const header = $$('div')\n .addClass(styles.header)\n .append([\n $$('div')\n .addClass(styles.logoWrapper)\n .append([\n $$('a').addClass(styles.logo),\n $$('h3')\n .addClass(styles.heading)\n .append(this.getLabel('Oovvuu Video Search')),\n ]),\n this.getAuthComponents($$),\n ]);\n\n const container = $$('div')\n .addClass(styles.wrapper)\n .append(header);\n\n if (this.state.authenticated !== true) {\n return container;\n }\n\n return container.append(\n $$(SearchWrapper, {\n genres: this.state.genres ?? [],\n providers: this.state.providers ?? [],\n }),\n );\n }", "function getRecentSearches() {\n rss.get(function(data) {\n var html = window.recentSearchesCompiled({searches: data});\n $$('.state-place').html(html);\n });\n }", "function renderSearchFromState() {\n\tconst state = JSON.parse(sessionStorage.getItem(SEARCH_STATE_KEY));\n\n\tif (state) {\n\t\tconst searchResults = document.querySelector('#search-results');\n\t\tconst searchInput = document.querySelector('#search-input');\n\n\t\tsearchInput.value = state.searchTerm;\n\t\tsearchResults.classList.add('visible');\n\t\tsearchResults.classList.add('no-transition');\n\t\tsearchResults.innerHTML = state.resultsMarkup;\n\n\t\t// remove class which prevents transition on page move\n\t\tsetTimeout(() => searchResults.classList.remove('no-transition'), 100);\n\t}\n}", "render() {\n return (\n <div className=\"app\">\n <Route exact path=\"/\" render={() => (\n <ListBooks books={this.state.books} changeShelf={this.changeShelf} />\n )}\n />\n <Route path=\"/search\" render={({ history }) => (\n <SearchBooks books={this.state.books} changeShelf={this.changeShelf} />\n )} />\n <div className=\"open-search\">\n <Link to=\"/search\">Search</Link>\n </div>\n </div> \n )\n }", "@action\n showHistoryAction() {\n this.showHistory = true;\n }", "function SearchHistory() {\r\n const [searchState, setSearchState] = useState({\r\n search: \"ThaliaRowan\",\r\n error: \"\"\r\n })\r\n\r\n const [resultState, setResultState] = useState([]);\r\n // When the component mounts, update the title to be Wikipedia Searcher\r\n\r\n useEffect(() => {\r\n\r\n document.title = \"Wikipedia Searcher\";\r\n\r\n API.searchTerms(searchState.search)\r\n .then(res => {\r\n console.log(res.data);\r\n if (res.data.length === 0) {\r\n throw new Error(\"No results found.\");\r\n }\r\n if (res.data.status === \"error\") {\r\n throw new Error(res.data.message);\r\n }\r\n setSearchState(\r\n {\r\n error: \"\"\r\n },\r\n\r\n setResultState(\r\n res.data\r\n )\r\n );\r\n })\r\n .catch(err => setSearchState({ error: err.message }));\r\n }, [])\r\n\r\n\r\n\r\n const handleInputChange = event => {\r\n setSearchState({ search: event.target.value });\r\n };\r\n\r\n const handleFormSubmit = event => {\r\n event.preventDefault();\r\n if (!searchState.search) {\r\n return;\r\n }\r\n API.searchTerms(searchState.search)\r\n .then(res => {\r\n if (res.data.length === 0) {\r\n throw new Error(\"No results found.\");\r\n }\r\n if (res.data.status === \"error\") {\r\n throw new Error(res.data.message);\r\n }\r\n setSearchState({\r\n error: \"\"\r\n },\r\n setResultState(\r\n res.data\r\n )\r\n\r\n );\r\n sUser=JSON.parse(localStorage.getItem(\"gitUser\"));\r\n })\r\n .catch(err => setSearchState({ error: err.message }));\r\n };\r\n// user = \"\";\r\n// sUsers = [];\r\n// function find(u) {\r\n// for (var i = 0; i < sUsers.length; i++) {\r\n// if (u.toUpperCase() === sUser[i]) {\r\n// return -1;\r\n// }\r\n// }\r\n// return 1;\r\n// }\r\n // const addToList = sUser => {\r\n // var listEl = $(\"<li>\" + sUser.toUpperCase() + \"</li>\");\r\n // $(listEl).attr(\"class\", \"list-group-item\");\r\n // $(listEl).attr(\"data-value\", sUser.toUpperCase());\r\n // $(\".list-group\").append(listEl);\r\n // }\r\n// const invokePastSearch= event => {\r\n// var liEl = event.target;\r\n// if (event.target.matches(\"li\")) {\r\n// user = liEl.textContent.trim();\r\n// currentsearchItem(user);\r\n// }\r\n\r\n// }\r\n\r\n// function loadlastUser() {\r\n// $(\"ul\").empty();\r\n// var sUser = JSON.parse(localStorage.getItem(\"gitUser\"));\r\n// if (sUser !== null) {\r\n// sUser = JSON.parse(localStorage.getItem(\"gitUser\"));\r\n// for (i = 0; i < sUser.length; i++) {\r\n// addToList(sUser[i]);\r\n// }\r\n// city = sUser[i - 1];\r\n// currentsearchItem(user);\r\n// }\r\n\r\n// }\r\n // const handleclearHistory = event => {\r\n // event.preventDefault();\r\n // sUser = [];\r\n // localStorage.removeItem(\"gitUser\");\r\n // document.location.reload();\r\n\r\n // }\r\n \r\n return (\r\n // <div>\r\n <div className=\"col-sm-4 bg-light\">\r\n <h4 className=\"pt-1\"><strong>GitHub Name:</strong></h4>\r\n <div className=\"input-group mb-3\">\r\n <Input\r\n handleInputChange={handleInputChange}\r\n />\r\n <SearchBtn handleFormSubmit={handleFormSubmit}\r\n results={searchState.search}/>\r\n </div>\r\n {/* <ClearBtn handleclearHistory={handleclearHistory} /> */}\r\n <SearchList />\r\n </div>\r\n\r\n );\r\n}", "function history_list(){\n let temp_div = document.querySelector('.history_list');\n let div = document.createElement('div');\n div.className = 'history_data_in';\n div.innerHTML = `<h3>Task Name: ${c_task}, Status:${c_task_status}</h3>`\n temp_div.appendChild(div); \n }", "function render() {\r\n //does nothing if there is not a current error\r\n renderError();\r\n\r\n let html = '';\r\n\r\n//view state changes if user has chosen to add a new bookmark\r\n if (store.adding === true) {\r\n html = addBookmark()\r\n }\r\n //if the value of error has changed state from its initial value of null displayError will inject the msg into the html\r\n else if (store.error != null) {\r\n html = displayError()\r\n }\r\n \r\n //finally, if no errors are present the initial view of the app will render\r\n else { html = generateInitialView(generateBookmarkString) }\r\n $('main').html(html)\r\n store.filter = 0\r\n}", "render() {\n return (\n <div className=\"queue-container col-xs-6\">\n <ul \n className=\"list-group queue-list\"\n >\n {this.props.history.history.map(this.renderHistory.bind(this))}\n </ul>\n </div> \n );\n }", "function createHistoryButton(ingredientsArray) {\n //appends searches to search history box\n historyBox.prepend(`<div id='history-card'><p>${ingredientsArray}</p></div>`)\n}", "function DashBoardSideBar() {\n const employee = [\n {\n name: 'Vikkee Singh',\n designation: 'Field Worker',\n },\n {\n name: 'Vivek Singh',\n designation: 'Field Worker',\n },\n {\n name: 'Abhisek Singh',\n designation: 'Director',\n },\n ];\n return (\n <div className=\"sideBarContainer\">\n <div className=\"searchBox\">\n <Input\n placeholder=\"Search Employee\"\n prefix={<Icon type=\"search\" style={{ color: 'rgba(0,0,0,.25)' }} />}\n />\n </div>\n <div className=\"employeeList\">\n {employee.length &&\n employee.map((emp, i) => (\n <EmployeeWiz\n key={Number(i)}\n name={emp.name}\n designation={emp.designation}\n />\n ))}\n </div>\n </div>\n );\n}", "render() {\n return (\n <div className=\"list-view\">\n <header><h1>Theatres in Leeds</h1></header>\n <div className='search'>\n <input\n aria-label='Filter input field'\n role='Search'\n type='text'\n placeholder='Search Theatres'\n value={this.state.query}\n onChange={(queryText) => {this.updateQuery(queryText.target.value)}}\n />\n </div>\n <nav className='list-container'>\n {this.props.theatres && (\n <section className='list' role='list'>\n {this.props.theatres.map((t, inx) =>\n <button key={inx} role='listitem' onClick={evt => this.props.itemClickHandler(inx)}>{t.name}</button>\n )}\n </section>\n )}\n </nav>\n </div>\n );\n }", "function showHistoryVisits(){\n let $table=$(\"<table></table>\");\n $table.attr(\"id\",\"visitHistoryList\");\n $thead = $(\"<thead></thead>\");\n $thead.attr('id', 'visitHistoryListThead');\n $thead.html(\"<tr><th>Data</th><th>Godzina</th><th>Zwierzę</th><th>Status</th></tr>\");\n $tbody=$(\"<tbody></tbody>\");\n $tbody.attr('id','visitHistoryListTbody');\n $table.append($thead);\n $table.append($tbody);\n $(\"#contentDescription\").append($table);\n showHistoryFilterButtons();\n getMyVisits(\"ALL\");\n}", "function handleNewSearch(data){\n setNewNavigation(data);\n clearOldResults(data);\n renderResults(data);\n}", "function displayHistory() {\n let list = unorderedListTemplateStartTag;\n \n guesses.forEach((guess) => {\n list += historyMessageTemplate\n .replace(historyReplacePattern, guess.Number)\n .replace(historyStateReplacePattern, guess.State);\n });\n\n list += unorderedListTemplateEndTag;\n \n $('#history').html(list);\n}", "render(){\n\t\t// every class must have a render method \n\t\treturn(\n\t\t\t<div className=\"search-bar\">\n\t\t \t\t<input \n\t\t \t\t\tvalue = {this.state.term} // this turns into controlled component\n\t\t \t\t\tonChange={(event) => this.onInputChange(event.target.value)} />\n\t\t \t</div>\n\t\t );\n\t}", "render(){\n\t\tconst searchTerm = this.props.searchTerm\n\t\treturn(\n\t\t\t<form className=\"search-bar\">\n\t\t\t\t<input value={searchTerm} onChange={this.handleChange} type=\"text\" placeholder=\"Search...\" />\n\t\t\t\t<div>\n\t\t\t\t\t<input id=\"in-stock\" type=\"checkbox\" /> Only show products in stock\n\t\t\t\t</div>\n\t\t\t</form>\n\t\t)\n\t}", "_onSearch(event) {\n const searchDetails = event.detail;\n Object.assign(this.searchDetails, searchDetails);\n this.render();\n }", "function _drawResults() {\n let songs = store.State.songs;\n console.log(songs);\n let template = \"\";\n songs.forEach(song => (template += song.Template));\n document.getElementById(\"search-results\").innerHTML = template;\n}", "function History() {\n const history = useSelector(state => state.historyReducer);\n\n return (\n <div id=\"history\">\n <h2 class=\"label\">History</h2>\n <div className=\"history\">\n {history[0] ?\n <ul>\n {history.map((calculation, i) => (\n <li key={i}>\n {calculation.firstNumber.toString()} \n {calculation.operatorSymbol}\n {calculation.secondNumber.toString()} \n =\n {calculation.answer.toString()} \n </li>\n ))}\n </ul>\n :\n <p>loading...</p>\n }\n </div>\n </div>\n );\n}", "function doHistory(evnt) {\n\tif(evnt.state){\n\t\t//show a chef's details\n\t\tlet chef=evnt.state\n\t\ttitleEl.textContent = `Chef Name: ${chef.name}`;\n\t\timageEl.setAttribute(\"src\",chef.image);\n\t\tlocationEl.textContent = `Location: ${chef.location}`;\n levelEl.textContent = `Level: ${chef.level}`;\n cuisineEl.textContent = `Cuisine: ${chef.cuisine}`;\n descriptionEl.textContent = `Description: ${chef.description}`;\n\t\tlistDiv.classList.add(\"hide\");\n\t\tdetailsDiv.classList.remove(\"hide\");\n\t}else{\n\t\t//show the list of all the chefs\n\t\tdetailsDiv.classList.add(\"hide\");\n\t\tlistDiv.classList.remove(\"hide\");\n\t}\n\n}", "function init() {\n // gets local storage\n var storedHistory = JSON.parse(localStorage.getItem('history'))\n // If local storage isn't null\n if (storedHistory !== null) {\n // Updates storage array with the storedHistory\n storageArr = storedHistory\n var historyOLEl = document.getElementById('historyOL')\n // resets search history\n while (historyOLEl.firstChild) {\n historyOLEl.removeChild(historyOLEl.childNodes[0]);\n }\n // sets search history\n for (var i = 0; i < 4; i++) {\n if (i < storedHistory.length) {\n const historyItem = document.createElement('li')\n historyItem.textContent = storedHistory[i]\n historyOLEl.append(historyItem)\n // makes searches clickable to make them appear in search bar\n historyItem.addEventListener('click', function (event) {\n event.preventDefault();\n \n searchInputEl.value = historyItem.textContent\n \n });\n }\n }\n }\n\n return;\n}", "render() {\r\n return (\r\n <div>\r\n <div className=\"search-books\">\r\n <div className=\"search-books-bar\">\r\n <Link className=\"close-search\" to=\"/\">\r\n {\" \"}\r\n Close{\" \"}\r\n </Link>\r\n <div className=\"search-books-input-wrapper\">\r\n <input\r\n type=\"text\"\r\n placeholder=\"Search by title or author\"\r\n value={this.state.query}\r\n onChange={(event) => this.updateQuery(event.target.value)} />\r\n </div>\r\n </div>\r\n\r\n <div className=\"search-books-results\">\r\n <ol className=\"books-grid\">\r\n {\r\n this.state.searchFinding.map(results =>{\r\n let Shelf = \"none\"\r\n\r\n this.props.books.map(book => (\r\n book.id === results.id ?\r\n Shelf = book.Shelf :\r\n ''\r\n ));\r\n\r\n\r\n return (\r\n <li key={results.id}>\r\n <Book book={results}\r\n changeShelf={this.props.changeShelf}\r\n \r\n currentShelf = {Shelf}\r\n \r\n />\r\n </li>\r\n\r\n )\r\n })\r\n }\r\n\r\n\r\n\r\n \r\n\r\n </ol>\r\n </div>\r\n </div>\r\n </div>\r\n );\r\n }", "function generateHistoryLinkDiv() {\n // set type of link (FIXME, left after splitting functions for history/relation link)\n var linkType = \"changeset\";\n\n // get page language from HTML element\n var pageLang = document.getElementsByTagName('html')[0].getAttribute(\"lang\");\n\n // get changeset/relation ID from URL\n if (linkType === \"changeset\") {\n var linkedId = location.pathname.match(/^\\/changeset\\/(\\d+)/)[1];\n }\n else if (linkType === \"blame\") {\n var linkedId = location.pathname.match(/^\\/relation\\/(\\d+)/)[1];\n }\n\n // create link to OSM History Viewer/Relation Blame\n var osmhvLink = document.createElement('a');\n osmhvLink.href = \"http://osmhv.openstreetmap.de/\" + linkType + \".jsp?id=\" + encodeURIComponent(linkedId);\n if (linkType === \"changeset\") {\n osmhvLink.appendChild(document.createTextNode(changesetLinkLabel[pageLang] == null ? changesetLinkLabel[defaultLang] : changesetLinkLabel[pageLang]));\n }\n else if (linkType === \"blame\") {\n osmhvLink.appendChild(document.createTextNode(blameLinkLabel[pageLang] == null ? blameLinkLabel[defaultLang] : blameLinkLabel[pageLang]));\n }\n\n // create subDIV in sidebar for our link and append link to it\n var linkDiv = document.createElement('div');\n linkDiv.className = 'secondary-actions';\n linkDiv.appendChild(osmhvLink);\n\n\n // get first child of sidebar DIV (changeset/relation title label)\n var sidebarDiv = document.getElementById('sidebar_content').firstChild.nextSibling;\n // append osmhvlink DIV as next sibling\n sidebarDiv.parentNode.insertBefore(linkDiv, sidebarDiv.nextSibling);\n}", "searchBlog(e) {\n e.preventDefault();\n this.renderBlogs(this.state.search);\n }", "render(){\n return (\n <div>\n <SearchBar/>\n \n\n \n <div>\n <div class=\"textKnowledge\">\n\n <h2>Knowledge Base</h2>\n <h2 id=\"smallHeadingText\"><NavLink to=\"Answer\" style={{ textDecoration: 'none', color: 'black' }}>General</NavLink></h2>\n <Route path=\"/Answer\" component={Answer} />\n\n <hr />\n\n <h4>FAQ (2)</h4>\n <ul>\n <li id=\"smallHeadingText\"><NavLink to=\"Answer\" style={{ textDecoration: 'none', color: 'black' }}>What subjects do we provide? </NavLink></li>\n <Route path=\"/Answer\" component={Answer} />\n <li id=\"smallHeadingText\"><NavLink to=\"Answer\" style={{ textDecoration: 'none', color: 'black' }}>Why choose Tutorello.ie? </NavLink></li>\n <Route path=\"/Answer\" component={Answer} />\n </ul>\n\n <h4>Getting Started (2)</h4>\n <ul>\n <li id=\"smallHeadingText\"><NavLink to=\"Answer\" style={{ textDecoration: 'none', color: 'black' }}>What is supplied if you sign up for the free 14-day membership deal? </NavLink></li>\n <Route path=\"/Answer\" component={Answer} />\n <li id=\"smallHeadingText\"><NavLink to=\"Answer\" style={{ textDecoration: 'none', color: 'black' }}>How much does the full membership option cost?</NavLink></li>\n <Route path=\"/Answer\" component={Answer} />\n </ul>\n\n <h2 id=\"smallHeadingText\"><NavLink to=\"Refunds\" style={{ textDecoration: 'none', color: 'black' }}>Refunds</NavLink></h2>\n <Route path=\"/Refunds\" component={Answer} />\n <hr />\n\n <h4>Refunds (1)</h4>\n <ul>\n <li id=\"smallHeadingText\"><NavLink to=\"Refunds\" style={{ textDecoration: 'none', color: 'black' }}>I need a refund</NavLink></li>\n <Route path=\"/Refunds\" component={Answer} />\n </ul>\n\n <h2 id=\"smallHeadingText\"><NavLink to=\"InformationCollected\" style={{ textDecoration: 'none', color: 'black' }}>Information Collected</NavLink></h2>\n <Route path=\"/InformationCollected\" component={Answer} />\n <hr />\n\n <h4>Privacy Policy (2)</h4>\n <ul>\n <li id=\"smallHeadingText\"><NavLink to=\"InformationCollected\" style={{ textDecoration: 'none', color: 'black' }}>Legal Requirements</NavLink></li>\n <Route path=\"/InformationCollected\" component={Answer} />\n <li id=\"smallHeadingText\"><NavLink to=\"InformationCollected\" style={{ textDecoration: 'none', color: 'black' }}>Terms of Use</NavLink></li>\n <Route path=\"/InformationCollected\" component={Answer} />\n </ul>\n\n\n\n\n <h4>Ticket System</h4>\n <ul>\n \n <li id=\"smallHeadingText\"><NavLink to=\"CreateTicket\" style={{ textDecoration: 'none', color: 'black' }}>Request Ticket</NavLink></li>\n <Route path=\"/CreateTicket\" component={Answer} />\n </ul>\n </div>\n </div>\n\n </div>\n )\n }", "render() {\n const filteredLocations = (() => {\n const { state: { searchTerm }, props: { locations } } = this;\n if (searchTerm) {\n return locations.filter(createFilter(searchTerm.toLocaleLowerCase(), KEYS_TO_FILTERS));\n }\n return locations;\n })();\n return (\n <div id=\"location-list\">\n <button\n type=\"button\"\n tabIndex=\"0\"\n className=\"menu-button\"\n onClick={() => this.setState({ showNav: true })}\n >\n &#128463; MENU\n </button>\n <SideNav\n tabIndex=\"0\"\n openFromRight\n style={{ overflowScrolling: 'touch' }}\n showNav={this.state.showNav}\n onHideNav={() => this.setState({ showNav: false })}\n >\n <Header />\n <input\n role=\"search\"\n id=\"Search\"\n type=\"text\"\n tabIndex=\"0\"\n aria-label=\"Search in the results\"\n placeholder=\"\n &#128269; Search in the results\"\n value={this.state.searchTerm}\n onChange={e => this.searchUpdated(e.target.value)}\n />\n <h2 className=\"active-status\">\n Found\n {' '}\n {filteredLocations.length ? filteredLocations.length : 'no'}\n {' '}\n {filteredLocations.length === 1 ? 'result' : 'results'}\n </h2>\n <ul role=\"menu\" aria-label=\"Location list\">\n {filteredLocations.map(place => (\n <li\n role=\"menuitem\"\n aria-label=\"List item\"\n tabIndex=\"0\"\n className=\"LocationItems\"\n key={place.id}\n onKeyPress={() => this.populateInfoWindow(place.marker)}\n onClick={() => this.populateInfoWindow(place.marker)}\n >\n {place.name}\n </li>\n ))}\n </ul>\n <Footer />\n </SideNav>\n </div>\n );\n }", "render() {\n return (\n <div>\n <h1>Ja<span className=\"highlight\">mmm</span>ing</h1>\n <div className=\"App\">\n <SearchBar onSearch={this.search} />\n <div className=\"App-playlist\">\n <SearchResults searchResults={this.state.searchResults}\n onAdd={this.addTrack}/>\n <PlayList name={this.state.playlistName}\n tracks={this.state.playlistTracks} onRemove={this.removeTrack}\n onNameChange={this.updatePlaylistName} onSave={this.savePlaylist} />\n </div>\n </div>\n </div>\n );\n }", "renderAddBooks() {\n var searchResults = this.state.searchResults;\n return (\n <div className='search-view'>\n <p>Search for books to add to your profile.</p>\n <AddBook\n onClickAdd={this.addBook}\n onClickSearch={this.searchBook}\n searchResults={searchResults}\n waitingSearch={this.state.waitingSearch}\n />\n </div>\n );\n }", "render() {\n return (\n <div>\n <div className=\"search-query\">\n <span>\n Search: {Moment(this.state.search.startDate).format(this.state.dateFormat)} - {Moment(this.state.search.endDate).format(this.state.dateFormat)}\n </span>\n </div>\n <div className=\"campgrounds-container\">\n <Campsites\n campsites={this.state.campsites}\n dateFormat={this.state.dateFormat}\n gapRules={this.state.gapRules}\n reservations={this.state.reservations}\n search={this.state.search}\n />\n </div>\n </div>\n );\n }", "function displayNewSearchResults(event) {\n let searchTerm = event.target.value;\n let currentSearch = giphy[\"query\"][\"q\"];\n if (searchTerm !== currentSearch && searchTerm !== \"\") {\n giphy[\"query\"][\"q\"] = searchTerm;\n updateOffset(true);\n update();\n }\n}", "function render(history) {\n console.log(history);\n if (history.length > 0) {\n $('.js-total').text(history[history.length - 1].total);\n }\n\n $('.js-history').empty();\n for (let equation of history) {\n $('.js-history').append(\n `<li>${equation.input1} ${equation.operator} ${\n equation.input2\n } = ${parseInt(equation.total)}</li>`\n );\n }\n}", "render() {\n //console.log(this.state.books);\n\t\treturn (\n\t\t\t<div className=\"list-books\"> \n <div className=\"list-books-title\">\n <h1>MyReads</h1>\n </div>\n \n <div className=\"list-books-content\">\n \n {\n //pass books to their shelf\n } \n { this.state.books && \n (<div> <Shelf books={ this.state.books.filter((book)=> book.shelf === \"currentlyReading\")} name=\"Currently Reading\" onShelfChange={this.shelfChange}/>\n <Shelf books={ this.state.books.filter((book)=> book.shelf === \"read\")} name=\"Read\" onShelfChange={this.shelfChange}/>\n <Shelf books={ this.state.books.filter((book)=> book.shelf === \"wantToRead\")} name=\"Want To Read\" onShelfChange={this.shelfChange}/>\n </div> )\n }\n \n </div>\n\n <div className=\"open-search\">\n \t<Link to=\"/search\">Add Contact</Link>\n </div>\n </div>\n\t\t\t)\n\t}", "onActionClickSearchBar() {\n this.search(this.state.search)\n }", "render() {\n return (\n <div id=\"navMenu\" className=\"o-navbar\">\n <NavList />\n\n <Search />\n </div>\n )\n }", "function makeList() {\n\t\t\t\tsearchHistory.removeClass(\"hide\");\n\t\t\t\tweatherStage.removeClass(\"hide\");\n\n\t\t\t\tvar listItem = $(`<p class=\"padding\">`).text(city);\n\t\t\t\t$(\"#search-history\").append(listItem);\n\t\t\t\t// Prepend search items so they appear at the front\n\t\t\t\tconsole.log(response);\n\t\t\t}", "renderHistory(historyData, index) {\n const title = historyData.video.snippet.title.length > 50 ? \n historyData.video.snippet.title.substring(0, 50) + \"...\" : historyData.video.snippet.title;\n\n return (\n <QueueListItem \n onSelectVideo={this.props.onQueueVideo} \n deleteVideo={this.props.deleteArchive}\n videoData={historyData.video}\n key={index}\n id={index}\n title={title} />\n );\n }", "render(){ // see it says raindeer right here\n\t\treturn (\n\t\t<div> {/*^ this says that i will let u return the raindeers to the pole */}\n\t\t\t<h1>Ja<span className=\"highlight\">mmm</span>ing</h1>\n\t\t\t<h1 className=\"Description\">Make Your Spotify Playlist</h1>\n\t\t\t<div className=\"App\">\n\t\t\t<SearchBar onSearch={this.search}/>\n\t\t\t<div className=\"App-playlist\">\n\t\t\t<SearchResults searchResults={this.state.searchResults} \n\t\t\t\t\t\t\tonAdd={this.addTrack}\n\t\t\t\t\t\t\tonRemove={this.removeTrack} />\n\t\t\t<Playlist playlistTracks={this.state.playlistTracks}\n\t\t\t\t\t\t\tonRemove={this.removeTrack}\n\t\t\t\t\t\t\tonNameChange={this.updatePlaylistName}\n\t\t\t\t\t\t\tonSave={this.savePlaylist}/> \n\t\t\t</div> \n\t\t\t</div>\n\t\t</div>\n\t\t);\n\t}", "function dispalySearchHistory() {\n //Retrieve objects from localStorage\n let searchHistory = JSON.parse(localStorage.getItem(\"citySearchHistory\"));\n //If there are not any objects in localStorage, don't do anything else\n if(!searchHistory){\n return;\n };\n //Adds buttons for each object\n for(i = 0; i < searchHistory.length; i++){\n newCityButton = $('<button>');\n newCityButton.addClass('btn btn-primary mb-1');\n cityButtonName = searchHistory[i].city;\n cityButtonID = cityButtonName.trim().toLowerCase().split(' ').join('+');\n newCityButton.attr('id', cityButtonID);\n newCityButton.html(cityButtonName);\n //Prepends the buttons to the html\n $('#city-buttons').prepend(newCityButton);\n };\n}", "_renderWorkoutFrom_LocalStorageToSideBar() {\r\n const data = JSON.parse(localStorage.getItem(\"workouts\"));\r\n if (!data) return;\r\n this.#workouts = data;\r\n this.#workouts.forEach(workout => this._renderWorkoutOnSideBar(workout));\r\n }", "render(){\n\n\t\t//return <input onChange={this.onInputChange} />;\n\n\t\treturn(\n\t\t\t //below input is a controled input and its value is controled by state term\n\t\t\t<div className=\"search-bar\">\n\t\t\t\n\t\t\t\t<input value={this.state.term}\n\n\t\t\t\tonChange={event=> this.onInputChange(event.target.value)} />\n\t\t\t\t\n\t\t\t</div>\n\n\t\t\t) \n\t}", "render() {\n\n // Canviem els this.states per this.props en el cas de fer servir l'store\n return <main className=\"container\">\n <SearchForm onSubmit={this.onSubmit} search={this.props.search}/>\n <RepositoryList\n data={this.props.results} search={this.props.search}\n loading={this.props.loading} queried={this.props.queried}/>\n </main>;\n }", "render() {\n return (\n <div>>\n <div className=\"topcontainer container\" style={ styles.topcontainer }>\n <p><span style={styles.header}>Search for a book</span></p>\n <div className=\"form form-group cfix\">\n <input type=\"text\" className=\"form-control\" value={this.state.value} onChange={this.handleChange}></input>\n \n <p><span style={styles.statusmessage}>{this.state.message}</span></p>\n <input className=\"btn btn-primary\" type=\"submit\" value=\"Search\" style={styles.button} onClick={this.handleSubmit}/>\n </div>\n </div>\n <div className=\"container\" style={ styles.container }>\n {this.state.books.length ? (\n <div> \n <p><span style={styles.header}>Search results</span></p>\n <ul style={styles.ul}>\n {this.state.books.map(book => (\n <Book key={book.id}\n title={book.volumeInfo.title}\n author={book.volumeInfo.authors[0]}\n description={book.volumeInfo.description}\n image={book.volumeInfo.imageLinks.thumbnail}\n link={book.volumeInfo.infoLink}\n buttonText={\"Save\"}\n onSave={() => this.handleSave(book.id)}\n />\n ))}\n </ul>\n </div>\n ) : (\n <p><span style={styles.header}>No results to display</span></p>\n )}\n </div>\n </div>\n );\n }", "render(){\n let repos = this.state.repos;\n let hasRepos = (typeof(repos) === 'object' && Object.keys(this.state.repos).length > 0);\n let headerMessage = (this.state.searching ? `Fetching results for: ${this.state.query}` : `Showing results for: ${this.state.lastQuery}`);\n if(this.state.hasRetrieved === true && this.state.repos.length === 0){\n headerMessage = (this.state.query.length === 0 ? \"Query cannot be empty\": `No repos were found matching ${this.state.query}`);\n }\n return (\n <div className=\"App\">\n <div className='get-repos-container app-header'>\n <this.renderQueryBar/>\n </div>\n <div className='app-body'>\n {(this.state.searching || this.state.hasRetrieved) ?\n <Paper className='results'><Typography>{headerMessage}</Typography></Paper>\n : \n null\n }\n {hasRepos === true ? \n <RepoList lastQuery={this.state.lastQuery} repos={repos}/>\n : \n null\n }\n </div>\n </div>\n );\n }", "render() {\n\t\treturn(\n\t\t\t<section className='search-bar'>\n\t\t\t\t<label>Search</label>\n\t\t\t\t<input\n\t\t\t\t\tvalue = {this.state.term}\n\t\t\t\t\t// rather than calling directly to the SearchBar props,\n\t\t\t\t\t// call a separate method (below)\n\t\t\t\t\tonChange={ event => this.onInputChange(event.target.value) }\n\t\t\t\t/>\n\t\t\t\t<br/>\n\t\t\t</section>\n\t\t);\n\t}", "addSearchHTML() {\n\t/* The following is the jQuery method to display live search window.\n\t The argument of append() has back quote, since it has HTML elements, which are \n\t defined by more than one line.\t*/ \n \t$(\"body\").append(` \n \t\t<div class=\"search-overlay\">\n\t\t <div class=\"search-overlay__top\">\n\t\t <div class=\"container\">\n\t\t <i class=\"fa fa-search search-overlay__icon\" aria-hidden=\"true\"></i>\n\t\t <input type=\"text\" class=\"search-term\" placeholder=\"What are you looking for?\" id=\"search-term\">\n\t\t <i class=\"fa fa-window-close search-overlay__close\" aria-hidden=\"true\"></i>\n\t\t </div>\n\t\t </div>\n\n\t\t <div class=\"container\">\n\t\t <div id=\"search-overlay__results\"></div>\n\t\t </div>\n \t\t</div>\n `);\n }", "function pastSearch() {\n for (var i = 0; i < cities.length; i++) {\n var button = $(\"<button>\");\n button.text(cities[i]).appendTo(\"#history\");\n $(button).addClass(\"btn btn-light\");\n }\n }" ]
[ "0.7022282", "0.68599397", "0.6753106", "0.6540701", "0.64023733", "0.63515586", "0.6346039", "0.6341267", "0.6274871", "0.6132972", "0.611475", "0.6103948", "0.60996795", "0.60921645", "0.60869604", "0.608087", "0.6037994", "0.6031692", "0.6020746", "0.5986857", "0.59419715", "0.5935235", "0.5932454", "0.59208614", "0.58913106", "0.5870211", "0.5793446", "0.5771558", "0.5747349", "0.57399815", "0.573758", "0.57370913", "0.5720599", "0.57074213", "0.5704961", "0.5688042", "0.56530124", "0.565159", "0.5633854", "0.5625342", "0.56179297", "0.5616392", "0.56071144", "0.5605041", "0.5598997", "0.55972886", "0.5579542", "0.5579536", "0.555314", "0.55484724", "0.5524201", "0.55235744", "0.5514744", "0.55123717", "0.55091465", "0.55047643", "0.5491053", "0.54887164", "0.54865736", "0.5486209", "0.5483485", "0.5469793", "0.54687893", "0.5463369", "0.54610515", "0.5427067", "0.5423643", "0.542108", "0.5416472", "0.5411721", "0.54067034", "0.5406285", "0.5404124", "0.5399024", "0.53932106", "0.5391864", "0.53917307", "0.5390905", "0.53902674", "0.539024", "0.53897995", "0.53892463", "0.5385787", "0.5383656", "0.53809816", "0.53758836", "0.5372242", "0.5368929", "0.53645223", "0.53636855", "0.5363534", "0.53581697", "0.5355484", "0.53449404", "0.53442276", "0.53436726", "0.53391916", "0.53382874", "0.53374463", "0.53366953" ]
0.6297695
8
FUnction to render the current weather
function renderCurrentWeather(dataCurrentWeather) { const weatherCityName = dataCurrentWeather.name; const weatherCondition = dataCurrentWeather.weather[0].main; const weatherTemp = dataCurrentWeather.main.temp; const weatherHumidity = dataCurrentWeather.main.humidity; const weatherWind = dataCurrentWeather.wind.speed; weatherLat = dataCurrentWeather.coord.lat; weatherLon = dataCurrentWeather.coord.lon; localStorage.setItem("lastSearchedCity", weatherCityName); ////////Storage Search City to local storage//// function saveCityToLocalStorage(item) { let localStorageMessage = $("#weather-search-bar").val().toUpperCase(); let inputbarParentID = $("#weather-search-bar").val().toUpperCase(); if (localStorage.getItem(localStorageMessage)) { //pass } else { localStorage.setItem(inputbarParentID, localStorageMessage); $("#recent-history").append( $("<li>").text(localStorageMessage).addClass("recentHistory") ); } } saveCityToLocalStorage(); ////////////////////////Append the information to the html/////////////// $("#current-weather-container") .children("h1") .html("You can viewing the weather report of: " + weatherCityName); $("#current-weather-container-condition").html( "Today weather condition is: " + weatherCondition ); $("#current-weather-container-temp").html( "Today tempature is: " + weatherTemp + " C" ); $("#current-weather-container-humidity").html( "Today humidity is: " + weatherHumidity ); $("#current-weather-container-wind").html( "Today windspeed is: " + weatherWind ); //////////////////////Because the UV is existing in another API, I need to call UV API////////////////////// //////////////////Now enjoy this spaghetti//////// const settings_1 = { url: "http://api.openweathermap.org/data/2.5/uvi?appid=c1f7f71746ba6e7fda1ac3eca46c4500&lat=" + weatherLat + "&lon=" + weatherLon, method: "GET", }; function renderUV(dataUV) { let weatherUV = dataUV.value; $("#current-weather-container-uv").html("Today UV is: " + weatherUV); if (weatherUV >= 0 && weatherUV < 3) { $("#current-weather-container-uv").css("background-color", "green"); } else if (weatherUV >= 3 && weatherUV < 6) { $("#current-weather-container-uv").css("background-color", "yellow"); } else if (weatherUV >= 6 && weatherUV < 8) { $("#current-weather-container-uv").css("background-color", "orange"); } else if (weatherUV >= 8 && weatherUV < 11) { $("#current-weather-container-uv").css("background-color", "red"); } else if (weatherUV >= 11) { $("#current-weather-container-uv").css("background-color", "purple"); } else { $("#current-weather-container-uv").html("ESCAPE FROM MOTHER EARTH!!"); } } $.ajax(settings_1).then(renderUV).catch(errorFunction); ////////////////////////////////////////////////////////////////////// }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderWeather(data) {\n\toutputLocation.textContent = data.name + \", \" + data.sys.country;\n\toutputTemp.textContent = Math.round(data.main.temp);\n\toutputDesc.textContent = \" \" + data.weather[0].description;\n\toutputMaxTemp.textContent = \" \" + Math.round(data.main.temp_max);\n\toutputMinTemp.textContent = \" \" + Math.round(data.main.temp_min);\n\toutputWind.textContent = Math.round(data.wind.speed);\n\toutputHumidity.textContent = data.main.humidity;\n \n}", "function showWeather() {\r\n // remove loader\r\n clearLoader();\r\n\r\n // update state\r\n state.lastUpdate = Date.now();\r\n\r\n // render elements\r\n renderElements();\r\n\r\n // time\r\n state.intervalID = setInterval(updateTime, 1000);\r\n}", "function drawWeather() {\n console.log(\"THE WEATHER MAN SAYS:\", ProxyState.weather);\n let template = ProxyState.weather.Template;\n document.getElementById(\"weather-display\").innerHTML = template;\n}", "function getWeather() {\n\t\tcity.innerHTML = `${forecast.city},` + `${forecast.country}`;\n\t\tweather.innerHTML = `${forecast.description}`;\n\t\ttemp.innerHTML = `Current Temp:${forecast.temperature}&degC`;\n\t\ticon.innerHTML = `<img src=\"assets/${forecast.image}.png\">`;\n\n\t\tsearch.value = '';\n\t}", "function drawWeather() {\n\tlet weather = document.getElementById(\"weather\")\n\tweather.style.backgroundColor = \"rgba(0,0,0,.4)\"\n\tweather.style.color = \"white\"\n\tlet temp = _weatherService.Weather\n\t// @ts-ignore\n\tweather.innerHTML = `${temp.tempF}°F <br>${temp.description}`\n}", "function renderCurrentWeather() {\n $(\"#curr-city-date\").text(currentWeather.city + \" \" + currentWeather.date);\n $(\"#curr-icon\").attr(\"src\", \"http://openweathermap.org/img/wn/\" + currentWeather.weatherIcon + \"@2x.png\");\n $(\"#curr-temp\").text(currentWeather.temperature);\n $(\"#curr-humidity\").text(currentWeather.humidity);\n $(\"#wind-speed\").text(currentWeather.windSpeed);\n}", "function renderCurrentWeather(location, temperature, humidity, windSpeed, uv, condition) {\n $(\"#welcome\").css(\"display\", \"none\");\n $(\"#currentWeather, #forecast\").css(\"display\", \"block\");\n $(\"#location\").empty().append(`${location} `);\n let date = moment().format(\"MM\" + \"/\" + \"DD\" + \"/\" + \"YYYY\");\n $(\"#location\").append(`${date} `);\n\n let icon = $(\"<span>\");\n icon.addClass(getIcon(condition));\n $(\"#location\").append(icon);\n\n $(\"#temperature\").empty().append(`${temperature} °F`);\n\n $(\"#humidity\").empty().append(`${humidity}%`);\n\n $(\"#windSpeed\").empty().append(`${windSpeed} MPH`);\n\n let uvWarnings = {\n green: \"* You can safely stay outside using standard daily sun protection: broad spectrum SPF 30+ sunscreen containing zinc, sunglasses, and hat. Don't forget: in winter, reflection off snow can nearly double UV strength.\",\n yellow: \"* Stay in the shade during late morning through mid-afternoon. Wear broad spectrum SPF 30+ sunscreen containing zinc, sunglasses, and hat.\",\n orange: \"* Stay in the shade as much as possible, especially during late morning through mid-afternoon. Wear broad spectrum SPF 30+ sunscreen containing zinc, protective clothing (long-sleeved shirt and pants), sunglasses, and wide-brimmed hat.\",\n red: \"* Extra protection needed. Be careful outside, especially during late morning through mid-afternoon. Stay in the shade as much as possible, especially during late morning through mid-afternoon. Wear broad spectrum SPF 30+ sunscreen containing zinc, protective clothing (long-sleeved shirt and pants), sunglasses, and wide-brimmed hat. Please note: white sand on the beach will reflect UV rays and can double UV exposure.\",\n purple: \"* Extra protection needed. Avoid sun exposure during late morning through mid-afternoon. Unprotected skin and eyes can burn in minutes. Wear broad spectrum SPF 30+ sunscreen containing zinc, protective clothing (like long-sleeves), sunglasses, and wide-brimmed hat. Please note: white sand on the beach will reflect UV rays and can double UV exposure.\"\n }\n\n let warnings = [];\n let uvWarning = $(\"<div>\");\n if (uv < 3) {\n $(\"#uv\").css(\"background-color\", \"green\");\n uvWarning.append(uvWarnings.green);\n }\n else if (uv < 6) {\n $(\"#uv\").css(\"background-color\", \"yellow\");\n uvWarning.append(uvWarnings.yellow);\n }\n else if (uv < 8) {\n $(\"#uv\").css(\"background-color\", \"orange\");\n uvWarning.append(uvWarnings.orange);\n }\n else if (uv < 11) {\n $(\"#uv\").css(\"background-color\", \"red\");\n uvWarning.append(uvWarnings.red);\n }\n else {\n $(\"#uv\").css(\"background-color\", \"purple\");\n uvWarning.append(uvWarnings.purple);\n }\n $(\"#warnings\").empty().append(uvWarning);\n $(\"#uv\").empty().append(uv);\n}", "render(weather) {\n console.log(weather);\n this.location.textContent = weather.name + \" / \" + weather.sys.country;\n this.desc.textContent = weather.weather[0][\"description\"];\n this.string.textContent = weather.main.temp + \" °C\";\n this.humidity.textContent = \"Humedad: \" + weather.main.humidity + \"°C\";\n this.wind.textContent = \"Vel. Viento: \" + weather.wind.speed + \" m/s\";\n\n //ACA MUESTRA LA TEMPERATURA MAXIMA\n this.max.textContent = \"MAX: \" + weather.main.temp_max + \"°C\";\n //ACA MUESTRA LA TEMPERATURA MINIMA\n this.min.textContent = \"MIN: \" + weather.main.temp_min + \"°C\";\n }", "function displayWeather() {\n locationElement.innerHTML = `${weather.city}, ${weather.country}`; // City/Country name\n iconElement.innerHTML = `<img src=\"icons/${weather.iconId}.png\"/>`; // Icon\n tempElement.innerHTML = `${weather.temperature.value}°<span>F</span>`; // Temp\n descElement.innerHTML = `${weather.description}`; // Short description\n descElementDaily.innerHTML = dailyDescription(); // Daily description\n sunRiseElement.innerHTML = `<span class=\"lightText\">Sunrise</span> <br>${weather.sunrise} AM`; // Sunrise\n sunSetElement.innerHTML = `<span class=\"lightText\">Sunset</span> <br>${weather.sunset} PM`; // Sunset\n windElement.innerHTML = `<span class=\"lightText\">Wind</span> <br>${weather.wind} mph`; // Wind speed\n gustElement.innerHTML = `<span class=\"lightText\">Gust</span> <br>${weather.gust} mph`; // Gust speed\n feelsLikeElement.innerHTML = `<span class=\"lightText\">Feels-like</span> <br>${weather.feels_like} °F`; // Feels-like\n humidityElement.innerHTML = `<span class=\"lightText\">Humidity</span> <br>${weather.humidity}%`; // Humidity \n tempMinElement.innerHTML = `<span class=\"lightText\">Min-temp</span> <br>${weather.temp_min} °F`; // Temp_min\n tempMaxElement.innerHTML = `<span class=\"lightText\">Max-temp</span> <br>${weather.temp_max} °F`; // Temp_max\n}", "function showWeather() {\ngiveCity()\npreForecast()\nfutureFore() \n}", "function displayWeather(response) {\n lastSearchedCityWeather = response;\n displayTemp(lastSearchedCityWeather.data.main.temp);\n\n // Update city name\n let cityName = document.querySelector(\"#searchedCity\");\n cityName.innerHTML = lastSearchedCityWeather.data.name.toUpperCase();\n\n // Update wind speed\n document.querySelector(\"#wind_Speed\").innerHTML = lastSearchedCityWeather.data.wind.speed;\n\n // Update Rain\n if (lastSearchedCityWeather.data.rain === undefined) {\n document.querySelector(\"#rain_Amount\").innerHTML = 0;\n } else {\n document.querySelector(\"#rain_Amount\").innerHTML =\n lastSearchedCityWeather.data.rain[\"1h\"];\n }\n // Update weather description\n document.querySelector(\"#weather_Description\").innerHTML = lastSearchedCityWeather.data.weather[0].description.toUpperCase();\n\n // Update weather icon\n let currentWeatherIcon = document.querySelector(\"#today_Icon\");\n currentWeatherIcon.setAttribute(\"src\",`https://openweathermap.org/img/wn/${lastSearchedCityWeather.data.weather[0].icon}@2x.png`);\n currentWeatherIcon.setAttribute(\"alt\",lastSearchedCityWeather.data.weather[0].description);\n\n // Update feels like\n document.querySelector(\"#feels_Like\").innerHTML =lastSearchedCityWeather.data.main.feels_like;\n\n // Update humidity\n document.querySelector(\"#humidity\").innerHTML =lastSearchedCityWeather.data.main.humidity + \"%\";\n\n addUnits();\n \n //Forecast\n getForecast();\n\n}", "function displayWeather(response) {\n console.log(response);\n let cityPosition = document.querySelector(\"#city\");\n cityPosition.innerHTML = response.data.name;\n let currentTemp = document.querySelector(\"#currentTemp\");\n let country = document.querySelector(\"#country\");\n let discription = document.querySelector(\"#discription\");\n let humidity = document.querySelector(\"#humidity\");\n let wind = document.querySelector(\"#wind\");\n\n currentTemp.innerHTML = `${Math.round(response.data.main.temp)}°`;\n country.innerHTML = `, ${response.data.sys.country}`;\n discription.innerHTML = response.data.weather[0].description;\n humidity.innerHTML = `${response.data.main.humidity}%`;\n wind.innerHTML = `${Math.round(response.data.wind.speed * 3.6)} km/h`;\n\n //updateing global temperature variable for conversion\n globalTempCelsius = response.data.main.temp;\n\n //icon \n document.querySelector(\"#icon\").innerHTML = `<img src=\"http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png\" width = 90px>`;\n \n // formatting time\n //calculate time difference from UTC at current position \n let localTimestamp = new Date().getTime();\n localOffsetToUTC = new Date().getTimezoneOffset()*60000;\n cityOffsettoUTC = response.data.timezone *1000;\n let timestamp = localTimestamp + localOffsetToUTC + cityOffsettoUTC;\n\n changeTime (timestamp);\n \n}", "function displayWeather(response){\n let cityName = document.querySelector(\"#city\");\n let temperatureValue = document.querySelector(\"#temperature\");\n let weatherDescription = document.querySelector(\"#currentDescription\");\n let humidityValue =document.querySelector(\"#humidity\");\n let windValue = document.querySelector(\"#wind\");\n let iconElement = document.querySelector(\"#weatherIcon\");\n let currentDate = document.querySelector(\"#currenTime\");\n\n celsiusTemperature = response.data.main.temp;\n\n cityName.innerHTML= response.data.name;\n temperatureValue.innerHTML= Math.round(celsiusTemperature);\n weatherDescription.innerHTML= response.data.weather[0].description;\n humidityValue.innerHTML= Math.round(response.data.main.humidity);\n windValue.innerHTML= Math.round(response.data.wind.speed);\n iconElement.setAttribute(\"src\",`image/${response.data.weather[0].icon}.png`)\n iconElement.setAttribute(\"alt\",response.data.weather[0].description);\n currentDate.innerHTML = formatDate(response.data.dt * 1000);\n \n}", "paint(weather) {\n document.title = `Weather for ${weather.forecastCity}, ${weather.forecastState}`;\n this.location.textContent = `${weather.forecastCity}, ${weather.forecastState}`;\n this.currentDesc.textContent =\n weather.currentConditions.textDescription;\n this.currentTemp.textContent = toFahr(\n weather.currentConditions.temperature.value\n );\n this.currentHumidity.textContent =\n Math.round(weather.currentConditions.relativeHumidity.value) + \"%\";\n let feelsLike = weather.currentConditions.windChill.value;\n if (feelsLike === null) {\n feelsLike = weather.currentConditions.heatIndex.value;\n }\n this.currentFeelsLike.textContent = toFahr(feelsLike);\n const windDir = toWindDir(\n weather.currentConditions.windDirection.value\n );\n const windSpeed = toMPH(weather.currentConditions.windSpeed.value);\n this.currentWind.textContent = `${windDir} at ${windSpeed} mph`;\n this.currentDewpoint.textContent =\n toFahr(weather.currentConditions.dewpoint.value) + \"\\u00B0\";\n this.currIcon.setAttribute(\"src\", weather.currentConditions.icon);\n this.currIcon.setAttribute(\n \"alt\",\n weather.currentConditions.textDescription\n );\n this.insertDailyForecastRows(weather.dailyForecast);\n this.insertHourlyForecastrows(weather.hourlyForecast);\n }", "function displayWeather({ main, wind, name, weather }) {\n // console.log(\"weather\", response);\n $(\"#temp\").text(main.temp);\n $(\"#humidity\").text(main.humidity);\n $(\"#wind\").text(wind.speed);\n $(\"#cityAndDate\").text(\n `${name} (${moment().format(\"dddd MMMM Do, YYYY\")})`\n );\n const iconUrl = `https://openweathermap.org/img/wn/${weather[0].icon}@2x.png`;\n\n $(\"#weatherIcon\").attr(\"src\", iconUrl);\n }", "function currentWeather(response) {\n var cityValue = response.name;\n var iconValue = $(\"<img>\").attr(\"src\", \"https://openweathermap.org/img/wn/\" + response.weather[0].icon + \".png\").addClass(\"bg-primary rounded\");\n var tempValue = (response.main.temp - 273.15) * 1.8 + 32;\n var humidityValue = response.main.humidity;\n var windSpeedValue = response.wind.speed;\n\n // Get lat and lon from response\n var latValue = response.coord.lat;\n var lonValue = response.coord.lon;\n\n // Display weather data browser by append to html\n cityEl.text((cityValue) + \" (\" + todayDate + \" ) \");\n cityEl.append(iconValue);\n temperatureEl.text(\"Temperature: \" + tempValue.toFixed(1) + \" °F\");\n humidityEl.text(\"Humidity: \" + humidityValue + \"%\");\n windspeedEl.text(\"Wind Speed: \" + windSpeedValue);\n\n // Get LAT and LON values and pass to uvIndexWeather() function\n uvIndexWeather(latValue, lonValue);\n forecastWeather(latValue, lonValue);\n}", "function displayCurrentWeather (response) {\n document.querySelector(\"h1\").innerHTML = response.data.name;\n document.querySelector(\".current-weather-description\").innerHTML = response.data.weather[0].description;\n document.querySelector(\"#cloudiness-value\").innerHTML = `${response.data.clouds.all}%`;\n document.querySelector(\"#humidity-value\").innerHTML = `${response.data.main.humidity}%`;\n document.querySelector(\"#wind-value\").innerHTML = `${Math.round(response.data.wind.speed)}mph`;\n\n celsiusTemperature = document.querySelector(\"#temperature-value\").innerHTML = Math.round(response.data.main.temp);\n\n let iconElement = document.querySelector(\"#current-weather-icon\")\n let icon = response.data.weather[0].icon\n iconElement.setAttribute (\"src\", `media/${icon}.png`)\n\n let dateElement = document.querySelector(\"#current-date\");\n dateElement.innerHTML = formatDate(response.data.dt*1000);\n}", "function displayWeather() {\n locationElement.textContent = `${weather.city}, ${weather.country}`;\n weatherIconElement.innerHTML = `<img src=\"./icons/${weather.iconID}.svg\" alt=\"icon\">`;\n descElement.textContent = `${weather.description}`;\n tempElement.innerHTML = `${weather.temperature.value}<span>°c</span>`;\n humidityElement.innerHTML = `<img class=\"humidity-icon\" src=\"./extraicons/humidity.svg\" alt=\"humidity\">${weather.humidity}`;\n}", "function renderWeather(weatherData) {\n addTabs(weatherData, 'Air');\n displayWeather(weatherData);\n}", "function displayTemperature(response) {\n let cityElement = document.querySelector(\"#city-name\");\n let humid = response.data.main.humidity;\n let humidityElement = document.querySelector(\"#humidity-read\");\n let precipitation = Math.round(response.data.main.temp);\n let precipitationElement = document.querySelector(\"#precip-read\"); \n let wind = Math.round(response.data.wind.speed);\n let windElement = document.querySelector(\"#wind-read\");\n let feel = Math.round(response.data.main.feels_like);\n let feelElement = document.querySelector(\"#feel-read\");\n let temp = Math.round(response.data.main.temp);\n let temperatureElement = document.querySelector(\"#read-out\");\n let description = response.data.weather[0].main;\n let descriptionElement = document.querySelector(\"#describe-read\");\n let dateElement = document.querySelector(\"#current-data\");\n let visualElement = document.querySelector(\"#representation\");\n \n farenheitTemp = response.data.main.temp;\n\n cityElement.innerHTML = response.data.name;\n humidityElement.innerHTML = `Humidity: ${humid}%`;\n precipitationElement.innerHTML = `Precipitation: ${precipitation}%`;\n windElement.innerHTML = `Wind Speed: ${wind} km/h`;\n feelElement.innerHTML = `It feels like ${feel}°F`;\n temperatureElement.innerHTML = `${temp}°F`;\n descriptionElement.innerHTML = `Currently: ${description}`;\n dateElement.innerHTML = formatDate(response.data.dt * 1000)\n visualElement.setAttribute(\n \"src\",\n `https://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n\n getForecast(response.data.coord)\n}", "function renderWeather(data) {\n\tlet timestamp = data[0].dt;\n\tlet date = new Date(timestamp * 1000);\n\n\tlet dayOfWeek = date.toLocaleDateString(undefined, {\n\t\tday: 'numeric',\n\t\tmonth: 'short',\n\t\tyear: 'numeric',\n\t});\n\n\tlet time = new Date(data[1].dt * 1000).toLocaleTimeString(undefined, {\n\t\tday: 'numeric',\n\t\tmonth: 'short',\n\t\thour: '2-digit',\n\t});\n\n\tlet sunrise = new Date(data[0].sunrise * 1000).toLocaleTimeString(undefined, {\n\t\thour: '2-digit',\n\t\tminute: '2-digit',\n\t});\n\n\tlet sunset = new Date(data[0].sunset * 1000).toLocaleTimeString(undefined, {\n\t\thour: '2-digit',\n\t\tminute: '2-digit',\n\t});\n\n\tlet temp = parseInt(data[0].temp.day);\n\tlet feels = parseInt(data[0].feels_like.day);\n\tlet max = parseInt(data[0].temp.max);\n\tlet min = parseInt(data[0].temp.min);\n\tlet rain = parseInt(data[0].pop);\n\tlet wind = parseInt(data[0].wind_speed);\n\tlet description = data[0].weather[0].description;\n\tlet uv = parseInt(data[0].uvi);\n\tlet windDeg;\n\n\tif (data[0].wind_deg > 90 && data[0].wind_deg < 180) {\n\t\twindDeg = 'SE';\n\t} else if (data[0].wind_deg > 180 && data[0].wind_deg < 270) {\n\t\twindDeg = 'SW';\n\t} else if (data[0].wind_deg > 270 && data[0].wind_deg < 360) {\n\t\twindDeg = 'NW';\n\t} else if (data[0].wind_deg < 90) {\n\t\twindDeg = 'NE';\n\t}\n\n\treturn `\n \n <div class=\"front\">\n\n <div class=\"top\">\n <div class=\"week\">${dayOfWeek}.</div>\n </div>\n\n <div class=\"current\">\n <div class=\"icon\">\n <img src=\"https://openweathermap.org/img/wn/${data[0].weather[0].icon}@2x.png\">\n <h1><span>${temp}°C</span></h1>\n </div>\n \n <div class=\"text\">\n <p> Feels Like ${feels}°C</p>\n <p>${description}</p>\n </div>\n </div>\n\n <div class=\"forecast\">\n\n <div class=\"row\">\n <div class=\"left\">Temperature</div>\n <div class=\"right\"> ${max}°C/${min}°C</div>\n </div>\n\n <div class=\"row\">\n <div class=\"left\">Humidity</div>\n <div class=\"right\">${data[0].humidity}%</div>\n </div>\n\n <div class=\"row\">\n <div class=\"left\">Precipitation</div>\n <div class=\"right\">${rain}%</div>\n </div>\n\n <div class=\"row\">\n <div class=\"left\">Pressure</div>\n <div class=\"right\">${data[0].pressure}mbar</div>\n </div>\n\n <div class=\" row\">\n <div class=\"left\">Wind Speed</div>\n <div class=\"right\">${wind}km/h</div>\n </div>\n\n <div class=\" row\">\n <div class=\"left\">Wind Direction</div>\n <div class=\"right\">${data[0].wind_deg}°${windDeg}</div>\n </div>\n\n\n <div class=\"row\">\n <div class=\"left\">Morning</div>\n <div class=\"right\">${data[0].temp.morn}°C</div>\n </div>\n\n <div class=\"row\">\n <div class=\"left\">Sunrise</div>\n <div class=\"right\">${sunrise}</div>\n </div>\n\n <div class=\"last\" id=\"tr\">\n <div class=\"left\">Night</div>\n <div class=\"right\">${data[0].temp.night}°C</div>\n </div>\n\n <div class=\"last\">\n <div class=\"left\">Sunset</div>\n <div class=\"right\">${sunset}</div>\n </div>\n\n </div>\n </div>\n \n </div>`;\n}", "function showTemp(response){\n //search Temp\n let currentTemp = Math.round(response.data.main.temp);\n let currentCelcius = document.querySelector(\"#degrees\");\n currentCelcius.innerHTML = currentTemp;\n //search Desc\n let descValue = response.data.weather[0].description;\n let currentDesc = document.querySelector(\"#desc\");\n currentDesc.innerHTML = descValue;\n //search Temp Min & Max\n let tempMinValue = Math.round(response.data.main.temp_min);\n let tempMin = document.querySelector(\"#min\");\n tempMin.innerHTML = tempMinValue;\n let tempMaxValue = Math.round(response.data.main.temp_max);\n let tempMax = document.querySelector(\"#max\");\n tempMax.innerHTML = tempMaxValue;\n //change icon\n let iconValue = response.data.weather[0].icon;\n let weatherIcon = document.querySelector(\"#icon\");\n weatherIcon.setAttribute(\"src\", `http://openweathermap.org/img/wn/${iconValue}@2x.png`);\n weatherIcon.setAttribute(\"alt\", response.data.weather[0].description)\n //show info\n //humidity - you asked for precipitation but is not on the API\n let humidityValue = Math.round(response.data.main.humidity);\n let currentHum = document.querySelector(\"#humidity\");\n currentHum.innerHTML = humidityValue;\n //Wind\n let windValue = Math.round(response.data.wind.speed);\n let currentWind = document.querySelector(\"#wind\");\n currentWind.innerHTML = windValue;\n\n celsiusTemp = response.data.main.temp;\n\n getForecast(response.data.coord);\n //Change Background Image\n updateBackgroundImg(iconValue);\n\n}", "function displayWeather(response) {\n\tdocument.querySelector(\"h1\").innerHTML = `<i class=\"bi bi-geo-alt-fill\"></i>${response.data.name.trim().toUpperCase()}`;\n\tdocument.querySelector(\"#current-temp\").innerHTML = Math.round(response.data.main.temp);\n\tdocument.querySelector(\".humidity\").innerHTML = response.data.main.humidity;\n\tdocument.querySelector(\".wind\").innerHTML = Math.round(response.data.wind.speed);\n\tlet description = document.querySelector(\".weather-condition\");\n\tdescription.innerHTML = response.data.weather[0].description.toUpperCase();\n}", "function displayCurrentWeather(data) {\n //Current Weather\n const currentWeather = Math.round(data.main.temp).toString() + \" \\xB0 F\";\n $(\".current-weather\").prepend(currentWeather);\n\n //Weather Icon\n let iconCode = data.weather[0].icon;\n let iconURL = \"http://openweathermap.org/img/wn/\" + iconCode + \"@2x.png\";\n $(\".wicon\").attr(\"src\", iconURL);\n\n //feels like\n let feelsLike = Math.round(data.main.feels_like).toString() + \" \\xB0 F\";\n $(\".feels-like\").append(\" \" + feelsLike);\n\n //Weather Description\n let weatherDescription = data.weather[0].description;\n $(\".weather-description\").text(weatherDescription);\n\n //Humidity\n let humidity = data.main.humidity;\n $(\".humidity\").append(\" \" + humidity + \"%\");\n\n //Wind\n let wind = data.wind.speed;\n $(\".wind\").append(\" \" + wind + \" mph\");\n\n //Sunrise/Sunset\n let timeZone;\n timeZone = data.timezone;\n\n let sunrise = data.sys.sunrise + timeZone;\n sunrise = convertTimestamptoTime(sunrise);\n sunrise = sunrise.split(\":\").slice(0, 2);\n sunrise = formatTime(sunrise[0], parseInt(sunrise[1]));\n $(\".sunrise\").append(\" \" + sunrise);\n\n let sunset = data.sys.sunset + timeZone;\n sunset = convertTimestamptoTime(sunset);\n sunset = sunset.split(\":\").slice(0, 2);\n sunset = formatTime(sunset[0], parseInt(sunset[1]));\n $(\".sunset\").append(\" \" + sunset);\n}", "function displayWeather(data) {\n nyWeather = f2k(data.main.temp);\n // debugger\n $('p.NY-Weather').text(`The weather in New York is ${nyWeather} F`);\n}", "function displayWeatherData(data) {\n \n\n const cityName = document.querySelector('#cityName');\n cityName.innerHTML = data.name;\n const weatherIcon = document.createElement('img');\n \n weatherIcon.setAttribute(\"src\", `http://openweathermap.org/img/w/${data.weather[0].icon}.png`);\n weatherIcon.setAttribute('height', '200px');\n weatherIcon.setAttribute('width', '200px');\n const currentDiv = document.querySelector('.current');\n currentDiv.appendChild(weatherIcon);\n \n const temperature = document.querySelector('#temperature');\n temperature.innerHTML = Math.floor((data.main.temp) - 273.15) + '°';\n const windSpeed = document.querySelector('#windSpeed');\n windSpeed.innerHTML = `WIND : ${Math.floor(data.wind.speed)} m/s`;\n \n const description = document.querySelector('#description');\n description.innerHTML = data.weather[0].description;\n\n const sunRise = document.querySelector('#sunRise');\n sunRise.innerHTML = `SUN RISE : ${new Date(data.sys.sunrise * 1000).toLocaleTimeString()}`;\n\n const sunRSet = document.querySelector('#sunSet');\n sunSet.innerHTML = `SUN SET : ${new Date(data.sys.sunset * 1000).toLocaleTimeString()}`;\n\n \n\n//Optional a map showing where the city is located\n getMapCoordinates(data);\n function getMapCoordinates(data) {\n const latlongvalue = `${\n data.coord.lat\n },${\n data.coord.lon\n }`;\n const map_url = `https://maps.google.com/maps?q=${latlongvalue}&hl=es&z=14&amp;output=embed`;\n document.getElementById(\"map\").innerHTML = `<iframe src=\"${map_url}\"></iframe>`;\n }\n\n//Your feature here\n const feelsLike = document.querySelector('#feelsLike');\n feelsLike.innerHTML = `FEELS LIKE : ${Math.floor((data.main.feels_like)- 273.15)}°`;\n \n const tempMaxMin = document.querySelector('#tempMaxMin');\n tempMaxMin.innerHTML = `H : ${Math.floor((data.main.temp_max) - 273.15)}° L : ${Math.floor((data.main.temp_min) - 273.15)}°`;\n\n}", "function displayCurrentWeather(response){\n \n let city = response.name;\n\n let latitude = response.coord.lat;\n let longitude = response.coord.lon;\n\n console.log(\"latitude = \" + latitude + \" longitude = \" + longitude);\n\n displayUV(latitude, longitude);\n\n // convert dt to date format\n let day = moment.unix(response.dt);\n console.log(day.format(\"MM/DD/YYYY\"));\n\n // update title with city and date\n let currentWeatherTitle = $(\"#weatherTitle\");\n let titleString = city + \" (\" + day.format(\"MM/DD/YYYY\") + \")\";\n $(currentWeatherTitle).text(titleString);\n \n // create the img for the weather icon and give it the source for the correct icon\n let newIcon = $(\"<img>\");\n let icon = response.weather[0].icon;\n let descript = response.weather[0].description;\n let iconURL = \"http://openweathermap.org/img/wn/\" + icon + \".png\";\n console.log(descript);\n newIcon.attr(\"src\", iconURL);\n newIcon.attr(\"alt\", descript);\n\n $(currentWeatherTitle).append(newIcon);\n\n // get the temperature, humidity, and wind speed from the response\n let temp = response.main.temp;\n temp = temp.toFixed(1);\n let humidity = response.main.humidity;\n let wind = response.wind.speed;\n\n // create new paragraphs for each point of data \n let newTempP = $(\"<p>\");\n newTempP.text(\"Temperature: \" + temp + \"°F\");\n\n let newHumidityP = $(\"<p>\");\n newHumidityP.text(\"Humidity: \" + humidity + \"%\");\n\n let newWindP = $(\"<p>\");\n newWindP.text(\"Wind Speed: \" + wind + \" MPH\");\n\n // append data to HTML page\n $(\".weatherBody\").empty();\n $(\".weatherBody\").append(newTempP); \n $(\".weatherBody\").append(newHumidityP);\n $(\".weatherBody\").append(newWindP);\n\n}", "function displayWeather() {\n // iconElement.innerHTML = `<img src=\"icons/${weather.iconId}.png\"/>`;\n // tempElement.innerHTML = `${weather.temperature.value}°<span>C</span>`;\n // descElement.innerHTML = weather.description;\n // locationElement.innerHTML = `${weather.city}, ${weather.country}`;\n}", "function renderCurrent(arr) {\n var container = $('#currentWeather');\n container.html(''); // clear out old stuff\n container.addClass('currentWeatherBorder');\n var date = new Date(arr.dt * 1000).toLocaleDateString(\"en-US\"); // convert into miliseconds\n var icon = \"https://openweathermap.org/img/w/\" + arr.weather[0].icon + \".png\";\n var temp = arr.temp;\n var wind = arr.wind_speed;\n var humid = arr.humidity;\n var uvIndex = arr.uvi;\n var color;\n\n if (uvIndex > 5) {\n color = \"uvRed\"\n } else if (uvIndex < 5 && uvIndex > 2) {\n color = \"uvYellow\"\n } else {\n color = \"uvGreen\"\n };\n\n // populates the element with current weather\n container.append(`\n <p class=\"title is-3\">${city} (${date})<img src=\"${icon}\"></p>\n <p class=\"subtitle is-6\">Temp: ${temp} °F</p>\n <p class=\"subtitle is-6\">Wind: ${wind} MPH</p>\n <p class=\"subtitle is-6\">Humidity: ${humid} %</p>\n <p class=\"subtitle is-6\">UV Index: <span class=\"${color}\"> ${uvIndex}</span></p>\n `);\n}", "renderWeather(){\n if (this.state.weatherNow) { // checking that state contains weather\n const current = this.state.weatherNow;\n console.log(current); // double-check timing\n const hourly = this.state.weatherLater;\n\n return (\n <div className=\"weather\">\n <div className=\"temp\">\n <p className=\"current-temp\">{Math.round(current.temperature)}&deg;F</p>\n </div>\n <div className=\"summary\">\n <p className=\"hourly-summary\">{hourly.summary}</p>\n </div>\n </div>\n )}\n else {\n return <p> Now loading...</p>\n }\n }", "function displayWeather() {\n currentLocation.innerHTML = `<h2>Welcome to ${currentWeather.city}, ${currentWeather.country}</h2>`;\n tempValue.innerHTML = `<p>Current Temperature: ${currentWeather.temperature.value} °${currentWeather.temperature.unit}</p>`;\n tempDescText.innerHTML = `<p>Current Weather: ${currentWeather.tempDescText}</p>`;\n if (currentLandmarkCode == undefined) { // for current location\n sunriseTime.innerHTML = `<p>Sunrise: ${currentWeather.sunrise.toLocaleString(dateFormat, timeFormatCurrent)}</p>`;\n sunsetTime.innerHTML = `<p>Sunset: ${currentWeather.sunset.toLocaleString(dateFormat, timeFormatCurrent)}</p>`;\n currentDateTime.innerHTML = `<p>Current Date: ${currentWeather.time.toLocaleString(dateFormat, timeDateFormatCurrent)}</p>`;\n }\n else { // for landmark location\n sunriseTime.innerHTML = `<p>Sunrise: ${currentWeather.sunrise.toLocaleString(dateFormat, timeFormat)}</p>`;\n sunsetTime.innerHTML = `<p>Sunset: ${currentWeather.sunset.toLocaleString(dateFormat, timeFormat)}</p>`;\n currentDateTime.innerHTML = `<p>Current Date: ${currentWeather.time.toLocaleString(dateFormat, timeDateFormat)}</p>`;\n }\n}", "function showWeather (response) {\n console.log(response.data);\n\n let temperature = Math.round(response.data.main.temp);\n let wind = (response.data.wind.speed)*2.2;\n let windRounded = Math.round(wind);\n let temperatureElement = document.querySelector(\"#temperature\");\n let humidityElement = document.querySelector(\"#humidity\");\n let windElement = document.querySelector(\"#wind\");\n let weatherDescriptionElement = document.querySelector(\"#weather-description\");\n let iconElement = document.querySelector (\"#weather-icon\");\n let dateElement = document.querySelector (\"#date-today\");\n \n//City Name Entered now comes from API\n let cityName = response.data.name;\n let city = document.querySelector(\"#city-name\")\n city.innerHTML = cityName;\n\n celsiusTemperature = response.data.main.temp; \n // Can use above in let temperature \n\n//Presenting Translated Variables on HTML\n temperatureElement.innerHTML = temperature;\n humidityElement.innerHTML = `Humidity: ${response.data.main.humidity}%`;\n windElement.innerHTML = `Wind: ${windRounded}mph`;\n weatherDescriptionElement.innerHTML = response.data.weather[0].description;\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`);\n dateElement.innerHTML = formatDateAndTime (response.data.dt * 1000);\n}", "function showWeather(response) {\n let temperature = Math.round(response.data.main.temp);\n let weather = document.querySelector(\"#tempDisplay\");\n weather.innerHTML = `${temperature}°C`;\n let mainCity = document.querySelector(\"h1\");\n mainCity.innerHTML = response.data.name;\n}", "function showWeather(response) {\n document.querySelector(\"#current-location\").innerHTML = response.data.name;\n document.querySelector(\"#description\").innerHTML =\n response.data.weather[0].description;\n\n celsiusTemperature = response.data.main.temp;\n\n let actualWeatherLocation = document.querySelector(\"#temperature-posted\");\n actualWeatherLocation.innerHTML = Math.round(celsiusTemperature);\n\n let inspectWind = response.data.wind.speed;\n let realWind = document.querySelector(\"#wind\");\n realWind.innerHTML = `Wind ${inspectWind} Km/H`;\n\n let inspectHumidity = response.data.main.humidity;\n let realHumidity = document.querySelector(\"#humidity\");\n realHumidity.innerHTML = `Humidity ${inspectHumidity} %`;\n\n let actualWeatherIcon = document.querySelector(\"#weather-icon\");\n actualWeatherIcon.setAttribute(\n \"src\",\n `https://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n}", "function displayWeatherCondition(response) {\n document.querySelector(\"#city\").innerHTML = response.data.name;\n document.querySelector(\"#country\").innerHTML = response.data.sys.country;\n document.querySelector(\"#temperature\").innerHTML = Math.round(\n response.data.main.temp\n );\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed\n );\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#description\").innerHTML =\n response.data.weather[0].main;\n\n\ndocument.querySelector(\"#sunrise\").innerHTML = formatTime(\n response.data.sys.sunrise * 1000\n );\n document.querySelector(\"#sunset\").innerHTML = formatTime(\n response.data.sys.sunset * 1000\n );\n let iconElement = document.querySelector(\"#icon\");\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n celsiusTemperature = response.data.main.temp;\n searchForecast(response);\n}", "function showTemperature(response) {\n console.log(response)\n document.querySelector(\"#city\").innerHTML = response.data.name;\n\n let temperature = Math.round(response.data.main.temp);\n \n let temp = document.querySelector(\"#now-temp\");\n temp.innerHTML = temperature;\n \n let highTemp = document.querySelector(\"#high-temp\");\n highTemp.innerHTML = Math.round(response.data.main.temp_max);\n \n let lowTemp = document.querySelector(\"#low-temp\");\n lowTemp.innerHTML = Math.round(response.data.main.temp_min);\n \n let description = document.querySelector(\"#description\");\n description.innerHTML = response.data.weather[0].description;\n \n let wind = document.querySelector(\"#wind\");\n wind.innerHTML = Math.round(response.data.wind.speed * 3.6);\n\n let humidity = document.querySelector(\"#humidity\");\n humidity.innerHTML = Math.round(response.data.main.humidity);\n\n let mainIcon = document.querySelector('#main-weather-icon')\n mainIcon.setAttribute('src', `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`);\n mainIcon.setAttribute('alt', response.data.weather[0].description);\n}", "function getCurrentWeatherData (){\n //need to find way to get city name and date\n //convert from kelvin to fahrenheit. Remove decimals\n var temperature = Math.floor(((data.current.temp)-273) * 1.8 + 32);\n var humidity =data.current.humidity;\n var windSpeed =data.current.wind_speed;\n var uvIndex = data.current.uvi;\n \n $(\"#temp\").append(temperature + \"*F\");\n $(\"#humidity\").append(humidity + \"%\");\n $(\"#wind\").append(windSpeed + \"mph\");\n $('#uv-index').append(uvIndex)\n}", "function showWeather(response) {\n console.log(response.data); \n let iconElement = document.querySelector(\"#icon\");\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n document.querySelector(\"#current-date-time\").innerHTML = formatDate(\n response.data.dt * 1000 + (response.data.timezone * 1000\n ));\n document.querySelector(\"#city-input\").innerHTML = response.data.name;\n celsiusTemperature = response.data.main.temp;\n document.querySelector(\"#main-temperature\").innerHTML = Math.round(\n celsiusTemperature\n );\n document.querySelector(\"#feels-like\").innerHTML = Math.round(\n response.data.main.feels_like\n );\n let temperature = response.data.main.feels_like;\n document.querySelector(\"#feels-like-fahrenheit\").innerHTML = Math.round(\n (temperature * 9) / 5 + 32\n );\n document.querySelector(\"#weather-description\").innerHTML =\n response.data.weather[0].description;\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed\n );\n}", "function displayWeather(response) {\n document.querySelector(\n \"#city\"\n ).innerHTML = `${response.data.name}, ${response.data.sys.country}`;\n document.querySelector(\"#date\").innerHTML = showDate();\n document.querySelector(\"#time\").innerHTML = showHour();\n celsiusTemperature = response.data.main.temp;\n document.querySelector(\"#temperature\").innerHTML = Math.round(\n celsiusTemperature\n );\n document.querySelector(\n \"#description\"\n ).innerHTML = response.data.weather[0].description.replace(/^\\w/, (c) =>\n c.toUpperCase()\n );\n document.querySelector(\"#humidity\").innerHTML = Math.round(\n response.data.main.humidity\n );\n document.querySelector(\"#windSpeed\").innerHTML = Math.round(\n response.data.wind.speed\n );\n document\n .querySelector(\"#icon\")\n .setAttribute(\"src\", changeImage(response.data.weather[0].icon));\n document\n .querySelector(\"#icon\")\n .setAttribute(\"alt\", response.data.weather[0].description);\n}", "function getWeather() {\n weather\n .getWeather()\n .then((results) => {\n // console.log(results);\n ui.paint(results);\n })\n .catch((err) => console.log(err));\n}", "function currentWeather(data) {\r\n document.getElementById(\"currentweathervalue\").innerHTML = `${Math.round(data.main.temp)}&deg;`;\r\n document.getElementById(\"hightempvalue\").innerHTML = `${Math.round(data.main.temp_max)}&deg;`;\r\n document.getElementById(\"lowtempvalue\").innerHTML= `${Math.round(data.main.temp_min)}&deg`;\r\n document.getElementById(\"humidityvalue\").innerHTML= `${data.main.humidity}%`;\r\n document.getElementById(\"windvalue\").innerHTML= `${Math.round(data.wind.speed)} MPH`;\r\n document.getElementById(\"currentstatus\").innerHTML= `${data.weather[0].main}`\r\n document.getElementById(\"weathericon\").src= `http://openweathermap.org/img/wn/${data.weather[0].icon}@2x.png`\r\n}", "function displayWeather(){\n \n temperature.innerHTML = `${weather.temperature}°C`;\n loc.innerHTML = `${weather.city}`;\n}", "function showTemp(response) {\n // Identify Celcius Temp\n celciusTemperature = Math.round(response.data.main.temp);\n // Locate Metric\n let currentTemperature = Math.round(celciusTemperature);\n // Identify Element to Change\n let currentTemperatureElement = document.querySelector(\"#temp\");\n // Change Element to Metric\n currentTemperatureElement.innerHTML = `${currentTemperature} °C`;\n // Change Country and City in HTML\n let city = response.data.name;\n let country = response.data.sys.country;\n let locationElement = document.querySelector(\"#searched-city\");\n locationElement.innerHTML = `${city}, ${country}`;\n // Change Weather Details\n document.querySelector(\n \"#humidity\"\n ).innerHTML = ` Humidity: ${response.data.main.humidity}%`;\n document.querySelector(\n \"#wind-speed\"\n ).innerHTML = ` Wind: ${response.data.wind.speed} mph`;\n\n // Change Icon\n let weatherIcon = document.querySelector(\"#current-weather-icon\");\n weatherIcon.innerHTML = `<img src=\"https://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png\" alt=\"weather-icon\">`;\n\n // Change Weather Description\n let weatherDescriptionElement = document.querySelector(\n \"#weather-description\"\n );\n if (currentTemperature <= 0) {\n weatherDescriptionElement.innerHTML =\n \"It's very cold out there. Wrap up warm!\";\n } else if (currentTemperature >= 10 === currentTemperature <= 19) {\n weatherDescriptionElement.innerHTML = \"Maybe put on a jumper.\";\n } else if (currentTemperature > 19) {\n weatherDescriptionElement.innerHTML =\n \"It's a lovely warm day. <br /> Get outside and enjoy it!\";\n }\n\n getForecast(response.data.coord);\n}", "function setWeather (response) {\n var cityName = response.name;\n curTemp = Math.round(response.main.temp);\n var curCond = response.weather[0].main;\n var curHum = response.main.humidity;\n var curID = response.weather[0].id;\n\n setIcon(curID);\n\n $('#location').html(cityName);\n $('#c1').html(curCond);\n $('#hum1').html(\"Humidity: \"+curHum+\"%\");\n\n if (unitStatus == \"1F\") {\n $('#t1').html(curTemp+\"&#8457;\");\n }\n else {\n $('#t1').html(curTemp+\"&#8451;\");\n }\n\n /*\n console.log(cityName);\n console.log(curTemp);\n console.log(curCond);\n console.log(curHum);\n console.log(curID);\n console.log(response);\n */\n}", "function postWeather() {\r\n weatherValue.innerHTML = main;\r\n descValue.innerHTML = description;\r\n tempValue.innerHTML = `${Math.floor(temp)}°F`;\r\n windValue.innerHTML = `Wind: ${Math.floor(wind)}mph`;\r\n sunriseValue.innerHTML = `Sunrise: ${dsunrise.toTimeString()} AM`;\r\n sunsetValue.innerHTML = `Sunset: ${dsunset.toTimeString()} PM`;\r\n}", "function displayWeatherData() {\r\n if(weatherData.name && weatherData.sys.country) {\r\n currentLocation.innerHTML = weatherData.name + ', ' + weatherData.sys.country;\r\n };\r\n humidity.innerHTML = 'Humidity: ' + weatherData.main.humidity + ' %';\r\n pressure.innerHTML = 'Pressure: ' + transformFromHpaToMmHg() + ' mm Hg';\r\n temperature.innerHTML = transformFromKelvinToCelsius() + '°';\r\n\r\n var imgUrl = 'http://openweathermap.org/img/wn/' + weatherData.weather[0].icon + '@4x.png';\r\n weatherIcon.innerHTML = '<img src=' + imgUrl + '>';\r\n windDeg = weatherData.wind.deg;\r\n windInfo.innerHTML = 'Wind: ' + transformWindDeg() + ', ' + transformFromKnotsToMeters() + ' m/s';\r\n weatherSummary.innerHTML = weatherData.weather[0].main;\r\n words.value = \"\";\r\n}", "function renderWeather(data) {\n $(\"#weather-info\").empty();\n var p = $(\"<p>\").text(data.address);\n $(\"#weather-info\").append(p);\n p = $(\"<p>\").text(\"Max Temp: \" + data.main.temp_max);\n $(\"#weather-info\").append(p);\n p = $(\"<p>\").text(\"Min Temp: \" + data.main.temp_min);\n $(\"#weather-info\").append(p);\n p = $(\"<p>\").text(\"Current Temp: \" + data.main.temp);\n $(\"#weather-info\").append(p);\n var i = renderIcon(data.weather[0].main);\n $(\"#weather-info\").append(i);\n p = $(\"<p>\").text(data.weather[0].description);\n $(\"#weather-info\").append(p);\n p = $(\"<p>\").text(\"Wind Speed: \" + data.wind.speed);\n $(\"#weather-info\").append(p);\n p = $(\"<p>\").text(\"We recommend: \");\n $(\"#weather-info\").append(p);\n p = renderWear(data.weather[0].main, data.main.temp);\n $(\"#weather-info\").append(p);\n}", "showWeather(weather) {\n this.weatherIcon.src = weather.isRaining ? Raining : Sun;\n this.textNode.nodeValue = weather.temperature + ' ' + Celsius.normalize(); // celsius unicode\n }", "function showWeatherConditions(response) {\n document.querySelector(\"#city\").innerHTML = response.data.name;\n celsiusTemperature = response.data.main.temp;\n document.querySelector(\"#temperature\").innerHTML =\n Math.round(celsiusTemperature);\n maxTemperature = response.data.main.temp_max;\n document.querySelector(\"#max-current-temp\").innerHTML = `<strong>${Math.round(\n maxTemperature\n )} </strong>`;\n minTemperature = response.data.main.temp_min;\n document.querySelector(\"#min-current-temp\").innerHTML =\n Math.round(minTemperature);\n document.querySelector(\"#country\").innerHTML = response.data.sys.country;\n feelsLikeTemperature = response.data.main.feels_like;\n document.querySelector(\"#feels-like\").innerHTML =\n Math.round(feelsLikeTemperature);\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed * (18 / 5)\n );\n document.querySelector(\"#current-sky\").innerHTML =\n response.data.weather[0].description;\n\n let iconElement = document.querySelector(\"#weather-icon\");\n iconElement.setAttribute(\n \"src\",\n `images/${response.data.weather[0].icon}.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n\n getForecast(response.data.coord);\n}", "showWeather(weather) {\n this.location.textContent = `${weather.name}, ${weather.sys.country}`;\n this.weatherMain.textContent = weather.weather[0].main;\n this.weatherDesc.textContent = weather.weather[0].description;\n this.temp.innerHTML = `${weather.main.temp}&#8451;`;\n this.weatherIcon.setAttribute('src', `https://openweathermap.org/img/wn/${weather.weather[0].icon}@2x.png`);\n this.weatherIcon.setAttribute('alt', weather.weather[0].description);\n this.humidity.innerHTML = `Relative Humidity: ${weather.main.humidity}&#65285;`;\n this.pressure.textContent = `Air Pressure: ${weather.main.pressure} hPa`;\n this.maxTemp.innerHTML = `Max Temp: ${weather.main.temp_max}&#8451;`;\n this.minTemp.innerHTML = `Min Temp: ${weather.main.temp_min}&#8451;`;\n this.windDeg.innerHTML = `Wind Degrees: ${weather.wind.deg}&#176;`;\n this.windSpeed.textContent = `Wind Speed: ${weather.wind.speed} meter/sec`;\n }", "function displayWeather(){\n iconElement.innerHTML = `<img src=\"icons/${weather.iconId}.png\">`;\n tempElement.innerHTML = `${weather.temperature.value}°<span>C<span>`;\n descElement.innerHTML = weather.descripition;\n locationElement.innerHTML =`${weather.city}, ${weather.country}`\n}", "function displayWeather() {\n iconElement.innerHTML = `<img src=\"icons/${weather.iconId}.png\"/>`;\n tempElement.innerHTML = `${weather.temperature.value}°<span>C</span>`;\n descElement.innerHTML = weather.description;\n locationElement.innerHTML = `${weather.city}, ${weather.country}`;\n}", "function showWeather(response) {\n document.querySelector(\n \"#city-display\"\n ).innerHTML = `${response.data.name}, ${response.data.sys.country}`;\n\n celsiusTemperature = response.data.main.temp;\n feelsLikeTemperature = response.data.main.feels_like;\n\n let temp = document.querySelector(\"#current-temp\");\n let currentTemp = Math.floor(celsiusTemperature);\n\n let description = document.querySelector(\"#description\");\n let weatherDescription = response.data.weather[0].description;\n\n console.log(weatherDescription);\n\n if (\n weatherDescription === \"scattered clouds\" ||\n \"few clouds\" ||\n \"broken clouds\" ||\n \"overcast clouds\"\n ) {\n document.body.style.backgroundImage = `url(\"images/cloudy.jpg\")`;\n }\n if (weatherDescription === \"clear sky\") {\n document.body.style.backgroundImage = `url(\"images/sunnyday.jpg\")`;\n }\n if (weatherDescription === \"shower rain\" || \"rain\") {\n document.body.style.backgroundImage === `url(\"images/rainy1.jpg\")`;\n }\n if (weatherDescription === \"snow\") {\n document.body.style.backgroundImage = `url(\"images/snowy.jpg\")`;\n }\n if (weatherDescription === \"thunderstorm\") {\n document.body.style.backgroundImage === `url(\"images/stormy.jpg\")`;\n }\n if (weatherDescription === \"mist\") {\n document.body.style.backgroundImage = `url(\"images/misty.jpg\")`;\n }\n\n let feelsLike = document.querySelector(\"#feels-like\");\n let feelsLikeTemp = Math.floor(feelsLikeTemperature);\n\n // let humidity = document.querySelector(\"#humidity\");\n // let showHumidity = response.data.main.humidity;\n\n // let windSpeed = document.querySelector(\"#wind-speed\");\n // let showWindSpeed = Math.floor(response.data.wind.speed);\n\n let max = document.querySelector(\"#high\");\n let min = document.querySelector(\"#low\");\n let high = Math.floor(response.data.main.temp_max);\n let low = Math.floor(response.data.main.temp_min);\n\n temp.innerHTML = `${currentTemp}`;\n description.innerHTML = `${weatherDescription}`;\n feelsLike.innerHTML = `Feels like ${feelsLikeTemp}`;\n // humidity.innerHTML = `Humidity: ${showHumidity}`;\n // windSpeed.innerHTML = `Windspeed: ${showWindSpeed}`;\n max.innerHTML = `${high}`;\n min.innerHTML = ` ${low}`;\n\n let iconElement = document.querySelector(\"#icon\");\n iconElement.innerHTML = response.data.weather[0].icon;\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n\n getForecast(response.data.coord);\n}", "function renderWeatherInformation(data, units) {\n let tempUnit = '°C';\n\n if (units === 'imperial') {\n tempUnit = '°F';\n }\n const weatherDescription = document.querySelector(\n '.weather-info__description'\n );\n weatherDescription.textContent = _utils__WEBPACK_IMPORTED_MODULE_0__.capitalize(\n data.current.weather[0].description\n );\n const city = document.querySelector('.weather-info__city');\n city.textContent = data.name;\n const date = document.querySelector('.weather-info__date');\n date.textContent = _utils__WEBPACK_IMPORTED_MODULE_0__.formatDate(data.current.dt, data.timezone_offset);\n const time = document.querySelector('.weather-info__time');\n time.textContent = _utils__WEBPACK_IMPORTED_MODULE_0__.formatTime(data.current.dt, data.timezone_offset);\n\n const temperature = document.querySelector('.weather-info__temperature');\n temperature.textContent = `${Math.round(data.current.temp)} ${tempUnit}`;\n const temperatureIcon = document.querySelector('.weather-info__icon');\n temperatureIcon.innerHTML = _utils__WEBPACK_IMPORTED_MODULE_0__.getIcon(data.current.weather[0].icon);\n}", "function currentTemp(response) {\n console.log(response.data);\n imperialTemperature = Math.round(response.data.main.temp);\n let description = (response.data.weather[0].description);\n let precip = Math.round(response.data.main.humidity);\n let wind = Math.round(response.data.wind.speed);\n let icon = response.data.weather[0].icon;\n let tempReplace = document.querySelector(\"b\");\n let describeReplace = document.querySelector(\".description\");\n let precipReplace = document.querySelector(\"#precip\");\n let windReplace = document.querySelector(\"#wind\");\n let iconReplace = document.querySelector(\"#icon\");\n describeReplace.innerHTML = `${description}`;\n tempReplace.innerHTML = `${imperialTemperature}<sup>°F</sup>`;\n precipReplace.innerHTML = `Humidity: ${precip}%`;\n windReplace.innerHTML = `Wind: ${wind} m/h`;\n iconReplace.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${icon}@2x.png`\n );\n iconReplace.setAttribute(\"alt\", response.data.weather[0].description);\n getForecast(response.data.coord);\n}", "function showWeather(response) {\n document.querySelector(\"#searched-city\").innerHTML = response.data.name;\n document.querySelector(\"#temperature\").innerHTML = Math.round(\n response.data.main.temp\n );\n document.querySelector(\"#weather-description\").innerHTML =\n response.data.weather[0].main;\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed\n );\n}", "function showDefaultWeather(response) {\r\n let temperature = Math.round(response.data.main.temp);\r\n let degrees = document.querySelector(\"#main-temp\");\r\n degrees.innerHTML = `${temperature}°C`;\r\n let mainDescription = response.data.weather[0].description;\r\n let description = document.querySelector(\"#main-description\");\r\n description.innerHTML = `Conditions: ${mainDescription}`;\r\n}", "function render(data,C){\n var currentWeather = data.weather[0].description;\n var currentTemp = displayTemp(data.main.temp,C);\n var icon = data.weather[0].icon;\n \n $(\"#currentTemp\").html(currentTemp);\n $(\"#currentWeather\").html(currentWeather);\n \n var apiIcon = \"http://openweathermap.org/img/w/01d.png\";\n $(\"#currentTemp\").prepend('<img src=' + apiIcon + '>' );\n }", "function updateDisplay(weatherData) {\n var currentTemp = weatherData.main.temp;\n var currentHumidity = weatherData.main.humidity;\n var currentImg = 'https://openweathermap.org/img/w/' + weatherData.weather[0].icon + '.png'\n var currentWindSpeed = weatherData.wind.speed;\n var cityName = weatherData.name;\n\n document.getElementById('current-temp').textContent = currentTemp;\n document.getElementById('current-humidity').textContent = currentHumidity;\n document.getElementById('current-img').src = currentImg;\n document.getElementById('current-wind').textContent = currentWindSpeed;\n document.getElementById('current-city').textContent = cityName;\n return\n}", "function showWeather(response) {\n document.querySelector(\"#city\").innerHTML = response.data.name;\n document.querySelector(\"#today\").innerHTML = Math.round(\n response.data.main.temp\n );\n document.querySelector(\"#humidity\").innerHTML = response.data.main.humidity;\n document.querySelector(\"#wind\").innerHTML = Math.round(\n response.data.wind.speed\n );\n document\n .querySelector(\"#icon\")\n .setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n document.querySelector(\"#date\").innerHTML = formatDate(\n response.data.dt * 1000\n );\n}", "function showWeather() {\n document.getElementById(\"summary\").innerHTML = summary;\n document.getElementById(\"temp\").innerHTML = `Temperature ${tempF} F`;\n document.getElementById(\"tempConvert\").classList.add(\"fahrenheit\");\n document.getElementById(\"humidT\").innerHTML = `Humidity: ${humidT.toFixed(0)}%`\n document.getElementById(\"windS\").innerHTML = `Wind Speed: ${windS} mi/h`\n skycons.set(\"icon\", icon)\n skycons.play();\n document.getElementById(\"tempConvert\").classList.remove(\"hidden\")\n}", "function getCurrentWeather(response) {\n\t\t\t\tvar cityName = $(\"#city-name \");\n\t\t\t\tvar image = $(\n\t\t\t\t\t`<span> ${response.name} <img src=\"https://openweathermap.org/img/w/${response.weather[0].icon}.png\"> </span>`\n\t\t\t\t);\n\n\t\t\t\tcityName.html(image);\n\n\t\t\t\tvar currentTempF = $(\"#current-Temp\");\n\t\t\t\tcurrentTempF.html(\n\t\t\t\t\t\"Temperature \" +\n\t\t\t\t\t\t((response.main.temp - 273.15) * 1.8 + 32).toFixed(0) +\n\t\t\t\t\t\t\" °F\"\n\t\t\t\t);\n\t\t\t\tvar currentHumidity = $(\"#current-humidity\");\n\t\t\t\tcurrentHumidity.html(\n\t\t\t\t\t\"Humidity: \" + response.main.humidity + \"%\"\n\t\t\t\t);\n\t\t\t\tvar windSpeed = $(\"#current-Windspeed\");\n\t\t\t\twindSpeed.html(\"Wind Speed: \" + response.wind.speed + \" MPH\");\n\t\t\t}", "function renderCurrent() {\n document.getElementById('currentCity').innerHTML = \n `\n ${currentSearch.city.name} ${currentSearch.list[0].dt_txt}\n <p>${Math.round(currentSearch.list[0].main.temp * (9 / 5) - 459.67)}°F.</p>\n <p>Humidity: ${currentSearch.list[0].main.humidity}%</p>\n <p>Wind Speed: ${currentSearch.list[0].wind.speed}mph</p>\n <p id='uvIndex'></p>\n `\n document.getElementById('forecast').innerHTML = renderForecastItem(0) + renderForecastItem(8) + renderForecastItem(16) + renderForecastItem(24) + renderForecastItem(32)\n}", "function displayCurrentWeather(homeWeather) {\n getBackground();\n displayCurrentLocation.innerText = homeWeather.name;\n displayCurrentIcon.src = `https://openweathermap.org/img/wn/${homeWeather.weatherIcon}@2x.png`;\n /** CHECK IF LOGO INFO IS PRESENT */\n if (homeWeather.weatherIcon) {\n displayStandaloneIcon.style = \"display: block\";\n displayStandaloneIcon.src = `https://openweathermap.org/img/wn/${homeWeather.weatherIcon}@4x.png`;\n }\n displayCurrentTemp.innerHTML = homeWeather.tempInCelsius + `&#176<span id=\"tempUnit\">C</span>`;\n displayCurrentDesc.innerText = homeWeather.description.charAt(0).toUpperCase() +\n homeWeather.description.slice(1); // SET FIRST LETTER TO UPPERCASE\n displayCurrentHumidity.innerText = `Humidity: ${homeWeather.humidity}%`;\n displayCurrentWind.innerText = `Wind: ${homeWeather.windSpeed}m/s`;\n displayCurrentFeelsLike.innerHTML = `Feels: ${homeWeather.feelsLike}&#176<span>C</span>`;\n displayCurrentDate.innerHTML = currentDate();\n displayCurrentTime.innerHTML = currentTime();\n document.getElementById(\"weatherCurrentInfoContainer\").style.display = \"flex\";\n}", "function displayWeather(){\n iconElement.innerHTML = `<img src=\"icons/${weather.iconId}.png\"/>`;\n tempElement.innerHTML = `<span>Feels like</span> ${weather.temperature.value}°<span>C</span>`;\n descElement.innerHTML = weather.description;\n locationElement.innerHTML = `${weather.city}, ${weather.country}`;\n\n temp_minElement.innerHTML = `Min Temperature: ${weather.temperature.min}°<span>C</span>`;\n temp_maxElement.innerHTML = `Max Temperature: ${weather.temperature.max}°<span>C</span>`;\n humidityElement.innerHTML = `Humidity: ${weather.humidity}%`;\n pressureElement.innerHTML = `Pressure: ${weather.pressure} hpa`;\n windElement.innerHTML = `Wind: ${weather.wind} mph`;\n\n}", "function getWeather(Data){\n\t\n\t//store pertinent weather data as variables for html display\n\tvar currentTemp = parseInt(Data.current_observation.feelslike_f);\n\tvar location = Data.current_observation.display_location.full;\n\tvar icon = Data.current_observation.estimated.icon;\n\tvar forecast = Data.forecast.txt_forecast.forecastday[0].fcttext;\n\t\t \n\t //create html for display \n\t \n var html = '<h2>'+currentTemp+'&deg;F</h2>';\n html += '<h3>'+ forecast+'</h3>';\n html += '<div id=\"attribution\"><p>Weather data courtesy of: </p><a href=\"http://www.wunderground.com/\"><img src=\"weatherlogo.png\" style=\"width:70%\" /></a></div>';\n \n \n \n \n // \n document.getElementById(\"cityWeather\").innerHTML = location + \" Weather\";\n document.getElementById(\"weather2\").innerHTML = html;\n\t\n}//end of getWeather function", "function displayWeather() {\n document.querySelector('.top').classList.remove('hidden');\n city.textContent = `${weather.city}, ${weather.country}`;\n temp.textContent = Math.round(weather.temperature);\n description.textContent = weather.description;\n icon.innerHTML = `<img src=\"icons/${weather.iconId}.png\" alt=\"Weather Icon\"/>`;\n humidity.textContent = `Humidity: ${weather.humidity} %`;\n feelLike.textContent = `Feels like: ${Math.round(weather.feels_like)} °C`;\n wind.textContent = `Wind: ${Math.round(weather.wind_speed)} m/s`;\n high.textContent = Math.round(weather.temp_high);\n low.textContent = Math.round(weather.temp_low);\n document.querySelector('.credit').classList.remove('hidden');\n const date = new Date(weather.last_updated);\n lastUpdated.textContent = `\n ${date.getHours().toString().padStart('2', '0')} : \n ${date.getMinutes().toString().padStart('2', '0')}`;\n}", "function showTemperature(response) {\n celsuisTemp = Math.round(response.data.main.temp);\n let apiLocation = response.data.name;\n let cityPlaceholder = document.querySelector(\".location\");\n cityPlaceholder.innerHTML = `${apiLocation}`;\n let temperaturePlaceholder = document.querySelector(\".temperature\");\n temperaturePlaceholder.innerHTML = `${celsuisTemp}°C`;\n let description = response.data.weather[0].main;\n let descriptionPlaceholder = document.querySelector(\".weatherDescription\");\n descriptionPlaceholder.innerHTML = `${description}`;\n let humidity = response.data.main.humidity;\n let humuidityPlaceholder = document.querySelector(\".humidityValue\");\n humuidityPlaceholder.innerHTML = `Humidity: ${humidity}%`;\n let windSpeed = response.data.wind.speed;\n let windPlaceholder = document.querySelector(\".windSpeed\");\n windPlaceholder.innerHTML = `Wind Speed: ${windSpeed}m/s`;\n fahrenheitLink.classList.remove(\"active\");\n celsiusLink.classList.add(\"active\");\n let iconToday = document.querySelector(\".weather-icon\");\n iconToday.setAttribute(\"class\", showIcon(response.data.weather[0].icon));\n}", "function displayTemperature(response) {\n let cityElement = document.querySelector(\"#Location\");\n let tempElement = document.querySelector(\"#todayTemp\");\n let describElement = document.querySelector(\"#description\");\n let humidElement = document.querySelector(\"#humid\");\n let windElement = document.querySelector(\"#wind\");\n let dateElement = document.querySelector(\"#date\");\n let iconElement = document.querySelector(\"#icon\");\n cityElement.innerHTML = response.data.name;\n tempElement.innerHTML = Math.round(response.data.main.temp);\n describElement.innerHTML = response.data.weather[0].description;\n humidElement.innerHTML = response.data.main.humidity;\n windElement.innerHTML = Math.round(response.data.wind.speed);\n dateElement.innerHTML = formateDate(response.data.dt * 1000);\n iconElement.setAttribute(\n \"src\",\n `https://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n}", "function updateCurrent() {\n // console.dir(document.querySelector('#temp'));\n $('#current-city').html(\"\" + activeCity + \": \" + \"<span>\" + date.format('MMM. Do') + \"<span><img src='\"+ weathData.icon + \"'>\" );\n // console.log(weathData.uv);\n $('#temp').text(weathData.temp + \" °F\");\n $('#hum').text(weathData.hum + \"%\");\n $('#wind').text(weathData.wind + \" MPH\");\n $('#uv').removeClass('yellow red green')\n if (weathData.uv < 3) {\n $('#uv').text(weathData.uv).addClass('green');\n } else if (weathData.uv >= 3 && weathData.uv < 8) {\n $('#uv').text(weathData.uv).addClass('yellow');\n } else if (weathData.uv > 8) {\n $('#uv').text(weathData.uv).addClass('red');\n }\n \n }", "function renderDay (data, tog) {\n\ttemp = displayTemp(data.list[0].temp.day, tog);\n\ttempMin = displayTemp(data.list[0].temp.min, tog);\n\ttempMax = displayTemp(data.list[0].temp.max, tog);\n\tdescription = data.list[0].weather[0].description;\n\tdescription = description[0].toUpperCase() + description.substring(1);\n\twind = displaySpeed(data.list[0].speed, tog);\n\ticon = data.list[0].weather[0].icon;\n\tbgURL = switchBG(icon);\n\tcity = data.city.name;\n $(\"#todayTemp\").html(\" \" + description + \"<br />\" + 'Temp: ' + temp + \"<br />\" + 'High/Low: ' + tempMax + \"/\" + tempMin + \"<br />\" + 'Wind: ' + wind);\n\tif (night == 1) {\n\t\t$(\"#todayTemp\").css({\"color\":\"white\", \"background\":\"rgba(255, 255, 255, 0.07)\"})\n\t}\n\tif (night == 0){\n \t$(\"#weatherBG\").prepend('<h1> Today in ' + city + '</h1>');\n\t\t}\n\t\telse {\n\t\t\t$(\"#weatherBG\").prepend('<h2> Tonight in ' + city + '</h2>');\t\n\t\t}\n}", "function displayResults(weather) {\n city.innerHTML = `${weather.name}, ${weather.sys.country}`;\n\n now = new Date();\n today.innerHTML = dateBuilder(now);\n\n temp.innerHTML = `${Math.round(weather.main.temp)}<span>°C</span>`;\n\n currentWeather.innerHTML = weather.weather[0].main;\n\n hilow.innerHTML = `${Math.round(weather.main.temp_min)}°C / ${Math.round(\n weather.main.temp_max,\n )}°C`;\n modify();\n}", "function show(data){ \n return `<h3 class='temp'> The Weather in ${location} is Currently ${data.main.temp} C°</h3>`;\n }", "function localWeather(response) {\n let temperature = Math.round(response.data.main.temp);\n let temperatureElement = document.querySelector(\"#temperature\");\n temperatureElement.innerHTML = `${temperature}`;\n\n let currentCity = document.querySelector(\"#current-city\");\n currentCity.innerHTML = `${response.data.name}`;\n\n let description = document.querySelector(\"li .description\");\n let updateDescription = response.data.weather[0].description;\n description.innerHTML = updateDescription;\n\n let wind = document.querySelector(\"#windSpeed\");\n wind.innerHTML = `Wind: ${response.data.wind.speed} mph`;\n\n let humidity = document.querySelector(\"#humidity-percentage\");\n humidity.innerHTML = `Humidity: ${response.data.main.humidity}%`;\n\n let iconElement = document.querySelector(\"li #current-icon\");\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n celsuisTemperature = Math.round(response.data.main.temp);\n}", "function renderForecast(data) {\n // Add city and timestamp to elements\n document.querySelector('#city')\n .textContent = `Weather forecast for ${data.location.name}, ${data.location.country} on ${getDay()}`;\n document.querySelector('#updated')\n .textContent = `Last updated on ${getDay()} ${data.current.last_updated}`;\n\n // Add specific current weather data\n document.querySelector(`#day-1 .feels-like`)\n .textContent = `Feels like ${Math.round(data.current.feelslike_c)} °C`;\n document.querySelector(`#day-1 .pressure`)\n .textContent = `Pres. ${(data.current.pressure_mb / 1000).toFixed(3)} bar`;\n\n // Add weather data to elements\n let counter = 1;\n data.forecast.forecastday.forEach(forecastday => {\n if (counter === 2)\n document.querySelector(`#day-${counter} .day`).textContent = 'Tomorrow';\n else\n document.querySelector(`#day-${counter} .day`).textContent = getDay(counter - 1);\n\n document.querySelector(`#day-${counter} .icon`)\n .setAttribute('src', `https:${forecastday.day.condition.icon}`);\n document.querySelector(`#day-${counter} .temp`)\n .textContent = Math.round(forecastday.day.avgtemp_c) + ' °C';\n document.querySelector(`#day-${counter} .conditions`)\n .textContent = forecastday.day.condition.text;\n document.querySelector(`#day-${counter} .diff-temp`)\n .textContent = `Temps ${Math.round(forecastday.day.mintemp_c)} to ${Math.round(forecastday.day.maxtemp_c)} °C`;\n document.querySelector(`#day-${counter} .humidity`)\n .textContent = `Humidity ${forecastday.day.avghumidity}%`;\n document.querySelector(`#day-${counter} .rain`)\n .textContent = `Rain ${forecastday.day.totalprecip_mm} mm`;\n document.querySelector(`#day-${counter} .max-wind`)\n .textContent = `Wind ${(forecastday.day.maxwind_kph / 3.6).toFixed(2)} m/s`;\n document.querySelector(`#day-${counter} .sunrise`)\n .textContent = forecastday.astro.sunrise;\n document.querySelector(`#day-${counter} .sunset`)\n .textContent = forecastday.astro.sunset;\n counter++;\n });\n\n // Add location to search field\n document.getElementById('city-input').placeholder = data.location.name;\n document.getElementById('city-input').value = '';\n\n // Unhide forecast\n document.getElementById('forecast').classList.remove('hide');\n document.getElementById('day-1').classList.remove('hide');\n}", "function displayTemperature(response) {\n let cityName = response.data.name;\n let cityElement = document.querySelector(\"#city\");\n let dateElement = document.querySelector(\"#day-time\");\n let temperature = Math.round(response.data.main.temp);\n let currentTemp = document.querySelector(\"#degree\");\n let tempDescription = document.querySelector(\"#conditions\");\n let humidity = document.querySelector(\"#humidity-stat\");\n let wind = document.querySelector(\"#wind-stat\");\n let icon = document.querySelector(\"#weather-icon\");\n\n celsiusTemp = response.data.main.temp;\n\n cityElement.innerHTML = `${cityName}`;\n dateElement.innerHTML = formatDate(response.data.dt * 1000);\n currentTemp.innerHTML = `${temperature}`;\n tempDescription.innerHTML = response.data.weather[0].description;\n humidity.innerHTML = response.data.main.humidity;\n wind.innerHTML = Math.round(response.data.wind.speed);\n icon.setAttribute(\"src\", `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`);\n icon.setAttribute(\"alt\", response.data.weather[0].description);\n}", "function showGeoInfo(){\n $('#location').html(geo.city);\n $('#day').html(geo.day);\n $('#weather').html(geo.weather);\n $('#weather-icon').attr('src',geo.weather_icon);\n $('#precip').html(geo.precip + '&#37;');\n $('#humidity').html(geo.humidity + '&#37;');\n \n isFahren(true);\n \n //timestamp//\n $('#update').html(geo.update);\n }", "function weat() {\n $.simpleWeather({\n woeid: '', //56244897 San Jose City Hall\n location: 'San Jose, CA',\n unit: 'f',\n success: function(weather) {\n html = '<h2>'+weather.temp+'&deg;'+weather.units.temp+'</h2>';\n html += '<ul><li>'+weather.city+', '+weather.region+'</li>';\n html += '<li class=\"currently\">'+weather.currently+'</li>';\n html += '<li>'+weather.alt.temp+'&deg;C</li></ul>';\n \n for(var i=0;i<weather.forecast.length;i++) {\n html += '<p class=\"fore\">'+weather.forecast[i].day+': '+weather.forecast[i].high+'</p>';\n }\n \n $(\"#weather\").html(html);\n },\n error: function(error) {\n $(\"#weather\").html('<p>'+error+'</p>');\n }\n });\n}", "function currentWeatherDisplay(cityInput) {\n fetch(\n `https://api.openweathermap.org/data/2.5/weather?q=${cityInput}&units=imperial&appid=${apiKey}`\n )\n .then(function (response) {\n return response.json();\n })\n .then(function (data) {\n console.log(data);\n\n document.querySelector(\"#currentWeather\").innerHTML = `\n <h3>${data.name} - ${date}</h3>\n <p>Temperature: ${data.main.temp} F </p>\n <p>Humidity: ${data.main.humidity}%</p>\n <p>Wind Speed: ${data.wind.speed} mph</p>\n \n `;\n\n let lat = data.coord.lat;\n let lon = data.coord.lon;\n weekDisplay(lat, lon);\n fetch(\n `https://api.openweathermap.org/data/2.5/onecall?lat=${lat}&lon=${lon}&exclude=minutely,alerts&appid=${apiKey}`\n )\n .then(function (response) {\n return response.json();\n })\n .then(function (data2) {\n document.querySelector(\n \"#currentWeather\"\n ).innerHTML += `<p>UV Index: ${data2.current.uvi}</p>`;\n });\n });\n}", "function displayWeather(){\n iconElement.innerHTML=`<img src=\"icons/${weather.iconId}.png\">`;\n tempElement.innerHTML=`${weather.temperature.value}°<span>C</span>`;\n descElement.innerHTML=weather.description;\n locationElement.innerHTML=`${weather.city}, ${weather.country}`;\n}", "function showTemperature(response) {\n //Select HTML parts, which have to be substitute with the api data:\n let temp = document.querySelector(\".degree\");\n let hum = document.querySelector(\"#local-humidity\");\n let wind = document.querySelector(\"#local-wind\");\n let weatherDescription = document.querySelector(\"#weather-description\");\n let bigWeatherIcon = document.querySelector(\"#big-icon\");\n let cityName = document.querySelector(\"#city-name\");\n\n celsiusTemperature = response.data.main.temp; //you don't need \"let\" because it is already defined in 4.1.1\n\n //Select data from the apiUrl:\n let temperature = Math.round(celsiusTemperature);\n let humidity = response.data.main.humidity;\n let windSpeed = response.data.wind.speed;\n let weatherDescr = response.data.weather[0].description;\n let iconSource = response.data.weather[0].icon;\n let currentCityName = response.data.name;\n console.log(currentCityName);\n\n temp.innerHTML = `${temperature}`;\n hum.innerHTML = `${humidity}`;\n wind.innerHTML = `${windSpeed}`;\n cityName.innerHTML = `${currentCityName}`;\n weatherDescription.innerHTML = `${weatherDescr}`;\n bigWeatherIcon.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${iconSource}@2x.png`\n );\n}", "function dataWeather(response) {\n console.log(response.data);\n //for city\n let htmlCityValue = response.data.name;\n let htmlCity = document.querySelector(\"#city\");\n htmlCity.innerHTML = htmlCityValue;\n //degree\n let tempRound = Math.round(response.data.main.temp);\n let tempChange = document.querySelector(\"#degree-today\");\n tempChange.innerHTML = tempRound;\n //humidity\n let humRound = Math.round(response.data.main.humidity);\n let humChange = document.querySelector(\"#humidity\");\n humChange.innerHTML = `Humidity ${humRound} %`;\n //windspeed\n let windRound = response.data.wind.speed;\n let windChange = document.querySelector(\"#wind-speed\");\n windChange.innerHTML = `Wind speed ${windRound} m/s`;\n}", "function showWeather(cityName, data) {\n var dateCurrent = new Date(data.dt *1000);\n var conditions = data.weather[0].main;\n var temperature = data.main.temp;\n var humidity = data.main.humidity;\n var windSpeed = data.wind.speed;\n var currentCity = data.name;\n \n // console.log(temperature);\n iconEl.src =\n \"https://openweathermap.org/img/wn/\" + data.weather[0].icon + \"@2x.png\";\n descriptionEl.textContent = conditions;\n temperatureEl.textContent = temperature + \"°\";\n humidityEl.textContent = humidity + \"%\";\n windSpeedEl.textContent = windSpeed + \" mph\";\n cityEl.textContent = currentCity;\n dateEl.textContent = dateCurrent;\n }", "function drawVandenbergWeather(d) {\n var celcius = Math.round(parseFloat(d.main.temp)-273.15);\n\n document.getElementById('description1').innerHTML = d.weather[0].description;\n document.getElementById('temp1').innerHTML = celcius + '&deg;';\n document.getElementById('location1').innerHTML = d.name;\n}", "function displayWeather(){\n iconImgElem.innerHTML = `<img src=\"icons/${weather.iconId}.png\"/>`;\n tempratureElm.innerHTML = `${weather.temperature.value}°<span>C</span>`;\n descreptionElem.innerHTML = weather.description;\n locationElem.innerHTML = `${weather.city}, ${weather.country}`;\n}", "function updateCurrentWeather() {\n //Clear the div\n currentWeatherDiv.empty();\n\n //Get the image of the current weather\n var weatherIcon = $('<img>').attr('src', getWeatherIcon(currentCityWeather));\n\n //Get the city and date and append the weatherIcon\n var cityEl = $('<h2>').html(currentCityWeather.name + ' (' + moment(currentCityWeather.dt*1000).format('MM/DD/YYYY') + ')');\n cityEl.append(weatherIcon);\n\n //Get the temperature and convert it to farenheit\n var temp = (currentCityWeather.main.temp - 273.15) * 1.80 + 32;\n temp = temp.toFixed(2);\n var temperatureEl = $('<p>').html(\"Temperature: \" + temp + \"&#8457;\");\n\n //Get the humidity\n var humidityEl = $('<p>').html(\"Humidty: \" + currentCityWeather.main.humidity + \"%\");\n\n //Get the Wind speed\n var windSpeedEl = $('<p>').html(\"Wind Speed: \" + currentCityWeather.wind.speed + \" MPH\");\n\n //Append the information to the today's weather div\n currentWeatherDiv.append(cityEl);\n currentWeatherDiv.append(temperatureEl);\n currentWeatherDiv.append(humidityEl);\n currentWeatherDiv.append(windSpeedEl);\n }", "function displayWeather(data, cityInputText){\n if(data.length === 0){\n currentDate.textContent = \"No data for that city :(\";\n return;\n }\n else{\n currentDate.textContent = cityInputText + moment().format(\" MM/DD/YY\");\n var iconUrl = \"http://openweathermap.org/img/wn/\" +data.current.weather[0].icon +\"@2x.png\";\n //http://openweathermap.org/img/wn/[email protected]\n //only need link for img icon\n //console.log(data.current.weather[0].icon);\n var cityTemp = data.current.temp;\n var cityHumidity = data.current.humidity;\n var cityWind = data.current.wind_speed;\n var cityUV = data.current.uvi;\n //clear out previous classname\n currentUVIndex.className = \"\";\n //var uvi = parseInt($(this).attr(\"\"))\n if(cityUV < 3.0){\n //cityUV.innerHTML = (\"class = 'low'\")\n currentUVIndex.className += \"low\";\n }\n if(cityUV > 3 && cityUV < 7){\n currentUVIndex.className += \"moderate\";\n }\n else if(cityUV > 7){\n currentUVIndex.className += \"danger\";\n }\n //console.log(cityTemp);\n \n var currentIcon = document.getElementById(\"icon\");\n currentIcon.src = iconUrl;\n currentTemp.textContent= \"Temp: \" + cityTemp + \" °F\";\n currentHumidity.textContent = \"Humidity \" + cityHumidity + \" %\";\n currentWindSpeed.textContent = \"Wind Speed: \" + cityWind + \" mph\";\n currentUVIndex.textContent = \"UV Index: \" + cityUV;\n }\n}", "function renderTemperature(weatherResponse){\n let currentTempFar = convertToFarenheight(weatherResponse.main.temp);\n let feelsLikeTempFar = convertToFarenheight(weatherResponse.main.feels_like);\n let tempMinFar = convertToFarenheight(weatherResponse.main.temp_min);\n let tempMaxFar = convertToFarenheight(weatherResponse.main.temp_max);\n let currentTempCel = convertToCelcius(weatherResponse.main.temp);\n let feelsLikeTempCel = convertToCelcius(weatherResponse.main.feels_like);\n let tempMinCel = convertToCelcius(weatherResponse.main.temp_min);\n let tempMaxCel = convertToCelcius(weatherResponse.main.temp_max);\n $(\".weather\").replaceWith(\n `<section class=\"weather orangeBox\">\n <div class=\"forecast\">\n <img id=\"weather-icon\" src=\"https://openweathermap.org/img/wn/${weatherResponse.weather[0].icon}.png\" alt=\"weather\">\n <p>${weatherResponse.weather[0].description}</p>\n <p>${weatherResponse.main.humidity} % humidity</p>\n </div>\n <div class=\"temp\">\n <p>It's currently ${currentTempFar} °F/ ${currentTempCel} °C</p>\n <p>Feels like ${feelsLikeTempFar} °F / ${feelsLikeTempCel} °C</p>\n <p>High of ${tempMaxFar} °F / ${tempMaxCel} °C and a low of ${tempMinFar} °F/ ${tempMinCel} °C</p>\n <p>${weatherResponse.wind.speed} mph winds</p>\n </div>\n </section>`\n );\n}", "function renderData(cityName) {\n\n var queryURL = \"https://api.openweathermap.org/data/2.5/forecast?q=\" + cityName + \"&units=imperial&appid=2acfaadbcdceb6ac258c5d746dd4e2a2\";\n\n $(\"#currentStats\").show();\n $(\"#forecastStats\").show();\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n }).then(function (response) {\n var temp = response.list[0].main.temp;\n var humidity = response.list[0].main.humidity;\n var wind = response.list[3].wind.speed;\n var lat = response.city.coord.lat;\n var lon = response.city.coord.lon;\n var queryURLuvi = \"https://api.openweathermap.org/data/2.5/onecall?lat=\" + lat + \"&lon=\" + lon + \"&exclude=minutely,hourly&appid=2acfaadbcdceb6ac258c5d746dd4e2a2\";\n\n //Incorporate UVI\n $.ajax({\n url: queryURLuvi,\n method: \"GET\"\n }).then(function (response) {\n var uvi = response.current.uvi\n $(\"div.uvi\").text(\"UV Index: \" + uvi);\n console.log(uvi)\n \n //UV Index Danger Level\n if (uvi < 2) {\n $(\"div.uvi\").attr(\"style\", \"background-color:green; color:white\")\n } if (uvi >2 && uvi<5) {\n $(\"div.uvi\").attr(\"style\", \"background-color:yellow\")\n } if (uvi > 5) {\n $(\"div.uvi\").attr(\"style\", \"background-color:red; color:white\")\n }\n })\n\n //Display current stats\n $(\"div.city\").html(\"<h2>\" + response.city.name + \"</h2>\");\n $(\"div.city\").append(\"<h2>\" + currentDate + \"</h2>\")\n $(\"div.temp\").text(\"Temperature: \" + temp + \" °F\");\n $(\"div.humidity\").text(\"Humidity: \" + humidity + \"%\");\n $(\"div.wind\").text(\"Wind: \" + wind + \" mph\");\n\n //5 day forecast\n for (i = 0; i < 6; i++) {\n $(\"#day\" + [i]).text((moment().add(i, 'days').format(\"M/\" + \"DD\" + \"/YYYY\")));\n var imgToAttach = response.list[i].weather[0].icon;\n $(\"#day\" + [i] + \"Img\").attr(\"src\", \"http://openweathermap.org/img/wn/\" + imgToAttach + \".png\")\n $(\"#day\" + [i] + \"temp\").text(response.list[i].main.temp + \"°F\");\n $(\"#day\" + [i] + \"humid\").text(\"Humidity: \" + response.list[i].main.humidity + \"%\");\n }\n });\n}", "function displayCurrentCity(cityName, response) {\n\n resultCityEl.text(cityName.toUpperCase());\n var currentDate = moment().format(\" (M/D/YYYY) \");\n\n var currentFah = ((response.main.temp - 273.15) * 9 / 5 + 32).toFixed(1);\n var currentCel = (response.main.temp - 273.15).toFixed(1);\n\n var currentHumidity = response.main.humidity;\n var currentWind = ((response.wind.speed) * 2.237).toFixed(1);\n var currentDesc = response.weather[0].description;\n $('#date').text(currentDate);\n resultTempEl.text(\"Temperature: \");\n\n// calling the function to toggle with fahreneit and celcius\n fahOrCelcius(currentFah,currentCel);\n\n fahreneitEl.text(\" ℉\");\n $('#slash').text(\" / \");\n celciusEl.text(\"°C\");\n resultHumEl.text(\"Humidity: \" + currentHumidity + \"%\");\n resultWindEl.text(\"Wind Speed: \" + currentWind + \" MPH\");\n resultDescEl.text(\"Description: \" + capFirstLetter(currentDesc));\n weatherImageTitleEl.attr(\"src\", \"https://openweathermap.org/img/w/\" + response.weather[0].icon + \".png\");\n\n}", "function renderWeatherDetails(data, units) {\n let tempUnit = '°C';\n let speedUnit = 'km/h';\n\n if (units === 'imperial') {\n tempUnit = '°F';\n speedUnit = 'mph';\n }\n\n // convert windspeed from meters per second to km/h\n if (units === 'metric') {\n data.current.wind_speed *= 3.6;\n }\n\n const temperatureFeelsLike = document.querySelector('#feels-like');\n temperatureFeelsLike.textContent = `${Math.round(\n data.current.feels_like\n )} ${tempUnit}`;\n\n const humidity = document.querySelector('#humidity');\n humidity.textContent = `${data.current.humidity} %`;\n const chanceOfRain = document.querySelector('#chance-of-rain');\n chanceOfRain.textContent = `${data.daily[0].pop} %`;\n const windSpeed = document.querySelector('#wind-speed');\n // round to 1 decimal place\n windSpeed.textContent = `${\n Math.round(data.current.wind_speed * 10) / 10\n } ${speedUnit}`;\n}", "function showTemp(response) {\n let currentTemp = Math.round(response.data.list[0].main.temp);\n let currentTemperature = document.querySelector(\"#temp\");\n currentTemperature.innerHTML = currentTemp;\n\n let currentHumid = Math.round(response.data.list[0].main.humidity);\n let humidity = document.querySelector(\"#humid\");\n humidity.innerHTML = `${currentHumid}%`;\n\n let currentWind = (response.data.list[0].wind.speed) * 100;\n let windSpeed = document.querySelector(\"#speed\");\n windSpeed.innerHTML = currentWind;\n\n let cityName = response.data.list[0].name;\n let currentCity = document.querySelector(\"#city-name\");\n currentCity.innerHTML = cityName;\n}", "function displayTemperature(response) {\n let temperatureElement = document.querySelector(\"#temperature\");\n let cityElement = document.querySelector(\"#city\");\n let descriptionElement = document.querySelector(\"#description\");\n let humidityElement = document.querySelector(\"#humidity\");\n let windElement = document.querySelector(\"#wind\");\n let dateElement = document.querySelector(\"#date\");\n let iconElement = document.querySelector(\"#icon\");\n\n temperatureElement.innerHTML = Math.round(celsiusTemperature);\n cityElement.innerHTML = response.data.name;\n descriptionElement.innerHTML = response.data.weather[0].description;\n humidityElement.innerHTML = response.data.main.humidity;\n windElement.innerHTML = Math.round(response.data.wind.speed);\n dateElement.innerHTML = formatDate(response.data.dt * 1000);\n iconElement.setAttribute(\n \"src\",\n `http://openweathermap.org/img/wn/${response.data.weather[0].icon}@2x.png`\n );\n iconElement.setAttribute(\"alt\", response.data.weather[0].description);\n\n getForecast(response.data.coord);\n}", "function displayCurrentWeather(d) {\n card.style.display = 'block';\n fiveDayBtn.style.display = 'block';\n fiveDayBtnGPS.style.display = 'none';\n fiveDayBtnGPS2.style.display = 'none';\n symbolFGPS.style.display = 'none';\n celGPS2.style.display = 'none';\n symbolF.style.display = 'block';\n symbolF.style.color = 'black';\n symbolC.style.display = 'block';\n var iconUrl = d.weather[0].icon;\n var fahrenheit = Math.round(((parseFloat(d.main.temp)-273.15)*1.8)+32); \n \n cityName.innerHTML = d.name;\n countryName.innerHTML = d.sys.country; \n temp.innerHTML = fahrenheit;\n symbol.innerHTML = `&deg;F <span style=\"color:lightgrey\">|</span>`;\n icon.innerHTML = `<img src=\"http://openweathermap.org/img/wn/${iconUrl}@2x.png\"></img>`;\n desc.innerHTML = d.weather[0].description.toUpperCase(); \n input.value = ''; \n}", "function displayWeather(lat,lon){\n\n var currentUrl = api+lat+'&'+lon;\n\n $.ajax({\n url: currentUrl,\n // url: 'https://freegeoip.net/json/' // alternative url API (NOT USED - future growth)\n datatype: 'jsonp',\n\n success: function(data) {\n\n console.log(data);\n var celsiusTemprature = data.main.temp\n var fahrenheitTemprature = cToF(celsiusTemprature);\n var $weatherDescription = data.weather[0].description;\n\n $('#location').append(data.name + '<br>' + data.sys.country);\n $('#weatherIcon').append('<img src='+ data.weather[0].icon + ' alt=' +\"'\" +$weatherDescription+\"'\" +'>' );\n\n $('#temprature').append(data.main.temp+ '\\xB0C ');\n $('#weatherDescription').append($weatherDescription.toUpperCase());\n\n // show Farenheit function upon click showFarenheit button\n $('#showFarenheit').click(function(){\n $('#temprature').replaceWith( '<span id=\"temprature\">' + fahrenheitTemprature + ' \\xB0F' + '</span>' );\n });\n\n // show Celsius function upon click showCelsius button\n $('#showCelsius').click(function(){\n $('#temprature').replaceWith( '<span id=\"temprature\">' + celsiusTemprature +' \\xB0C' + '</span>' );\n });\n\n }// END success: function(data)\n\n }); // END ajax GET\n\n }", "function drawWeather( d ) {\n\n // placeholder div for testing output\n //The landing page\n $('.weather h1').html( convertTemp(d.current.temp) + '<span>&deg;</span>' );\n $('.weather p').html( printMessage(d.current.weather[0].description ));\n $('.current .currently').html( printImage(d.daily[0].weather[0].description));\n \n\n//Details of a day in hell\n $('.intro-weather h6').html( printImage(d.daily[0].weather[0].description));\n $('.intro-weather .high').html( convertTemp(d.daily[0].temp.max)+ '<span>&deg;</span>');\n $('.intro-weather .low').html( convertTemp(d.daily[0].temp.min)+ '<span>&deg;</span>');\n $('.intro-weather h3').html( convertTime(d.current.dt) );\n $('.intro-weather h5').html( convertTime(d.current.sunrise) );\n $('.intro-weather h5').html( convertTime(d.current.sunset) );\n\n //hourly weather //hour 1\n $('.intro-weather .hourly .hour0 .hour00').html( convertTemp(d.hourly[0].temp)+ '<span>&deg;</span>' );\n $('.intro-weather .hourly .hour0 .icon').html( printGraphic(d.hourly[0].weather[0].description));\n //$('.intro-weather .hourly .hour0 .icon').html( doTwoThings(convertTemp(d.hourly[0].temp), d.hourly.weather[0].description) );\n $('.intro-weather .hourly .hour0 .time').html( convertTime(d.hourly[0].dt) );\n//hour 2\n $('.intro-weather .hourly .hour1 .hour01').html( convertTemp(d.hourly[1].temp)+ '<span>&deg;</span>' );\n $('.intro-weather .hourly .hour1 .icon').html( printGraphic(d.hourly[1].weather[0].description));\n $('.intro-weather .hourly .hour1 .time').html( convertTime(d.hourly[1].dt) );\n//hour 3\n $('.intro-weather .hourly .hour2 .hour02').html( convertTemp(d.hourly[2].temp)+ '<span>&deg;</span>' );\n $('.intro-weather .hourly .hour2 .icon').html( printGraphic(d.hourly[2].weather[0].description));\n $('.intro-weather .hourly .hour2 .time').html( convertTime(d.hourly[2].dt) );\n//hour 4\n $('.intro-weather .hourly .hour3 .hour03').html( convertTemp(d.hourly[3].temp)+ '<span>&deg;</span>' );\n $('.intro-weather .hourly .hour3 .icon').html( printGraphic(d.hourly[3].weather[0].description));\n $('.intro-weather .hourly .hour3 .time').html( convertTime(d.hourly[3].dt) );\n //hour5\n $('.intro-weather .hourly .hour4 .hour04').html( convertTemp(d.hourly[4].temp)+ '<span>&deg;</span>' );\n $('.intro-weather .hourly .hour4 .icon').html( printGraphic(d.hourly[4].weather[0].description));\n $('.intro-weather .hourly .hour4 .time').html( convertTime(d.hourly[4].dt) );\n\n\n//7 day weather forecast + additional details\n $('.day00 .day').html( displayDay(0) );\n $('.day00 .desc').html( printGraphic(d.daily[0].weather[0].description));\n $('.day00 .high').html( convertTemp(d.daily[0].temp.max)+ '<span>&deg;</span>');\n $('.day00 .low').html( convertTemp(d.daily[0].temp.min)+ '<span>&deg;</span>');\n\n $('.day01 .day').html( displayDay(1) );\n $('.day01 .desc').html( printGraphic(d.daily[1].weather[0].description));\n $('.day01 .high').html( convertTemp(d.daily[1].temp.max)+ '<span>&deg;</span>');\n $('.day01 .low').html( convertTemp(d.daily[1].temp.min)+ '<span>&deg;</span>');\n\n $('.day02 .day').html( displayDay(2) );\n $('.day02 .desc').html( printGraphic(d.daily[2].weather[0].description));\n $('.day02 .high').html( convertTemp(d.daily[2].temp.max)+ '<span>&deg;</span>');\n $('.day02 .low').html( convertTemp(d.daily[2].temp.min)+ '<span>&deg;</span>');\n\n $('.day03 .day').html( displayDay(3) );\n $('.day03 .desc').html( printGraphic(d.daily[3].weather[0].description));\n $('.day03 .high').html( convertTemp(d.daily[3].temp.max)+ '<span>&deg;</span>');\n $('.day03 .low').html( convertTemp(d.daily[3].temp.min)+ '<span>&deg;</span>');\n\n $('.day04 .day').html( displayDay(4) );\n $('.day04 .desc').html( printGraphic(d.daily[4].weather[0].description));\n $('.day04 .high').html( convertTemp(d.daily[4].temp.max)+ '<span>&deg;</span>');\n $('.day04 .low').html( convertTemp(d.daily[4].temp.min)+ '<span>&deg;</span>');\n\n $('.day05 .day').html( displayDay(5) );\n $('.day05 .desc').html( printGraphic(d.daily[5].weather[0].description));\n $('.day05 .high').html( convertTemp(d.daily[5].temp.max)+ '<span>&deg;</span>');\n $('.day05 .low').html( convertTemp(d.daily[5].temp.min)+ '<span>&deg;</span>');\n\n $('.day06 .day').html( displayDay(6) );\n $('.day06 .desc').html( printGraphic(d.daily[6].weather[0].description));\n $('.day06 .high').html( convertTemp(d.daily[6].temp.max)+ '<span>&deg;</span>');\n $('.day06 .low').html( convertTemp(d.daily[6].temp.min)+ '<span>&deg;</span>');\n\n}", "function renderCityWeather(response) {\n msgDiv.empty();\n fiveDayForecast.empty();\n cityName.html(\"<h3>\" + city + \" (\" + date + \")\" + \"</h3>\");\n\n let tempF = (response.current.temp - 273.15) * 1.8 + 32;\n temperature.text(\"Temperature (F): \" + tempF.toFixed(2) + \" degrees\");\n\n //sets the color of the uv index\n if (response.current.uvi < 3) {\n uvIndex.attr(\"class\", \"uv-favorable\");\n } else if (response.current.uvi >= 3 && response.current.uvi <= 6) {\n uvIndex.attr(\"class\", \"uv-moderate\");\n } else {\n uvIndex.attr(\"class\", \"uv-severe\");\n }\n\n weatherIcon.attr(\n \"src\",\n \"http://openweathermap.org/img/w/\" +\n response.current.weather[0].icon +\n \".png\"\n );\n humidity.text(\"Humidity: \" + response.current.humidity + \"%\");\n windSpeed.text(\"Wind Speed: \" + response.current.wind_speed);\n uvIndex.text(\"UV Index: \" + response.current.uvi);\n\n let dateArray = [\n moment().add(1, \"days\").format(\"dddd MMMM DD\"),\n moment().add(2, \"days\").format(\"dddd MMMM DD\"),\n moment().add(3, \"days\").format(\"dddd MMMM DD\"),\n moment().add(4, \"days\").format(\"dddd MMMM DD\"),\n moment().add(5, \"days\").format(\"dddd MMMM DD\"),\n ];\n\n //loop to add in 5-day forecast info\n for (let i = 0; i < dateArray.length; i++) {\n let forecastDiv = $(\"<div class='forecast'>\");\n\n let dailyTemp = (response.daily[i].temp.day - 273.15) * 1.8 + 32;\n let dailyHumidity = response.daily[i].humidity;\n\n let imageEl = $(\"<img>\").attr(\n \"src\",\n \"http://openweathermap.org/img/w/\" +\n response.daily[i].weather[0].icon +\n \".png\"\n );\n let pDate = $(\"<p>\").text(dateArray[i]);\n let pTemp = $(\"<p>\").text(\"Temp: \" + dailyTemp.toFixed(1) + \" degrees\");\n let pHumidity = $(\"<p>\").text(\"Humidity: \" + dailyHumidity + \"%\");\n forecastDiv.append(imageEl);\n forecastDiv.append(pDate);\n forecastDiv.append(pTemp);\n forecastDiv.append(pHumidity);\n fiveDayForecast.append(forecastDiv);\n }\n}", "function showTemp(response) {\n //obj destructuring\n console.log(response.data);\n const {\n coord: { lat, lon },\n dt,\n main: { temp, temp_min, temp_max, feels_like, humidity },\n name,\n wind: { speed },\n } = response.data;\n\n const { main, description, icon } = response.data.weather[0];\n\n //formate time from value given in response mill secs\n formatDate(dt * 1000);\n\n place.innerHTML = name || city.value;\n cityTemp.textContent = `${temp} ℃`;\n tempDesc.textContent = description;\n\n tempDesc.textContent =\n tempDesc.innerHTML.charAt(0).toUpperCase() + tempDesc.innerHTML.slice(1);\n tempMaxMin.textContent = `${Math.round(temp_min)}℃/${Math.round(\n temp_max\n )}℃ `;\n tempRealFeel.textContent = `Feels Like: ${feels_like}℃`;\n humidityNow.textContent = ` Humidity: ${humidity}% `;\n windSpeedElem.textContent = ` Wind: ${speed} km/h`;\n\n let tempIcon = icon;\n let iconURL = `http://openweathermap.org/img/wn/${tempIcon}@2x.png`;\n //setting def value\n weatherImgElem.setAttribute(\"src\", iconURL);\n weatherImgElem.setAttribute(\"alt\", description);\n\n weatherImgIlus[main] &&\n weatherImgElem.setAttribute(\"src\", weatherImgIlus[main]);\n\n //to display the hourly forecast\n let forecastUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${name}&units=metric&appid=${apiKey}`;\n\n //display hourly(3) weather;\n axios.get(forecastUrl).then(showForeCast);\n\n //get daily wether\n getDailyWeather(lat, lon);\n\n //get hourly forecast\n // getHourlyWeather(lat, lon);\n}", "function displayWeather() {\n // iconElement.innerHTML = `<i class=\"wi wi-owm-${weather.iconId}\"></i>`;\n state.innerHTML = `<i id=\"icon-desc\" class=\"wi wi-owm-${weather.iconId}\" style=\"width:150px;\"></i>\n <p style=\"font-size: 17px;width:150px;display:flex;justify-content:center;align-items: center;\">${translatePT}</p>`;\n tempElement.innerHTML = `${weather.temperature.value}<i class=\"wi wi-celsius\"></i>`;\n}", "function currentweatherPopulate() {\n\n let city = currentDay.name;\n let temp = tempConvertor(currentDay.main.temp);\n let humid = currentDay.main.humidity;\n let wind = currentDay.wind.speed;\n let icon = currentDay.weather[0].icon;\n let date = moment.unix(currentDay.dt).format('MMMM Do YYYY');\n\n $(`.city`).text(city);\n $(`.current-date`).text(date);\n $(`.current-temp`).html(`${temp}&#176;`);\n $(`.current-humidity`).html(`${humid}&#37;`);\n $(`.current-wind`).html(`${wind} MPH`);\n $(`.current-icon`).attr(`src`, `${iconURL}${icon}@2x.png`);\n }", "function getWeather(loc) {\n weather.getWeather()\n .then(result => {\n ui.paint(result, loc);\n })\n .catch(err => console.log(err));\n}" ]
[ "0.73947626", "0.7280583", "0.72365373", "0.7206919", "0.71708155", "0.7163274", "0.71141857", "0.70769805", "0.7055402", "0.70539325", "0.70528114", "0.7048736", "0.7047533", "0.70363975", "0.7029938", "0.7001123", "0.69831103", "0.6956311", "0.6948383", "0.6945235", "0.69268197", "0.6905882", "0.6888814", "0.6888103", "0.6882444", "0.68711996", "0.6867365", "0.6862576", "0.68586504", "0.6855545", "0.6841294", "0.68405634", "0.68353736", "0.6834472", "0.6832656", "0.6827385", "0.6822983", "0.6818042", "0.6817817", "0.6814555", "0.68100786", "0.68051463", "0.68008924", "0.68004954", "0.678452", "0.6769813", "0.67652655", "0.6761341", "0.675766", "0.67536575", "0.67531574", "0.67506504", "0.6746539", "0.6744982", "0.6743609", "0.6741632", "0.6739533", "0.67364657", "0.67358416", "0.6735747", "0.6733851", "0.6727219", "0.6727062", "0.67205775", "0.672006", "0.6720025", "0.67192", "0.6709745", "0.6708544", "0.67072815", "0.67015386", "0.66830873", "0.66717637", "0.6666566", "0.66590667", "0.66579884", "0.6650921", "0.6650737", "0.66431755", "0.6637574", "0.6633809", "0.66302365", "0.66282797", "0.66271085", "0.6625751", "0.6623578", "0.66226315", "0.66212726", "0.6619812", "0.6616854", "0.6614402", "0.6613913", "0.6611731", "0.6611157", "0.6610586", "0.66058636", "0.65957236", "0.6585707", "0.65852016", "0.6576987", "0.6575881" ]
0.0
-1
Storage Search City to local storage
function saveCityToLocalStorage(item) { let localStorageMessage = $("#weather-search-bar").val().toUpperCase(); let inputbarParentID = $("#weather-search-bar").val().toUpperCase(); if (localStorage.getItem(localStorageMessage)) { //pass } else { localStorage.setItem(inputbarParentID, localStorageMessage); $("#recent-history").append( $("<li>").text(localStorageMessage).addClass("recentHistory") ); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function storeSearch() {\n localStorage.setItem('cities', JSON.stringify(allCities));\n}", "function storeLookupCity() {\n\n localStorage.setItem(\"SearchedCity\", JSON.stringify(searchedCity));\n}", "function saveCitySearch(city) {\n cityArr.push(city.toLowerCase());\n localStorage.setItem(\"city\", JSON.stringify(cityArr));\n }", "function setCitiesToLocalStorage() {\n localStorage.setItem(\"cities\", JSON.stringify(citySearches));\n}", "function saveCitySearch() {\n\n var cityInput = document.querySelector(\"#cityNameInput\");\n \n var cityStore = JSON.parse(localStorage.getItem(\"#savedCitySearches\"));\n\n if(cityStore === null){\n cityStore = [];\n } else if (!cityInput.value){\n return;\n } else if(cityStore.includes(cityInput.value)) { \n return; \n }\n cityStore.push(cityInput.value);\n localStorage.setItem(\"#savedCitySearches\", JSON.stringify(cityStore));\n cityInput.value = [\"\"]; \n }", "function saveSearch() {\n localStorage.setItem('currentCity', JSON.stringify(cityName));\n localStorage.setItem('searchHistory', JSON.stringify(searchHistory));\n}", "function savedSearches() {\n localStorage.setItem(\"savedCities\", JSON.stringify(searchedCities));\n}", "function saveToLocalStorage() {\n // Validation check to see if searched city exists on the sidebar AND whether or not searched city is an empty string\n if(citySearches.includes($(\"#searchInput\").val()) === false && $(\"#searchInput\").val().trim() != \"\") {\n // Push search term to citySearches array\n citySearches.push($(\"#searchInput\").val());\n // Sets localStorage to past searches using citySearches array\n localStorage.setItem(\"citySearches\", JSON.stringify(citySearches));\n\n // Sets localStorage to last searched city\n localStorage.setItem(\"lastSearchedCity\", lastSearchedCity);\n }\n }", "function storeSearches() {\n localStorage.setItem(\"citiesList\", JSON.stringify(citiesList));\n}", "function storeCityInfo() {\n localStorage.setItem('cities', JSON.stringify(cities));\n }", "function storeCitiesToLocalStorage(cityName){\n //Reading localstorage list if any\n var cityList = JSON.parse(localStorage.getItem('weatherCityList')) || [];\n var isCityExist = false;\n for(var i=0;i<cityList.length;i++)\n {\n if(cityName === cityList[i]){\n isCityExist = true;\n }\n }\n if(!isCityExist){\n cityList.push(cityName);\n localStorage.setItem('weatherCityList',JSON.stringify(cityList));\n //Load localstorage city list\n loadLocalStorageCities(cityName);\n }\n \n}", "function storeCities(){\n localStorage.setItem(\"savedCity\", JSON.stringify(savedCity));\n }", "function getCitiesFromLocalStorage() {\n if (localStorage.getItem(\"cities\")) {\n citySearches = JSON.parse(localStorage.getItem(\"cities\"));\n }\n}", "function getSetCityLocalStorage(city) {\n var citiesStored = JSON.parse(localStorage.getItem(\"citiesserched\"));\n if (!citiesStored) {\n var citiesArray = [];\n if (city) {\n city = city.toUpperCase();\n citiesArray.push(city);\n var cityObject = {};\n cityObject.cities = citiesArray;\n localStorage.setItem(\"citiesserched\", JSON.stringify(cityObject));\n displayCitySearchHistory();\n }\n } else {\n if (city) {\n city = city.toUpperCase();\n if (citiesStored.cities.indexOf(city) === -1) {\n citiesStored.cities.push(city);\n }\n localStorage.setItem(\"citiesserched\", JSON.stringify(citiesStored));\n }\n displayCitySearchHistory();\n }\n}", "function storeCity(citySearch) {\n const cityDataObj = {\n city: citySearch\n \n }\n \n cities.push(cityDataObj);\n console.log(cities);\n window.localStorage.setItem('cityList', JSON.stringify(cities));\n window.localStorage.getItem('cityList');\n JSON.parse(window.localStorage.getItem('cityList'));\n displayCities();\n \n}", "function saveCity() {\n localStorage.setItem(\"lscity\", JSON.stringify(cities));\n }", "function storeCities() {\n localStorage.setItem(\"cities\", JSON.stringify(cities));\n }", "function storeCities() {\n var cityToBeAdded = inputCityEl.value;\n console.log(cityToBeAdded);\n\n // confirm there are no duplicates\n if (cityList.indexOf(cityToBeAdded) === -1) {\n cityList.push(cityToBeAdded);\n localStorage.setItem(\"cities\", JSON.stringify(cityList));\n }\n\n // Add the recently searched cities to the CityList\n renderCities();\n\n // Make the forecast request\n searchWeather(cityToBeAdded);\n}", "function searchStorage() {\n var newSearch = $(\"<li>\")\n .addClass(\"list-group-item\")\n .text(city.charAt(0).toUpperCase() + city.substr(1));\n\n $(\".list-group\").append(newSearch);\n \n saveSearch.push(newSearch.text());\n localStorage.setItem(\"city\", JSON.stringify(saveSearch));\n }", "function getSearch() {\n var storedSearch = JSON.parse(localStorage.getItem('cities'));\n if (storedSearch !== null) {\n allCities = storedSearch;\n }\n renderButtons();\n}", "function storeCityToStorage(cityName) {\n\n if(allCities.filter(c => c === cityName).length === 0) {\n allCities.push(cityName);\n localStorage.setItem(\"citiesObject\", JSON.stringify(allCities)); \n }\n}", "function savCities() {\n localStorage.setItem(\"saveCity\", JSON.stringify(cities));\n }", "addToLocalStorage (value) {\n // It save the searched city on local storage\n const $this = this\n let isCityStorage = this.cities.find(item => {\n return (item.key === $this.getName && item.value === $this.getCountry)\n })\n if (!isCityStorage) {\n this.cities.push(value)\n let parse = JSON.stringify(this.cities)\n localStorage.setItem('cities', parse)\n }\n }", "function storeCities(){\n localStorage.setItem(\"cities\", JSON.stringify(cities)); \n}", "function storeCities(){\n localStorage.setItem(\"cities\", JSON.stringify(citiesArray));\n }", "function saveToLocal(cityInput) {\n var inputData = JSON.parse(localStorage.getItem(\"cityInput\")) || [];\n inputData.push(cityInput);\n localStorage.setItem(\"cityInput\", JSON.stringify(inputData));\n}", "function storeCities() {\n localStorage.setItem(\"city\", JSON.stringify(previousCities));\n}", "function storeCity() {\n localStorage.setItem(\"stored\", JSON.stringify(recentCities));\n}", "function searchCity(savedCity){\n \n getCurrentWeather( savedCity);\n getForecastWeather( savedCity);\n \n}", "function setSavedCities() {\n // Only save if user has put in cities\n if (savedCities.length > 0) {\n // put this in local storage\n localStorage.setItem(lastCitySearch, lastCityNumber);\n localStorage.setItem(savedCitySearches, JSON.stringify(savedCities));\n }\n}", "function storageSet() {\n city = cityNameEl.text()\n cityArray.push(city);\n localStorage.setItem('cityname', JSON.stringify(cityArray));\n}", "setStorage(city) {\r\n localStorage.setItem('city', city);\r\n }", "function searchCityWeather() {\n let name = ele.getElementsByClassName(\"city-name\")[0].value;\n if (!name) return;\n let wData = getDataFromLocalStorage(name);\n if (!wData) {\n fetch(getApiURL(name))\n .then(response => response.json())\n .then(data => {\n setDataToDisplay(data);\n setDataToLocalStroage(name, data);\n })\n .catch(error => console.error(error));\n } else {\n setDataToDisplay(wData);\n }\n}", "function storeCurrentCity() {\n\n localStorage.setItem(\"currentCity\", JSON.stringify(cityname));\n}", "function storeCity(city) {\n //notice this var is scoped only in this function -not same as getCities function below\n var storedCities = getCities();\n if (!storedCities.includes(city)) {\n storedCities.push(city);\n localStorage.setItem(\"storeCity\", JSON.stringify(storedCities));\n var newCity = $(`<div class=\"cityChoice\">${city}</div>`);\n //makes city clickable\n newCity.on(\"click\", cityClicked);\n $(\"#searchedCities\").append(newCity);\n }\n }", "function saveToStorage(){\n let citySavedNames = $(\"#cityname\").val();\n\n let cities;\n if(localStorage.getItem('S-Cities') === null){\n cities = [];\n }else{\n cities = JSON.parse(localStorage.getItem('S-Cities'))\n }\n cities.push(citySavedNames);\n localStorage.setItem('S-Cities', JSON.stringify(cities));\n }", "function saveCities(){\n localStorage.setItem(\"currentCity\", JSON.stringify(city));\n localStorage.setItem(\"citiesList\", JSON.stringify(cityList));\n}", "function storeCityArray() {\n localStorage.setItem(\"cities\", JSON.stringify(cityList));\n }", "function saveCity(city){\n if (city !== \"\") {\n cityArray.push(city);\n }\n localStorage.setItem(\"cities\", JSON.stringify(cityArray));\n displayCity();\n}", "function storingCities(prevSearches) {\n localStorage.setItem(\"searched-cities\", JSON.stringify(prevSearches));\n renderButtons();\n }", "function localStorageDataExchange(inputSearchCityValue) {\n let dataCityName = JSON.parse(localStorage[\"city-name\"]);\n let presenceInData = dataCityName.indexOf(inputSearchCityValue)\n if (presenceInData == 0) {\n return\n } else if (presenceInData > 0) {\n dataCityName.unshift(dataCityName.splice(presenceInData, 1)[0]);\n localStorage.setItem(\"city-name\", JSON.stringify(dataCityName));\n } else if (presenceInData == -1) {\n dataCityName.unshift(inputSearchCityValue);\n localStorage.setItem(\"city-name\", JSON.stringify(dataCityName));\n }\n}", "function storedCityArray() {\n localStorage.setItem(\"cities\", JSON.stringify(cityList));\n }", "function storedCities() {\n//create a variable to get the cities object from storage\n var storedCities = JSON.parse(localStorage.getItem(\"cities\"));\n//if the value or type are not empty, use them as the city list\n if (storedCities !== null) {\n cityList = storedCities; \n }\n//call the previous function to get the user provided city\n displayCities();\n }", "function getCityInfo() {\n var cityList = JSON.parse(localStorage.getItem(savedCitySearches));\n\n lastCityNumber = localStorage.getItem(lastCitySearch);\n\n //set global variable to list if value is returned\n if (cityList) {\n savedCities = cityList;\n displaySavedCities(); // Load displayed city list that user has previously searched\n displayOldData(); // Last viewed city displayed here\n }\n}", "function storeCity(cityName) {\n let cityStore;\n\n // Check if Array exists\n if(localStorage.getItem('cities') === null) {\n cityStore = [];\n } else{\n cityStore = JSON.parse(localStorage.getItem('cities', cityStore));\n }\n\n // Push city data\n cityStore.push(cityName);\n\n // Push to localstorage\n localStorage.setItem('cities', JSON.stringify(cityStore));\n }", "handleSearch() {\n let city = this.state.addedCity;\n if (!this.state.locations.includes(city) && city !== '') {\n let newLocationsList = [...this.state.locations, city];\n localStorage.setItem(GLOBAL_CONSTANTS.STORED_LOCATIONS, JSON.stringify(newLocationsList));\n this.setState({ locations: newLocationsList, addedCity: '', notFoundCity: null, alreadyExists: false });\n } else if (this.state.locations.includes(city)) {\n this.setState({ alreadyExists: true, notFoundCity: null });\n }\n }", "function saveCities(city) {\n // use an if statement to make sure the list doesn't populate the same city more than once\n if (!cityNames.includes(city)) {\n // if the city the user typed in isn't already in the cityNames array, use unshift to inject it at the 0 index of the array\n cityNames.unshift(city)\n }\n // if there are more than 5 items in cityNames array, get rid of the last one\n if (cityNames.length === 6){\n cityNames.splice(5, 1)\n }\n // set cityNames array in local storage\n localStorage.setItem(\"Cities\", JSON.stringify(cityNames)) \n}", "function searchWeather(city) {\n fetchWeather(city);\n addNewCity(city);\n}", "static getSavedCityCollection() {\n return JSON.parse(localStorage.getItem(App.localStorageKey));\n }", "function setChosenCityLS() {\n localStorage.setItem(\"chosenCity\", JSON.stringify(chosenCity));\n}", "function checkStorage() {\n var storedCity = localStorage.getItem(\"city\");\n if(storedCity) {\n sTerm = storedCity;\n getForecasts();\n };\n var storedCities = localStorage.getItem(\"cities\")\n if (storedCities){\n cities = JSON.parse(storedCities)\n for (i=0; i < cities.length; i++){\n name = cities[i];\n btnMk(name);\n };\n btnClear();\n };\n}", "function storeSearchList() {\n console.log(\"storing: \" + JSON.stringify(countrySearchList));\n\n localStorage.setItem(SEARCHEDLIST, JSON.stringify(countrySearchList));\n}", "function getLS() {\n // console.log(JSON.stringify(localStorage));\n if (localStorage.getItem(\"searchedCities\") === null ||\n localStorage.getItem(\"searchedCities\") === \"\"){\n searchedCities = [];\n } else {\n searchedCities = JSON.parse(localStorage.getItem(\"searchedCities\"));\n }\n console.log(searchedCities)\n}", "function handleSearchFormSubmit(event){\n event.preventDefault();\n\n searchInputVal = document.querySelector('#search-input').value;\n\n if (!searchInputVal){\n alert(\"You Need to Enter a Valid City!\");\n } else {\n // save input into searchedCities array \n // save searchedcity into local storage\n // console.log(searchedCities);\n searchedCities.push(searchInputVal);\n // console.log(typeof searchInputVal);\n localStorage.setItem('searchedCities', JSON.stringify(searchedCities));\n }\n\n geoCoords(searchInputVal);\n savedCities();\n clearDiv();\n // searchWeather();\n // var timeout = setTimeout(displayWeather(),5000);\n \n}", "static addCityToStorage(newCity, savedCities) {\n savedCities = savedCities || [];\n const updatedCollection = savedCities.concat(newCity);\n localStorage.setItem(App.localStorageKey, JSON.stringify(updatedCollection));\n }", "recoverCities () {\n this.cities = localStorage.cities ? JSON.parse(localStorage.cities) : []\n }", "setLocality(state, city){\n localStorage.setItem('state', state)\n localStorage.setItem('city', city)\n }", "function grabStorage() {\n var cityStorage = JSON.parse(localStorage.getItem(\"city\")) || [];\n storageArray = cityStorage;\n cityStorage.forEach((element) => {\n var searchHistoryDisplay = generateCityListItem(element);\n searchHistoryElem.append(searchHistoryDisplay);\n });\n}", "function displayCities() {\n if (localStorage.getItem(\"citySearchedArray\") !== null) {\n var citySearchedArray = JSON.parse(localStorage.getItem(\"citySearchedArray\"));\n console.log(citySearchedArray);\n }\n}", "function saveSearch() {\n \n \n localStorage.setItem(\"search-value\", teamSearch);\n console.log(saveSearch);\n }", "function getSavedInfo(cityName) {\n // check if selected city is already in list\n var cityFound = false;\n for (let i=0; i<savedCities.length; i++) {\n if (cityName.toLowerCase() === savedCities[i].name.toLowerCase()) {\n cityFound = true;\n lastCityNumber = i;\n localStorage.setItem(lastCitySearch, lastCityNumber);\n }\n }\n\n if (!cityFound) {\n var newCityInfo = {}; // object for holding data\n\n // Get current forecast with the API and its key\n var owURL = openWeatherAPI + openCurrentWeather + cityName + openAPIkey;\n\n $.ajax({\n url: owURL,\n method: \"GET\"\n }).then(function (response) {\n newCityInfo.name = response.name; // format the city name correctly\n newCityInfo.lat = response.coord.lat; // latitude\n newCityInfo.lon = response.coord.lon; // longitude\n lastCityNumber = savedCities.push(newCityInfo) - 1; // add to array of saved searches\n setSavedCities(); // save array in localstorage\n displaySavedCities();\n displayOldData();\n }).catch(function (error) {\n if (error.status == 404) {\n $(\"#errorMsg\").text('City \"' + cityName + '\" not found. Please check spelling and try again.');\n }\n else {\n $(\"#errorMsg\").text(\"Sorry, cannot retrieve weather information. Please try again later.\");\n }\n $(\".modal\").modal('show');\n });\n }\n else {\n displayOldData(); // if city already in list, display its data \n }\n}", "function getLocalStorage() {\n var storage = JSON.parse(localStorage.getItem(\"cities\"));\n if (storage !== null) {\n citiesArray = storage;\n }\n }", "function storeCityName() {\n //stringify and set \"cityArray\" key in localStorage to cityArray array\n localStorage.setItem(\"cityArray\", JSON.stringify(cityArray));\n}", "function search() {\n let cityName = $(\"#input\").val();\n btnArr.push(cityName);\n localStorage.setItem(\"history\", JSON.stringify(btnArr));\n renderBtn(cityName);\n currentWeather(cityName);\n get5Day(cityName);\n $(\"#input\").val(\"\");\n}", "writeResult() {\n const local = window.localStorage;\n // concat cityname and country\n const cityName = this.cityOutput.concat(', ', this.cityCountry);\n // check if localStorage 'object' exists, if not create\n if (!local.getItem('cityList')) {\n local.setItem('cityList', `${JSON.stringify([])}`);\n }\n // check if it already exists in the (no dupes)\n if (!this.cityList.includes(cityName)) {\n const tempCityList = this.cityList;\n // cityName to start of array\n tempCityList.unshift(cityName);\n this.cityList = tempCityList;\n console.log(this.cityList);\n // write back to local\n }\n }", "function saveList(city){\n cityList.push(city);\n localStorage.setItem('cities', JSON.stringify(cityList));\n}", "function getCities() {\n var storedCities = localStorage.getItem(\"storeCity\");\n\n //this will give back cities array\n return JSON.parse(storedCities) || [];\n }", "function saveRecents() {\n // // saves entire Object to local storage\n localStorage.setItem('Recent Cities', JSON.stringify(recentSearches));\n }", "function loadCity() {\n cities = JSON.parse(localStorage.getItem(\"lscity\"));\n if (cities) {\n weatherData(cities[cities.length - 1])\n } else {\n cities = [];\n }\n }", "function setStorage() {\n var cityNames = [];\n cities.forEach(function(element) {\n cityNames.push(element.name);\n }, this);\n sessionStorage.setItem(\"cities\", cityNames);\n}", "function getSavedCity() {\n var searchHistory = JSON.parse(localStorage.getItem(\"city\"));\n\n if (!searchHistory) {\n return null;\n }\n\n cityArr = searchHistory\n\n $(\"#city-div\").empty();\n\n for (var i = 0; i < searchHistory.length; i++) {\n var cityButton = $(\"<button id='historyBtn'>\");\n cityButton.addClass(\"historyBtn\");\n cityButton.attr(\"data-name\", searchHistory[i]);\n cityButton.text(searchHistory[i]);\n\n\n $(\"#city-div\").prepend(cityButton);\n }\n }", "function saveCity(newCity){\n //Flag to see if City exists\n var cityExists = false;\n //Loops through local storage\n for(var i = 0; i < localStorage.length; i++){\n //If city passed into the method matches something in local storage\n if(localStorage[\"cities\" + i] === newCity){\n //Flag switches to true\n cityExists = true;\n break;\n }\n }\n //If city is not already in the local storage\n if(cityExists === false){\n //Then add it\n localStorage.setItem('cities' + localStorage.length, newCity);\n }\n\n}", "function geoIdentify() {\n var searchCity = $(\"#inputGroupSelect03\").val();\n console.log(searchCity);\n localStorage.setItem(\"cityName\", searchCity);\n selectedCity = searchCity;\n $.ajax({\n url: apiBase + searchCity,\n method: \"GET\",\n }).done(function (response) {\n console.log(response);\n querySecondURL =\n response._embedded[\"city:search-results\"][0]._links[\"city:item\"].href;\n urbanSlug();\n });\n }", "function getStoredCities() {\n storedCities = JSON.parse(localStorage.getItem(\"Recent Cities\"))\n if (storedCities !== null) {\n renderCities();\n } else {\n storedCities = [];\n }\n}", "function loadSaveData() {\n // Grab the local storage data\n var storedSearchData = JSON.parse(localStorage.getItem(\"weatherHistoryData\"));\n // Check if stored data is empty or non-existent\n if (!storedSearchData || storedSearchData.length == 0) {\n return;\n }\n else {\n // Remove the invis class from the main wrapper if there is saved data\n $(mainWrapper).removeClass(\"invis\");\n // Overwrite array based on localstorage\n storedSearchData.forEach((item) => {\n searchHistoryArray = [...storedSearchData];\n });\n for (i = 0; i < searchHistoryArray.length; i++) {\n $(historyPanel).append('<article class=\"searchHistory bordered centered\">' + searchHistoryArray[i] + '</article>');\n }\n // Search city based on last search but don't update the array\n searchCityWeather(searchHistoryArray[0], false);\n }\n }", "function saveCity(cityName) {\n // Save the cityName to local storage with the key: weather-app\n localStorage.setItem(\"weather-app\", cityName);\n showSavedCity(cityName);\n}", "function addCity(cityName) {\n const key = 'Search History';\n var searchHistory = JSON.parse(localStorage.getItem(key) || \"[]\");\n\n for (var i = 0; i < searchHistory.length; i++) {\n if (cityName === searchHistory[i]) {\n return;\n }\n }\n\n searchHistory.push(cityName);\n localStorage.setItem(key, JSON.stringify(searchHistory));\n\n displaySearchHistory();\n}", "function getCities() {\n\n var storedCities = JSON.parse(localStorage.getItem(\"cityArray\"));\n\n if (storedCities !== null) {\n cityArray = storedCities;\n }\n //render array to the dom\n renderCityList();\n}", "function addCity(city) {\n var storedCities = JSON.parse(localStorage.getItem(\"cities\"));\n for (i=0; i<cities.length; i++) {\n if (storedCities[i] === city) {\n return\n }\n }\n cities.push(city);\n localStorage.setItem(\"cities\", JSON.stringify(cities));\n renderCities();\n}", "function originCity() {\r\n localStorage.setItem('origin', document.getElementById(\"originCity\").value);\r\n}", "function setCurrentSearch(city) {\n fetch(`https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=e9adb5ecd7dff0e9e1999612c1c3fdfd`)\n .then(r => r.json())\n .then(data => {\n currentSearch = data\n searchHistoryList.push(data)\n fetch(`http://api.openweathermap.org/data/2.5/uvi?appid=e9adb5ecd7dff0e9e1999612c1c3fdfd&lat=${data.city.coord.lat}&lon=${data.city.coord.lon}`)\n .then(r => r.json())\n .then(data => {\n document.getElementById('uvIndex').innerHTML = `\n UV Index: ${data.value}\n `\n })\n localStorage.setItem('searchHistoryList', JSON.stringify(searchHistoryList))\n renderHistory()\n renderCurrent()\n console.log(data)\n })\n}", "function checkForSavedCities() {\n let lastCity = JSON.parse(localStorage.getItem('city'));\n if (lastCity !== null) {\n recentCityArr = lastCity;\n }\n }", "function writeLocalItems(lastCitiesSearched) {\n prevent.preventDefault();\n\n // Add Last Cities Object Here\n\n console.log(lastCitiesSearched);\n localStorage.setItem(\"lastCitiesSearched\", JSON.stringify(lastCitiesSearched));\n}", "function storeCities(city, cityData) {\n if (sCity.includes(cityData.name)) { // if value already exists - don't push to array\n console.log('ALREADY EXISTS DONT PUSH ME')\n } else { // else if- value does not exist- push to array\n sCity.push(cityData.name);\n localStorage.setItem(\"cityname\", JSON.stringify(sCity));\n }\n}", "function getCities(){\n //if there are items in a stored 'cities' key, grab them and push to cities arr\n if (localStorage.getItem(\"cities\")) {\n const savedCities = JSON.parse(localStorage.getItem(\"cities\"))\n cities.push(...savedCities)\n }\n }", "get cityList() {\n return JSON.parse(window.localStorage.getItem('cityList'));\n }", "function getCitiesFromAPI(term) {\n\n //Check whether the term is already searched for from localstorage, if yes load it from cache\n for (var i = 0, len = localStorage.length; i < len; ++i) {\n if (localStorage.key(i) == term) {\n populateList(JSON.parse(localStorage.getItem(term)));\n return;\n }\n }\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"https://api.myjson.com/bins/uaro7?term=\" + term, true);\n xhr.onload = function () {\n //console.log(xhr.responseText);\n var data = JSON.parse(xhr.responseText);\n if (Object.keys(data).length == 0) {\n alert(\"Empty response !!\");\n }\n else {\n //Filter the response data based on user input and narrow it down\n let matches = [] = data.filter(s => s.includes(term));\n //console.log(matches);\n //Store the result in localstorage\n localStorage.setItem(term, JSON.stringify(matches));\n populateList(matches);\n\n }\n\n };\n xhr.send();\n}", "function storeCityList(){\n //this initializes the cityList array\n let cityList = [];\n //this grabs each li element innerText which should be city names and pushes them to the cityList array\n $(\"li\").each(function(){\n cityList.push($(this)[0].innerText);\n });\n //store cityList array to local storage\n localStorage.setItem(\"cities\", cityList);\n}", "function storeCity(city) {\n var currentCity = $('<li>').text(city);\n currentCity.attr({ type: 'button', class: 'storeCity', name: city });\n $('#cities').append(currentCity);\n localStorage.setItem(city, city);\n }", "onCityNotFound(city) {\n let locations = JSON.parse(localStorage.getItem(GLOBAL_CONSTANTS.STORED_LOCATIONS));\n let newLocations = locations.filter((location) => {\n return location !== city;\n })\n this.setState({ locations: newLocations, notFoundCity: city });\n localStorage.setItem(GLOBAL_CONSTANTS.STORED_LOCATIONS, JSON.stringify(newLocations));\n }", "getStorage() {\r\n if(!localStorage.getItem('city')) {\r\n this.city = this.defaultCity\r\n }\r\n else {\r\n this.city = localStorage.getItem('city');\r\n }\r\n\r\n return {\r\n city: this.city\r\n }\r\n }", "function saveSearchFilter() {\n var searchOptions = {};\n searchOptions[HOTEL_SEARCH_FILTER] = filterParams;\n searchOptions[HOTEL_SEARCH_BODY] = filterBody;\n searchOptions[HOTEL_SEARCH_ADVANCE] = filterAdvance;\n $localStorage[HOTEL_SEARCH_OPTIONS] = searchOptions;\n }", "function retrieveHistory() {\n if (!localStorage.getItem('cities')) {\n localStorage.setItem('cities', JSON.stringify(searchHistory));\n } else {\n searchHistory = JSON.parse(localStorage.getItem('cities'));\n }\n}", "function selectCity(event) {\n event.preventDefault();\n console.log(\"city has been called\");\n \n // select form element by its `name` attribute and get its value\n var cityName = $('input[name=\"city-input\"]').val();\n\n // if there's nothing in the form entered, don't print to the page\n if (!cityName) {\n alert(\"Introduce a city name\");\n return;\n }\n var isCityInList = false;\n for (let i=0; i<cityHistory.length; i++) {\n if(cityName.toLowerCase() === cityHistory[i].toLowerCase()) {\n isCityInList = true;\n }\n \n }\n getWeather(cityName)\n // print to the page\n if (!isCityInList){\n cityListEl.append('<li class= \"list-group-item\">' + cityName + '</li>');\n cityHistory.push(cityName);\n localStorage.setItem(\"cityHistory\", JSON.stringify(cityHistory));\n }\n \n\n // clear the form input element\n $('input[name=\"city-input\"]').val('');\n //create a function `getWeather` that accepts `cityName` and call +\n\n //TODO store city on local storage\n}", "function addToCityList() {\n if (searchHistory) {\n searchHistory = JSON.parse(localStorage.getItem(PLACEHOLDER_KEY));\n $('#searchedCityList').append(searchHistory.city);\n console.log(searchHistory);\n }\n}", "function buildURL(citySearch){\n var userCity = $(\"#userInput\").val().trim();\n userCity = userCity.replace(/\\s+/g, \"\");\n localStorage.setItem('lastSearch', userCity)\n var citySearch = 'https://api.openweathermap.org/data/2.5/forecast?q=' + userCity + '&appid=7a55a4098897a5f61d0e5acedb9f428e';\n return (citySearch);\n }", "function searchHistory(city) {\n var oldHistory = JSON.parse(localStorage.getItem(\"searchHistory\"));\n var newHistory = [];\n\n if (!Array.isArray(oldHistory)) {\n newHistory.unshift(city); // if object retrieved from storage is not an array add the city to new history array\n } else {\n newHistory = oldHistory; // add the old history to the new history\n };\n\n // add city if missing from newHistory array\n if (!newHistory.includes(city)) {\n newHistory.unshift(city);\n };\n\n localStorage.setItem(\"searchHistory\", JSON.stringify(newHistory)); // save newHistory array to storage.\n\n renderBtns(newHistory); // re-renders buttons with new list\n}", "function dellSelectCities(dellCity, event) {\n event.target.parentElement.remove()\n let tempLocalStorage = JSON.parse(localStorage[\"city-name\"])\n tempLocalStorage.forEach(function(data, i) {\n if (data == dellCity) {\n tempLocalStorage.splice(i, 1);\n if (i == 0 && tempLocalStorage.length > 0) {\n xhttpRequesrtWeather(tempLocalStorage[0])\n }\n }\n })\n localStorage.setItem(\"city-name\", JSON.stringify(tempLocalStorage));\n}", "function getCitiesFromLocalStorage() {\n // Parse the string version of the array from local storage back into an array of objects and set the myCities array equal to this array\n myCities = JSON.parse(localStorage.getItem(\"myCities\"));\n // Add the methods back onto the objects because they are not stored in local storage\n myCities.forEach(function(city) {\n city.getCityInfo = getCityInfo;\n city.getCurrentTime = getCurrentTime;\n city.getCurrentWeather = getCurrentWeather;\n });\n}", "function loadStorage() {\n if (lastSearch === \"\") {\n return;\n } else {\n $(\"#search-term\").val(lastSearch);\n currentWeather(lastSearch);\n setTimeout(function () {\n $(\"#search-btn\").click();\n }, 100);\n }\n}" ]
[ "0.8242157", "0.80308855", "0.7977705", "0.7835976", "0.77531713", "0.7630605", "0.76001495", "0.759969", "0.75666624", "0.7434485", "0.7381797", "0.73768234", "0.7357764", "0.73375696", "0.73187834", "0.7318287", "0.73105556", "0.72839904", "0.72810763", "0.72541094", "0.7184414", "0.71610856", "0.7092093", "0.7090279", "0.7072726", "0.70709854", "0.7063333", "0.70561546", "0.70533407", "0.70105916", "0.69769895", "0.6927724", "0.6878709", "0.6869022", "0.68244576", "0.6817062", "0.6810318", "0.6810131", "0.68089056", "0.6806942", "0.6793319", "0.67779815", "0.67719287", "0.67588663", "0.67102623", "0.6694008", "0.66934824", "0.6686865", "0.6686575", "0.6683326", "0.6661134", "0.6602628", "0.6601063", "0.6594299", "0.65906686", "0.65857667", "0.6580764", "0.6548358", "0.6538977", "0.65371066", "0.6513024", "0.65045565", "0.64951146", "0.646742", "0.646161", "0.6455631", "0.6429263", "0.6419978", "0.6416473", "0.6416058", "0.6413045", "0.64110905", "0.6404864", "0.64035213", "0.6403239", "0.6389591", "0.63849765", "0.6382345", "0.6376195", "0.6374646", "0.63731766", "0.63715184", "0.6366017", "0.63607985", "0.63430476", "0.63427734", "0.63419527", "0.63253623", "0.6322681", "0.6320509", "0.6310196", "0.6294693", "0.6289007", "0.628863", "0.628059", "0.6272322", "0.6269792", "0.626924", "0.62691784", "0.62627864" ]
0.6554526
57
used in componentWillReceiveProps to update patientHuddles, selectedPatientHuddle, and selectedPatientHuddlePatientInfo state
updateHuddles(patient, huddles, selectedDate) { let patientHuddles = getPatientHuddles(patient, huddles); let selectedPatientHuddle; if (patientHuddles != null) { selectedPatientHuddle = this.selectedPatientHuddle(selectedDate, patientHuddles); } let selectedPatientHuddlePatientInfo; if (selectedPatientHuddle != null) { selectedPatientHuddlePatientInfo = selectedPatientHuddle.patients.find((patient) => patient.id === this.props.patient.id); } this.setState({ patientHuddles, selectedPatientHuddle, selectedPatientHuddlePatientInfo }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "componentWillReceiveProps(nextProps) {\n console.log(\"SelectFromObject props\");\n console.log(nextProps);\n nextProps.selected ? this.setState({selected: nextProps.selected}) : '';\n }", "componentWillReceiveProps(nextProps) {\n // console.log(\"SelectFromObject props\");\n // console.log(nextProps);\n nextProps.selected ? this.setState({selected: nextProps.selected}) : '';\n }", "componentDidUpdate(prevProps) {\n if (prevProps.selected !== this.props.selected) { \n this.highlightSelected(this.props);\n }\n }", "componentWillReceiveProps(nextProps){\n let selectedValue_old = this.props.selectedValue\n let selectedValue_new = nextProps.selectedValue\n let option = this.state.options.find(opt=> opt.value==selectedValue_new)\n if(selectedValue_old!==selectedValue_new){\n // si esto cambia, entonces se debe hacer un \"reset\" del estado con los nuevos valores\n this.setState({\n selectedLabel: option? option.label : '-',\n selectedValue: selectedValue_new,\n dirty: false\n })\n }\n if(selectedValue_new!==this.state.selectedValue){\n // si se reciben propiedades distintas al \"state\" actual, se reemplazan por las propiedades\n this.setState({\n selectedLabel: option? option.label : '-',\n selectedValue: selectedValue_new,\n dirty: false\n })\n }\n }", "componentWillMount(){\n this.setState({\n selectedValue: this.props.selectedValue,\n selectedLabel: this.props.selectedLabel,\n dirty: false\n })\n }", "componentWillReceiveProps(newProps) {\n newProps.stations.map(station => {\n if (newProps.selectedId === station.public_id){\n this.setState({lng:station.lang, ltd:station.latd, name:station.name})\n }\n });\n }", "componentDidUpdate(prevProps){\n if(this.props.selectedCountry !== prevProps.selectedCountry){\n this.getUserList(this.props.selectedCountry);\n }\n }", "handlePick(pickedPeopleReturnedFromPicker) {\n\t\tthis.setState({\n\t\t\tpickedPeople: pickedPeopleReturnedFromPicker,\n\t\t});\n\t\tthis.props.setSelectedPersonasFromPeoplePickerData(pickedPeopleReturnedFromPicker);\n\t}", "componentDidUpdate(_prevProps, prevState) {\n const { patientData, patientID } = this.state;\n const { sendData, sendID } = this.props;\n // Lodash makes it easy to loop through objects and compare values\n if (!_.isEqual(prevState.patientData, patientData)) {\n sendData(patientData);\n }\n\n if (!_.isEqual(prevState.patientID, patientID)) {\n sendID(patientID);\n }\n }", "componentDidUpdate(prevProps) {\n if (prevProps !== this.props)\n this.setState({ selectedItems: new Set() });\n return true;\n }", "onValueChange(value: string) {\n let specialty = this.state.specialties.find(chSpecialty => chSpecialty.name === value)\n this.setState({\n selected: value,\n specialties_id: specialty.id\n // selectedSpecialty_id: specialty.id,\n })\n store.setState({\n selectedSpecialty: value,\n selectedSpecialty_id: specialty.id,\n })\n console.log('selected specialty:', store.getState().selectedSpecialty)\n console.log('selectedSpecialty_id:', store.getState().selectedSpecialty_id)\n}", "componentDidUpdate(prevProps) {\n if (prevProps.toggle === false) {\n if (this.state.selected === true) {\n this.setState({ selected: false })\n }\n }\n }", "componentDidUpdate(prevProps, prevState, snapshot) {\n if(prevProps.allDoctors !== this.props.allDoctors){\n let dataSelect=this.buildDataInputSelect(this.props.allDoctors, 'USERS');\n this.setState({\n listDoctors: dataSelect,\n })\n }\n\n \n if(prevProps.allRequiredDoctorInfor !== this.props.allRequiredDoctorInfor){\n let{resPrice, resPayment, resProvince, resSpecialty, resClinic}= this.props.allRequiredDoctorInfor;\n \n let dataSelectPrice=this.buildDataInputSelect(resPrice, 'PRICE');\n let dataSelectPayment=this.buildDataInputSelect(resPayment, 'PAYMENT');\n let dataSelectProvince=this.buildDataInputSelect(resProvince, 'PROVINCE');\n let dataSelectSpecialty=this.buildDataInputSelect(resSpecialty, 'SPECIALTY');\n let dataSelectClinic=this.buildDataInputSelect(resClinic, 'CLINIC');\n\n this.setState({\n listPrice: dataSelectPrice,\n listPayment: dataSelectPayment,\n listProvince: dataSelectProvince,\n listSpecialty: dataSelectSpecialty,\n listClinic: dataSelectClinic,\n })\n }\n\n if(prevProps.language !== this.props.language){\n let{resPrice, resPayment, resProvince, resSpecialty, resClinic}= this.props.allRequiredDoctorInfor;\n \n let dataSelect=this.buildDataInputSelect(this.props.allDoctors, 'USERS');\n let dataSelectPrice=this.buildDataInputSelect(resPrice, 'PRICE');\n let dataSelectPayment=this.buildDataInputSelect(resPayment, 'PAYMENT');\n let dataSelectProvince=this.buildDataInputSelect(resProvince, 'PROVINCE');\n let dataSelectSpecialty=this.buildDataInputSelect(resSpecialty, 'SPECIALTY');\n let dataSelectClinic=this.buildDataInputSelect(resClinic, 'CLINIC');\n this.setState({\n listDoctors: dataSelect,\n listPrice: dataSelectPrice,\n listPayment: dataSelectPayment,\n listProvince: dataSelectProvince,\n listSpecialty: dataSelectSpecialty,\n listClinic: dataSelectClinic,\n })\n }\n\n }", "componentDidUpdate(prevProps) {\n const { patientID } = this.props;\n if (!_.isEqual(prevProps.patientID, patientID)) {\n this.fetchPatientDemographics();\n }\n }", "updateSelectedEvent(calEvent){\n var originalEvent = calEvent && calEvent.originalEvent ? calEvent.originalEvent : {};\n var premiseEventPartecipant;\n var _this = this;\n\n if(this.state.teacherID){\n premiseEventPartecipant = this.fetchDataPersonalDataParent(originalEvent.ParentID);\n }\n if(this.state.parentID){\n premiseEventPartecipant = this.fetchDataPersonalDataTeacher(originalEvent.TeacherID);\n }\n \n premiseEventPartecipant.then(function(){\n _this.setState((prevState, props) => {return {selectedEvent: originalEvent} });\n });\n //this.setState({selectedEvent: originalEvent});\n }", "componentDidUpdate(previousProps, previousState) {\n var sentenceResult = this.props.sentenceResult;\n var selectSta = this.props.selectStats[0];\n\n // to avoid infinite loop\n if (\n previousProps.sentenceResult !== sentenceResult ||\n previousState.selectSta !== selectSta\n ) {\n console.log(\"componentDidUpdate\");\n this.commonMU(selectSta, sentenceResult);\n }\n }", "componentDidUpdate(previousProps, previousState) {\n var sentenceResult = this.props.sentenceResult;\n var selectSta = this.props.selectStats[2];\n\n // to avoid infinite loop\n if (\n previousProps.sentenceResult !== sentenceResult ||\n previousState.selectSta !== selectSta\n ) {\n // console.log(\"fillter 2 sentence result\", sentenceResult);\n this.commonMU(selectSta, sentenceResult);\n }\n }", "handleDataSelectChange(key, type, value, obj) {\n const arr = [];\n let newSelected = _.extend({}, this.state.periodicReviewObject);\n\n // Look through the object passed and push each item to an array.\n obj.forEach(item => {\n if (item.Id) {\n arr.push(item.Id);\n }\n });\n\n // Update the selected object.\n if (arr.length > 1 || type === 'array') {\n // Array of objects.\n newSelected[key] = arr;\n } else {\n // Single object.\n newSelected[key] = arr[0];\n }\n\n // Update the state.\n this.setState({ periodicReviewObject: newSelected });\n\n // console.log('newSelected:', newSelected);\n\n // Reset userSubmittedForm.\n this.userSubmittedForm = false;\n this.setState({ userSubmittedForm: false });\n }", "gpSelected(info, e, doctor, date, time) {\r\n this.setState({gp: info})\r\n this.setState({bookingStep: e})\r\n this.setState({doctor: doctor})\r\n this.setState({date: date})\r\n this.setState({time: time})\r\n }", "componentDidUpdate(previousProps, previousState) {\n var sentenceResult = this.props.sentenceResult;\n var selectSta = this.props.selectStats[1];\n\n // to avoid infinite loop\n if (\n previousProps.sentenceResult !== sentenceResult ||\n previousState.selectSta !== selectSta\n ) {\n // console.log(\"fillter 2 sentence result\", sentenceResult);\n this.commonMU(selectSta, sentenceResult);\n }\n }", "_selectHandler(params) {\n var id = params[0], state = params[1], selected = this.state.selected;\n\n if (state === true) {\n if (!selected[id]) selected[id] = LocalStore.getById(id);\n } else {\n if (selected[id]) delete selected[id];\n }\n this.setState({mainBlock: LocalStore.getLast(), selected: selected});\n }", "componentDidUpdate(prevprops){\n const prevData = _.pluck(prevprops.dataList, 'id'),\n currentData = _.pluck(this.props.dataList, 'id');\n if(_.difference(prevData, currentData).length || (prevData.length !== currentData.length )){\n this.setState({\n ...this.state,\n selectedItemsList: []\n })\n };\n \n }", "componentDidUpdate(prevProps, prevState) {\n if (prevState.selected && this.props.refresh) {\n this.setState({ selected: 0 });\n }\n }", "_addSelectedToSelection(e) {\n let selectedOptions =\n this.props.selectedOptions.concat(getItemsByProp(this.state.filteredOptions,\n this.props.valueProp,\n this.state.selectedValues))\n this.setState({selectedValues: []}, () => {\n this.props.onChange(selectedOptions)\n })\n }", "updateState({oldProps, props, context, changeFlags}) {\n const attributeManager = this.getAttributeManager();\n if (changeFlags.dataChanged && attributeManager) {\n const {dataChanged} = changeFlags;\n if (Array.isArray(dataChanged)) {\n // is partial update\n for (const dataRange of dataChanged) {\n attributeManager.invalidateAll(dataRange);\n }\n } else {\n attributeManager.invalidateAll();\n }\n }\n\n const neededPickingBuffer = oldProps.highlightedObjectIndex >= 0 || oldProps.pickable;\n const needPickingBuffer = props.highlightedObjectIndex >= 0 || props.pickable;\n if (neededPickingBuffer !== needPickingBuffer && attributeManager) {\n const {pickingColors, instancePickingColors} = attributeManager.attributes;\n const pickingColorsAttribute = pickingColors || instancePickingColors;\n if (pickingColorsAttribute) {\n if (needPickingBuffer && pickingColorsAttribute.constant) {\n pickingColorsAttribute.constant = false;\n attributeManager.invalidate(pickingColorsAttribute.id);\n }\n if (!pickingColorsAttribute.value && !needPickingBuffer) {\n pickingColorsAttribute.constant = true;\n pickingColorsAttribute.value = [0, 0, 0];\n }\n }\n }\n }", "handleSelections(selection){\r\n console.log(\"INSIDE HANDLE SELECTION\");\r\n console.log(selection);\r\n // this.props.fresh({headerSelection:'New'});\r\n this.props.orderByNew({genre: selection}); //change the headerSelection later so it does not entered manually, same for genre\r\n this.props.selection('New');\r\n this.props.imageLoad(true);\r\n this.props.newBooks({\r\n subject: selection,\r\n orderBy: this.props.orderBy,\r\n language: this.props.language\r\n })\r\n }", "componentWillReceiveProps(nextProps) {\n if(nextProps.sessions) {\n if (nextProps.sessions[this.props.routeParams.id]) {\n this.setState({\n isFound: 'yes',\n patientInformation: nextProps.sessions[this.props.routeParams.id]\n })\n\n } else {\n this.setState({\n isFound: 'no'\n })\n\n }\n }\n\n }", "_onCheckHospitalByDoktor(id) {\n let { _cell, data } = this.state;\n console.log('doctor click ', id);\n console.log(\" cell\", _cell);\n this.setState({\n convertDataState: [],\n })\n _cell.map(res => {\n console.log(\" cell res \", res);\n if (id.data.locations) {\n id.data.locations.map((idlocate, index) => {\n let gethospital = res.find(result => { return result.dataHospital.id == idlocate });\n if (gethospital) {\n let getdoktor = gethospital.dataHospital.doctors.find(\n doc => {\n return doc.id == id.listid;\n }\n );\n if (getdoktor) {\n getdoktor.isSelect = id.isSelect;\n }\n //auto check hospital\n let countSelectDokter = this._findSelectDoktorFromHospital(\n gethospital.dataHospital.doctors\n );\n if (\n countSelectDokter.length ==\n gethospital.dataHospital.doctors.length\n ) {\n gethospital.dataHospital.isSelect = 1;\n } else {\n gethospital.dataHospital.isSelect = 0;\n }\n }\n });\n } else {\n callToast(\"Doctor Location id not found\");\n }\n })\n console.log(\" cell done\", _cell);\n this.props.updateScheduleSelectDoktor(id);\n //this.props.screenProps._updateReviewSchedule(id);\n let _convertData = [];\n for (var i = 0; i < _cell.length; i++) {\n _cell[i].map(res => {\n if (res.dataHospital.doctors.length > 0) {\n _convertData.push({\n title: res.dataHospital.name,\n parentdata: res,\n data: res.dataHospital.doctors,\n area: res.area\n })\n }\n });\n }\n\n console.log(\"DONE CHECK PROCESSS\", _convertData)\n this.setState({\n isLoading: false,\n //isSelectLoading:false,\n convertDataState: _convertData,\n _cell: _cell\n }, () => {\n this.getTotalShedule()\n //this._setData()\n })\n }", "componentDidUpdate(prevProps) {\n\t\tlet prevResourceId = prevProps.selectedItem.resource_id\n\t\tlet nextResourceId = this.props.selectedItem.resource_id\n\n\t\tif (prevResourceId !== nextResourceId) {\n\t\t\tlet selectedItem = this.props.selectedItem\n\n\t\t\tthis.setState({\n\t\t\t\tresource_id: selectedItem.resource_id,\n\t\t\t\tdescriptionValue: selectedItem.description,\n\t\t\t\turlValue: selectedItem.url,\n\t\t\t\tresourceValue: selectedItem.topic.topic_id,\n\t\t\t\tdropdownValue: `${selectedItem.topic.topic_id} - ${selectedItem.topic.name}`\n\t\t\t})\n\t\t}\n\t}", "componentWillReceiveProps(nextProps) {\r\n if (nextProps.selectedCategory !== this.state.selectedCategory) {\r\n this.setState({ selectedCategory: nextProps.selectedCategory });\r\n }\r\n }", "handleDepartmentChange(e,{value}){\n\n const prevJobDepartments = _.cloneDeep(this.state.job.job_departments);\n const curJobDepartments = {value}.value;\n const job = Object.assign({},this.state.job,{job_departments: curJobDepartments });\n\n this.setState((prevState, props) => ({\n job\n }), this.getApiProgrammersSection); // Initialize assign programmers on change\n\n }", "displayChoreInfo(id) {\n this.setState(prevState =>\n ({\n selectedChore: id,\n })\n );\n }", "componentWillReceiveProps(nextProps){\n console.log('Main componentWillReceiveProps()');\n if (this.props.selectedGroup !== nextProps.selectedGroup){\n this.setState({\n selectedGroup : nextProps.selectedGroup,\n })\n }\n }", "setSelected(options) {\n console.log(options, this.props)\n this.setState({selected: this.props.weather[options.value]});\n }", "setOptions() {\n const { selectedNote } = this.props;\n this.setState({\n initialNote: selectedNote,\n currentViewedNote: selectedNote,\n currentViewedNoteId: selectedNote.id,\n });\n }", "componentWillReceiveProps(newProps) {\n\n let stageBoardsList = this.setGrid(newProps.floor);\n let itemsAtStage = this.setItemsAtStage(newProps.floor.rooms);\n\n this.setState({\n stageBoardsList,\n itemsAtStage,\n selectedItem: this.dummyObj\n });\n\n //this.setGrid(newProps.floor);\n //this.setItemsAtStage(newProps.floor.rooms);\n }", "componentWillReceiveProps(nextProps) {\n if (nextProps.currentCategory !== this.props.currentCategory) {\n //console.log('nextProps', nextProps.currentCategory)\n\n let { title, description, imagePath } = nextProps.currentCategory\n\n this.setState({\n edit:true,\n checked:true,\n data:{\n ...this.state.data,\n title,\n description,\n imagePath\n }\n })\n }\n }", "componentDidMount() {\r\n //console.log(localConfigConfig);\r\n\r\n // JS : inisialisasi seluruh elemen dengan this.state default\r\n /*\r\n * Tabel Level 1\r\n */\r\n this.REF_DEVICE_1_NAME.current.value = this.state.TAG_LIST[0].DEVICE_NAME;\r\n this.REF_DEVICE_2_NAME.current.value = this.state.TAG_LIST[1].DEVICE_NAME;\r\n this.REF_DEVICE_3_NAME.current.value = this.state.TAG_LIST[2].DEVICE_NAME;\r\n this.REF_DEVICE_4_NAME.current.value = this.state.TAG_LIST[3].DEVICE_NAME;\r\n\r\n this.REF_DEVICE_1_VISIBLE.current.checked = this.state.TAG_LIST[0].DEVICE_VISIBLE;\r\n this.REF_DEVICE_2_VISIBLE.current.checked = this.state.TAG_LIST[1].DEVICE_VISIBLE;\r\n this.REF_DEVICE_3_VISIBLE.current.checked = this.state.TAG_LIST[2].DEVICE_VISIBLE;\r\n this.REF_DEVICE_4_VISIBLE.current.checked = this.state.TAG_LIST[3].DEVICE_VISIBLE;\r\n\r\n /*\r\n * Tabel Level 2\r\n */\r\n // JS : Inisialisasi level 2, Device 1\r\n this.REF_DEVICE_1_GROUPTAG_1_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_2_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_3_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_4_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_5_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_6_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_7_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_8_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_NAME;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_1_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_2_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_3_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_4_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_5_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_6_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_7_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_8_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_VISIBLE;\r\n\r\n // JS : Inisialisasi level 2, Device 2\r\n this.REF_DEVICE_2_GROUPTAG_1_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_2_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_3_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_4_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_5_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_6_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_7_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_8_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_NAME;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_1_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_2_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_3_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_4_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_5_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_6_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_7_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_8_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_VISIBLE;\r\n\r\n // JS : Inisialisasi level 2, Device 3\r\n this.REF_DEVICE_3_GROUPTAG_1_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_2_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_3_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_4_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_5_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_6_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_7_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_8_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_NAME;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_1_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_2_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_3_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_4_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_5_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_6_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_7_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_8_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_VISIBLE;\r\n\r\n // JS : Inisialisasi level 2, Device 4\r\n this.REF_DEVICE_4_GROUPTAG_1_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_2_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_3_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_4_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_5_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_6_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_7_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_8_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_NAME;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_1_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_2_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_3_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_4_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_5_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_6_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_7_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_8_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_VISIBLE;\r\n\r\n /*\r\n * Tabel Level 3\r\n */\r\n /*\r\n * Tabel Level 3, Device 1\r\n */\r\n // JS : Inisialisasi Level 3, Device 1, Group Tag 1\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_1_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_2_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_3_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_4_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_5_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_6_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_7_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_8_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_1_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_2_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_3_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_4_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_5_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_6_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_7_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_8_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_1_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_2_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_3_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_4_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_5_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_6_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_7_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_8_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_1_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_2_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_3_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_4_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_5_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_6_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_7_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_8_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_1_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_2_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_3_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_4_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_5_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_6_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_7_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_8_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_1_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_2_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_3_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_4_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_5_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_6_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_7_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_1_TAG_8_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_1_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_1_GROUPTAG_1_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_1_GROUPTAG_1_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_1_GROUPTAG_1_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_1_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_1_GROUPTAG_1_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_1_GROUPTAG_1_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_1_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_1_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 1, Group Tag 2\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_1_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_2_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_3_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_4_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_5_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_6_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_7_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_8_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_1_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_2_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_3_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_4_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_5_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_6_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_7_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_8_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_1_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_2_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_3_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_4_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_5_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_6_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_7_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_8_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_1_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_2_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_3_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_4_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_5_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_6_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_7_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_8_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_1_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_2_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_3_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_4_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_5_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_6_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_7_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_8_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_1_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_2_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_3_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_4_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_5_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_6_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_7_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_2_TAG_8_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_2_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_1_GROUPTAG_2_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_1_GROUPTAG_2_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_1_GROUPTAG_2_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_2_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_1_GROUPTAG_2_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_1_GROUPTAG_2_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_2_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_2_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 1, Group Tag 3\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_1_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_2_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_3_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_4_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_5_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_6_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_7_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_8_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_1_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_2_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_3_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_4_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_5_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_6_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_7_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_8_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_1_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_2_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_3_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_4_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_5_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_6_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_7_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_8_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_1_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_2_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_3_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_4_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_5_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_6_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_7_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_8_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_1_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_2_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_3_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_4_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_5_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_6_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_7_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_8_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_1_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_2_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_3_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_4_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_5_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_6_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_7_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_3_TAG_8_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_3_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_1_GROUPTAG_3_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_1_GROUPTAG_3_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_1_GROUPTAG_3_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_3_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_1_GROUPTAG_3_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_1_GROUPTAG_3_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_3_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_3_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 1, Group Tag 4\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_1_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_2_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_3_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_4_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_5_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_6_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_7_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_8_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_1_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_2_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_3_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_4_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_5_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_6_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_7_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_8_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_1_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_2_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_3_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_4_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_5_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_6_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_7_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_8_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_1_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_2_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_3_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_4_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_5_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_6_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_7_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_8_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_1_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_2_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_3_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_4_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_5_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_6_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_7_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_8_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_1_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_2_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_3_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_4_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_5_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_6_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_7_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_4_TAG_8_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_4_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_1_GROUPTAG_4_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_1_GROUPTAG_4_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_1_GROUPTAG_4_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_4_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_1_GROUPTAG_4_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_1_GROUPTAG_4_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_4_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_4_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 1, Group Tag 5\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_1_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_2_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_3_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_4_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_5_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_6_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_7_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_8_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_1_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_2_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_3_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_4_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_5_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_6_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_7_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_8_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_1_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_2_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_3_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_4_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_5_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_6_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_7_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_8_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_1_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_2_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_3_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_4_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_5_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_6_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_7_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_8_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_1_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_2_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_3_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_4_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_5_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_6_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_7_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_8_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_1_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_2_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_3_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_4_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_5_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_6_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_7_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_5_TAG_8_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_5_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_1_GROUPTAG_5_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_1_GROUPTAG_5_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_1_GROUPTAG_5_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_5_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_1_GROUPTAG_5_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_1_GROUPTAG_5_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_5_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_5_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 1, Group Tag 6\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_1_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_2_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_3_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_4_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_5_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_6_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_7_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_8_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_1_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_2_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_3_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_4_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_5_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_6_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_7_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_8_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_1_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_2_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_3_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_4_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_5_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_6_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_7_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_8_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_1_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_2_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_3_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_4_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_5_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_6_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_7_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_8_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_1_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_2_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_3_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_4_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_5_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_6_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_7_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_8_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_1_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_2_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_3_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_4_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_5_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_6_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_7_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_6_TAG_8_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_6_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_1_GROUPTAG_6_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_1_GROUPTAG_6_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_1_GROUPTAG_6_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_6_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_1_GROUPTAG_6_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_1_GROUPTAG_6_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_6_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_6_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 1, Group Tag 7\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_1_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_2_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_3_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_4_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_5_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_6_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_7_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_8_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_1_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_2_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_3_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_4_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_5_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_6_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_7_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_8_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_1_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_2_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_3_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_4_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_5_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_6_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_7_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_8_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_1_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_2_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_3_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_4_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_5_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_6_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_7_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_8_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_1_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_2_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_3_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_4_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_5_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_6_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_7_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_8_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_1_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_2_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_3_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_4_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_5_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_6_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_7_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_7_TAG_8_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_7_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_1_GROUPTAG_7_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_1_GROUPTAG_7_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_1_GROUPTAG_7_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_7_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_1_GROUPTAG_7_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_1_GROUPTAG_7_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_7_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_7_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 1, Group Tag 8\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_1_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_2_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_3_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_4_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_5_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_6_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_7_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_8_NAME.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_1_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_2_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_3_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_4_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_5_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_6_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_7_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_8_INDEX.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_1_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_2_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_3_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_4_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_5_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_6_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_7_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_8_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_1_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_2_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_3_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_4_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_5_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_6_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_7_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_8_MINEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_1_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_2_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_3_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_4_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_5_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_6_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_7_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_8_MAXEU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_1_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_2_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_3_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_4_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_5_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_6_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_7_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_1_GROUPTAG_8_TAG_8_EU.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_1_GROUPTAG_8_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_1_GROUPTAG_8_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_1_GROUPTAG_8_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_1_GROUPTAG_8_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_8_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_1_GROUPTAG_8_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_1_GROUPTAG_8_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_1_GROUPTAG_8_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_1_GROUPTAG_8_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[0].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n /*\r\n * Tabel Level 3, Device 2\r\n */\r\n // JS : Inisialisasi Level 3, Device 2, Group Tag 1\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_1_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_2_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_3_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_4_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_5_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_6_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_7_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_8_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_1_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_2_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_3_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_4_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_5_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_6_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_7_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_8_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_1_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_2_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_3_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_4_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_5_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_6_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_7_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_8_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_1_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_2_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_3_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_4_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_5_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_6_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_7_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_8_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_1_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_2_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_3_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_4_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_5_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_6_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_7_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_8_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_1_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_2_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_3_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_4_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_5_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_6_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_7_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_1_TAG_8_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_1_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_2_GROUPTAG_1_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_2_GROUPTAG_1_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_2_GROUPTAG_1_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_1_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_2_GROUPTAG_1_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_2_GROUPTAG_1_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_1_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_1_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 2, Group Tag 2\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_1_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_2_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_3_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_4_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_5_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_6_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_7_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_8_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_1_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_2_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_3_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_4_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_5_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_6_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_7_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_8_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_1_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_2_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_3_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_4_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_5_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_6_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_7_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_8_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_1_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_2_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_3_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_4_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_5_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_6_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_7_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_8_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_1_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_2_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_3_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_4_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_5_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_6_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_7_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_8_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_1_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_2_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_3_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_4_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_5_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_6_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_7_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_2_TAG_8_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_2_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_2_GROUPTAG_2_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_2_GROUPTAG_2_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_2_GROUPTAG_2_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_2_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_2_GROUPTAG_2_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_2_GROUPTAG_2_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_2_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_2_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 2, Group Tag 3\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_1_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_2_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_3_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_4_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_5_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_6_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_7_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_8_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_1_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_2_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_3_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_4_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_5_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_6_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_7_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_8_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_1_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_2_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_3_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_4_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_5_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_6_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_7_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_8_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_1_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_2_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_3_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_4_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_5_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_6_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_7_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_8_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_1_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_2_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_3_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_4_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_5_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_6_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_7_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_8_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_1_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_2_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_3_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_4_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_5_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_6_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_7_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_3_TAG_8_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_3_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_2_GROUPTAG_3_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_2_GROUPTAG_3_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_2_GROUPTAG_3_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_3_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_2_GROUPTAG_3_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_2_GROUPTAG_3_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_3_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_3_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 2, Group Tag 4\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_1_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_2_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_3_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_4_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_5_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_6_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_7_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_8_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_1_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_2_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_3_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_4_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_5_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_6_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_7_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_8_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_1_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_2_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_3_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_4_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_5_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_6_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_7_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_8_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_1_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_2_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_3_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_4_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_5_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_6_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_7_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_8_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_1_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_2_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_3_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_4_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_5_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_6_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_7_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_8_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_1_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_2_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_3_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_4_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_5_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_6_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_7_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_4_TAG_8_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_4_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_2_GROUPTAG_4_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_2_GROUPTAG_4_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_2_GROUPTAG_4_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_4_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_2_GROUPTAG_4_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_2_GROUPTAG_4_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_4_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_4_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 2, Group Tag 5\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_1_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_2_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_3_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_4_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_5_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_6_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_7_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_8_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_1_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_2_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_3_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_4_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_5_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_6_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_7_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_8_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_1_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_2_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_3_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_4_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_5_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_6_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_7_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_8_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_1_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_2_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_3_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_4_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_5_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_6_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_7_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_8_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_1_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_2_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_3_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_4_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_5_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_6_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_7_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_8_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_1_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_2_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_3_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_4_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_5_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_6_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_7_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_5_TAG_8_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_5_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_2_GROUPTAG_5_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_2_GROUPTAG_5_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_2_GROUPTAG_5_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_5_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_2_GROUPTAG_5_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_2_GROUPTAG_5_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_5_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_5_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 2, Group Tag 6\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_1_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_2_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_3_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_4_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_5_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_6_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_7_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_8_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_1_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_2_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_3_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_4_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_5_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_6_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_7_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_8_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_1_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_2_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_3_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_4_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_5_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_6_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_7_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_8_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_1_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_2_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_3_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_4_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_5_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_6_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_7_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_8_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_1_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_2_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_3_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_4_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_5_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_6_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_7_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_8_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_1_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_2_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_3_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_4_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_5_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_6_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_7_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_6_TAG_8_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_6_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_2_GROUPTAG_6_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_2_GROUPTAG_6_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_2_GROUPTAG_6_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_6_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_2_GROUPTAG_6_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_2_GROUPTAG_6_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_6_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_6_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 2, Group Tag 7\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_1_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_2_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_3_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_4_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_5_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_6_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_7_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_8_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_1_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_2_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_3_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_4_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_5_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_6_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_7_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_8_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_1_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_2_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_3_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_4_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_5_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_6_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_7_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_8_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_1_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_2_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_3_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_4_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_5_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_6_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_7_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_8_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_1_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_2_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_3_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_4_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_5_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_6_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_7_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_8_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_1_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_2_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_3_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_4_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_5_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_6_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_7_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_7_TAG_8_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_7_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_2_GROUPTAG_7_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_2_GROUPTAG_7_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_2_GROUPTAG_7_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_7_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_2_GROUPTAG_7_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_2_GROUPTAG_7_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_7_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_7_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 2, Group Tag 8\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_1_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_2_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_3_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_4_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_5_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_6_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_7_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_8_NAME.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_1_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_2_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_3_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_4_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_5_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_6_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_7_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_8_INDEX.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_1_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_2_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_3_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_4_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_5_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_6_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_7_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_8_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_1_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_2_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_3_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_4_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_5_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_6_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_7_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_8_MINEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_1_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_2_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_3_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_4_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_5_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_6_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_7_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_8_MAXEU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_1_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_2_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_3_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_4_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_5_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_6_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_7_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_2_GROUPTAG_8_TAG_8_EU.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_2_GROUPTAG_8_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_2_GROUPTAG_8_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_2_GROUPTAG_8_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_2_GROUPTAG_8_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_8_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_2_GROUPTAG_8_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_2_GROUPTAG_8_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_2_GROUPTAG_8_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_2_GROUPTAG_8_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[1].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n /*\r\n * Tabel Level 3, Device 3\r\n */\r\n // JS : Inisialisasi Level 3, Device 3, Group Tag 1\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_1_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_2_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_3_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_4_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_5_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_6_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_7_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_8_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_1_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_2_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_3_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_4_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_5_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_6_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_7_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_8_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_1_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_2_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_3_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_4_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_5_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_6_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_7_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_8_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_1_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_2_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_3_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_4_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_5_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_6_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_7_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_8_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_1_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_2_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_3_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_4_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_5_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_6_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_7_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_8_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_1_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_2_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_3_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_4_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_5_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_6_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_7_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_1_TAG_8_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_1_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_3_GROUPTAG_1_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_3_GROUPTAG_1_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_3_GROUPTAG_1_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_1_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_3_GROUPTAG_1_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_3_GROUPTAG_1_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_1_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_1_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 3, Group Tag 2\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_1_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_2_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_3_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_4_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_5_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_6_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_7_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_8_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_1_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_2_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_3_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_4_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_5_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_6_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_7_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_8_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_1_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_2_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_3_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_4_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_5_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_6_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_7_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_8_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_1_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_2_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_3_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_4_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_5_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_6_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_7_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_8_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_1_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_2_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_3_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_4_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_5_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_6_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_7_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_8_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_1_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_2_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_3_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_4_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_5_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_6_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_7_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_2_TAG_8_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_2_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_3_GROUPTAG_2_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_3_GROUPTAG_2_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_3_GROUPTAG_2_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_2_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_3_GROUPTAG_2_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_3_GROUPTAG_2_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_2_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_2_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 3, Group Tag 3\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_1_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_2_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_3_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_4_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_5_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_6_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_7_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_8_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_1_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_2_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_3_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_4_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_5_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_6_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_7_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_8_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_1_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_2_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_3_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_4_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_5_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_6_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_7_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_8_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_1_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_2_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_3_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_4_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_5_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_6_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_7_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_8_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_1_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_2_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_3_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_4_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_5_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_6_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_7_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_8_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_1_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_2_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_3_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_4_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_5_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_6_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_7_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_3_TAG_8_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_3_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_3_GROUPTAG_3_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_3_GROUPTAG_3_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_3_GROUPTAG_3_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_3_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_3_GROUPTAG_3_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_3_GROUPTAG_3_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_3_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_3_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 3, Group Tag 4\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_1_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_2_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_3_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_4_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_5_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_6_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_7_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_8_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_1_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_2_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_3_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_4_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_5_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_6_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_7_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_8_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_1_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_2_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_3_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_4_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_5_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_6_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_7_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_8_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_1_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_2_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_3_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_4_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_5_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_6_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_7_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_8_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_1_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_2_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_3_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_4_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_5_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_6_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_7_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_8_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_1_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_2_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_3_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_4_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_5_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_6_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_7_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_4_TAG_8_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_4_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_3_GROUPTAG_4_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_3_GROUPTAG_4_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_3_GROUPTAG_4_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_4_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_3_GROUPTAG_4_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_3_GROUPTAG_4_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_4_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_4_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 3, Group Tag 5\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_1_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_2_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_3_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_4_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_5_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_6_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_7_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_8_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_1_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_2_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_3_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_4_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_5_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_6_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_7_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_8_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_1_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_2_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_3_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_4_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_5_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_6_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_7_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_8_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_1_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_2_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_3_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_4_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_5_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_6_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_7_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_8_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_1_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_2_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_3_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_4_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_5_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_6_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_7_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_8_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_1_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_2_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_3_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_4_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_5_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_6_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_7_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_5_TAG_8_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_5_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_3_GROUPTAG_5_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_3_GROUPTAG_5_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_3_GROUPTAG_5_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_5_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_3_GROUPTAG_5_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_3_GROUPTAG_5_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_5_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_5_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 3, Group Tag 6\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_1_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_2_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_3_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_4_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_5_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_6_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_7_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_8_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_1_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_2_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_3_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_4_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_5_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_6_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_7_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_8_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_1_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_2_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_3_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_4_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_5_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_6_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_7_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_8_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_1_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_2_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_3_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_4_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_5_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_6_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_7_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_8_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_1_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_2_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_3_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_4_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_5_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_6_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_7_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_8_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_1_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_2_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_3_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_4_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_5_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_6_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_7_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_6_TAG_8_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_6_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_3_GROUPTAG_6_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_3_GROUPTAG_6_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_3_GROUPTAG_6_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_6_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_3_GROUPTAG_6_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_3_GROUPTAG_6_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_6_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_6_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 3, Group Tag 7\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_1_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_2_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_3_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_4_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_5_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_6_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_7_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_8_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_1_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_2_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_3_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_4_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_5_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_6_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_7_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_8_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_1_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_2_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_3_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_4_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_5_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_6_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_7_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_8_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_1_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_2_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_3_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_4_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_5_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_6_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_7_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_8_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_1_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_2_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_3_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_4_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_5_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_6_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_7_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_8_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_1_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_2_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_3_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_4_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_5_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_6_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_7_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_7_TAG_8_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_7_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_3_GROUPTAG_7_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_3_GROUPTAG_7_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_3_GROUPTAG_7_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_7_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_3_GROUPTAG_7_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_3_GROUPTAG_7_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_7_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_7_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 3, Group Tag 8\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_1_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_2_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_3_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_4_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_5_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_6_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_7_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_8_NAME.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_1_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_2_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_3_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_4_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_5_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_6_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_7_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_8_INDEX.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_1_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_2_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_3_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_4_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_5_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_6_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_7_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_8_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_1_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_2_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_3_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_4_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_5_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_6_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_7_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_8_MINEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_1_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_2_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_3_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_4_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_5_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_6_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_7_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_8_MAXEU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_1_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_2_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_3_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_4_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_5_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_6_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_7_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_3_GROUPTAG_8_TAG_8_EU.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_3_GROUPTAG_8_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_3_GROUPTAG_8_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_3_GROUPTAG_8_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_3_GROUPTAG_8_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_8_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_3_GROUPTAG_8_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_3_GROUPTAG_8_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_3_GROUPTAG_8_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_3_GROUPTAG_8_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[2].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n /*\r\n * Tabel Level 3, Device 4\r\n */\r\n // JS : Inisialisasi Level 3, Device 4, Group Tag 1\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_1_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_2_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_3_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_4_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_5_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_6_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_7_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_8_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_1_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_2_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_3_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_4_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_5_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_6_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_7_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_8_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_1_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_2_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_3_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_4_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_5_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_6_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_7_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_8_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_1_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_2_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_3_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_4_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_5_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_6_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_7_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_8_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_1_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_2_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_3_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_4_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_5_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_6_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_7_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_8_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_1_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_2_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_3_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_4_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_5_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_6_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_7_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_1_TAG_8_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_1_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_4_GROUPTAG_1_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_4_GROUPTAG_1_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_4_GROUPTAG_1_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_1_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_4_GROUPTAG_1_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_4_GROUPTAG_1_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_1_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_1_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[0].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 4, Group Tag 2\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_1_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_2_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_3_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_4_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_5_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_6_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_7_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_8_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_1_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_2_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_3_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_4_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_5_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_6_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_7_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_8_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_1_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_2_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_3_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_4_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_5_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_6_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_7_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_8_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_1_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_2_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_3_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_4_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_5_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_6_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_7_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_8_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_1_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_2_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_3_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_4_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_5_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_6_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_7_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_8_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_1_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_2_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_3_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_4_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_5_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_6_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_7_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_2_TAG_8_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_2_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_4_GROUPTAG_2_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_4_GROUPTAG_2_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_4_GROUPTAG_2_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_2_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_4_GROUPTAG_2_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_4_GROUPTAG_2_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_2_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_2_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[1].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 4, Group Tag 3\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_1_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_2_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_3_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_4_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_5_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_6_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_7_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_8_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_1_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_2_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_3_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_4_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_5_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_6_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_7_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_8_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_1_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_2_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_3_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_4_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_5_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_6_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_7_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_8_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_1_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_2_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_3_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_4_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_5_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_6_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_7_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_8_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_1_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_2_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_3_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_4_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_5_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_6_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_7_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_8_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_1_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_2_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_3_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_4_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_5_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_6_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_7_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_3_TAG_8_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_3_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_4_GROUPTAG_3_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_4_GROUPTAG_3_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_4_GROUPTAG_3_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_3_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_4_GROUPTAG_3_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_4_GROUPTAG_3_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_3_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_3_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[2].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 4, Group Tag 4\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_1_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_2_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_3_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_4_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_5_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_6_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_7_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_8_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_1_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_2_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_3_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_4_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_5_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_6_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_7_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_8_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_1_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_2_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_3_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_4_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_5_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_6_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_7_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_8_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_1_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_2_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_3_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_4_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_5_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_6_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_7_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_8_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_1_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_2_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_3_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_4_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_5_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_6_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_7_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_8_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_1_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_2_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_3_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_4_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_5_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_6_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_7_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_4_TAG_8_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_4_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_4_GROUPTAG_4_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_4_GROUPTAG_4_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_4_GROUPTAG_4_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_4_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_4_GROUPTAG_4_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_4_GROUPTAG_4_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_4_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_4_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[3].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 4, Group Tag 5\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_1_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_2_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_3_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_4_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_5_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_6_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_7_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_8_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_1_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_2_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_3_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_4_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_5_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_6_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_7_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_8_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_1_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_2_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_3_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_4_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_5_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_6_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_7_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_8_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_1_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_2_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_3_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_4_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_5_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_6_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_7_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_8_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_1_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_2_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_3_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_4_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_5_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_6_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_7_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_8_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_1_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_2_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_3_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_4_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_5_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_6_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_7_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_5_TAG_8_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_5_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_4_GROUPTAG_5_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_4_GROUPTAG_5_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_4_GROUPTAG_5_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_5_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_4_GROUPTAG_5_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_4_GROUPTAG_5_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_5_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_5_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[4].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 4, Group Tag 6\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_1_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_2_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_3_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_4_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_5_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_6_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_7_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_8_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_1_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_2_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_3_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_4_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_5_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_6_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_7_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_8_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_1_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_2_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_3_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_4_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_5_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_6_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_7_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_8_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_1_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_2_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_3_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_4_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_5_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_6_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_7_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_8_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_1_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_2_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_3_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_4_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_5_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_6_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_7_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_8_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_1_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_2_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_3_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_4_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_5_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_6_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_7_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_6_TAG_8_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_6_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_4_GROUPTAG_6_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_4_GROUPTAG_6_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_4_GROUPTAG_6_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_6_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_4_GROUPTAG_6_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_4_GROUPTAG_6_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_6_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_6_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[5].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 4, Group Tag 7\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_1_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_2_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_3_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_4_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_5_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_6_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_7_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_8_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_1_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_2_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_3_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_4_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_5_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_6_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_7_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_8_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_1_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_2_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_3_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_4_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_5_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_6_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_7_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_8_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_1_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_2_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_3_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_4_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_5_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_6_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_7_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_8_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_1_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_2_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_3_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_4_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_5_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_6_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_7_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_8_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_1_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_2_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_3_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_4_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_5_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_6_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_7_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_7_TAG_8_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_7_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_4_GROUPTAG_7_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_4_GROUPTAG_7_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_4_GROUPTAG_7_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_7_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_4_GROUPTAG_7_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_4_GROUPTAG_7_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_7_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_7_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[6].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n // JS : Inisialisasi Level 3, Device 4, Group Tag 8\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_1_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[0].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_2_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[1].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_3_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[2].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_4_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[3].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_5_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[4].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_6_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[5].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_7_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[6].TAG_NAME;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_8_NAME.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[7].TAG_NAME;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_1_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[0].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_2_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[1].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_3_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[2].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_4_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[3].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_5_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[4].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_6_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[5].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_7_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[6].TAG_VISIBLE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_8_VISIBLE.current.checked = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[7].TAG_VISIBLE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_1_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[0].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_2_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[1].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_3_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[2].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_4_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[3].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_5_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[4].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_6_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[5].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_7_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[6].TAG_DATASOURCE;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_8_DATASOURCE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[7].TAG_DATASOURCE;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_1_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[0].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_2_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[1].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_3_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[2].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_4_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[3].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_5_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[4].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_6_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[5].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_7_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[6].TAG_INDEX;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_8_INDEX.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[7].TAG_INDEX;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_1_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_2_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_3_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_4_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_5_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_6_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_7_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_8_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MINVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_1_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_2_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_3_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_4_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_5_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_6_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_7_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_8_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MAXVAL;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_1_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_2_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_3_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_4_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_5_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_6_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_7_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MINEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_8_MINEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MINEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_1_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[0].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_2_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[1].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_3_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[2].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_4_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[3].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_5_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[4].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_6_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[5].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_7_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[6].TAG_MAXEU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_8_MAXEU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[7].TAG_MAXEU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_1_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[0].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_2_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[1].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_3_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[2].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_4_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[3].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_5_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[4].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_6_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[5].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_7_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[6].TAG_EU;\r\n this.REF_DEVICE_4_GROUPTAG_8_TAG_8_EU.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].TAG_LIST[7].TAG_EU;\r\n\r\n this.REF_DEVICE_4_GROUPTAG_8_PLOTCONFIG_X_AXIS_SPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_SPAN;\r\n this.REF_DEVICE_4_GROUPTAG_8_PLOTCONFIG_X_AXIS_UNIT.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_UNIT;\r\n this.REF_DEVICE_4_GROUPTAG_8_PLOTCONFIG_X_AXIS_SAMPLEPERSPAN.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_SAMPLEPERSPAN;\r\n this.REF_DEVICE_4_GROUPTAG_8_PLOTCONFIG_X_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_8_PLOTCONFIG_X_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.X_AXIS_LABEL;\r\n this.REF_DEVICE_4_GROUPTAG_8_PLOTCONFIG_Y_AXIS_TYPE.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_TYPE;\r\n this.REF_DEVICE_4_GROUPTAG_8_PLOTCONFIG_Y_AXIS_MINVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_MINVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_PLOTCONFIG_Y_AXIS_MAXVAL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_MAXVAL;\r\n this.REF_DEVICE_4_GROUPTAG_8_PLOTCONFIG_Y_AXIS_NUMBERDIV.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_NUMBERDIV;\r\n this.REF_DEVICE_4_GROUPTAG_8_PLOTCONFIG_Y_AXIS_LABEL.current.value = this.state.TAG_LIST[3].GROUPTAG_LIST[7].GROUPTAG_PLOTCONFIG.Y_AXIS_LABEL;\r\n\r\n }", "handleUpdatedState(state) {\n this.lastTechnology = state.selectedTechnology;\n this.totalClicks = state.clickCounter;\n }", "onInfoPrice(response) {\n this.setState({selectedInstrument:response});\n }", "handleChangeSelectResource(selected) {\n const state = {...this.state};\n state['role']['resource'] = selected.value;\n state['formHasChanged'] = true;\n this.setState(state);\n }", "handleHomeLocationChange(currIndex) {\n var currentLocations = this.state.locations;\n currentLocations[currIndex].selected = ! currentLocations[currIndex].selected;\n this.setState({locations: currentLocations});\n }", "componentWillReceiveProps(nextProps){\n \n this.setState({\n selectedDate:nextProps.selectedWeek\n })\n}", "function handleSelectedItemChange(selectedItem,previousSelectedItem){selectedItemWatchers.forEach(function(watcher){watcher(selectedItem,previousSelectedItem);});}", "handleListClick(value, selectedStatus) {\n // If the checkbox selectedStatus is true, then update selectedItems array\n if (selectedStatus) {\n var updated = this.state.selectedItems;\n updated.push(value);\n this.setState({\n selectedItems: updated\n });\n // Pass the props to parent components to add to the Query\n this.props.onSelect(value);\n }\n // If the checkbox selectedStatus is false\n // Call handleTagClick to remove it from the selected Items\n else {\n this.handleTagClick(value);\n }\n }", "componentDidUpdate(prevProps, prevState) {\n const {clearFlag, setClearFlag, selectedStudent} = this.props;\n //checking whether to clear fields or not\n if ((clearFlag !== prevProps.clearFlag) &&\n clearFlag) {\n this.clearForm();\n setClearFlag(false);\n }\n\n //checking whether a student object has been passed for update or not\n if (!isEmpty(selectedStudent) && (prevProps.selectedStudent.key !== selectedStudent.key)) {\n let phoneExtension = selectedStudent.phoneNumber.charAt(1);\n let phoneNumber = selectedStudent.phoneNumber.substring(\n 3, selectedStudent.phoneNumber.length);\n //clearing all previous validation errors\n let {validation} = this.state;\n validation.name.error = \"\";\n validation.email.error = \"\";\n validation.phoneNumber.error = \"\";\n validation.dob.error = \"\";\n validation.university.error = \"\";\n //setting up new state\n this.setState({\n name: selectedStudent.name,\n email: selectedStudent.email,\n dob: selectedStudent.dob,\n phoneExtension: phoneExtension,\n phoneNumber: phoneNumber,\n university: selectedStudent.university,\n validation: validation,\n })\n }\n }", "handleSelectItems(name, value){\n\t\tif(name == 'productgroup'){\n\t\t\tdelete this.state.errors.selectProductGroup;\n\t\t this.setState({\n \t\t\tselectProductGroup: value\n \t\t\t})\n\t\t}\n\t\tif(name == 'measurementtype'){\n \t\t\tdelete this.state.errors.selectMeasurementType;\n \t\t\tvar Product = this.state.Product;\n \t\t\tvar pricemethod = 0;\n \t\t\tif(value.label =='Unit') var pricemethod = 1;\n\t\t\tProduct['pricemethod'] = pricemethod;\n\t\t this.setState({\n \t\t\tselectMeasurementType: value,\n \t\t\tProduct: Product\n \t\t\t})\n\t\t}\n\n \t\tif(name == 'taxgroup'){\n\t\t\tdelete this.state.errors.selectTaxGroup;\n\t\t\tthis.setState({\n \t\t\t\tselectTaxGroup: value\n\t\t\t})\n\t\t}\n\t\tif(name == 'printergroup'){\n \t\t\tdelete this.state.errors.selectPrinterGroups;\n \t\t\tthis.setState({\n \t\t\tselectPrinterGroups: value\n \t\t\t})\n\t\t}\n\n\t\t/*\n\t\tswitch (name) {\n\t\t\tcase 'productgroup':\n\t\t\t\tdelete this.state.errors.selectProductGroup;\n\t\t\t this.setState({\n \t\t\tselectProductGroup: value\n \t\t\t})\n \t\tcase 'measurementtype':\n \t\t\tdelete this.state.errors.selectMeasurementType;\n \t\t\tvar Product = this.state.Product;\n \t\t\tvar pricemethod = 0;\n \t\t\tif(value.label =='Unit') var pricemethod = 1;\n\t\t\t\tProduct['pricemethod'] = pricemethod;\n\t\t\t this.setState({\n \t\t\tselectMeasurementType: value,\n \t\t\tProduct: Product\n \t\t\t})\n \t\tcase 'taxgroup':\n \t\t\tdelete this.state.errors.selectTaxGroup;\n \t\t\tthis.setState({\n \t\t\tselectTaxGroup: value\n \t\t\t})\n \t\tcase 'printergroup':\n \t\t\tdelete this.state.errors.selectPrinterGroups;\n \t\t\tthis.setState({\n \t\t\tselectPrinterGroups: value\n \t\t\t})\n\t\t}*/\n\t}", "componentWillReceiveProps(newProps) {\n this.type = newProps.p.parameter_spec.type;\n this.name = newProps.p.parameter_spec.name;\n\n // update form controls to current values\n if (this.stringRef) this.stringRef.value = newProps.p.value;\n if (this.numberRef) this.numberRef.value = newProps.p.value;\n if (this.checkboxRef) this.checkboxRef.value = newProps.p.value;\n }", "handleSelected(event) {\n this.setData(event);\n }", "handleSelected(event) {\n this.setData(event);\n }", "componentWillMount() {\n // load all the settings\n stored = settingsHandle.stored\n // adding selected property to tableData\n let tempData = stored.dldata.data.filter(this.filterDownloader)\n for (let cData of tempData) {\n cData.selected = false\n }\n // update the local data\n this.setState({tableData: tempData})\n }", "handleChange() {\n this.setState(state => {\n if (!state.isSelected) {\n this.props.store.dispatch(addToSelected(this.props.ingredientName));\n } else {\n this.props.store.dispatch(removeFromSelected(this.props.ingredientName));\n }\n return { isSelected: !state.isSelected };\n });\n }", "@action updateSelectedData(data) {\n this.selectedData = data.details;\n this.activeDetailTab = data.label;\n }", "handleProFlatSelect(event)\r\n\t{\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\t\tlet propertyflat_list = this.state.property_service_id;\r\n\t\t\t\t// console.log(propertyflat_list);\r\n\t\t\t\tlet check = event.target.checked;\r\n\t\t\t\t// alert(check);\r\n\t\t\t\tlet checked_propertyflat = event.target.value;\r\n\t\t\t\tif(check)\r\n\t\t\t\t\t\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tthis.setState(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tproperty_service_id: [...this.state.property_service_id, checked_propertyflat]\r\n\t\t\t\t\t})\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\tvar index = propertyflat_list.indexOf(checked_propertyflat);\r\n\t\t\t\t\t\t\t\t\t if (index > -1)\r\n\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\tpropertyflat_list.splice(index, 1);\r\n\t\t\t\t\t\t\t\t\t\t\tthis.setState(\r\n\t\t\t\t\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tproperty_service_id: propertyflat_list\r\n\t\t\t\t\t\t\t\t\t\t\t\t})\r\n\t\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t}\t\r\n\r\n\t}", "async componentDidMount() {\n let projectID = this.props.match.params.projectID;\n await fetch(`../api/displayResourceInfoPerProject/${projectID}`)\n .then(result => result.json())\n .then(data => this.processData(data))\n .then(function (newStuff) {\n this.setState({ rowData: newStuff[\"rowData\"], columnDefs: newStuff[\"columnDefs\"] })\n }.bind(this));\n\n let response = await fetch(`../api/displayProjectInfo/${projectID}`);\n let actualResponse = await response.json();\n let currentStatus = actualResponse[0][\"Status\"];\n this.dueDate = actualResponse[0][\"DueDate\"];\n let theSelectedOption = {};\n if (currentStatus == \"Ongoing\") {\n theSelectedOption = { label: \"Ongoing\", value: 1 };\n }\n\n else if (currentStatus == \"Inactive\") {\n theSelectedOption = { label: \"Inactive\", value: 2 };\n }\n\n else if (currentStatus == \"Done\") {\n theSelectedOption = { label: \"Done\", value: 3 };\n }\n\n else if (currentStatus == \"On Hold\") {\n theSelectedOption = { label: \"On Hold\", value: 4 };\n }\n\n let projectName = actualResponse[0][\"ProjectName\"];\n let technology = actualResponse[0][\"Technology\"];\n let maxHours = actualResponse[0][\"EstMaxHours\"];\n let startDate = actualResponse[0][\"StartDate\"];\n let dueDate = actualResponse[0][\"DueDate\"];\n this.setState({\n updatedProjectName: projectName,\n updatedProjectTechnology: technology,\n updatedProjectMaxHours: maxHours,\n updatedProjectStartDate: startDate,\n updatedProjectDueDate: dueDate,\n selectedOption: theSelectedOption\n });\n let names = await fetch(`../api/getNames/${projectID}`);\n let names_json = await names.json();\n for (let i = 0; i < names_json.length; i++) {\n let name = names_json[i][\"FirstName\"] + \" \" + names_json[i][\"LastName\"];\n let netid = names_json[i][\"NetID\"];\n this.resourceNameOptions.push({ label: name, value: 1 });\n\n if (this.nameToNetID.has(name)) {\n let old_arr = this.nameToNetID.get(name);\n old_arr.push(netid);\n this.nameToNetID.set(name, old_arr);\n } else {\n this.nameToNetID.set(name, [netid]);\n }\n }\n }", "componentDidUpdate(prevProps) {\n // Have we selected a user different to that which is displayed in the current Conversation component?\n // This runs after our component's state has updated (or when we have picked a new user in our chat list)\n\n if (prevProps.newSelectedUser === null || (this.props.newSelectedUser._id !== prevProps.newSelectedUser._id)) {\n // console.log(\"Selected a new user\");\n \n this.setSelectedUser(this.props.newSelectedUser);\n\n this.getMessages();\n } \n }", "setSelected(selected) {\n if (selected !== this.state.selected) {\n this.setState({ selected })\n }\n }", "handleChange(record, setTrue = false) {\n\t\tlet { selected } = this.state;\n\t\tlet selectedIndex = null;\n\t\tlet records = record;\n\n\t\tfunction setRecord(selectedRecord, index, item) {\n\t\t\tif (item.label === selectedRecord.label) {\n\t\t\t\tselectedIndex = index;\n\t\t\t\tselected.splice(index, 1);\n\t\t\t}\n\t\t}\n\n\t\tif (record) {\n\t\t\tif (selected === null) {\n\t\t\t\tselected = [];\n\t\t\t}\n\t\t\tif (!Array.isArray(record)) {\n\t\t\t\trecords = [record];\n\t\t\t}\n\t\t\tif (setTrue) {\n\t\t\t\t// all matching records should be added to selected state\n\t\t\t\tselected = [];\n\t\t\t\trecords.forEach((item) => {\n\t\t\t\t\tif (this.props.data.some(label => label.label === item.label)) {\n\t\t\t\t\t\tselected.push(item);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\trecords.forEach((item) => {\n\t\t\t\t\tselected.forEach((selectedRecord, index) => {\n\t\t\t\t\t\tsetRecord(selectedRecord, index, item);\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\t\t\tif (selectedIndex === null) {\n\t\t\t\t\trecords.forEach((item) => {\n\t\t\t\t\t\tselected.push(item);\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tselected = null;\n\t\t}\n\t\tselected = selected === \"\" ? null : selected;\n\t\tselected = selected && selected.length ? selected : null;\n\t\tthis.defaultSelected = selected;\n\n\t\tthis.setState({\n\t\t\tselected\n\t\t});\n\n\t\tconst obj = {\n\t\t\tkey: this.props.componentId,\n\t\t\tvalue: selected\n\t\t};\n\n\t\tconst execQuery = () => {\n\t\t\tconst isExecuteQuery = true;\n\t\t\tif (this.props.onValueChange) {\n\t\t\t\tthis.props.onValueChange(obj.value);\n\t\t\t}\n\t\t\tif (this.props.URLParams) {\n\t\t\t\thelper.URLParams.update(this.props.componentId, this.getSelectedLabels(selected), this.props.URLParams);\n\t\t\t}\n\t\t\thelper.selectedSensor.set(obj, isExecuteQuery);\n\t\t};\n\n\t\tif (this.props.beforeValueChange) {\n\t\t\tthis.props.beforeValueChange(obj.value)\n\t\t\t.then(() => {\n\t\t\t\texecQuery();\n\t\t\t})\n\t\t\t.catch((e) => {\n\t\t\t\tconsole.warn(`${this.props.componentId} - beforeValueChange rejected the promise with`, e);\n\t\t\t});\n\t\t} else {\n\t\t\texecQuery();\n\t\t}\n\t}", "componentWillReceiveProps(nextProps){\n //if(nextProps.selectedRecipe.modalVisible === true){\n this.setState({\n recipe: nextProps.selectedRecipe,\n ingredients: nextProps.selectedRecipe.ingredients.toString(),\n index: nextProps.selectedRecipe.index,\n modalVisible: nextProps.modalVisible\n });\n //}\n }", "componentWillReceiveProps(nextState, prevState) {\n if (nextState.SelectedMake && nextState.SelectedMake.length > 0) {\n this.setState({\n isLoading: false,\n show: false,\n showConfirme: false,\n });\n } else {\n this.setState({\n isLoading: false,\n showConfirme: false,\n });\n }\n }", "componentDidUpdate(oldProps) {\n if (\n this.props.selectedProductId !== oldProps.selectedProductId &&\n this.props.selectedProductId != null\n ) {\n const productToUpdate = this.props.inventory.find(\n (product) => product.id === this.props.selectedProductId\n );\n\n const { name, price, imgurl } = productToUpdate;\n\n this.setState({\n id: this.props.selectedProductId,\n name,\n price,\n imgurl,\n });\n }\n }", "timeSelectorHandler(data, timeSlot, dayNumber) {\n // Newly selected time\n let clickedTime = { data: data, timeSlot: timeSlot, day: dayNumber };\n // Previously selected times\n console.log(\"old\", this.state.selectedTimes);\n console.log(\"new\", clickedTime);\n let previous = this.state.selectedTimes;\n // Check if clickedTime has been previously selected\n // If clickedTime is previously selected remove clickedTime.\n let checkForRedundancy = previous.filter(function(item) {\n return item !== clickedTime;\n });\n // Remove previously selected clickedTime\n if (checkForRedundancy.length !== previous.length) {\n this.setState({ selectedTimes: checkForRedundancy });\n\n // Otherwise add clickedTime to selected times.\n } else {\n previous.push(clickedTime);\n this.setState({ selectedTimes: previous });\n }\n }", "reassignPatient({state, rootState}, volunteer) {\n\t\t\tfor (let patient of rootState.view.selected) {\n\t\t\t\tstate.patients[patient].volunteer_id = volunteer\n\t\t\t}\n\t\t\tstate.touched++;\n\t\t\treturn true\n\t\t}", "onChangePersonalDetails(response){\n this.state.isSet.employmentDetailsSet = true;\n this.setState({\n applicants: response\n });\n\n }", "componentWillReceiveProps(nextProps) {\r\n\t\t// nextProps will include the incoming props with\r\n\t\t// the update state from the store\r\n\t\t//\r\n\t\t// You should update the component state with the \r\n\t\t// updated values, so the component re-renders.\r\n\t\t// You should also check if the state has actually changed,\r\n\t\t// to prevent an unnecessary render.\r\n\t\tif (nextProps.samples.byIds != this.state.samples) {\r\n\t this.setState({\r\n\t samples: nextProps.samples.byIds,\r\n\t });\r\n \t}\r\n }", "sendSelection() {\n\t\tlet hasAfterSelect = typeof this.props.afterSelect == 'function', hasGetSelection = typeof this.props.afterSelectGetSelection == 'function';\n\n\t\tif (hasAfterSelect || hasGetSelection) {\n\t\t\tlet selectionArray = [], selection = this.state.selection;\n\n\t\t\t// Parse the selection to return it as an array instead of a Set obj\n\t\t\tselection.forEach(item => {\n\t\t\t\tselectionArray.push(item.toString());\n\t\t\t});\n\n\t\t\tif (hasGetSelection) { // When you just need the selection but no data\n\t\t\t\tthis.props.afterSelectGetSelection.call(this, selectionArray, selection); // selection array / selection Set()\n\t\t\t}\n\n\t\t\tif (hasAfterSelect) {\n\t\t\t\tlet selectedData = [], properId = null, rowIndex = null, filteredData = null;\n\t\t\t\tlet {indexedData, initialData, rawData, data} = this.state;\n\t\t\t\tlet fields = new Set(_.keys(rawData.get(0).toJSON())), hasIdField = fields.has(this.state.idField) ? true : false;\n\n\t\t\t\tif (hasIdField) {\n\t\t\t\t\tselectedData = rawData.filter(element => {\n\t\t\t\t\t\treturn selection.has(element.get(this.state.idField).toString());\n\t\t\t\t\t});\n\t\t\t\t} else {\n\t\t\t\t\t// Get the data (initialData) that match with the selection\n\t\t\t\t\tfilteredData = initialData.filter(element => selection.has(element.get(this.state.idField)));\n\n\t\t\t\t\t// Then from the filtered data get the raw data that match with the selection\n\t\t\t\t\tselectedData = filteredData.map(row => {\n\t\t\t\t\t\tproperId = row.get(this.state.idField);\n\t\t\t\t\t\trowIndex = this.state.initialIndexed[properId]._rawDataIndex;\n\n\t\t\t\t\t\treturn rawData.get(rowIndex);\n\t\t\t\t\t});\n\t\t\t\t}\n\n\t\t\t\tthis.props.afterSelect.call(this, selectedData.toJSON(), selectionArray);\n\t\t\t}\n\t\t}\n\t}", "UNSAFE_componentWillReceiveProps(recived_data) {\r\n console.log(recived_data)\r\n\t\tthis.setState({\r\n\t\t\tid : recived_data.originalData.id,\r\n\t\t\tlanguage : recived_data.originalData.language\r\n\t\t})\r\n\t}", "componentWillReceiveProps() {\n console.log(\"willreceiveprops\")\n console.log(\"hello sandeep\");\n var selectContact = contact.getSelectedContact();\n console.log(selectContact);\n this.setState({\n viewContact: selectContact\n }, () => console.log(this.state.viewContact))\n }", "onInfoPrice (response) {\n this.setState({ selectedInstrument: response })\n }", "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 }", "function updateSelectedItemComponents() {\n // Reset the components list\n selectedItemsComponents = {}\n\n // For each selected item, access the components\n selectedItems.forEach(itemName => {\n components = itemComponents[itemName]\n // console.log(components)\n\n // For each component, update the count in selectedItemComponents\n components.forEach(component => {\n // If component not in ignored components, update the summed costs\n if (!ignoredComponents.includes(component.name)) {\n if (component.name in selectedItemsComponents) {\n selectedItemsComponents[component.name] += component.itemCount\n } else {\n selectedItemsComponents[component.name] = component.itemCount\n }\n }\n });\n });\n\n updateComponentListDisplay()\n}", "handleSelect(event) {\n this.selectedRecord = false;\n this.selectedRecordCode = false;\n this.selectedAcc = this.allAccesList.find(record => record.Id === event.detail);\n console.log('== In handleSelct ', this.selectedAcc);\n this.selectedName = this.allAccesList.find(record => record.Id === event.detail).Name;\n this.selectedCode = this.allAccesList.find(record => record.Id === event.detail).ProductCode;\n \n }", "updateDropdownTwoData (state, payload) {\n state.dropdownTwo.content.forEach(el => {\n if (el.id === payload.id) {\n el.isSelected = payload.value\n }\n })\n }", "function _updateSelectedObject() {\n var data = $('.listTree').data('listTree');\n\n // Filter the context to the selected parents.\n var selected = _.filter($.extend(true, {}, data.context), function(parent) {\n return $('.listTree > ul > li > span > input[value=\"' + parent.key + '\"]').prop('checked')\n });\n \n // For each parent in the working context...\n _.each(selected, function(parent) {\n\n // Filter the children to the selected children.\n parent.values = _.filter(parent.values, function(child) {\n return $('.listTree > ul > li > ul > li > span > input[value=\"' + child.key + '\"]').prop('checked');\n });\n });\n\n // Update the plugin's selected object.\n $('.listTree').data('listTree', {\n \"target\": data.target,\n \"context\": data.context,\n \"options\": data.options,\n \"selected\": selected\n });\n }", "_handleSelected(plan) {\n this.setState({ selected: plan })\n }", "updateSelected(name) {\n this.setState({\n selected: name\n })\n }", "setSelectedItem(state, itemDb) {\n //console.log(itemDb,'setSelectedItem');\n state.selectedItem.user_id = itemDb.user_id\n state.selectedItem.user_name.value = itemDb.user_name\n state.selectedItem.password.value = itemDb.password\n state.selectedItem.full_name.value = itemDb.full_name\n state.selectedItem.email.value = itemDb.email\n state.selectedItem.phone_number.value = itemDb.phone_number\n state.selectedItem.mobile_number.value = itemDb.mobile_number\n state.selectedItem.unit.value = itemDb.unit\n state.selectedItem.sex.value = itemDb.sex\n state.selectedItem.address.value = itemDb.address\n state.selectedItem.status = itemDb.status\n state.selectedItem.birthday.value = this.$formatDateVNToISO(itemDb.birthday)\n state.selectedItem.schedule_id.value = itemDb.schedule_id\n let obj = state.items.find(p => p.user_id === itemDb.user_id)\n if (obj) state.selectedIndex = state.items.indexOf(obj)\n state.selectedItem.list_group.value = []\n state.selectedItem.ip.value = []\n }", "_addDevicesToGroup(tmpDevices) {\n // (save selected devices in state, open dialog)\n this.setState({ tmpDevices, modifyGroupDialog: !this.state.modifyGroupDialog });\n }", "componentWillMount() {\n /*If there exists a patient record with the id for this particular patient\n then store the information in the patientInformation state array.*/\n if (this.props.sessions && this.props.sessions[this.props.routeParams.id]) {\n this.setState({\n isFound: 'yes',\n patientInformation: this.props.sessions[this.props.routeParams.id]\n })\n\n }\n\n }", "async componentDidUpdate() {\n Object.values(this.getProjects()).forEach(project => {\n const studentID = project.data.student_id;\n if (studentID !== null) {\n if (!this.state.savedChoices.hasOwnProperty(studentID)) {\n this.setSavedChoice(studentID, {type: \"project\", id: project.data.id});\n }\n if (!this.state.choices.hasOwnProperty(studentID)) {\n this.setChoice(studentID, {type: \"project\", id: project.data.id});\n }\n }\n });\n }", "componentWillReceiveProps(nextProps) {\n if (nextProps.hasOwnProperty(\"checked\")) {\n this.setState({ checked: nextProps.checked });\n }\n }", "connectedCallback()\n {\n this.allList.map(allListElement => {\n \n if (allListElement.selected) {\n\n this.selectedList = [\n ...this.selectedList,\n {\n label: allListElement.label,\n value: allListElement.value,\n selected: allListElement.selected\n }\n ]\n \n }\n \n });\n\n this.SelectTextDisplayLogic();\n }", "handleGenre(newState) {\n\t\t//console.log(\"Genre selecionado: \" + newState.selected);\n\n\t\t// save selected genre\n\t\tthis.setState({ selectedGenre: newState.selected });\n\n\t\t// give options for next step\n\t\tif (newState.selected == 'Masculino') {\n\t\t\tthis.setState({ optionsClothes: maleClothes });\n\t\t} else {\n\t\t\tthis.setState({ optionsClothes: femaleClothes });\n\t\t}\n\t}", "handleSelect(id){\n let selectedNeighborhood = this.props.neighborhoods.find((hood) => hood.id === id)\n this.setState({\n neighborhood: selectedNeighborhood\n }, this.validateNeighborhood)\n \n }", "setSub() {\n\t\tconsole.log('called constructor setSub');\n\t\tlet sub_category_selected_display = [],\n\t\t\tcategory_selected = this.state.category_selected;\n\t\tif ((this.state.category_selected && this.state.category_selected.length) || (this.state.sub_category_selected && this.state.sub_category_selected.length)) {\n\t\t\tif (this.state.category_selected && this.state.category_selected.length) {\n\t\t\t\tthis.state.category_selected.map((id) => {\n\t\t\t\t\tthis.state.category_list.map((op) => {\n\t\t\t\t\t\tif (id == op.id) {\n\t\t\t\t\t\t\top.sub_category.map((sub_op) => {\n\t\t\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_op.id) === -1) {\n\t\t\t\t\t\t\t\t\tsub_category_selected_display.push(sub_op.id);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t\tif (this.state.sub_category_selected && this.state.sub_category_selected.length) {\n\t\t\t\t\tthis.state.sub_category_selected.map((sub_id) => {\n\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_id) === -1) {\n\t\t\t\t\t\t\tsub_category_selected_display.push(sub_id);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (this.state.sub_category_selected && this.state.sub_category_selected.length) {\n\t\t\t\tthis.state.sub_category_selected.map((data) => {\n\t\t\t\t\tif (sub_category_selected_display.indexOf(data) === -1) {\n\t\t\t\t\t\tsub_category_selected_display.push(data);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t});\n\t\t\t}\n\t\t} else {\n\t\t\tif (this.props.location.search == '?cat=[]&subcat=[]&layer=[]') {\n\n\t\t\t} else {\n\t\t\t\t/*if (this.state.category_list && this.state.category_list.length) {\n\t\t\t\t\tthis.state.category_list.map((op) => {\n\t\t\t\t\t\top.sub_category.map((sub_op) => {\n\t\t\t\t\t\t\tif (sub_category_selected_display.indexOf(sub_op.id) === -1) {\n\t\t\t\t\t\t\t\tsub_category_selected_display.push(sub_op.id);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t});\n\t\t\t\t\t\t// this.setCategory(true, op.id);\n\t\t\t\t\t\tif (category_selected.indexOf(op.id) === -1) {\n\t\t\t\t\t\t\tcategory_selected.push(op.id);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t}*/\n\t\t\t}\n\t\t}\n\t\tthis.setState({\n\t\t\tsub_category_selected_display: sub_category_selected_display,\n\t\t\tcategory_selected: category_selected\n\t\t});\n\t}", "UNSAFE_componentWillReceiveProps(){\n const { configuredPart, updateConfiguredPart } = this.props;\n const { savedOutputOption } = this.state;\n\n /**\n * Whenever we reset Voltage to \"_\" with a multi-option Output\n * selected, we need to reset the Output to the multi-option\n * value in order to provide all the possible Voltage options.\n */\n if( configuredPart.voltage !== null && savedOutputOption !== null ){\n if(\n configuredPart.voltage.value === '_' // Voltage is empty\n && -1 < savedOutputOption.value.indexOf(',') // We have a multi-option Output\n && -1 < savedOutputOption.value.indexOf(configuredPart.output.value) // Our current Output is in the saved multi-option Output\n ){\n updateConfiguredPart('output',savedOutputOption)\n }\n }\n }", "getDispSelected(i, id) {\n selected[i] = !selected[i]\n var temp = this.state.selected\n if (selected[i]) {\n temp.push(id)\n\n }\n if (!selected[i]) {\n const index = temp.indexOf(id);\n if (index > -1) {\n temp.splice(index, 1);\n\n }\n }\n // console.log(temp)\n this.setState({ selected: temp })\n //console.log(this.state.selected.length)\n\n this.checkBack()\n }", "componentWillReceiveProps(new_props)\n\t{\n\t\tconst { countries, value } = this.props\n\n\t\t// Normalize `country` codes\n\t\tlet country = normalize_country_code(this.props.country)\n\t\tlet new_country = normalize_country_code(new_props.country)\n\n\t\t// If the default country changed\n\t\t// (e.g. in case of IP detection)\n\t\tif (new_country !== country)\n\t\t{\n\t\t\t// If the phone number input field is currently empty\n\t\t\t// (e.g. not touched yet) then change the selected `country`\n\t\t\t// to the newly passed one (e.g. as a result of a GeoIP query)\n\t\t\tif (!value)\n\t\t\t{\n\t\t\t\t// If the passed `country` allowed then update it\n\t\t\t\tif (countries.indexOf(new_country) !== -1)\n\t\t\t\t{\n\t\t\t\t\t// Set the new `country`\n\t\t\t\t\tthis.set_country(new_country, false)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// This code is executed:\n\t\t// * after `this.props.onChange(value)` is called\n\t\t// * if the `value` was externally set (e.g. cleared)\n\t\tif (new_props.value !== value)\n\t\t{\n\t\t\t// `this.state.value_property` is the `this.props.value`\n\t\t\t// which corresponding to `this.state.value`.\n\t\t\t// It is being compared in `componentWillReceiveProps()`\n\t\t\t// against `newProps.value` to find out if the new `value` property\n\t\t\t// needs `this.state.value` recalculation.\n\t\t\t// This is an optimization, it's like `shouldComponentUpdate()`.\n\t\t\t// This is supposed to save some CPU cycles, maybe not much, I didn't check.\n\t\t\t// Or maybe there was some other reason for this I don't remember now.\n\t\t\tif (new_props.value !== this.state.value_property)\n\t\t\t{\n\t\t\t\t// Update the `value` because it was externally set\n\n\t\t\t\t// Country code gets updated too\n\t\t\t\tlet country_code = this.state.country_code\n\n\t\t\t\t// Autodetect country if `value` is set\n\t\t\t\t// and is international (which it should be)\n\t\t\t\tif (new_props.value && new_props.value[0] === '+')\n\t\t\t\t{\n\t\t\t\t\t// `parse().country` will be `undefined` in case of non-detection\n\t\t\t\t\tcountry_code = parse(new_props.value).country || country_code\n\t\t\t\t}\n\n\t\t\t\tthis.setState\n\t\t\t\t({\n\t\t\t\t\tcountry_code,\n\t\t\t\t\tvalue: this.get_input_value_depending_on_the_country_selected(new_props.value, country_code),\n\t\t\t\t\t// `this.state.value_property` is the `this.props.value`\n\t\t\t\t\t// which corresponding to `this.state.value`.\n\t\t\t\t\t// It is being compared in `componentWillReceiveProps()`\n\t\t\t\t\t// against `newProps.value` to find out if the new `value` property\n\t\t\t\t\t// needs `this.state.value` recalculation.\n\t\t\t\t\tvalue_property: new_props.value\n\t\t\t\t})\n\t\t\t}\n\t\t}\n\t}", "selectIndustry(value) {\n let appointmentTaskInfo = this.state.appointmentTaskInfo;\n appointmentTaskInfo.industries = value;\n this.setState({\n appointmentTaskInfo: appointmentTaskInfo\n });\n }", "selectAndContactApplicant () {\n var selectedApplicant = this.props.selectedApplicant;\n this.props.multiSelectDeselectAll();\n this.props.multiSelectAdd(selectedApplicant.student_id);\n this.openConfirmMultiApplicantContactModal();\n }", "_onChangeMulti(option) {\n\n let selected = option.selected;\n let key = option.key;\n\n var keys = [...this.state._selectedIndices];\n let included = keys.includes(key);\n\n //If selected, let's add it to our tracking array prop.\n if (selected && included == false) {\n keys.push(key);\n }\n else if (selected == false && included) {\n\n //Otherwise let's remove it from our tracking array. \n var filtered = keys.filter(\n function (currVal) {\n return currVal != key;\n });\n\n // Now we set the filtered array to the keys array.\n keys = filtered;\n }\n\n this.setState(\n {\n _selectedIndices: keys,\n isDirty: true,\n }\n )\n }", "UNSAFE_componentWillReceiveProps(nextProps) {\n\t\tthis.state.chart.update(nextProps.gender)\n\t}", "onChangeEmploymentDetails(response){\n this.state.isSet.incomeDetailsSet = true;\n this.setState({\n employments: response\n });\n\n }", "function updateUserRecipeSelection() {\n dispatch({\n type: \"updateRecipe\",\n selectionId: Math.floor(Math.random() * 100000).toString(),\n recipeId: recipe._id,\n recipeName: recipe.name,\n recipeType: recipe.type,\n recipeImage: recipe.image,\n recipeImageMobile: recipe.imageMobile,\n recipeThumb: recipe.thumb,\n recipeWine: recipe.wine,\n recipeSubWine: recipe.subwine,\n recipeIngredients: recipe.ingredients,\n recipeDirections: recipe.directions,\n });\n console.log(\"Selected: \", state.recipeName);\n }", "handleChangeBookBy(e, bookBy) {\n let flightData = this.state.flightData;\n flightData.bookBy = bookBy;\n\n this.setState({\n flightData: flightData\n })\n }", "componentDidUpdate(prevprops, prevstate) {\n if (prevstate.selectedIndex !== this.state.selectedIndex) {\n let reformatedData = this.dataProcessing(this.state.brutData[this.state.selectedIndex.row][\"data\"])\n this.setState({ data: reformatedData });\n }\n if (prevprops.route.params !== this.props.route.params) {\n this.componentDidMount()\n }\n }", "function handleBuyerChange(selectedPerson) {\n setReceipt((prevReceipt) => {\n let updatedPeople = [...prevReceipt.people];\n for (var i = 0; i < updatedPeople.length; i++) {\n updatedPeople[i].isBuyer = i === selectedPerson.idx ? true : false;\n }\n\n return {\n ...prevReceipt,\n buyer: selectedPerson.name,\n people: updatedPeople,\n };\n });\n }", "componentDidUpdate(prevProps, prevState) {\n if (prevState.givenCountry !== this.props.givenCountry) {\n //if the country prop is changed for the dropdown given country, then this code block runs\n this.setState({\n givenCountry: this.props.givenCountry,\n //the new dropdown country is set here\n isLoaded: false,\n //the loaded status is falsified, because the graph data is changed\n graphData: {},\n //graph data is set to empty\n countryProv: undefined,\n //the countryProv from the user location is set to undefined\n });\n this.getCountryCaseStats();\n //fetch the country details for the new selected country\n }\n }", "constructor(props){\n super(props);\n\n this.state={\n isSet: {\n loanDetails:true,\n personalDetailsSet: false,\n employmentDetailsSet: false,\n incomeDetailsSet: false,\n ownershipDetailsSet: false,\n liabilityDetailsSet: false,\n expenseDetailsSet: false,\n protectingLoanSet: false,\n almostFinishedSet: false,\n },\n\n submission: {\n offerId: \"VXSCLS\",\n serviceCode: \"OR170\",\n loanAmount: \"\",\n loanType:\"\",\n peopleNo: \"\",\n existingCustomer: \"\",\n existingCustomer2: \"\",\n nabId: \"\",\n nabId2:\"\",\n loanPurpose: null,\n loanTerm: null,\n repaymentFrequency: null\n },\n\n applicants: {\n personalInfo: {\n title: \"\",\n gender: \"\",\n firstName: \"\",\n middleName: \"\",\n lastName: \"\",\n maritalStatus: \"\",\n birthDate: \"\",\n dependents: \"\",\n driversLicence: \"\",\n ausResident: \"\",\n usResident: \"\",\n otherCountryResident: \"\"\n },\n applicantRelationshipType: \"APPLICANT\",\n partyType: \"INDIVIDUAL\",\n isExistingParty: false,\n eKYCConsent: true,\n TFN: \"111119\",\n identificationDetails: [\n {\n type: \"PAS\",\n id: \"J123\",\n issuingAuthority: \"\",\n countryOfIssue: \"AU\",\n placeOfIssue: \"\",\n status: \"\",\n expiryDate: \"2028-02-01\",\n identificationId: \"\"\n }\n\n ],\n currentAddress: {\n type: \"RES\",\n postalAddress: {\n unit: \"\",\n number: \"\",\n street: \"\",\n suffix: \"\",\n state: \"VIC\",\n country: \"AU\",\n postalCode: \"2000\",\n },\n accommodationType: \"OWN\",\n stayingSince: \"2000-1-1\"\n },\n contacts: {\n personalMobile: \"\",\n personalEmail: \"\",\n homePhone: \"\"\n },\n securityQuestions: [{\n questionId: \"24\",\n question: \"\",\n answer: \"0\"\n\n }],\n consent: [{\n consentType: \"ONLINE\",\n isConsentAvailable: true,\n consentLevelType: \"APPLICANT\"\n }],\n isApplicantNotPresent: false,\n occupationCode: \"O223115\",\n industry: \"30\",\n fatcaDetails: {\n USResident: false,\n idType: \"TIN\",\n idNumber: \"\"\n }\n\n },\n employments: {\n partyDetailsConsent: true,\n profiles: 0,\n employmentProfiles: [{\n id: \"1\",\n type: \"\",\n status: null,\n industry: \"\",\n occupation: \"\",\n employerName: \"\",\n startDate: \"\",\n endDate: \"\",\n isPrimary: \"\",\n profileStatus: \"\"\n }]\n\n\n },\n\n\n }\n\n }", "componentWillReceiveProps(nextProps) {\n if(nextProps.formData && nextProps.formData._id) {\n this.setState({\n name: nextProps.formData.name,\n course: nextProps.formData.course,\n cuisines: nextProps.formData.cuisines,\n category: nextProps.formData.category,\n price: nextProps.formData.price,\n status: nextProps.formData.status? true: false,\n _id: nextProps.formData._id\n });\n } else {\n this.setState({ ...initialState });\n }\n }" ]
[ "0.5970631", "0.5964549", "0.59529996", "0.5948595", "0.5934879", "0.57891124", "0.577498", "0.57616746", "0.57463974", "0.56879246", "0.5653843", "0.56337166", "0.56114835", "0.5606435", "0.5602623", "0.5600986", "0.56008255", "0.55945164", "0.55933684", "0.5581502", "0.5564651", "0.5541643", "0.55236655", "0.5520145", "0.5519426", "0.55030406", "0.54946744", "0.54911023", "0.5489943", "0.5483905", "0.54572356", "0.54462856", "0.54406726", "0.543181", "0.5427789", "0.5419618", "0.53718036", "0.5369755", "0.5368407", "0.5364701", "0.53477633", "0.5341636", "0.5337766", "0.5337388", "0.53372324", "0.53369695", "0.5333634", "0.53272074", "0.53159535", "0.53159535", "0.52989703", "0.52933437", "0.52861565", "0.52838266", "0.5277407", "0.5274055", "0.5268254", "0.5259265", "0.52592546", "0.5251412", "0.52499485", "0.52373207", "0.5234179", "0.52272624", "0.52263916", "0.5217715", "0.5213288", "0.5206741", "0.52041733", "0.51988727", "0.51966405", "0.5190279", "0.51882684", "0.5183792", "0.51723224", "0.51719135", "0.51647884", "0.51598746", "0.5152836", "0.51519936", "0.51512235", "0.51442593", "0.513852", "0.5134627", "0.51323825", "0.5130723", "0.51303047", "0.512995", "0.51289845", "0.5127575", "0.51224715", "0.5119084", "0.5117629", "0.51162434", "0.5112817", "0.5111737", "0.51114756", "0.5111031", "0.5110904", "0.5110447" ]
0.7381843
0
used in updateHuddles to select huddle for patient on the given selected date
selectedPatientHuddle(selectedDate, patientHuddles) { if (patientHuddles == null) { return null; } return patientHuddles.find((huddle) => moment(selectedDate).isSame(huddle.datetime, 'day')); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "updateHuddles(patient, huddles, selectedDate) {\n let patientHuddles = getPatientHuddles(patient, huddles);\n\n let selectedPatientHuddle;\n if (patientHuddles != null) {\n selectedPatientHuddle = this.selectedPatientHuddle(selectedDate, patientHuddles);\n }\n\n let selectedPatientHuddlePatientInfo;\n if (selectedPatientHuddle != null) {\n selectedPatientHuddlePatientInfo = selectedPatientHuddle.patients.find((patient) => patient.id === this.props.patient.id);\n }\n\n this.setState({ patientHuddles, selectedPatientHuddle, selectedPatientHuddlePatientInfo });\n }", "_selectDate(date, eventPrevented, noPropSynch) {\n const that = this;\n\n if (typeof (that._viewDates) === 'undefined' || that.selectionMode === 'none') {\n return;\n }\n\n let selectedDates = that.selectedDates.slice(0);\n\n let cell = that._getCellByDate(date, that._animationStarted ? that.$.nextMonthsContainer : that.$.monthsContainer);\n\n if (cell) {\n that._selectCell(cell);\n }\n\n let index;\n\n date = new Date(date);\n date.setHours(0, 0, 0, 0);\n\n index = selectedDates.map(Number).indexOf(date.getTime());\n\n //Date selection\n if (that.restrictedDates.map(Number).indexOf(date.getTime()) > -1 || date.getTime() < that.min.getTime() || date.getTime() > that.max.getTime()) {\n return;\n }\n\n index > -1 ? selectedDates.splice(index, 1) : selectedDates.push(date);\n\n if (!noPropSynch) {\n that.selectedDates = selectedDates;\n }\n\n that._refreshFooter();\n\n // Update the hidden input\n that.$.hiddenInput.value = that.selectedDates.toString();\n\n if (!eventPrevented) {\n that.$.fireEvent('change', {\n 'value': [date]\n });\n }\n\n that._refreshTitle();\n }", "function selectDate(event) { \r\n if (event.target !== this){\r\n var newDate = new Date(getRootDate());\r\n newDate.setDate(event.target.textContent);\r\n setRootDate(newDate);\r\n calendar.getElementsByClassName('vjsdate-day-selected')[0].classList.remove('vjsdate-day-selected');\r\n calendar.getElementsByClassName('vjsdate-day' + newDate.getDate())[0].classList.add('vjsdate-day-selected');\r\n }\r\n listHour.dispatchEvent(new Event('change'));\r\n }", "setDate(date) {\n this.selectedDate = moment(date).format('YYYY-MM-DD');\n return this.getSchedule(this.doctor)\n }", "onDateChanged(selectedDate, doctorIdHostpitalId) {\n\n let { selectedDatesByDoctorIds, selectedSlotByDoctorIds, selectedSlotItemByDoctorIds } = this.state;\n\n selectedDatesByDoctorIds[doctorIdHostpitalId] = selectedDate;\n selectedSlotByDoctorIds[doctorIdHostpitalId] = -1;\n selectedSlotItemByDoctorIds[doctorIdHostpitalId] = null;\n\n this.setState({ selectedDatesByDoctorIds, selectedSlotByDoctorIds, selectedSlotItemByDoctorIds, refreshCount: this.state.refreshCount + 1 });\n\n if (this.processedDoctorAvailabilityDates.includes(selectedDate) === false) {\n let endDateMoment = addMoment(getMoment(selectedDate), 7, 'days');\n\n this.callGetAvailabilitySlot(this.state.getSearchedDoctorIds, getMoment(selectedDate), endDateMoment);\n\n }\n \n }", "function clickSelect(){\n console.log(date.property(\"value\"));\n var newtable = tableData.filter(sight => sight.datetime===date.property(\"value\"))\n displayData(newtable);\n}", "function selectDate(day, month, year) {\r\n date = { day: day, month: month, year: year };\r\n data.selectedDates.push(date);\r\n showAsSelected(day, month, year);\r\n }", "function selectDate(){\n var choose = $(this).datepicker('getDate');\n $('.error-card').css('display', 'none');\n $('#date-select').val(choose.toDateString());\n showDate(choose);\n }", "select(date) {\n this._model.add(date);\n }", "select(date) {\n this._model.add(date);\n }", "function selected(cal, date) {\n cal.sel.value = date; // just update the date in the input field.\n if (cal.dateClicked && (cal.sel.id == \"sel1\" || cal.sel.id == \"sel3\"))\n // if we add this call we close the calendar on single-click.\n // just to exemplify both cases, we are using this only for the 1st\n // and the 3rd field, while 2nd and 4th will still require double-click.\n cal.callCloseHandler();\n}", "_dateSelected(event) {\n const date = event.value;\n if (this.selected instanceof DateRange ||\n (date && !this._dateAdapter.sameDate(date, this.selected))) {\n this.selectedChange.emit(date);\n }\n this._userSelection.emit(event);\n }", "function handleDateSelection(date, instance) {\n console.log(\"before: \" + environment.addedMinDate);\n\n\t\tswitch(instance) {\n\t\t\tcase \"from\":\n\t\t\t\tenvironment.addedMinDate = date;\n\t\t\t break;\n\t\t\tcase \"to\":\n\t\t\t\tenvironment.addedMaxDate = date;\n\t\t\t break;\t\t\n\t\t}\n\n console.log(\"after: \" + environment.addedMinDate);\n }", "onChangeDate(e) {\n let _selectedDate = e.target.value;\n this.setState({\n selectedDate: _selectedDate\n }, ()=> {\n this.fetchAppointmentsByDoctorIdAndDate(this.state.selectedDate);\n });\n }", "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n }", "function selected(cal, date) {\r\n cal.sel.value = date; // just update the date in the input field.\r\n if (cal.dateClicked && (cal.sel.id == \"sel1\" || cal.sel.id == \"sel3\"))\r\n // if we add this call we close the calendar on single-click.\r\n // just to exemplify both cases, we are using this only for the 1st\r\n // and the 3rd field, while 2nd and 4th will still require double-click.\r\n cal.callCloseHandler();\r\n}", "function onDateSelection(date) {\n currentDate = date;\n $('.date-selection').val(dateSlashString(date));\n // Update daily data\n getDailyData().done(updateDataByTime);\n // Update display data\n updateVisualData();\n document.dispatchEvent(new CustomEvent('datechanged'));\n}", "function dateSelect() {\r\n // Prevent the page from refreshing\r\n event.preventDefault();\r\n\r\n // change date format to datetime\r\n tableData.forEach(row => row.datetime = new Date(row.datetime));\r\n\r\n // save user input\r\n // d3 object\r\n var userDate = d3.select('#datetime').property('value');\r\n console.log(userDate);\r\n // format to datetime\r\n var userDateFormatted = new Date(userDate);\r\n console.log(userDateFormatted);\r\n\r\n // filter data table by user input\r\n // add if else to enable non-date searches\r\n if (userDate !== '') {\r\n var newData = tableData.filter(function(row) {\r\n var rowDate = row.datetime;\r\n return rowDate.getTime() === userDateFormatted.getTime();\r\n });\r\n }\r\n\r\n else {\r\n var newData = tableData;\r\n };\r\n \r\n var finalData = filterSightings(newData);\r\n console.log(finalData);\r\n\r\n // populate table\r\n tableAppend(finalData);\r\n}", "async function getSelection(date) {\n let selection;\n if ((date.year > 0) && (date.month <= 0) && (date.day <= 0)) {\n selection = {'date.year': date.year};\n } else if ((date.year > 0) && (date.month > 0) && (date.day <= 0)) {\n selection = {'date.year': date.year, 'date.month': date.month};\n } else if ((date.year > 0) && (date.month > 0) && (date.day > 0)) {\n selection = {'date.year': date.year, 'date.month': date.month, \n 'date.day': date.day};\n } else {\n selection = \"\";\n }\n return selection;\n}", "_dateSelected(event) {\n const date = event.value;\n const selectedYear = this._dateAdapter.getYear(this.activeDate);\n const selectedMonth = this._dateAdapter.getMonth(this.activeDate);\n const selectedDate = this._dateAdapter.createDate(selectedYear, selectedMonth, date);\n let rangeStartDate;\n let rangeEndDate;\n if (this._selected instanceof DateRange) {\n rangeStartDate = this._getDateInCurrentMonth(this._selected.start);\n rangeEndDate = this._getDateInCurrentMonth(this._selected.end);\n }\n else {\n rangeStartDate = rangeEndDate = this._getDateInCurrentMonth(this._selected);\n }\n if (rangeStartDate !== date || rangeEndDate !== date) {\n this.selectedChange.emit(selectedDate);\n }\n this._userSelection.emit({ value: selectedDate, event: event.event });\n this._previewStart = this._previewEnd = null;\n this._changeDetectorRef.markForCheck();\n }", "selectDate(newDate) {\n if (this.dateInCalendar(newDate)) {\n const dateElement = this.getElementByDate(this.formatDate(newDate));\n\n // do not select if date is disabled\n if (this.dateElementDisabled(dateElement)) {\n return;\n }\n\n this.selectDateInCalendar(dateElement);\n } else {\n this.renderCalendar(newDate);\n }\n }", "handleDateClick(event){\n this.currentSelectedDate = event.currentTarget.getAttribute(\"data-id\");\n console.log('onItemSelected:::',this.currentSelectedDate);\n const selectedDate = new Date(this.currentYear, this.currentMonth, event.target.value);\n console.log('selectedDate-->'+selectedDate);\n this.handleSelectedDate(this.currentSelectedDate);\n //fire an event to set payoff date variable in Parent comp\n const selectedEvent = new CustomEvent(\"seldate\", {\n detail: {\n selectedDateInChild: this.currentSelectedDate\n }\n });\n // Dispatches the event.b\n this.dispatchEvent(selectedEvent);\n }", "function handleSelect(date){\n \n console.log(date.hour());\n // here we get the standard hours that the therapist has set\n // he is not available\n let _day = date.day();\n let foundDay = days.find(d=>d.value==_day);\n \n // something very bad happened here, lets just ignore it for now\n if(!foundDay){\n return;\n }\n\n let available_times = therapist.availability_times.filter(availability=>availability.weekday==foundDay.value).map(availability=>{\n let startTime = parseInt(availability.start_time.substring(0, 2));\n let endTime = parseInt(availability.end_time.substring(0, 2)) + 1; // plus 1 to include the last hour\n return range(startTime, endTime);\n })\n available_times = available_times.flat()\n let standardDisabledHours = getDisabledHoursFromAvailability(available_times);\n \n // here we get the dynamic disabled hours that are occupied\n // by existing sessions\n let disabled = [];\n let day = date.date();\n sessions.forEach(session=>{\n let startDate = moment(session.start_date);\n let endDate = moment(session.end_date);\n if(startDate.date()==day){\n disabled.push(startDate.hour());\n disabled.push(endDate.hour());\n }\n })\n\n // at the end we concat the two arrays together\n let finalDisabledHours = disabled.concat(standardDisabledHours)\n if(finalDisabledHours.includes(date.hour())){\n setDisabledMinutes(range(0, 60));\n }else{\n setDisabledMinutes(range(0, 0));\n }\n setDisabledHours(finalDisabledHours);\n }", "function getSelectedDate()\n{\nreturn curr_date;\n}", "function loadResources2(date) {\n\n var actualDate = moment(date).format('e');\n //var actualDate = $('#calendar').fullCalendar('getDate');\n\n //console.log(actualDate)\n $.ajax({\n url: \"admin/json-resources.php\",\n type: 'GET',\n //async: false,\n dataType: 'json',\n success: function (data) {\n //we need to remove values from dropdown\n $(\"#selectResource\").empty()\n\n $.each(data, function (i, resource) {\n\n $(\"#selectResource\").append('<option value=\"' + resource.id + '\"selected=\"selected\">' + resource.name + '</option>');\n\n\n });\n\n $('#selectResource').multiselect('rebuild');\n\n $.each(data, function (i, resource) {\n if (resource.workingDays.indexOf(actualDate) === -1) {\n $(\"#selectResource\").multiselect('deselect', resource.id)\n }\n //console.log(resource.workingDays);\n });\n\n },\n error: function (data) {\n alert(data);\n }\n\n });\n element.fullCalendar('render', true);\n }", "_dateSelected(event) {\n const date = event.value;\n if (this.selected instanceof DateRange ||\n (date && !this._dateAdapter.sameDate(date, this.selected))) {\n // @breaking-change 11.0.0 remove non-null assertion\n // once the `selectedChange` is allowed to be null.\n this.selectedChange.emit(date);\n }\n this._userSelection.emit(event);\n }", "add(date) {\n super.updateSelection(date, this);\n }", "add(date) {\n super.updateSelection(date, this);\n }", "setSelectedDate(state, selectedDate) {\n state.selectedDate = selectedDate;\n }", "function seleccionarDia () {\n \n var fecha = $('#fechas_seleccionadas_cita').val();\n globalFecha = fecha;\n var idMedico = $('#idMedico').text();\n\n if (fecha) {\n var date = new Date(fecha);\n //alert(date, idMedico);\n var obj_dates_idMedico = _dates_idMedico(fecha, date.getDay(), idMedico);\n tramosDisponibles(obj_dates_idMedico);\n\n } else { \n alert(\"Selecione una fecha\");\n }\n}", "function changeDate(e){\n var _v = e.target.value;\n lastSelectedDay = _v;\n mapL.changeDate(_v);\n mapR.changeDate(_v);\n chartL.changeDate(_v);\n chartR.changeDate(_v);\n}", "_handleDateSelection(cell) {\n const that = this;\n\n if (typeof (cell) === 'undefined' || cell.disabled || cell.restricted) {\n return;\n }\n\n\n function selectMultipleDates(firstSelectedDate, date) {\n that._clearSelection(true);\n if (firstSelectedDate.getTime() < date.value.getTime()) {\n while (firstSelectedDate.getTime() <= date.value.getTime()) {\n that._selectDate(firstSelectedDate, true);\n firstSelectedDate.setDate(firstSelectedDate.getDate() + 1);\n }\n }\n else if (firstSelectedDate.getTime() > date.value.getTime()) {\n while (firstSelectedDate.getTime() >= date.value.getTime()) {\n that._selectDate(firstSelectedDate, true);\n firstSelectedDate.setDate(firstSelectedDate.getDate() - 1);\n }\n }\n else {\n that._selectDate(date, true);\n }\n\n //Update the hidden input\n that.$.hiddenInput.value = that.selectedDates.toString();\n\n that._refreshFooter();\n that.$.fireEvent('change', { 'value': that.selectedDates });\n that._refreshTitle();\n }\n\n switch (that.selectionMode) {\n case 'none':\n that._focusCell(cell);\n break;\n case 'one':\n case 'default':\n if (that._keysPressed['Control']) {\n if (that.selectedDates.length > 1 || (that.selectedDates.length === 1 && !cell.selected)) {\n that._selectDate(cell.value);\n return;\n }\n\n that._focusCell(cell);\n return;\n }\n\n if (that._keysPressed['Shift']) {\n selectMultipleDates(new Date(that.selectedDates[0]), cell);\n return;\n }\n\n that._clearSelection(true);\n\n that._selectDate(cell.value, that._selectedCells.indexOf(cell.value) > -1 ? true : false);\n break;\n case 'many': {\n if (that.selectedDates.length === 0) {\n that._selectDate(cell.value);\n return;\n }\n\n const lastSelectedDate = that.selectedDates[that.selectedDates.length - 1];\n let firstSelectedDate = new Date(that.selectedDates[0]);\n\n if (cell.value.getTime() === firstSelectedDate.getTime() || cell.value.getTime() === lastSelectedDate.getTime()) {\n that._clearSelection();\n that._focusCell(cell);\n return;\n }\n\n if (that.selectedDates.length > 0) {\n selectMultipleDates(firstSelectedDate, cell);\n }\n\n break;\n }\n case 'zeroOrMany':\n that._selectDate(cell.value);\n break;\n case 'oneOrMany':\n if (that.selectedDates.length === 1 && cell.selected) {\n that._focusCell(cell);\n return;\n }\n\n that._selectDate(cell.value);\n break;\n case 'zeroOrOne':\n if (that.selectedDates.length === 1 && cell.selected) {\n that._selectDate(cell.value);\n return;\n }\n\n that._clearSelection(true);\n that._selectDate(cell.value);\n break;\n case 'week': {\n if (cell.selected && (cell.value.getTime() === that.selectedDates[0].getTime() ||\n cell.value.getTime() === that.selectedDates[that.selectedDates.length - 1].getTime())) {\n that._clearSelection();\n that._focusCell(cell);\n return;\n }\n\n that._clearSelection(true);\n\n let date = new Date(cell.value);\n\n that._selectDate(date);\n\n for (let i = 1; i < 8; i++) {\n date.setDate(date.getDate() + 1, i < 7);\n that._selectDate(date);\n }\n\n if (!that._isDateInView(date)) {\n that.navigate(1)\n }\n\n break;\n }\n }\n }", "function dateTurlederSelectHandler(e, turleder, row) {\n row.removeClass('jq-hide');\n row.find('button').on('click', dateTurlederRemoveHandler);\n row.find('input').attr('name', 'dates[' + i + '][turleder][]');\n table.append(row);\n }", "selectDatePreset(datePreset) {\n this.selected = datePreset;\n const [start, end] = this.calculateDateRange(datePreset);\n // @ts-ignore\n // if only start is selected we need to set end to clear out start and end.\n if ((this.selected.start !== undefined && !this.calendar.selected.end) || (this.calendar.selected.start && !this.calendar.selected.end)) {\n this.datePicker.select(start);\n }\n this.datePicker.select(start);\n this.datePicker.select(end);\n this.calendar.activeDate = end;\n }", "function focusOnSelectedDate() {\n document.querySelectorAll('.selected[data-date]')[0].focus();\n }", "showSelectedData() {\n const findRanking = (dateString) => {\n return this.data.rankings.find((ranking) => {\n return Form.getDropDownDate(ranking.date) === dateString;\n });\n };\n this.updateGraph(findRanking(this.dateFromElement.value), findRanking(this.dateToElement.value), parseInt(this.topNRanksElement.value, 10));\n }", "function optionChanged(optDate) {\r\n\r\n updateDailyChart(optDate);\r\n selectedDate = optDate;\r\n}", "function onDatePick() {\n calRadioGroupSelectItem(\"view-field\", \"custom-range\");\n refreshHtml();\n}", "selectDateInCalendar(dateElement) {\n this.selectedDate = dateElement.getAttribute('data-value');\n\n this.removeCurrentlySelectedDateAttributes();\n this.addSelectedDateAttributes(dateElement);\n }", "function dateHandler() {\n\n d3.event.preventDefault();\n\n console.log(dateInput.property(\"value\"));\n\n // Create table showing filtered data\n var filterTable = tableData.filter(alienSighting => alienSighting.datetime === dateInput.property(\"value\"));\n\n // Display the filtered table\n alienData(filterTable);\n}", "function selectDate(ufo) {\n return ufo.datetime == inputValue;\n}", "function clickme(){\n d3.event.preventDefault();\n var userdate= d3.select(\"#datetime\").property(\"value\");\n let filterrecord= tableData;\n if (userdate){\n filterrecord= filterrecord.filter(element=>element.datetime === userdate);\n }\n displaytable(filterrecord);\n}", "function Calendar_OnDateSelected(sender, eventArgs) {\r\n // limpa o span das datas\t \r\n var dtSelecionada = document.getElementById(\"dtSelecionada\");\r\n dtSelecionada.innerHTML = \"\";\r\n // obtém a referencia para o calendario\r\n var calendario = $find(IdCalendario);\r\n // obtém as datas selecionadas\r\n var dates = calendario.get_selectedDates();\r\n\r\n // para cada data..\r\n for (var i = 0; i < dates.length; i++) {\r\n var date = dates[i];\r\n var data = date[2] + \"/\" + date[1] + \"/\" + date[0];\r\n data += \" \"; // adiciona um espaco ao final para dar espaco entre as datas\r\n dtSelecionada.innerHTML += data;\r\n }\r\n}", "setDropDownDates(first, last) {\n const addDateToSelector = (date, selector, isSelected, isEnabled) => {\n const option = document.createElement(\"option\");\n const dateString = Form.getDropDownDate(date);\n option.text = dateString;\n option.value = dateString;\n option.selected = isSelected;\n option.disabled = !isEnabled;\n selector.add(option);\n };\n Utilities.emptyElement(this.dateFromElement);\n Utilities.emptyElement(this.dateToElement);\n this.data.rankings.forEach((ranking) => {\n addDateToSelector(ranking.date, this.dateFromElement, ranking === first, ranking.date < last.date);\n addDateToSelector(ranking.date, this.dateToElement, ranking === last, ranking.date > first.date);\n });\n }", "function search_data(input_date, input_state){\n tableData.forEach(function(the_date) { \n var date= the_date.datetime;\n var state= the_date.state;\n if(input_state==='') {\n state='';\n }\n \n\n console.log(\"state \", state);\n if(input_date === date && input_state === state) {\n date_selection.push(the_date); \n console.log(date, state, \" added to date_selection array\");\n } \n });\n console.log(date_selection)\n return(date_selection);\n}", "function filterer() {\n\n clear();\n speedreset()\n spedometer();\n\n date_input = document.getElementById('date').value\n hour_input = document.getElementById('hour').value\n date_in = new Date(date_input);\n hour_in = Number(hour_input);\n\n // console.log(date_in, hour_in)\n\n filtered = unfiltered.filter(x => new Date(x['date']) >= date_in)\n\n try {\n var date_chk = new Date(filtered[0]['date'])\n var hour_chk = filtered[0]['hour']\n }\n catch {\n return;\n }\n\n //If date does not contain hour then go to select first associated with said date.\n if (String(date_chk) === String(date_in) && hour_chk != hour_in && hour_chk > hour_in) {\n d3.select('#hour').attr('value', hour)\n hour_in = hour_chk\n }\n\n OntheHour();\n}", "handleDateToogle(date, e) {\n this.props.dispatch(storePersonalizedDateSelection(date, e.target.value));\n }", "function DateSelecting(component){var _this=_super.call(this,component)||this;_this.dragListener=_this.buildDragListener();return _this;}", "function actionDateSelectedForAgendaManage(){\n\n\t}", "function setDate(e){\n\t\tif($('#selected-accomodation-' + idNumber).val() == null){return;}\n\t\tvar id = prevFocus ? prevFocus.attr('id') : null;\n\t\tvar secondElementId;\n\t\tvar elementDate;\n\t\tvar dataSource = $('#year-calendar').data('calendar').getDataSource();\n\t\tvar isDateValid;\n\t\t\n\t if(~id.indexOf(\"start-date\")){\n\t \tsecondElementId = \"#end-date-\" + idNumber;\n\t \tsecondElementDate = new Date(changeDateFormat($(secondElementId).val()));\t\n\t \tisDateValid = validateSelectedDates(dataSource, e.date, secondElementDate);\t\n\t \tif ((isNaN(secondElementDate) || e.date < secondElementDate) && (isDateValid)){setSelectedDate(id, e);}\t\n\t }else if(~id.indexOf(\"end-date\")){\n\t \tsecondElementId = \"#start-date-\" + idNumber;\n\t \tsecondElementDate = new Date(changeDateFormat($(secondElementId).val()));\n\t \tisDateValid = validateSelectedDates(dataSource, secondElementDate, e.date);\n\t \tif (!(isNaN(secondElementDate)) && (e.date >= secondElementDate) && (isDateValid)){\tsetSelectedDate(id, e);}\t\n\t }else{\n\t \treturn;\n\t }\n\t}", "findByDate (req, res) {\n return availability\n .findAll({\n where: {\n doctor_id: req.params.doctor,\n date: req.params.date\n }\n })\n .then(availability => res.status(200).send(availability))\n .catch(error => res.status(400).send(error))\n }", "function dateSelectionRight() {\n date1.setDate(date1.getDate() + 1);\n date2.setDate(date2.getDate() + 1);\n date3.setDate(date3.getDate() + 1);\n refreshDate();\n updateEventContent();\n}", "'click #due_date'(){\n var due_date_id = this._id;\n console.log();\n\n $(\"#due_date\").datepicker({dateFormat : \"mm/dd/yy\"});\n // showOn: \"button\",\n \n // buttonImageOnly: true,\n // buttonText: \"Select date\",\n // onSelect: function(){\n // var due_date = $(this).val();\n // task_list.update({_id : due_date_id},{$set:{'due_date' : due_date}});\n\n // }\n // });\n document.getElementById('due_date').value='';\n }", "function handleDateChange(date) {\n\t\tsetSelectedDate(date);\n\t\tconsole.log(\"date:-\", Utility.convertDate(date));\n\t\tonSelectedDate(Utility.convertDate(date));\n\t}", "function handleDateChoice(){\n let date = document.querySelector(\"input\").value\n chosenHours.date = date\n availabilityCheck()\n}", "setDate(date, lesson) {\n this.dayData = this.arrayToDate(this.sortedData, date);\n console.log(this.dayData)\n this.dayData = this.arrayByLesson(this.dayData, lesson);\n \n //If selected date doesn't have data, only applicable for today's date\n if (this.dayData.length == 0) {\n console.log('This date no data');\n $('.sliderDiv').hide();\n $('#studentsProgress').html('<p>No Data for this date</p>');\n $('.chartHeight').hide();\n $('#buttons').hide();\n $('#current').hide();\n if (!refreshInterval && !incomingNewData) runRefeshInterval();\n return;\n } else {\n $('.sliderDiv').show();\n $('#buttons').show();\n $('#current').show();\n if (sChart) {\n $('.chartHeight').show();\n } else {\n $('.chartHeight').hide();\n }\n }\n\n //Get latest time\n this.dayEndTime = this.dayData[0].HappendAt;\n if (dt.dateToDateString(date) == todayDate) {\n useCurrentTime = $('#currentB').text() == 'False' ? false : true;\n currentDay = true;\n $('#current').show();\n $('#btnStart').html('Set Now')\n $('#btnStart').prop(\"value\", \"startNow\")\n $('#btnEnd').html('Set Now')\n $('#btnEnd').prop(\"value\", \"endNow\")\n if (!refreshInterval && !incomingNewData) runRefeshInterval();\n } else {\n useCurrentTime = false;\n currentDay = false;\n clearInterval(refreshInterval);\n refreshInterval = null;\n $('#current').hide();\n $('#btnStart').html('Set Earliest')\n $('#btnStart').prop(\"value\", \"startEarliest\")\n $('#btnEnd').html('Set Latest')\n $('#btnEnd').prop(\"value\", \"endLatest\")\n }\n incomingNewData = false;\n\n //Add resolved data\n let cDate =\n currentDay || !$('#dateSelection').val()\n ? dt.dateToDateString(new Date())\n : $('#dateSelection').val();\n let resolvedThisDateData = resolvedData.filter(s => s.date == cDate && s.title==lesson);\n console.log(resolvedThisDateData)\n if (resolvedThisDateData) {\n for (let i = 0; i < resolvedThisDateData.length; i++) {\n const { Answer, Code, HappendAt, Name, QnLabel, Title } = resolvedThisDateData[\n i\n ].data;\n let rd = {\n Code,\n QnLabel,\n Name,\n Answer,\n HappendAt,\n Title\n };\n this.dayData.map(data => {\n if (data.Name == rd.Name && data.Answer == rd.Answer && data.Code==rd.Code && data.Title == rd.Title && data.QnLabel == rd.QnLabel)\n data.resolved = resolvedThisDateData[i].data.resolved\n else data\n });\n }\n }\n this.setQn0();\n this.setUp();\n }", "function setOnSelectDateValue(select, type, date) {\n\ttype = type.toUpperCase();\n\tswitch(type) {\n\tcase SelectDate.type[0]:\n\t\tdate = date.substring(0, 4);\n\t\tselect = $(select).prevAll(\"select:nth(2)\");\n\t\tbreak;\n\tcase SelectDate.type[1]:\n\t\tdate = date.substring(4, 6);\n\t\tselect = $(select).prevAll(\"select:nth(1)\");\n\t\tbreak;\n\tcase SelectDate.type[2]:\n\t\tdate = date.substring(6, 8);\n\t\tselect = $(select).prevAll(\"select:nth(0)\");\n\t\tbreak;\n\t}\n\t$(select).getSetSSValue(date);\n}", "checkDayEvents(date) {\n var dayEvents = this.events.find(ev => {\n return new Date(ev.date).toDateString() === date.toDateString();\n });\n this.settings.onDateSelect(this, date, dayEvents);\n }", "dateSelected(){\n //when date is selected need to set state to current date\n //make api call to db to see if user has info for that date yet\n //conditional to change state for conditional render if infoexist/info doesnt exist\n console.log(\"hello\");\n }", "function datePickerVisitDate(id){\n\t$(\"#visitDate_\"+id).datepicker();\n}", "function checkResources() {\n\n var actualDate = $('#calendar').fullCalendar('getDate');\n // console.log(actualDate);\n actualDate = actualDate.format('e');\n //console.log(actualDate);\n $.ajax({\n url: \"admin/json-resources.php\",\n type: 'GET',\n //async: false,\n dataType: 'json',\n success: function (data) {\n\n $.each(data, function (i, resource) {\n if (resource.workingDays.indexOf(actualDate) === -1) {\n $(\"#selectResource\").multiselect('deselect', resource.id)\n\n }\n else {\n $(\"#selectResource\").multiselect('select', resource.id)\n\n }\n\n //console.log(resource.workingDays);\n });\n\n $('#calendar').fullCalendar('render', true);\n },\n error: function (data) {\n alert(data);\n }\n\n });\n\n }", "function userClicked() {\n // selects elements\n let inputValue = d3.select(\"#datetime\").property(\"value\")\n let filtered = tableData\n // checks input and filters\n if (inputValue) {\n filtered = filtered.filter(newRow => newRow.datetime === inputValue)\n };\n // filtered table data\n ufoTable(filtered)\n}", "function optionChanged(selectedPatientID) {\n console.log(selectedPatientID);\n buildCharts(selectedPatientID);\n populateDemographicInfo(selectedPatientID);\n}", "function toggleSelection(target) {\r\n\tvar selectedID = target.attr('so_data.id');\r\n\tif (target.hasClass('highlight') == true) {\r\n\t\tselectedDates = $.grep(selectedDates, function(value) {\r\n\t\t\treturn value != selectedID;\r\n\t\t});\r\n\t\ttarget.removeClass('highlight');\r\n\t} else {\r\n\t\tselectedDates.push(selectedID);\r\n\t\ttarget.addClass('highlight');\r\n\t}\r\n}", "refreshSelection() {\n this.iterateDays().iterate(d => {\n if (this.selection) {\n d.updateSelected(this.selection);\n }\n else {\n d.clearSelected();\n }\n });\n return this;\n }", "function initialState() {\n return {\n get selectedDate() {\n return selectedDate;\n },\n set selectedDate(dt) {\n if (dt && !opts.inRange(dt)) {\n return;\n }\n\n if (dt) {\n selectedDate = new Date(dt);\n dp.state.hilightedDate = selectedDate;\n } else {\n selectedDate = dt;\n }\n\n dp.updateInput(selectedDate);\n emit('select');\n dp.close();\n },\n view: 'day',\n };\n }", "function myDatePicker_dateSelected(page){\n page.children.flexLayout1.children.textFlex.children.dateLabel.text = definedDate;\n}", "function handleClick() {\n var date = d3.select(\"#datetime\").property(\"value\");\n var filterData = tableData\n if (date) {\n filterData = filterData.filter(row => row.datetime === date);\n }\n buildTable(filterData);\n}", "function chooseDate() {\n\n console.group(\"Choose Date\");\n let selectedTheatre = $(\"#theatreName\").val();\n let selectedDate = $(\"#date\").val();\n let selectedTime = $(\"#time\").val();\n console.log(selectedTheatre, selectedDate, selectedTime)\n seatsQuantity(selectedTheatre, selectedDate, selectedTime).then(res => {\n let totalBookedTickets = res;\n console.log(\"totalbooked tickets:\", totalBookedTickets);\n getSeats();\n $(\"#noofticketsbooked\").val(totalBookedTickets);\n })\n let theatres = JSON.parse(localStorage.getItem(\"THEATRES\"));\n let selectedTheatreName = $(\"#theatreName\").val();\n let selectedTheatreObj = theatres.find(obj => obj.theatreName == selectedTheatreName);\n //displayShowTimings(selectedTheatreObj);\n console.groupEnd(\"Choose Date\");\n}", "function doctorWasChanged(e) {\n console.log(e.target.value);\n set_selectedDocterId(e.target.value);\n }", "'click #start_date'(){\n \n\n $(\"#start_date\").datepicker({dateFormat : \"mm/dd/yy\"});\n\n // showOn: \"button\",\n \n // buttonImageOnly: true,\n // buttonText: \"Select date\",\n // onSelect: function(){\n // var due_date = $(this).val();\n // task_list.update({_id : due_date_id},{$set:{'due_date' : due_date}});\n\n // }\n // });\n document.getElementById('start_date').value='';\n }", "function deleteSelection() {\n tempSelectedDates.forEach(function (e) {\n dateRangeChart.dispatchAction({\n type: 'downplay',\n dataIndex: e[1],\n seriesIndex: e[2]\n });\n });\n tempSelectedDates = new Set([]);\n //update the selection date list\n var $ul = createSelectionUl(tempSelectedDates);\n $(\"#daysSelectedList\").empty().append($ul);\n }", "function selectDay(idx) {\n\t\t\t\t\tvar daySelected = weekView.querySelectorAll('.cal-lg-day')[idx];\n\t\t\t\t\tsetTimeout(function () {\n\t\t\t\t\t\t_h.toggleClass(daySelected, 'selected');\n\t\t\t\t\t}, 200);\n\t\t\t\t}", "function selectDate(ufoEvents) {\n return ufoEvents.datetime === inputDate;\n }", "function ds_setDateParts( year, month, date ) {\r\r\n\tthis.dayObj[date-1].selected = true;\r\r\n\tthis.monthObj[month-1].selected = true;\r\r\n\tfor( i=0; i < this.yearObj.length; i++ ) {\r\r\n\t\tif( this.yearObj[i].value == year )\r\r\n\t\t\tthis.yearObj[i].selected = true;\r\r\n\t}\r\r\n\tthis.adjustDaysInMonth();\r\r\n}", "getDate(event) {\n this.registro.year = event.year;\n this.registro.month = event.monthIndex;\n this.isSelect = new Date(this.registro.year, this.registro.month);\n this.valiDate();\n }", "function onDateSelect(event) {\n // Initialize the clock, if not already done\n initClock();\n\n var dateArray = this.getAttribute('data-date').split('-');\n currentDateTime.setFullYear(parseInt(dateArray[0]), parseInt(dateArray[1])-1, parseInt(dateArray[2]));\n\n btnPreviousMonth.style.display = 'none';\n btnNextMonth.style.display = 'none';\n addClass(calendar, 'datipi-circle-hidden');\n\n window.setTimeout(function () {\n calendar.style.display = 'none';\n headline.innerHTML = 'Select Hour';\n clock.style.display = 'block';\n }, 350);\n\n updateInputValue();\n\n // The outside click event should not occur\n event.stopPropagation();\n }", "function handleClick(){\n d3.event.preventDefault()\n var date = d3.select(\"#datetime\").property(\"value\");\n var filterData = tableData;\n if (date){\n filterData = filterData.filter((row) => row.datetime == date);\n }\n buildTable(filterData);\n}", "function dateFilter() {\n if (filterDate === \"\") {\n dateSelect.selectAll(\".value\").remove();\n let dates = new Set(filteredData.map(date => date.datetime));\n dates.forEach(function(date) {\n d3.select(\"#dateSelect\").append(\"option\").attr(\"class\", \"value\").text(date);\n })\n }\n}", "function onSelect(datePicker,date)\n{\n var dt = new Date(date);\n // use the same output dateformat as datepicker uses\n document.getElementById(datePicker.idField).value = dt.format(datePicker.format);\n datePicker.destroy();\n}", "function addSelectionProperty() {\n let selectableDates = document.querySelectorAll('.selectable');\n selectableDates.forEach(selectableDate => {\n selectableDate.addEventListener('click', () => { \n let selectedDate = {\n date: selectableDate.innerHTML,\n monthNum : month,\n yearNum : year\n } \n if(selectableDate.classList.contains('selected'))\n removeDate(selectedDate);\n else\n addDate(selectedDate);\n })\n })\n}", "set selectedDate(v) {\n if (v !== this.innerValue) {\n this.innerValue = v;\n this.onChangeCallback(v);\n }\n }", "function find() {\n\tvar selectedOption = document.getElementById('dateRanges').value \n\tfor (i=0;i<zodiacObjArray.length;i++) {\n\t\tif (zodiacObjArray[i].dates == selectedOption) {\n\t\t\tdocument.getElementById('zdcSign').innerHTML = zodiacObjArray[i].sign.toUpperCase()\n\t\t\tdocument.getElementById('zdcReading').innerHTML = zodiacObjArray[i].horoscope\n\t\t\tdocument.getElementById('picture').src = zodiacObjArray[i].icon\n\t\t\tdocument.getElementById('type').src = zodiacObjArray[i].typePic\n\n\t\t}\n\t}\n}", "function loadResources() {\n var actualDate = moment().format('e');\n //var actualDate = $('#calendar').fullCalendar('getDate');\n if (actualDate != 0) {\n actualDate = actualDate - 1;\n }\n //console.log(actualDate);\n $.ajax({\n url: \"admin/json-resources.php\",\n type: 'GET',\n //async: false,\n dataType: 'json',\n success: function (data) {\n //we need to remove values from dropdown\n $(\"#selectResource\").empty();\n $(\"#edit-resourceID\").empty();\n $.each(data, function (i, resource) {\n\n $(\"#selectResource\").append('<option value=\"' + resource.id + '\"selected=\"selected\">' + resource.name + '</option>');\n $(\"#edit-resourceID\").append('<option value=\"' + resource.id + '\"selected=\"selected\">' + resource.name + '</option>');\n\n });\n $('#selectResource').multiselect('rebuild');\n $(\"#edit-resourceID\").multiselect('rebuild');\n $.each(data, function (i, resource) {\n if (resource.workingDays.indexOf(actualDate) === -1) {\n $(\"#selectResource\").multiselect('deselect', resource.id);\n }\n //console.log(resource.workingDays);\n });\n\n },\n error: function (data) {\n alert(data);\n }\n\n });\n element.fullCalendar('render', true);\n }", "function onSelectSlot(day) {\n setDayStartDate(day.start)\n setDayEndDate(day.end)\n setShowDayModal(true);\n console.log(\"day clicked: \", day.start)\n }", "function locationSelected(value) {\n\t\tconsole.log(value);\n\t\tvm.model.selectedLocation = value;\n\t\t/* API call to check available dates */\n\t\tcustApi.checkAvailableDatesInMonth(3, vm.model.fromMonthDate, value.pincodeid, value.zoneid, vm.model.physiotherapyId).\n\t\tsuccess(function (data, status, header, config) {\n\t\t\tconsole.log(\"Available dates retrieved successfully\");\n \n\t\t\tconsole.log(data);\n\t\t\t/* Enabling available dates */\n\t\t\tvar i=0;\n\t\t\tlocalVariables.enableDatesArray = [];\n\t\t\tvar yr='';\n\t\t\tvar month='';\n\t\t\tvar day='';\n\t\t\tvar date='';\n\t\t\tdata.payload.dates.forEach(function(p) {\n\t\t\t\tyr = p.substring(0,4);\n\t\t\t\tmonth = p.substring(4,6);\n\t\t\t\tday = p.substring(6,8);\n\t\t\t\tdate = yr + '/' + month + '/' + day;\n\t\t\t\tlocalVariables.enableDatesArray.push(new Date(date));\n\t\t\t});\t\t\t\t\n\t\t\tif(localVariables.enableDatesArray.length != 0) {\n \t$scope.$parent.cpc.flags.datesNotAvailable = false;\n\t\t\t\t$(\"#dt3\").data(\"DateTimePicker\").enabledDates(localVariables.enableDatesArray);\n\t\t\t} else {\n console.log(\"setting date not available flag to true\");\n \t$scope.$parent.cpc.flags.datesNotAvailable = true;\n \n $timeout(function () { \t$scope.$parent.cpc.flags.datesNotAvailable = false; }, 5000);\n\t\t\t\t$(\"#dt3\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\t\t\t}\n\t\t\t\n\t\t\t/* For available date retrieve 'available time' slots */\n \tif(vm.model.selectedLocation != 'Choose Location' && ( vm.model.fromDate != '' && vm.model.fromDate != undefined)) {\n \t\tcustApi.fetchAvailableSlotsForDay(vm.model.fromDate, vm.model.selectedLocation.zoneid, vm.model.physiotherapyId, vm.model.selectedLocation.pincodeid).\n \tsuccess(function (data, status, header, config) {\n \t\tconsole.log(\"Available slots retrieved successfully\");\n \t\tconsole.log(\"Slots:\");\n \t\tconsole.log(data);\n \t\tvm.model.timeslotArray = [];\n \t\t/* format time slot into hr:min am/pm */\n \t\tdata.payload.appointmentslots.forEach(function(item) {\n \t\t\tvar hours = item.st.substring(0,2);\n \t\t\tvar mins = item.st.substring(2,4);\n \t\t\tvar period = \"\";\n\t\t\t\t\t\tif(hours > 12) {\n\t\t\t\t\t\t\thours = hours - 12;\n\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t\t/*if(hours.toString().length == 1) {\n\t\t\t\t\t\t\t\thours = \"0\"+hours;\n\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t} else if(hours < 12) {\n\t\t\t\t\t\t\tperiod = \"AM\";\n\t\t\t\t\t\t} else if(hours == 12) {\n\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t}\n \t\t\tvar timeformat = hours + \":\" + mins + \" \" + period;\n \t\t\tvm.model.timeslotArray.push({starttime: timeformat});\n \t\t});\n \t}).\n \terror(function (data, status, header, config) {\n \t\tconsole.log(\"Error in retrieving available slots\");\n \t});\n \t}\n\t\t}).\n\t\terror(function (data, status, header, config) {\n\t\t\tconsole.log(\"Error in retrieving available dates\");\n\t\t});\n\t}", "function DateSelecting(component) {\n var _this = _super.call(this, component) || this;\n _this.dragListener = _this.buildDragListener();\n return _this;\n }", "function DateSelecting(component) {\n var _this = _super.call(this, component) || this;\n _this.dragListener = _this.buildDragListener();\n return _this;\n }", "function DateSelecting(component) {\n var _this = _super.call(this, component) || this;\n _this.dragListener = _this.buildDragListener();\n return _this;\n }", "function DateSelecting(component) {\n var _this = _super.call(this, component) || this;\n _this.dragListener = _this.buildDragListener();\n return _this;\n }", "function buttonClick(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Create & display new table with filtered/searched data\n var filtered_table = tableData.filter(ufo_sighting => ufo_sighting.datetime===dateInputText.property(\"value\"))\n displayData(filtered_table);\n}", "function selectProperLabor()\n\t{\n\t\tvar rows = auxJobGrid.getSelectionModel().getSelections();\n\t\t\n\t\tif(rows.length > 0)\n\t\t{\n\t\t\tvar record = null;\n\t\t\tvar selectedSize = size.getRawValue();\n\t\t\tvar labor = \"\";\n\t\t\t\n\t\t\tfor(var i = 0; i < dsLabor.getCount(); i++)\n\t\t\t{\n\t\t\t\trecord = dsLabor.getAt(i); \t\n\t\t\t\tlabor = record.data.name;\n\t\t\t\t\n\t\t\t\tif(labor.toString().indexOf(selectedSize) != -1)\n\t\t\t\t{\n\t\t\t\t\trows[0].set('labor', labor);\n\t\t\t\t\trows[0].set('labor_cost', record.data.cost);\n\t\t\t\n\t\t\t\t\tif(record.data.job_id == 21)//Weed\n\t\t\t\t\t{\n\t\t\t\t\t\trows[0].set('days', record.get('days'));\n\t\t\t\t\t\t\n\t\t\t\t\t\tsetScheduledDate(rows[0]);\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\trows[0].set('labor', '');\n\t\t\trows[0].set('labor_cost', 0);\n\t\t}\n\t}", "function showSelectedDays() {\r\n var selectedDates = data.selectedDates;\r\n for (var index in selectedDates) {\r\n var day = selectedDates[index][\"day\"];\r\n var month = selectedDates[index][\"month\"];\r\n var year = selectedDates[index][\"year\"];\r\n showAsSelected(day, month, year);\r\n }\r\n }", "onChange() {\n if (this.onDtChange) {\n this.onDtChange({\n $event: {\n dt: this._$filter('date')(this.dt, 'yyyy-MM-dd HH:mm:ss')\n }\n });\n }\n }", "function handleClick(){\n // create a variable to hold date data\n let date = d3.select(\"#datetime\").property(\"value\");\n let filteredData = tableData;\n\n // Checking to see if date was entered\n if (date) {\n // filter the data to show data that matches date that was used\n filteredData = filteredData.filter(row => row.datetime === date);\n };\n\n // Rebuild the table using the filtered data\n // @NOTE: If no date was entered, then filteredData will\n // just be the original tableData.\n buildTable(filteredData);\n }", "function locationSelected(value) {\n\t\t\tconsole.log(value);\n\t\t\tvm.selectedLocation = value;\n\t\t\tif($(\"#dt1\").data(\"DateTimePicker\").date() != null) {\n\t\t\t\tvm.fromMonthDate = $(\"#dt1\").data(\"DateTimePicker\").date().format(\"YYYYMM\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\tvm.fromMonthDate = moment(new Date()).format(\"YYYYMM\");\n\t\t\t}\n\t\t\t/* API call to check available dates */\n\t\t\tcustApi.checkAvailableDatesInMonth(3, vm.fromMonthDate, value.pincodeid, value.zoneid, vm.physiotherapyId).\n\t\t\tsuccess(function (data, status, header, config) {\n\t\t\t\tconsole.log(\"Available dates retrieved successfully\");\n\t\t\t\tconsole.log(data);\n\t\t\t\t/* Enabling available dates */\n\t\t\t\tvar i=0;\n\t\t\t\tenableDatesArray = [];\n\t\t\t\tvar yr='';\n\t\t\t\tvar month='';\n\t\t\t\tvar day='';\n\t\t\t\tvar date='';\n\t\t\t\tdata.payload.dates.forEach(function(p) {\n\t\t\t\t\tyr = p.substring(0,4);\n\t\t\t\t\tmonth = p.substring(4,6);\n\t\t\t\t\tday = p.substring(6,8);\n\t\t\t\t\tdate = yr + '/' + month + '/' + day;\n\t\t\t\t\tenableDatesArray.push(new Date(date));\n\t\t\t\t});\t\t\t\t\n\t\t\t\tif(enableDatesArray.length != 0) {\n\t\t\t\t\tvm.flags.datesNotAvailable = false;\n\t\t\t\t\t$(\"#dt1\").data(\"DateTimePicker\").enabledDates(enableDatesArray);\n\t\t\t\t\t$(\"#dt2\").data(\"DateTimePicker\").enabledDates(enableDatesArray);\n\t\t\t\t} else {\n\t\t\t\t\tvm.flags.datesNotAvailable = true;\n\t\t\t\t\t$timeout(function () { vm.flags.datesNotAvailable = false; }, 5000);\n\t\t\t\t\t$(\"#dt1\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\t\t\t\t\t$(\"#dt2\").data(\"DateTimePicker\").enabledDates([new Date('1970/1/1')]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t/* For available date retrieve 'available time' slots */\n\t\t\t\tif(vm.selectedLocation != 'Choose Location' && vm.fromDate != undefined) {\n\t\t\t\t\tcustApi.fetchAvailableSlotsForDay(vm.fromDate, vm.selectedLocation.zoneid, vm.physiotherapyId, vm.selectedLocation.pincodeid).\n\t\t\t\t\tsuccess(function (data, status, header, config) {\n\t\t\t\t\t\tconsole.log(\"Available slots retrieved successfully\");\n\t\t\t\t\t\tconsole.log(\"Slots:\");\n\t\t\t\t\t\tconsole.log(data);\n\t\t\t\t\t\tvm.timeslotArray = [];\n\t\t\t\t\t\t/* format time slot into hr:min am/pm */\n\t\t\t\t\t\tdata.payload.appointmentslots.forEach(function(item) {\n\t\t\t\t\t\t\tvar hours = item.st.substring(0,2);\n\t\t\t\t\t\t\tvar mins = item.st.substring(2,4);\n\t\t\t\t\t\t\tvar period = \"\";\n\t\t\t\t\t\t\tif(hours > 12) {\n\t\t\t\t\t\t\t\thours = hours - 12;\n\t\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t\t\t/*if(hours.toString().length == 1) {\n\t\t\t\t\t\t\t\t\thours = \"0\"+hours;\n\t\t\t\t\t\t\t\t}*/\n\t\t\t\t\t\t\t} else if(hours < 12) {\n\t\t\t\t\t\t\t\tperiod = \"AM\";\n\t\t\t\t\t\t\t} else if(hours == 12) {\n\t\t\t\t\t\t\t\tperiod = \"PM\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tvar timeformat = hours + \":\" + mins + \" \" + period;\n\t\t\t\t\t\t\tvm.timeslotArray.push({starttime: timeformat});\n\t\t\t\t\t\t});\n\t\t\t\t\t}).\n\t\t\t\t\terror(function (data, status, header, config) {\n\t\t\t\t\t\tconsole.log(\"Error in retrieving available slots\");\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}).\n\t\t\terror(function (data, status, header, config) {\n\t\t\t\tconsole.log(\"Error in retrieving available dates\");\n\t\t\t});\n\t\t}", "function eventDate(ev) {\n let userId = firebase.auth().currentUser.uid,\n dateTarget = ev.target.id;\n\n let monthes = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n date = Number.parseInt(dateTarget);\n\n function writeData(date) {\n \n firebase.database().ref(`users/${userId}/date`).set({\n day: date\n });\n }\n\n writeData(date);\n\n\n $timeout(function(){\n firebase.database().ref(`users/${userId}/events`).on(\"value\", function (snapshot) {\n if(snapshot.val()) {\n snapshot.forEach(function(childSnapshot) {\n if (childSnapshot.val().day === date) {\n $location.path(\"/event-list\")\n }\n });\n } else $location.path(\"/add-date-event\")\n })\n })\n }", "function setDate(){\n date = document.getElementById(\"range\").value;\n\n showAndHideInformation();\n loadContent(date);\n}", "onDateChange(date) {\n this.setState({\n selectedStartDate: date\n });\n }", "add(date) {\n let { start, end } = this.selection;\n if (start == null) {\n start = date;\n }\n else if (end == null) {\n end = date;\n }\n else {\n start = date;\n end = null;\n }\n super.updateSelection(new DateRange(start, end), this);\n }" ]
[ "0.6580257", "0.6579635", "0.64281875", "0.6380845", "0.6345712", "0.62575346", "0.62260044", "0.6168415", "0.6167086", "0.6167086", "0.5992148", "0.5969233", "0.5962206", "0.595201", "0.5936758", "0.59136313", "0.5885128", "0.5880619", "0.58546716", "0.58458585", "0.58419317", "0.5812922", "0.5753768", "0.57445", "0.574393", "0.5722828", "0.5704356", "0.5704356", "0.569464", "0.56498283", "0.5645268", "0.5608063", "0.56077814", "0.56066847", "0.5604551", "0.5596831", "0.558467", "0.55834943", "0.55816793", "0.5566861", "0.5551385", "0.5506699", "0.5502049", "0.54986155", "0.549365", "0.54901415", "0.5465667", "0.5458105", "0.5450373", "0.54409486", "0.54354227", "0.5428344", "0.5428186", "0.54146034", "0.54074526", "0.5397671", "0.53965545", "0.5391485", "0.53882074", "0.53715044", "0.5368576", "0.5356072", "0.5352358", "0.53492576", "0.53413427", "0.53406674", "0.5339666", "0.5338906", "0.53368104", "0.5334253", "0.53336024", "0.5327888", "0.5326459", "0.5311811", "0.5304224", "0.53028923", "0.5300688", "0.5298182", "0.5297422", "0.52937996", "0.52916384", "0.5289891", "0.528915", "0.52846724", "0.5284111", "0.52801853", "0.5279507", "0.5279507", "0.5279507", "0.5279507", "0.52779347", "0.5275751", "0.527315", "0.526637", "0.5263628", "0.52609044", "0.52532715", "0.52517045", "0.5250614", "0.5248069" ]
0.7555098
0
This function will empty all entries in the add Task form. The previous added Information will not be changed
function emptyFields() { document.getElementById("title").value = null; document.getElementById("urgency").value = "High Urgency"; document.getElementById("importance").value = "High Importance"; document.getElementById("date").value = null; document.getElementById("description").value = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function clearNewTaskRow(obj)\n{\n const kids = obj.children();\n const taskNameBox = $(kids[2]);\n const taskNameInput = $(taskNameBox.children()[1]);\n clearVal(taskNameInput);\n const spoon = kids.filter(\".spoon\");\n for (let i = 0; i < spoon.length; i++) {\n let spoonBox = $(spoon[i]);\n let spoonForm = $(spoonBox.children()[1]);\n setVal(spoonForm,\"blank\");\n }\n}", "function clearAll() {\n taskTitleInput.value = \"\";\n newTaskDisplay.innerHTML = \"\";\n}", "function clearTask(){\n // this one way of doing it \n //taskList.innerHTML=\" \";\n \n // this is the best way to do it cause its faster\n while(taskList.firstChild){\n taskList.removeChild(taskList.firstChild);\n }\n // clear from all from local storage\n clearTasksFromLocalStorage();\n }", "function clearTasks(e) {\n const tasks = Array.from(taskList.children);\n if (tasks.length > 0){\n if (confirm('Clear all tasks?')) {\n tasks.forEach(function (task){\n task.remove();\n });\n }\n }\n taskInput.value = '';\n filter.value = '';\n localStorage.removeItem('tasks');\n\n e.preventDefault();\n}", "function clearForm() {\n that.data = {\n taskDate: {}\n };\n }", "function emptyTasks() {\n $('#toDoItem').empty();\n}//end of emptyTasks", "function clearTaskItemElements() {\n document.getElementById('addTaskItemsContainer').innerHTML = \"\";\n document.getElementById('editTaskItemContainer').innerHTML = \"\";\n}", "function clearTasks(){\n item.parentNode.removeChild(item);\n }", "function clearTasks(e) {\n taskList.innerHTML = \"\";\n}", "function clearTasks(e) {\n //taskList.innerHTML = ''\n while (taskList.firstChild) {\n taskList.removeChild(taskList.firstChild)\n }\n //clear all tasks from local storage\n clearAllTasksFromLS()\n}", "static clearFieldsCreate() {\n document.getElementById(\"input_task\").value = \"\";\n document.getElementById(\"input_description\").value = \"\";\n document.getElementById(\"input_work_time\").value = \"25\";\n document.getElementById(\"input_long_break\").value = \"15\";\n document.getElementById(\"input_short_break\").value = \"5\";\n\n //This is the word counter of the description field\n document.getElementById(\"cant_characters\").innerText = \"0/100\";\n\n ListBinding.fillStarCrateTask(1);\n }", "clearTasks(){\n const taskList = document.getElementById(\"taskList\");\n taskList.innerHTML = '';\n }", "function clearTask(e) {\r\n taskList.innerHTML = \"\";\r\n localStorage.clear();\r\n}", "function clearTasks(e){\n //taskList.innerHTML = '';\n while(taskList.firstChild){\n taskList.removeChild(taskList.firstChild);\n }\n let deletedTasks;\n \n deletedTasks = localStorage.getItem('tasks')\n \n localStorage.setItem('deletedTasks',deletedTasks)\n localStorage.removeItem('tasks')\n //localStorage.clear()\n e.preventDefault()\n}", "function reset() {\n self.taskActionList([]);\n self.selectedTasklist([]);\n self.isTaskSelected(false);\n self.actionName('');\n self.actionComments('');\n self.showConfirmation('none');\n }", "function delAll(){\n document.getElementById(\"taskList\").innerHTML = '';\n}", "function clearNewEntryFields() {\n $('#new-entry [id^=entry]').val('');\n Category.clearSelectCategoryField(ENTRY_CAT_FIELD_ID);\n $('#new-entry .input-error').hide();\n}", "function clearTasks() {\r\n //CLEAR TASKS FROM THE DOM\r\n while (taskList.firstChild) {\r\n taskList.removeChild(taskList.firstChild);\r\n }\r\n //CLEAR TASKS FROM LOCAL STORAGE\r\n clearAllLS();\r\n}", "function clearAll()\n{\n document.getElementById(\"incomplete-tasks\").innerText = \"\";\n taskArr = [];\n console.log(taskArr);\n}", "function clearTasks() {\n// taskList.innerHTML = \"\" \n\n// more faster:\n\n if(confirm(\"Are You Sure To Remove all of This!!\"))\n {\n while(taskList.firstChild)\n {\n taskList.removeChild(taskList.firstChild)\n }\n // clear whole local storage when click clear tasks button:\n clearFromLocalUsingBtn();\n \n\n }\n \n \n}", "function clearInputFields() {\r\n\tdocument.getElementById(\"task-text\").value = \"\";\r\n\tdocument.getElementById(\"task-due-date\").value = \"\";\r\n\tdocument.getElementById(\"task-due-time\").value = \"\";\r\n\t\r\n\tupdateRequiredFieldsDisplay(); // show/hide \"required\" indication (asterisk) and handle labels\r\n}", "function clearTaskWindow() {\n $(\"#taskWindow .inputbox\").val(\"\");\n $(\"#taskWindow textarea\").val(\"\");\n\n //Update list of current backlog items \n createCurrentBacklogList();\n}", "function clearAll() {\n while (taskContainer.firstChild) {\n taskContainer.removeChild(taskContainer.firstChild);\n }\n browser.storage.local.clear();\n}", "function delAll() {\n let taskBox = document.getElementById(\"tasksBox\");\n\n if (taskBox.innerHTML !== \"\" && confirm(\"Are you sure you want to clear all the tasks?\")) {\n // delete all items with 'task' key prefix from localStorage\n localStorage.removeItem(\"task\");\n arrayTask = [];\n // task box\n taskBox.innerHTML = \"\";\n // filter text box\n document.tasksForm.txtFilterTasks.value = \"\";\n }\n}", "function clearAllHandler() {\n trash = toDoList.filter((task) => task.isDone == true);\n toDoList = toDoList.filter((task) => task.isDone == false);\n commitToLocalStorage(toDoList);\n reRender();\n}", "function clean_modal() {\n $(\"#save_task\").val(\"\");\n $(\"#task_title\").val(\"\");\n $(\"#task_content\").val(\"\");\n tag_selector.set([]);\n}", "deleteAllTasks () {\r\n this.eliminatedTask.splice(0, this.eliminatedTask.length);\r\n }", "function addEmptyTask() {\n $(\"#taskList\").append(\n \"<task class=\\\"task\\\">\" +\n \"<text class=\\\"action\\\"></text> \" +\n \"<date class=\\\"action\\\"></date> \" +\n \"<button onclick='model.editTask(this)'>Edit</button> \" +\n \"<button onclick='model.deleteTask(this)'>Delete</button> \" +\n \"<label for=\\\"action\\\">Done</label> \" +\n \"<input class=\\\"checkBox\\\" onclick='model.updateTask(this)' type=\\\"checkbox\\\">\" +\n \"<br>\" +\n \"</task>\"\n );\n }", "function clearNew() {\n const buttonClear = document.querySelector('.button-clear-new')\n buttonClear.onclick = function () {\n newContainer.classList.add(hiddenClass)\n newText.value = ''\n showInfoNoTask()\n }\n }", "function clearTasks() {\r\n\r\n // One way to clear all the tasks\r\n // taskList.innerHTML = '';\r\n\r\n // Other way to clear all the tasks (Faster way)\r\n while(taskList.firstChild) { // That means there is still something in the list\r\n\r\n // Remove the li of taskList\r\n taskList.removeChild(taskList.firstChild);\r\n }\r\n\r\n // Clear/Remove the tasks from localStorage\r\n clearTasksFromLocalStorage();\r\n\r\n}", "function clearForm() {\n clearUnitDetails();\n clearUnits();\n }", "function add_task() {\n const task = NEW_TASK.value.trim();\n if (task !== '') {\n COMPLETE_ALL.checked = false;\n TASK_LIST.appendChild(create_task(task, false));\n }\n NEW_TASK.value = '';\n save();\n}", "function clearTasks(e) {\n\n while (taskList.firstChild) {\n taskList.removeChild(taskList.firstChild)\n }\n\n localStorage.clear()\n\n // Array.from(e.target.parentElement.children[2].children).forEach(function (item) {\n\n // item.remove()\n // })\n //// Another Sloution //////\n //taskList.textContent = ''\n\n\n\n // e.target.parentElement.children[2].innerHTML=''\n // console.log(e.target.parentElement.children[2])\n}", "clear() {\n let count = this.tree.mTaskArray.length;\n if (count > 0) {\n this.tree.mTaskArray = [];\n this.tree.mHash2Index = {};\n this.tree.rowCountChanged(0, -count);\n this.tree.view.selection.clearSelection();\n }\n }", "function clearTasksFromLocalStorage(){\n localStorage.clear();\n }", "function clear(){\n storageService.clear();\n model.createdPlans = storageService.items;\n }", "function clearFields() {\n name.value = \"\";\n title.value = \"\";\n hourlyRate.value = \"\";\n hours.value = \"\";\n salary.value = \"\";\n baseSalary.value = \"\";\n commissionRate.value = \"\";\n sales.value = \"\";\n commissionOption.checked = false;\n salaryOption.checked = false;\n hourlyOption.checked = false;\n hourlyEntry.style.display = \"none\";\n salaryEntry.style.display = \"none\";\n commissionEntry.style.display = \"none\";\n }", "clearForm() {\n // clear any previous highlighted row\n this.clearPrevHighlight();\n // clear the inputs\n $(\"#item_id\").val(0);\n $(\"#item_title\").val(\"\");\n $(\"#item_author_first_name\").val(\"\");\n $(\"#item_author_surname\").val(\"\");\n $(\"#item_year\").val(\"\");\n // disable buttons dependent on a table row having been clicked\n $(\"#btn_search\").prop(\"disabled\", true);\n $(\"#btn_add_item\").prop(\"disabled\", true);\n $(\"#btn_update_item\").prop(\"disabled\", true);\n $(\"#btn_delete_item\").prop(\"disabled\", true);\n // disable link to author page\n $(\"#link_current_author\").removeClass(\"text-primary\");\n $(\"#link_current_author\").addClass(\"text-muted\");\n // hide editions page\n $(\"#page_editions\").hide(\"slow\");\n }", "function clearTasks(){\r\n\r\n // taskList.innerHTML = ('');///here we set the innerHTML of tasklist as empty so all child elements are cleared\r\n ///however the second way which is 'faster' is using the while loop to remove each one (more about this on https://jsperf.com/innerhtml-vs-removechild/47) as follows:\r\n if(confirm('Are you sure?')){\r\n while (taskList.firstChild) {\r\n taskList.removeChild(taskList.firstChild);\r\n }\r\n } \r\n ///Clear All Tasks from Local Storage\r\n clearTasksFromLocalStorage();\r\n}", "function onSubmitClearForm() {\n document.getElementById(\"taskForm\").reset();\n}", "function clearTasksFromStorage(){\n localStorage.clear();\n}", "function clearTasks() {\n\t\t\tlongTasks = [];\n\n\t\t\tlongTasksTime = 0;\n\t\t}", "function clearComTasks() {\r\n //CLEAR TASKS FROM THE DOM\r\n while (completed.firstChild) {\r\n completed.removeChild(completed.firstChild);\r\n }\r\n //CLEAR TASKS FROM LOCAL STORAGE\r\n clearAllLS();\r\n}", "function clearTasksFromLocalStorage(){\r\n localStorage.clear();\r\n}", "function delData() {\n document.getElementById(\"task_list\").innerHTML = \"\";\n localStorage.clear();\n\n}", "function emptyTrash() {\n /* Clear tasks from 'Trash' column */\n document.getElementById(\"monday\").innerHTML = \"\";\n document.getElementById(\"tuesday\").innerHTML = \"\";\n document.getElementById(\"wednesday\").innerHTML = \"\";\n document.getElementById(\"thursday\").innerHTML = \"\";\n document.getElementById(\"friday\").innerHTML = \"\";\n document.getElementById(\"saturday\").innerHTML = \"\";\n}", "_clearForm() {\n // Clears input fields\n itemNameInput.value =\n itemDueDateInput.value =\n itemTimeDueInput.value =\n itemDescriptionInput.value =\n \"\";\n // Makes sure default pri always \"no priority\"\n itemPriorityInput.value = \"no_pri\";\n }", "function clearTasksFromLocalStorage() {\n localStorage.clear() //thats clear out everything in local storage\n}", "function clearTasksFromLocalStorage() {\r\n localStorage.clear();\r\n}", "function clearForm() {\n document.getElementById(\"timeEndOfTask\").value = \"\";\n document.getElementById(\"dateEndOfTask\").value = \"\";\n document.getElementById(\"enterNoteText\").value = \"\";\n}", "function clearOrderForm() {\n currentOrder = {};\n fillOrder({});\n fillOrderItemList({});\n $('#buttonDelete').hide();\n $('#buttonCreate').hide();\n $('#buttonSave').hide();\n}", "function clearTasksFromLocalStorage(){\r\n localStorage.clear();\r\n}", "function clearTasksFromLocalStorage(){\n\nlocalStorage.clear();\n}", "function clearTasksFromLocalStorage() {\r\n localStorage.clear();\r\n}", "function clearFormContent() {\n $(\"#formOrgList\").empty();\n Organizations.length = 0;\n // Reset the name field\n clearDetailContent();\n currentOrg = undefined;\n }", "function clearFormContent() {\n $(\"#formOrgList\").empty();\n Organizations.length = 0;\n // Reset the name field\n clearDetailContent();\n currentOrg = undefined;\n }", "function clearTasksFromLocalStorage() {\n\t// Brisanje svega\n\tlocalStorage.clear();\n}", "function clear() {\t\t\n\t\t\tresetData();\n refreshTotalCount();\n for(var i=0;i<5; i++) { addMutationInvolvesRow(); }\n for(var i=0;i<5; i++) { addExpressesComponentsRow(); }\n for(var i=0;i<5; i++) { addDriverComponentsRow(); }\n\t\t\tsetFocus();\n\t\t}", "function clearAll() {\n recipeArea.empty();\n recipeTitle.empty();\n }", "function clearTasksFromLocalStorage(){\n localStorage.clear();\n}", "function clearForm() {\n\t\tconst blankState = Object.fromEntries(\n\t\t\tObject.entries(inputs).map(([key, value]) => [key, \"\"])\n\t\t);\n\t\tsetInputs(blankState);\n\t}", "function clearTasksFromLocalStorage(){\n localStorage.clear();\n}", "function resetTasks() {\n\t\t\tfor (var i = 0; i < vm.tasks.length; i++) {\n\t\t\t\ttasks.removeTask(vm.tasks[i]);\t\n\t\t\t}\n\t\t}", "function addToTasks() {\n\n //get value of the task and the description...\n var task = document.getElementById('task').value;\n var description = document.getElementById('description').value;\n\n var li = document.createElement(\"li\");\n var inputValue = \" Task: \" + task + \"\\nDescription: \" + description;//\n // console.log(f);\n var t = document.createTextNode(inputValue);\n li.appendChild(t);\n if (inputValue === '') {\n alert(\"Please type in a task!\");\n } else {\n document.getElementById(\"mytasks\").appendChild(li);\n }\n \n document.getElementById(\"task\").value = \"\";\n document.getElementById(\"description\").value = \"\";\n\n //add task and description to the added tasks section\n \n \n //console.log(task,description);\n // var x = document.getElementById(\"taskinfo\").firstChild;\n // console.log(x);\n // x.remove();\n\n // var y = document.getElementById(\"doneButton\").firstChild;\n // console.log(y);\n // y.remove();\n\n}", "function clearNewEvent() {\n $(\"#new-event-name-input\").val(\"\");\n $(\"#new-event-date-input\").val(\"\");\n $(\"#new-event-time-input\").val(\"\");\n $(\"#address\").val(\"\");\n $(\"#new-event-description-input\").val(\"\");\n $(\"#item_needed1\").val(\"\");\n $(\"#item_needed2\").val(\"\");\n $(\"#item_needed3\").val(\"\");\n $(\"#item_needed4\").val(\"\");\n}", "function clear() {\n\t\t\tconsole.log(\"clear()\");\t\t\n\t\t\tresetData();\n refreshTotalCount();\n\t\t\tsetFocus();\n\t\t\taddAdbRow();\n\t\t\tconsole.log(\"done clear()\");\n\t\t}", "function clearTasksfromLocalStorage() {\n localStorage.clear();\n}", "function clearTasksFromLocalStorage(){\n localStorage.clear();\n}", "function clear_form_data() {\n var item_area=$('#item_area');\n console.log(\"Clear all data\");\n item_area.val(\"\");\n $('#change_course_dis_text').val(\"\");\n $('#course_name_text').val(\"\");\n $('#course_dis_text').val(\"\");\n\n }", "function deleteTask()\n {\n var child = this.parentNode.parentNode;\n var parent = child.parentNode;\n parent.removeChild(child);\n var id= parent.id;\n var value = child.innerText;\n if (id == \"taskList\")\n {\n obj.taskListArr.splice(obj.taskListArr.indexOf(value), 1);\n }\n else \n {\n obj.taskCompletedArr.splice(obj.taskCompletedArr.indexOf(value), 1);\n } \n dataStorageUpdt();\n }", "function clearToDoList() {\n\t\ttoDoList = [];\n\t\t$(\"ul#to-do li\").remove();\n\t\taddClear();\n\t}", "function clearTask(id) {\n \"use strict\";\n tasks.splice(id, 1);\n displayTasks.tasksReload();\n }", "function clearTasksFromLocalStorage() {\n localStorage.clear();\n}", "function clearTasksFromLocalStorage() {\n localStorage.clear();\n}", "function clearTasksFromLocalStorage() {\n localStorage.clear();\n}", "function clearTasksFromLocalStorage() {\n localStorage.clear();\n}", "function clearTasksFromLocalStorage() {\n localStorage.clear();\n}", "function handleClearTasks() {\n const newTasks = tasks.filter(task => !task.complete)\n setTasks(newTasks)\n }", "function addTaskLocalstorage(){\n \n \n if(validation() == false)\n return ; \n\n\n let taskObject = { task : document.getElementById(\"task\").value, status : \"active\" }\t;\n let dataList = JSON.parse(localStorage.getItem(\"allData\"));\n dataList.push(taskObject);\n\n localStorage.setItem(\"allData\" , JSON.stringify(dataList));\n\n addShowList(taskObject) ;\n decideToShowOrHide(taskObject) ;\n\n document.getElementById(\"task\").value = \"\" ; // Make the input field null again \n\n }", "function clearEdits(){\n\n}", "function clearFields() {\n employeeId.value = \"\";\n firstName.value = \"\";\n lastName.value = \"\";\n address.value = \"\";\n emailId.value = \"\";\n}", "_resetUpdateITOInfoForm()\r\n\t{\r\n\t\tvar self=this;\r\n\t\tvar form=document.getElementById(\"updateITOInfoForm\");\r\n\t\tform.reset();\r\n\t\tform.itoId.value=\"\";\r\n\t\t \r\n\t\tform.joinDate.value=\"\";\r\n\t\t$(form.joinDate).datepicker(\"destroy\");\r\n\t\t$(form.joinDate).datepicker({changeMonth: true,\r\n\t\t\t changeYear: true,\r\n\t\t\t dateFormat: 'yy-mm-dd',\r\n\t\t\t \"defaultDate\":new Date()});\r\n\t\t$(form.joinDate).datepicker(\"refresh\");\r\n\t\tform.leaveDate.value=\"2099-12-31\";\r\n\t\t\r\n\t\tvar blackListShiftListDiv=$(\"div.blackListShiftListDiv\")[0];\r\n\t\r\n\t\t$(blackListShiftListDiv).empty();\r\n\t\tself._addBlackListShiftPatternEntry(\"\",blackListShiftListDiv);\r\n\t\tform.submitButton.value=\"Add\";\r\n\t}", "function clear() {\n $('treeitem').remove();\n $(\"#rtc-triple-detail\").val('');\n $(\"#rtc-info\").val('');\n}", "function clearForm() {\n $scope.description = '';\n $scope.title = '';\n $scope.lat = '';\n $scope.lng = '';\n }", "function emptyTrash() {\n /* Clear tasks from 'Trash' column */\n document.getElementById(\"trash\").innerHTML = \"\";\n\n}", "clearNewTodo() {\n\t\tthis.$newTodo.value = '';\n\t}", "function clearForm() {\n\n $(\"#formOrgList\").empty();\n $(\"#txtName\").val(\"\");\n $(\"#txtDescription\").val(\"\");\n $(\"#activeFlag\").prop('checked', false);\n $(\"#orgRoleList\").empty();\n }", "function clear() {\t\t\n\t\t\tresetData();\n refreshTotalCount();\n\t\t\tsetFocus();\n\t\t}", "static clearDone () {\n withTasks(tasks, (task) => {\n if (task.isPreloaded && task.pDone > task.pTotal - 3) {\n this.remove(task.$id)\n }\n })\n }", "function clearFields() {\r\n\t\t\t\t\t\t$('#tf_Id').val(null);\r\n\t\t\t\t\t\t$('#tf_Descricao').val(null);\r\n\t\t\t\t\t\t$('#slc_Marca').val(0);\r\n\t\t\t\t\t\t$('#slc_TipoVeiculo').val(0);\r\n\t\t\t\t\t\t$('#slc_Status').val(0);\r\n\t\t\t\t\t\t$('#btn-operation').val(\"Criar Modelo\");\r\n\t\t\t\t\t}", "static clearFields() {\n document.querySelector('#date').value = '';\n document.querySelector('#title').value = '';\n document.querySelector('#post').value = '';\n }", "function clear_form_data() {\n $(\"#promotion_title\").val(\"\");\n $(\"#promotion_promotion_type\").val(\"\");\n $(\"#promotion_start_date\").val(\"\");\n $(\"#promotion_end_date\").val(\"\");\n $(\"#promotion_active\").val(\"\");\n }", "function clearData() {\n todos = [];\n localStorage.removeItem(LOCALSTORAGE_KEY);\n clearInputs();\n document.getElementById('todo-list').innerHTML = '';\n}", "function addTask() {\n event.preventDefault();\n currentTask = {\n name: document.getElementById('newTaskForm').elements.taskName.value,\n status: document.getElementById('newTaskForm').elements.taskStatus.value,\n date: document.getElementById('newTaskForm').elements.taskDate.value,\n };\n // adding this object to the overall array\n console.log(currentTask);\n myTasks.push(currentTask);\n \n alert(\"Task added: \" + currentTask.name + \".\");\n document.getElementById('newTaskForm').reset();\n \n // updating/replacing the localStorage version.\n updateTasks();\n\n deleteDisplayList(-1);\n createTaskList(myTasks);\n \n // collapse the Property form\n document.getElementById('btnAddTaskCollapser').nextElementSibling.style.display = \"none\";\n}", "clearAllData() {\r\n localStorage.clear();\r\n this._accountList = [];\r\n this._settings = [];\r\n this._lastAssignedID = 0;\r\n }", "function cleanBillInfo() {\n\t\tbillTextDiv.select(\".billText\").remove();\n\t\tbillInfoDiv.selectAll(\".BillInfo\").remove();\n\t\t\n\t\tassignment.style(\"display\", \"none\");\n\t\tassignment.select(\"#submit\")\n\t\t\t.on(\"click\", null);\n\t}", "function clearStorageAndForm()\n{\n\t// Remove saved values\n\tlocalStorage.removeItem('timeStorage');\n\t\n\t// Clear each row\n\tfor (var i=0; i < numOfTimeEntries; i++)\n\t{\n\t\t// Clear fields on the page to default values\n\t\t$('#startHour' + i).val('').removeClass('timeError');\n\t\t$('#startMin' + i).val('').removeClass('timeError');\n\t\t$('#endHour' + i).val('').removeClass('timeError');\n\t\t$('#endMin' + i).val('').removeClass('timeError');\n\t\t$('#warningIcon' + i).hide();\n\t\t$('#task' + i).val('');\n\t\t$('#subTotal' + i).prop('checked', false);\n\t\t$('#totalTimeRow' + i).html(0);\t\t\n\t\t$('#totalTimeRowHoursMins' + i).html('');\n\t\t\n\t}\n\t\n\t// Clear date fields and overall totals\n\t$('#displayDate').val('');\n\t$('#backendDate').val('');\n\t$('#restoreFile').val('');\n\t$('#overallSubtotalTime').text(0);\n\t$('#overallSubtotalTimeHoursMins').text('');\n\t$('#overallTotalTime').html(0);\n\t$('#overallTotalTimeHoursMins').html('');\n\t\n\t// Clear save data from iframe\n\tvar ifrm = document.getElementById('backupData');\n\tifrm.src = '';\n}", "function clearTaskTable() {\n $('#taskDisplay').find('#taskTable').find('tr:not(.head)').remove();\n}", "function ClearFields() { }", "function clearList() {\n\t\ttodoList = [];\n\t\tlocalStorage.clear();\n\t\tlist.innerHTML = \"\";\n\t\tid = 1;\n\t}", "clearFields(){\n this.description.value = \"\"\n this.amount.value = \"\"\n this.date.value = \"\"\n }" ]
[ "0.73305076", "0.7067622", "0.704136", "0.7035703", "0.6992786", "0.69507784", "0.6939786", "0.69102806", "0.6820282", "0.67786145", "0.677821", "0.6775592", "0.676358", "0.6669147", "0.66587514", "0.66172826", "0.65853125", "0.65442747", "0.6533585", "0.6514466", "0.6506862", "0.6492108", "0.64905316", "0.6455612", "0.6448722", "0.64325595", "0.64068186", "0.63938403", "0.6357495", "0.63489676", "0.634822", "0.6337916", "0.6332643", "0.63277566", "0.6322035", "0.6304074", "0.6300844", "0.6296396", "0.62788194", "0.6278158", "0.62743074", "0.62678474", "0.62584573", "0.6256792", "0.6245308", "0.62378764", "0.6233731", "0.6229677", "0.62221766", "0.621928", "0.62106156", "0.62101203", "0.62009305", "0.6195322", "0.61920106", "0.61920106", "0.6191903", "0.6183956", "0.61836076", "0.6177572", "0.617283", "0.61671114", "0.61657274", "0.6159344", "0.6156367", "0.61532307", "0.6152064", "0.6141182", "0.6140744", "0.6134158", "0.6134001", "0.61304486", "0.61235535", "0.61235535", "0.61235535", "0.61235535", "0.61235535", "0.6123115", "0.61185455", "0.6092397", "0.609181", "0.60884666", "0.6083381", "0.6076533", "0.6075577", "0.60691917", "0.60672075", "0.6058436", "0.60530216", "0.60499", "0.6048437", "0.6046077", "0.60410666", "0.6040078", "0.6030724", "0.60306025", "0.60292226", "0.6026596", "0.6023277", "0.60085654", "0.60066545" ]
0.0
-1
creates the JSON 'task' which is used in the function addTask() for saving the data in the local storage
function gererateTaskObject() { let title = document.getElementById("title").value; let urgency = document.getElementById("urgency").value; let importance = document.getElementById("importance").value; let date = document.getElementById("date").value; let discription = document.getElementById("description").value; let task = { 'title': title, 'urgency': urgency, 'importance': importance, 'date': date, 'description': discription, 'created': new Date().getTime() //unix timestamp at the time of creating the task }; return task; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function saveTask(e) {\n let title = document.getElementById('title').value; /*el .value es el valor que esta dentro de la caja del input de ese id, osea lo que vos le escribas como titulo*/ \n let description = document.getElementById('description').value;/*y lo mismo pero para description osea la caja de abajo el otro input*/\n console.log(description)/*aca podes ver en la consola de de chrome los valores de las tarjetas con el \"console.log\"*/\n\n\n /*esto es en vez de escribir title: title: o description: description: en versiones anteriores de js ahora se escribe asi*/\n let task = {\n title,\n description\n };\n\n\n /*aca en el navegador lee la funcionalidad de guardar los datos localmente con localStorage que permite almacenar los datos en la memoria aunque se \n cierre el navegador y se abra va a estar ahi*/\n\n /*para obtener los elementos llamamos con getItem con el nombre del item que queremos obtener por ej \"task\" y para no obtener en formato String llamamos con el metodo\n JSON.parse y ahi se convierte en objeto js y no string*/\n\n /*si ya tenemos datos almacenados desde localstorage y es igual a nulo o null entonces vamos a empezar a crear tareas y si \n ya hay valores entonces vamos actualizar los datos */\n\n if(localStorage.getItem('tasks') === null) {\n let tasks = [];\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n } else {\n let tasks = JSON.parse(localStorage.getItem('tasks'));\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks)); /*aca volvemos a actualizar y almacenar nuevamente las tareas o los datos*/\n }\n\n\n /*aca se vuelve a ejecutar el metodo getTaskseste entonces cada vez que se guarde una tarea se vuelve a ejectura la tarea y se muestra lo que \n escribis en el formulario y se muestra al lado en tarjetas sin necesidad de refrescar la pagina */\n getTasks(); \n document.getElementById('formTask').reset(); /*aca se termina de procesar los datos y se limpia el formulario para agregar nuevos datos */\n e.preventDefault();\n}", "function createTask(e) {\n /* the data that is stored in allTasks variable is updated here with the localstorage */\n allTasks = JSON.parse(localStorage.getItem('data'));\n if (allTasks === null) {\n allTasks = [];\n }\n const newTask = {\n description: '',\n completed: false,\n index: allTasks.length + 1,\n };\n newTask.description = e;\n /* This procedure here verify if input text value contains nothing. */\n if (newTask.description === '') {\n document.getElementById('task').placeholder = 'this field cannot be blank';\n } else {\n allTasks.push(newTask);\n updateTasks(allTasks);\n }\n}", "function saveTask(e) {\n\n let action = document.getElementById('action').value;\n let description = document.getElementById('description').value;\n\n\n\n let task = {\n action, description\n };\n\n if (localStorage.getItem('tasks') === null) {\n\n let tasks = [];\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n }\n\n else {\n\n let tasks = JSON.parse(localStorage.getItem('tasks'));\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n\n\n }\n\n getTask();\n document.getElementById('formtask').reset();\n e.preventDefault();\n\n}", "function saveTask(e){\n // Get task value from form\n var taskName = document.getElementById(\"taskName\").value;\n\n // Validation\n if(validateForm(taskName) == false){\n return false;\n }\n // Create JS task object\n var task = {\n name: taskName\n }\n // Store in local storage\n // If ARRAY with tasks in LOCALSTORAGE == NULL\n if(localStorage.getItem(\"storedTasks\") === null){\n // Create new task array\n var storedTasks = [];\n // Add taskl object to array\n storedTasks.push(task);\n // Store new array in localStorage\n localStorage.setItem(\"storedTasks\", JSON.stringify(storedTasks));\n } else {\n var storedTasks = JSON.parse(localStorage.getItem(\"storedTasks\"));\n storedTasks.push(task);\n // Store new array in localStorage\n localStorage.setItem(\"storedTasks\", JSON.stringify(storedTasks));\n }\n\n // Clear Form\n document.getElementById(\"taskForm\").reset();\n // Get tasks\n getTasks();\n // Prevent form submission\n e.preventDefault();\n}", "function storeTaskInLocalStorage(task){\r\n let tasks;\r\n if(localStorage.getItem('tasks')===null){ // local storage a check korbe task na theake faka array dibe\r\n tasks=[];\r\n }\r\n else{\r\n tasks=JSON.parse(localStorage.getItem('tasks')); // jodi task pay seta k json obejct a dibe\r\n }\r\n tasks.push(task); // new task add hobe\r\n\r\n localStorage.setItem('tasks', JSON.stringify(tasks)); // new task a ke local storage a add korbe\r\n}", "function storeTask(task) {\n // Initially checking wether there is some data or not\n let taskContain;\n if (localStorage.length === 0) {\n // There is no data\n taskContain = [];\n } else {\n // Fetch the existing data into the task array through JSON.parse()\n taskContain = JSON.parse(localStorage.getItem(\"task\"));\n }\n\n // Add the inputed task into the taskContain array\n taskContain.push(task);\n // Now store all the tasks into the local storage through JSON.stringify()\n localStorage.setItem(\"task\", JSON.stringify(taskContain));\n // alert(\"Task saved\");\n}", "function addTask() {\n let t = gererateTaskObject();\n allTasks.push(t);\n document.getElementById('loading').classList.remove('d-none');\n tasksString = JSON.stringify(allTasks);\n saveJSONToServer(allTasks)\n .then(function (result) { //then(function (variable vom server))\n console.log('Laden erfolgreich!', result);\n document.getElementById('loading').classList.add('d-none');\n load(); \n })\n .catch(function (error) { // Fehler\n console.error('Fehler beim laden!', error);\n document.getElementById('loading').classList.add('d-none');\n document.getElementById('error').classList.remove('d-none');\n });\n \n //localStorage.setItem('data', tasksString); disabled - the JSON is saved on the Server\n\n emptyFields();\n \n /**\n * The following 5 lines would be a popup which shows the name and the category of the added Tast.\n * It has been replaced by the loading screen\n */\n //let html = \"<div id='popup' class='transparentgray'><div class='popup'><h5>A new Task with the Title \" + t.title + \" has been added!</h5>You have set \" + t.importance + \" and \" + t.urgency + \"!</div></div>\";\n //document.getElementById(\"mainWindow\").insertAdjacentHTML('beforeEnd', html);\n //setTimeout(function () {\n // document.getElementById('popup').remove();\n //}, 5000);\n}", "function storeTaskInLocalStorage(task){\n let tasks;\n if(localStorage.getItem(\"tasks\") === null){\n tasks = []\n }\n else{\n tasks = JSON.parse(localStorage.getItem(\"tasks\"))\n }\n tasks.push(task);\n localStorage.setItem('tasks',JSON.stringify(tasks));\n\n\n}", "function saveTasks(task) {\r\n let tasks;\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n tasks.push(task);\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n}", "function storeTaskLocalStorage(task){\n let tasks;\n if(localStorage.getItem(\"tasks\")===null){\n tasks=[];\n }else{\n tasks=JSON.parse(localStorage.getItem(\"tasks\"))\n }\n tasks.push(task);\n localStorage.setItem(\"tasks\",JSON.stringify(tasks));\n }", "function storeTaskInLocalStorage(task) {\r\n let tasks;//All Task Will Be Include//\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];//Checking local Storage If Tasks Exist Or Not//\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n\r\n }\r\n tasks.push(task);//Adding Task Will Be Pushed//\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n}", "function saveTasks() {\n //local storage is global variable\n localStorage.setItem(tasksKey, angular.toJson($scope.tasks));\n>>>>>>> 8618b52f1f130b0f8450375e3847289e36947cea\n }", "static saveTasks() {\n localStorage.setItem('tasks', JSON.stringify(taskArr));\n }", "function storeTask(task){\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n tasks.push(task);\n\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function storeTaskInLocalStorage(task){\n //Initialize the Tasks Array\n let tasks;\n //getting the Tasks Array from the Local Storage and Checking if there is no Tasks yet, Define it as Empty Array\n if(localStorage.getItem('tasks') == null){\n tasks = [];\n //Else Take it ready and assign it to Tasks Array\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n //Push th Task to it\n tasks.push(task)\n //Save it back to the Local Storage\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function storeTasks(task) {\n let givenTask;\n let getTasks = localStorage.getItem('givenTask');\n if(getTasks === null) {\n givenTask = [];\n } else {\n givenTask = JSON.parse(getTasks);\n }\n\n givenTask.push(task);\n localStorage.setItem('givenTask', JSON.stringify(givenTask));\n}", "function saveTasks(){\n localStorage.setItem(tasksKey, angular.toJson($scope.tasks))//will encode into JSON string format to save or post on the internet\n }", "function storeTaskInLocalStorage(task){\r\n\r\n let tasks;\r\n///we want to now pull whatever there is in the local storage that can be - either added to tasks array or else tasks can be set as an empty array.\r\n//initialise a tasks varibale to create the array\r\n\r\nif(localStorage.getItem('tasks') === null){\r\ntasks = [];\r\n}else{\r\n tasks = JSON.parse(localStorage.getItem('tasks'))///this will be a string and hence we will have to parse this an object that can be used, hence we will add the \"JSON parse\" wrapper.\r\n}\r\n///we would now want to push the task added through the input into this task array\r\n\r\ntasks.push(task);\r\n\r\n//this wont add anything to the local storage so we need reset(set) local storage with this array\r\nlocalStorage.setItem('tasks', JSON.stringify(tasks));///but since it has to store strings in local storage we will have to wrap the passed value of task as string in a \"JSON stringify\" wrapper\r\n}", "function storeTaskInLocalStorage(task) {\n let tasks;\n if (localStorage.getItem('tasks') === null) { //localStorage.getItem(keyname)\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n tasks.push(task);\n\n localStorage.setItem('tasks', JSON.stringify(tasks)); //localStorage.setItem(keyname, value)\n}", "function saveTask(e){\n let title = document.getElementById('title').value;//de esta menera logramos ingresar a que es lo que se escribe en ADD TASK\n //esto necesita ser una constante para ser reutilizable en el resto de nuestra app\n\n let description = document.getElementById('description').value; //same\n\n const task ={//creamos el objeto para ordenar nuestra data \n title, //title:title\n description // description:description\n };\n\n if(localStorage.getItem('tasks')===null){//si desde el localstorage ya existe un valor llamado tareas y es igual a nulo vamos a crear tareas\n let tasks=[];\n tasks.push(task)//para a llenarlo con el metodo push\n \n //almacenarlo en el localstorage\n localStorage.setItem('tasks',JSON.stringify(tasks));\n \n }else{//si ya existe valores vamos a empezar a actualizarlos\n let tasks = JSON.parse(localStorage.getItem('tasks'));//aca obtenemos las tareas que tenemos almacenadas en el localstorage y almacenarla en una variable\n tasks.push(task);//las actualizamos con el metodo push, \n localStorage.setItem('tasks',JSON.stringify(tasks));//y al mismo tiempo lo almacenamos \n //para convertir un objeto a un string podemos utilizar JSON.stringify, este metodo nos permite convertir un objeto en un string\n }\n\n\n getTasks();\n\n document.getElementById('formTasks').requestFullscreen();//para que cuando guardemos una task se resetee el formulario de tasks\n\n e.preventDefault();//evita que se refresque la pagina cuando le das a confirm\n\n //todos nuestros datos van a quedar guardados en localStorage\n}", "function createTask() {\n let title = document.getElementById(\"title\");\n let desc = document.getElementById(\"desc\");\n let date = document.getElementById(\"date\");\n let time = document.getElementById(\"time\");\n let label = document.getElementById(\"label\");\n let clr = document.querySelector(\"input[name=\\\"color\\\"]:checked\");\n let selectedDate = date.options[date.selectedIndex].text;\n let selectedTime = time.options[time.selectedIndex].text;\n let selectedLabel = label.options[label.selectedIndex].text;\n\n if (selectedDate == 'Pick a date') {\n selectedDate = formatDate(getDate);\n }\n if (selectedTime == 'Pick a time') {\n selectedTime = formatTime(getTime);\n }\n\n let task = {\n title: `${title.value}`,\n desc: `${desc.value}`,\n time: `${selectedTime}`,\n date: `${selectedDate}`,\n label: `${selectedLabel}`,\n color: `${clr.value}`\n }\n\n if (localStorage.getItem('itemLabels') === null) {\n itemLabels = [];\n } else {\n itemLabels = JSON.parse(localStorage.getItem('itemLabels'));\n }\n label = document.getElementById(\"label\");\n itemLabels.forEach(el => {\n let opt = document.createElement('option');\n opt.appendChild(document.createTextNode(el));\n label.appendChild(opt);\n })\n\n tasks.push(task)\n localStorage.setItem('tasks', JSON.stringify(tasks))\n render(lists, tasks);\n}", "function saveTask(e){\n\n let title = document.getElementById('title').value;//guardamos lo que se encuentra dentro del campo en una variable\n \n let description = document.getElementById('description').value;\n\n const task = {//creamos la tarea con los dos valores anteriores\n title,//title:title\n description//description: description\n };\n //Nos perfimite guardar los datos y en el navegador y tiene algunos metodos set item nos permite poder almacenar un dato en base a dos parametra uno el nombre docmo vamos allamar los datos y el valor de los datos \n // localStorage.setItem('tasks', JSON.stringify(task));\n\n // console.log(JSON.parse(localStorage.getItem('tasks')));// obtener los datos y lo comvierte en un objeto \n\n if (localStorage.getItem('tasks') === null){ //si desde el localstorage ya exite un valor llamdo tareas y es nulo pues vamos a empesar a crear tareas\n let tasks = [];\n tasks.push(task); // se llenara atravez de lmetodo push con una tarea nueva\n localStorage.setItem('tasks', JSON.stringify(tasks)); // alamcesnar el valor en el coal storage en formato de string\n\n\n }else{// si ya existen valores vamos a actualizarlos\n let tasks = JSON.parse(localStorage.getItem('tasks'));// obtener los valores que tengo en el local storage y almacenarlos en una variable\n tasks.push(task);// con esto actualizo las tareas antiguas\n localStorage.setItem('tasks', JSON.stringify(tasks)); //y las vuelvo a almasenar\n }\n\n getTasks();\n document.getElementById('formTask').reset();\n e.preventDefault();\n}", "function localStorageTask(task) {\n let tasks;\n if (localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'))\n }\n tasks.push(task)\n localStorage.setItem('tasks', JSON.stringify(tasks))\n}", "save(){\n var tasks = []; \n this.list.forEach(function(item){\n var task = {}\n task.text = item.text;\n task.priority = item.priority;\n task.duedate = item.duedate;\n task.tag = item.tag;\n task.done = item.done;\n tasks.push(task);\n });\n var stringArray = JSON.stringify(tasks);\n localStorage.setItem(this.key, stringArray);\n }", "function Task() {\n // const getTask = (name, priority, date, projectid) => {\n // const task = {};\n // const storage = StorageTasks();\n // const dataSize = storage.getDataLength(TASK_KEY);\n // task.name = name;\n // task.id = dataSize;\n // task.priority = priority;\n // task.duedate = date;\n // task.projectid = projectid;\n // return task;\n // };\n // const AppendTasksToContainer = (tasksArr, tasksDiv) => {\n // for (let i = 0; i < tasksArr.length; i++) {\n // const item = document.createElement(\"li\");\n // item.setAttribute(\"data-id\", tasksArr[i].id);\n // item.setAttribute(\"id\", \"task-item\");\n // item.innerText = `${tasksArr[i].name} ${tasksArr[i].priority} ${tasksArr[i].duedate}`;\n // const delBtn = document.createElement(\"button\");\n // delBtn.innerText = \"del\";\n // delBtn.setAttribute(\"id\", \"task-delete\");\n // delBtn.setAttribute(\"data-id\", tasksArr[i].id);\n // item.appendChild(delBtn);\n // tasksDiv.appendChild(item);\n // }\n // return tasksDiv;\n // };\n // const makeTaskList = (tasksArr) => {\n // const tasksDiv = document.createElement(\"ul\");\n // tasksDiv.setAttribute(\"id\", \"tasks-list\");\n // return AppendTasksToContainer(tasksArr, tasksDiv);\n // };\n // const getTasksContainer = () => document.querySelector(\"#tasks-list\");\n // const removeTasks = () => {\n // const tasksContainer = getTasksContainer();\n // while (tasksContainer.firstChild) {\n // tasksContainer.removeChild(tasksContainer.firstChild);\n // }\n // };\n // const updateTaskListDisplay = (tasksArr) => {\n // removeTasks();\n // const TasksContainer = getTasksContainer();\n // return AppendTasksToContainer(tasksArr, TasksContainer);\n // };\n // return { getTask, makeTaskList, updateTaskListDisplay };\n}", "function taskToJson(task) {\n\t if (task.find('id')[0] == undefined) {\n\t\t return '{}';\n\t }\n\t return '{'+\n\t '\"id\":\"'+task.find('id')[0].innerHTML+'\", '+\n\t '\"title\":'+JSON.stringify(task.find('title')[0].innerHTML)+', '+\n\t '\"desc\":'+JSON.stringify(task.find('desc')[0].innerHTML)+', '+\n\t '\"type\":\"'+task.find('type')[0].className+'\", '+\n\t '\"req\":'+JSON.stringify(task.find('req')[0].innerHTML)+', '+\n\t '\"assign\":\"'+task.find('img').attr('avatar')+'\"'+\n\t '}';\n }", "function getTask() {\r\n\r\n let taskDate = document.getElementById(\"date\").value;\r\n if (!taskDate) {\r\n let message = \"Please enter the date!\";\r\n addAlert(message);\r\n return;\r\n }\r\n let taskTime = document.getElementById(\"time\").value;\r\n if (!taskTime) {\r\n let message = \"Please enter the time!\";\r\n addAlert(message);\r\n return;\r\n }\r\n let taskDetails = document.getElementById(\"details\").value;\r\n if (!taskDetails) {\r\n let message = \"Please enter the task details!\";\r\n addAlert(message);\r\n return;\r\n }\r\n\r\n let listItem = new task(taskDate, taskTime, taskDetails);\r\n taskList.push(listItem);\r\n\r\n for (let i = 0; i < taskList.length; i++) {\r\n taskList[i].id = i;\r\n }\r\n\r\n localStorage.setItem(\"taskList\", JSON.stringify(taskList));\r\n displayTask(listItem);\r\n document.getElementById(\"date\").value = \"\";\r\n document.getElementById(\"time\").value = \"\";\r\n document.getElementById(\"details\").value = \"\";\r\n}", "function addTaskLocalStorage(task) {\n var tasks;\n tasks = getTaskLocalStorage();\n // Añadir el nuevo tweet que es un areglo\n tasks.push(task);\n // Convertir de string a arreglo para local storage\n localStorage.setItem('task', JSON.stringify(tasks));\n}", "function insertNewTask() {\n let newTask = document.getElementById(\"input_new_task\").value;\n let obj = {};\n obj['id'] = taskCount;\n obj['task'] = newTask;\n obj['complete'] = false;\n tasksList.push(obj);\n taskCount += 1;\n const finalData = generateTasksList();\n document.getElementById(\"divTasksList\").innerHTML = finalData;\n document.getElementById(\"input_new_task\").value = '';\n}", "function storeTaskInLocalStorage(task){\r\n let tasks;\r\n\r\n // If we do not have any tasks in localStorage we set up empty array\r\n if(localStorage.getItem('tasks') ===null){\r\n tasks = [];\r\n } else {\r\n // If we have some taska we will load them in the variable first\r\n tasks = JSON.parse(localStorage.getItem('tasks'))\r\n }\r\n\r\n // Add new task to the array\r\n tasks.push(task);\r\n\r\n // Store newly created array of tasks in localStorage\r\n localStorage.setItem('tasks', JSON.stringify(tasks))\r\n}", "function addNewTask() {\r\n let textInput = document.querySelector(\"#taskInput\");\r\n let allTasksFromMemory = JSON.parse(localStorage.getItem(\"tasks\"));\r\n\r\n if (textInput.value == \"\") {\r\n return;\r\n }\r\n\r\n // dio za kreiranje novog taska:\r\n let newLi = document.createElement(\"li\");\r\n let textNode = document.createTextNode(\"\");\r\n newLi.appendChild(textNode);\r\n newLi.classList.add(\"task\", \"unfinished\");\r\n\r\n //dole je novo\r\n newLi.innerHTML =\r\n '<img class=\"emptyCircle\" src=\"SVG/empty-circle.svg\" onclick=\"completeTask(this)\"/><img class=\"tickedCircle\" src=\"SVG/ticked-circle.svg\"/><div class=\"textPartofTask\"><p class=\"taskText\">' +\r\n textInput.value +\r\n '</p><p class=\"taskDate\"></p></div><div class=\"right-task-buttons\"><img src=\"SVG/edit-circle.svg\" class=\"right-hidden-button editCircle\" onclick=\"footerVisibilitySwitch(\\'edit\\',this)\"/><img src=\"SVG/thrash-circle.svg\" class=\"right-hidden-button thrashCircle\" onclick=\"deleteTask(this)\"/><img src=\"SVG/date-circle.svg\" class=\"right-hidden-button dateCircle\" onclick=\"showCalendar(this)\"/><img src=\"SVG/options-circle.svg\" class=\"optionsCircle\" onclick=\"expandRightButton(this)\"/></div>';\r\n\r\n newLi.setAttribute(\"id\", taskCounter);\r\n document.querySelector(\".allTasksUl\").appendChild(newLi);\r\n\r\n let attrib;\r\n if (allTasksFromMemory) {\r\n attrib = {\r\n id: taskCounter,\r\n taskText: textInput.value,\r\n state: \"unfinished\",\r\n };\r\n } else {\r\n attrib = [\r\n {\r\n id: taskCounter,\r\n taskText: textInput.value,\r\n state: \"unfinished\",\r\n },\r\n ];\r\n }\r\n\r\n if (allTasksFromMemory) {\r\n allTasksFromMemory.push(attrib);\r\n localStorage.setItem(\"tasks\", JSON.stringify(allTasksFromMemory));\r\n } else {\r\n localStorage.setItem(\"tasks\", JSON.stringify(attrib));\r\n }\r\n\r\n //skrivanje footera i clear-anje input forme\r\n taskCounter++;\r\n localStorage.setItem(\"taskCounter\", taskCounter);\r\n textInput.value = \"\";\r\n footerVisibilitySwitch(\"default\");\r\n}", "function storeLocalStorage(task){\r\n let tasks;\r\n if(localStorage.getItem('tasks') ===null){\r\n tasks = [];\r\n }else{\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n tasks.push(task);\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n}", "function addTasktoLocalStorage(task){\n // init tasks\n let tasks;\n // Check if LS has tasks\n if (localStorage.getItem(\"tasks\") === null){\n // Init tasks as an array\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n tasks.push(task)\n\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n}", "function storeTaskInLocalStorage(task){\n let tasks\n\n // check if theres already something there\n if(localStorage.getItem('tasks') === null) {\n tasks = [] //if not => then set tasks to empty array\n } else {\n // if there's => then get it and convert it to json\n // because localStorage stores only string\n tasks = JSON.parse(localStorage.getItem('tasks'))\n }\n\n // now we got the data from localStorage => it's time to push it\n tasks.push(task)\n\n // now we have to store the data back to localStorage\n // remoember the data should be stored as string\n localStorage.setItem('tasks', JSON.stringify(tasks))\n}", "function storeTaskInLocalStorage(task){\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = []\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'))\n }\n tasks.push(task);\n localStorage.setItem('tasks',JSON.stringify(tasks));\n}", "function storeTasktoLocalStorage(task) {\n let tasks;\n if (localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function getTask(){\n // Clear UL of all task before adding new one...\n document.getElementById(\"taskList\").innerHTML = \"\";\n // Input value\n let getTask = document.getElementById(\"task\").value;\n \n if(getTask === null || getTask === \"\" || getTask === undefined) return false;\n // Timeduration for new task\n let timeDuration = document.getElementsByName(\"timeDuration\");\n \n let pickedTime;\n for(let i = 0; i < timeDuration.length; i++){\n if(timeDuration[i].checked){\n pickedTime = timeDuration[i].value;\n }\n }\n // Creating timestamp\n let getTimeStamp = (new Date().getTime() + Number(pickedTime*1000));\n // Object for task\n let objTask = {\n task: getTask,\n time: getTimeStamp,\n classState: \"list-group-item mb-1\"\n };\n \n allObjTask.push(objTask);\n \n // Set LS\n localStorage.setItem('items', JSON.stringify(allObjTask));\n // Restarting Input field\n document.getElementById(\"task\").value = \"\";\n // Printing new task in UI\n printUI();\n}", "function saveComTasks(task) {\r\n let ComTasks;\r\n if (localStorage.getItem('ComTasks') === null) {\r\n ComTasks = [];\r\n } else {\r\n ComTasks = JSON.parse(localStorage.getItem('ComTasks'));\r\n }\r\n ComTasks.push(task);\r\n localStorage.setItem('ComTasks', JSON.stringify(ComTasks));\r\n}", "function saveData() {\n let saveTask = JSON.stringify(listTask)\n window.localStorage.setItem(\"task_management\", saveTask)\n\n updateHtml()\n}", "function storeTaskInLocalStorage(task) {\n let allTask;\n if (localStorage.getItem('allTask') === null) {\n allTask = [];\n } else {\n allTask = JSON.parse(localStorage.getItem('allTask'))\n }\n allTask.push(task);\n\n localStorage.setItem('allTask', JSON.stringify(allTask))\n}", "function addTaskToLocalStorage(task){\r\n\tlet tasks;\r\n\r\n\tif(localStorage.getItem('tasks') === null){\r\n\t\ttasks = [];\r\n\t} else {\r\n\t\ttasks = JSON.parse(localStorage.getItem('tasks'));\r\n\t}\r\n\r\n\ttasks.push(task);\r\n\r\n\tlocalStorage.setItem('tasks', JSON.stringify(tasks));\r\n\r\n}", "function storeTaskInLocalStorage(task) {\r\n let tasks;\r\n\r\n // Check if there are any tasks present in localStorage\r\n if(localStorage.getItem('tasks') === null) {\r\n tasks = [];\r\n } else {\r\n // set the tasks to whatever is in localStorage \r\n //(localStorage only stores strings, therefore we need to do parsing)\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n\r\n }\r\n\r\n // Push the task to tasks[]\r\n tasks.push(task);\r\n\r\n // Set back to localStorage\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n}", "function storeTaskInLocalStorage(task){\n let tasks;\n if (localStorage.getItem('tasks') === null){ // check if anything in storage already\n tasks = []; // if nothing, set to empty array\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks')); \n //local storage can only store strings, so we must parse as JSON when it comes out\n }\n\n tasks.push(task); // add to the array\n localStorage.setItem('tasks', JSON.stringify(tasks)); // save to local storage\n}", "function saveTask(task){\n let setTask = task;\n //console.log('setTask is ' + setTask);\n\n var storedTaskString = localStorage.getItem(\"all_tasks\");\n var toDoList = JSON.parse(storedTaskString);\n\n // If there are no stored tasks in the toDoList variable, create an array to store them\n if(toDoList == null){\n toDoList = [];\n }\n\n toDoList.push(setTask);\n \n\n if(toDoList[0] == null){\n toDoList.shift();\n }\n\n for(let i = 0; i < toDoList.length; i++){\n if(toDoList[i] === null){\n toDoList.splice([i], 1);\n }\n }\n\n var toDoListString = JSON.stringify(toDoList); // Convert everything in allNotes array to string so localStorage can store it\n localStorage.setItem(\"all_tasks\", toDoListString); // Store allNotesString using the key 'all_notes'\n\n //let toDoListCount = toDoList.length;\n //return taskCount;\n return toDoList;\n}", "function storeTaskInLocalStorage(task) {\n let tasks;\n if(localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function storeTaskLS(task){\n let tasks;\n if(localStorage.getItem('tasks')===null){\n tasks=[];\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n tasks.push(task);\n localStorage.setItem('tasks',JSON.stringify(tasks));\n}", "function storeTaslToLocalStorage(task){\n let tasks ;\n if (localStorage.getItem('tasks') === null)\n {\n tasks = [] ;\n }\n else{\n tasks = JSON.parse(localStorage.getItem('tasks')) ;\n }\n tasks.push(task)\n localStorage.setItem('tasks' , JSON.stringify(tasks));\n}", "function storeInLS(task) {\n //get Data means tasks\n let tasks = getTasks();\n //set in LS\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function addNewTask(task) {\n let uniqueID = timeStamp();\n let data = {\n text: task,\n isDone: false,\n idNum: uniqueID,\n };\n toDoList.push(data);\n addTask(data);\n commitToLocalStorage(toDoList);\n}", "function storeTaskInLocalStorage(task) {\n let tasks;\n if (localStorage.getItem(\"tasks\") === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n tasks.push(task);\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n}", "function storeTaskInLocalStorage(task) {\n let tasks;\n if (localStorage.getItem(\"tasks\") === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n tasks.push(task);\n\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n}", "function datatoLocalstorage() {\r\n localStorage.setItem('tasksData', JSON.stringify(tasksData));\r\n}", "function storeTaskInLocalStorage(task) {\n let tasks;\n if (localStorage.getItem(\"tasks\") === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n\n tasks.push(task);\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n}", "function store() {\n let myTask = localStorage.getItem(\"tasks\");\n myTask = JSON.parse(myTask);\n myTask.push(\"This is a new task\");\n myTask = JSON.stringify(myTask);\n localStorage.setItem(\"tasks\", myTask);\n}", "function createNewTask(name) {\n return {\n id: Date.now().toString(),\n name: name,\n complete: false,\n };\n}", "function saveInLocalStorage(){\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function addTask() {\n Task.addTask(info.newTask);\n info.newTask = \"\";\n }", "function addTask() {\r\n\r\n var taskId = \"task_\" + taskCount++;\r\n\r\n var task = createTask(taskId, \"\", \"\");\r\n taskList[taskId] = task;\r\n\r\n var domElement = createNewTaskDOMElement(task);\r\n taskListDOMElements[taskId] = domElement;\r\n\r\n showTaskDetail(task);\r\n}", "function createNewTask(projectTitle) {\n //Cache DOM for displayArea\n let taskTitle = document.querySelector(\"#taskTitle\").value;\n let taskDate = document.querySelector(\"#taskDate\").value.split(\"-\"); //Returns date in yyyy/mm/dd string format; splitting into array and then making date instance\n if (taskDate == \"\") {\n taskDate = new Date();\n }\n else {\n taskDate = new Date(taskDate[0], taskDate[1] - 1, taskDate[2]);\n }\n let taskPriority = document.querySelector(\"#taskPriority\").value;\n document.querySelector(\"#taskTitle\").value = \"\";\n document.querySelector(\"#taskDate\").value = \"\";\n document.querySelector(\"#taskPriority\").value = \"\";\n let newTask = CreateTask(taskTitle, taskDate, taskPriority);\n //Find the project in our project holders to add the task\n if (projectTitle == \"All\" || projectTitle == \"Today\" || projectTitle == \"This Week\" || projectTitle == \"Misc\") {\n dynamicProjectHolder.addMiscTask(newTask);\n localStorage.setItem(\"miscTasks\", JSON.stringify(dynamicProjectHolder.miscTasks));\n }\n else {\n let numOfProj = projectHolder.getArrayLength();\n for (let i = 0; i < numOfProj; i++) {\n if (projectTitle == projectHolder.projectArray[i].title) {\n projectHolder.projectArray[i].addTask(newTask);\n localStorage.setItem(\"projectArray\", JSON.stringify(projectHolder.projectArray));\n }\n }\n }\n recreateDynamicArrays();\n let currentArray = getTaskArray(projectTitle, dynamicProjectHolder, projectHolder);\n createDisplay(projectTitle, currentArray);\n reattachTaskListener();\n}", "function addTasks() {\n const text =\n document.getElementById('enter-task').value;\n if (text) {\n tasks.push(new Task(text)); // somehow connect the tasks to the list they are in (optional-ish)\n showTasks();\n }\n // window.localStorage.setItem(lists, JSON.stringify(text));\n }", "function addTask(task) {\n task.elapsed = task.elapsed.hours + \":\" + task.elapsed.minutes + \":\" + task.elapsed.seconds;\n task.color = task.color.replace('#', '');\n task.description = \"(No description)\";\n task._csrf = document.getElementById('csrf').value;\n delete task.color;\n var req = new XMLHttpRequest();\n req.open('post', '/tasks');\n req.setRequestHeader('Content-Type', 'application/json');\n req.setRequestHeader('csrfToken', task._csrf);\n req.send(JSON.stringify(task));\n var taskAmt = document.getElementById('task-amt');\n taskAmt.value = taskAmt.placeholder = document.getElementById('hidden-value').value; //Set the value and placeholder to the projects default value\n}", "function storeTasks(taskObject) \n{\n\tlet tasksArray = localStorage.getItem(\"tasks\") ? JSON.parse(localStorage.getItem(\"tasks\")) : [];\n\ttasksArray.push(taskObject);\n\tlocalStorage.setItem(\"tasks\", JSON.stringify(tasksArray));\n}", "function createNewObject(jsonData) {\n jsonData.forEach(task => {\n const tasks = Object.create(taskPrototype);\n tasks.id = task.id;\n tasks.day = task.day;\n tasks.time = task.time;\n tasks.description = task.desc;\n //push to array\n arrayTasks.push(task);\n });\n // console.log(arrayTasks);\n displayTasks(arrayTasks);\n}", "toJSON() {\r\n var task = {\r\n name: this._name,\r\n type: this._type, // \"Cancellation\" only\r\n startDate: this.startDate,\r\n startTime: this._startTime,\r\n duration: this._duration,\r\n endDate: this._endDate,\r\n frequency: this._frequency\r\n };\r\n return JSON.stringify(task);\r\n }", "function addTaskLocalstorage(){\n \n \n if(validation() == false)\n return ; \n\n\n let taskObject = { task : document.getElementById(\"task\").value, status : \"active\" }\t;\n let dataList = JSON.parse(localStorage.getItem(\"allData\"));\n dataList.push(taskObject);\n\n localStorage.setItem(\"allData\" , JSON.stringify(dataList));\n\n addShowList(taskObject) ;\n decideToShowOrHide(taskObject) ;\n\n document.getElementById(\"task\").value = \"\" ; // Make the input field null again \n\n }", "function save() {\n let title = titleTask.value.trimStart().replace(/(<([^>]+)>)/ig,\"\");\n let description = descriptionTask.value.trimStart().replace(/(<([^>]+)>)/ig,\"\");\n let priority = priorityTask.value.replace(/(<([^>]+)>)/ig,\"\");\n\n if (title === null || title === '') return;\n\n if (createTask.getAttribute('task-id') && createTask.getAttribute('task-done')) {\n let isdone = createTask.getAttribute('task-done') === 'false'?false:true;\n let id = createTask.getAttribute('task-id');\n list = list.map((item) => {\n if (item.id === id) {\n item = { id: id, title: title, description: description, priority: priority, done: isdone };\n }\n return item;\n });\n saveToLocalStorage(list);\n createTask.removeAttribute('task-id');\n createTask.removeAttribute('task-done');\n changeFilter();\n } else {\n let saveList = saveToList(title, description, priority);\n list.push(saveList);\n saveToLocalStorage(list);\n }\n}", "function addTask() {\n // Create task\n let newTask;\n \n // Get task name from form\n taskName = $(\"#task-input\").val()\n\n // Add caracteristics to newTask\n newTask = new Task(taskName, false, tasks.length);\n\n // Add task to list of tasks\n tasks.push(newTask);\n\n // Reset value of field\n $(\"#task-input\").val(\"\")\n updateUI();\n\n}", "function createTask (task) {\n\tvar actionType = '[createTask]:';\n\tif (task.type > 2) {\n\t\treturn console.log(actionType, 'Type of the task is undefined');\n\t}\n\tif (!task.name) {\n\t\treturn console.log(actionType, 'Please provide the name of the task.');\n\t}\n\tif (!task.description) {\n\t\treturn console.log(actionType, 'Please provide the description of the task.');\n\t}\n\tif (typeof task.participants !== 'number') {\n\t\treturn console.log(actionType, 'You have to provide an ID of participant or a group.');\n\t}\n\tif (task.type === 2 && !isGroupExist(task.participants)) {\n\t\treturn console.log(actionType, `Group with this ID (${task.participants}) does not exist.`);\n\t}\n\tif (task.type === 1 && !isStudentExist(task.participants)) {\n\t\treturn console.log(actionType, `Student with this ID (${task.participants}) does not exist`);\n\t}\n\n\ttask.id = tasks.length;\n\ttasks.push(task);\n\treturn console.log(actionType, `Task «${task.name}» — ${task.description} — has been created.`);\n}", "function addToLocalStorage(listTask) {\n localStorage.setItem('listTask', JSON.stringify(listTask));\n renderTask(listTask);\n}", "addNewTask() {\n let task = new Task(this.newTaskName);\n task.id = new Date().getMilliseconds();\n this.tasks.push(task);\n }", "function saveTask(e) {\n\n let title = document.getElementById('title').value;//Para seleccionar el valor del id \"title\"\n let description = document.getElementById('description').value;//Para seleccionar el valor del id \"description\"\n\n const task = {//Para definir y guardar estos valores\n title, // esto es title: title\n description // esto es description: description\n };\n\n// Con este método de localStorage guardo los datos. Tengo que darle 2 parámetros: \n// el nombre de la lista de datos (tasks) y el dato que le paso. En este caso uso JSON.stringify\n// para convertir el dato en un String. \n /*localStorage.setItem('tasks', JSON.stringify(task));*/\n\n// Con este método de localStorage recupero los datos. Tengo que darle un parámetro:\n// el nombre de la lista que quiero recuperar. Si quisiera recuperarlo como un objeto, tendría\n// que escribir JSON.parse(localStorage.getItem('tasks'));\n /*localStorage.getItem('tasks')*/\n\n if (localStorage.getItem('tasks') === null) { // Si localStorage está vacío, le añado la\n let tasks = []; // tarea nueva que voya a almacenar.\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n } else {\n let tasks = JSON.parse(localStorage.getItem('tasks')); // Si ya existen algunas tareas\n tasks.push(task); // actualizalas y acumúlala con las demás.\n localStorage.setItem('tasks', JSON.stringify(tasks));\n }\n\n getTasks(); // Para llamar a la función que mostrará los datos en la interfaz.\n document.getElementById('formTask').requestFullscreen();\n e.preventeDefault();// Para que la web no se refresque cada vez que le doy al botón guardar.\n}", "function createTask(event) {\n event.preventDefault();\n document.getElementById(\"currentCount\").innerHTML = \"0 \";\n const taskList = JSON.parse(localStorage.getItem('task')) || [];\n const taskName = document.querySelector(\"[name='taskName']\").value;\n const taskDescription = document.querySelector(\"[name='taskDescription']\").value;\n const taskIcon = document.getElementById(\"pickedIcon\").src;\n const taskDeadlineInput = document.querySelector(\"[name='taskDeadlineInput']\").value;\n const taskMembers = [];\n const taskChecklistUl = document.getElementsByClassName(\"checkListLi\");\n var taskCheckListArray = [];\n const taskHeight = \"230px\";\n\n if(taskName == \"\") {\n console.log(\"missing taskname\");\n document.getElementById(\"missingInputName\").style.visibility = \"visible\";\n setTimeout(\"document.getElementById('missingInputName').style.visibility = 'hidden'\", 5000);\n return false;\n }\n\n for(var i = 0; i < taskChecklistUl.length; i++) {\n var taskChecklist = {\n checkPointName : taskChecklistUl[i].innerHTML,\n checked : false\n };\n taskCheckListArray.push(taskChecklist);\n\n }\n console.log(taskChecklistUl)\n \n let taskId = Math.floor(Math.random() * 1000);\n const task = { taskId, taskName, taskDescription, taskIcon, taskCheckListArray, taskMembers, taskDeadlineInput, taskHeight};\n taskList.push(task);\n window.localStorage.setItem('task', JSON.stringify(taskList));\n\n event.target.reset();\n hideSection(addTaskSection);\n renderTaskList();\n}", "function storeTasks() {\n localStorage.setItem(\"userTasks\", JSON.stringify(myTimeBlocks));\n }", "function loadJSON(){\n if(localStorage){\n if(localStorage.taskjson){\n var taskArray = JSON.parse(localStorage.taskjson);\n taskArray.forEach(function(taskObject,index){\n var ul = document.getElementsByTagName(\"fieldset\")[1].children[1];\n var li = document.createElement(\"li\");\n li.innerHTML=taskObject.id+ \" \"+taskObject.name+\" \"+taskObject.desc;\n li.addEventListener(\"click\",toogleTask);\n ul.appendChild(li);\n });\n taskId = taskArray.length;\n taskOperations.taskList = taskArray;\n }\n }\n}", "save() {\n const tasksJson = JSON.stringify(this.tasks);\n localStorage.setItem('tasks', tasksJson);\n const currentId = String(this.currentId);\n localStorage.setItem('currentId', currentId);\n }", "function createTask(v,t){\r\n \r\n }", "function addTask() {\n event.preventDefault();\n currentTask = {\n name: document.getElementById('newTaskForm').elements.taskName.value,\n status: document.getElementById('newTaskForm').elements.taskStatus.value,\n date: document.getElementById('newTaskForm').elements.taskDate.value,\n };\n // adding this object to the overall array\n console.log(currentTask);\n myTasks.push(currentTask);\n \n alert(\"Task added: \" + currentTask.name + \".\");\n document.getElementById('newTaskForm').reset();\n \n // updating/replacing the localStorage version.\n updateTasks();\n\n deleteDisplayList(-1);\n createTaskList(myTasks);\n \n // collapse the Property form\n document.getElementById('btnAddTaskCollapser').nextElementSibling.style.display = \"none\";\n}", "function addTaskFromClick() {\r\n\tvar noteObj = {}; // create task object\r\n\t\r\n\tvar tsk_txt = document.getElementById(\"task-text\").value;\r\n\tvar tsk_dt = document.getElementById(\"task-due-date\").value;\r\n\t\r\n\tif (tsk_txt === \"\") {\r\n\t\talert(\"New Task is a mandatory field!\");\r\n\t\tdocument.getElementById(\"task-text\").focus();\r\n\t} else {\r\n\t\t\tif (tsk_dt === \"\") {\r\n\t\t\t\talert(\"Due Date is a mandatory field!\");\r\n\t\t\t\tdocument.getElementById(\"task-due-date\").focus();\r\n\t\t\t} else {\r\n\t\t\t\t\tif (!isDueDateInFuture(tsk_dt)) {\r\n\t\t\t\t\t\t\talert(\"Due Date must be in the future!\");\r\n\t\t\t\t\t\t\tdocument.getElementById(\"task-due-date\").focus();\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar tsk_tm = document.getElementById(\"task-due-time\").value;\t\t\t\t\r\n\t\t\t\t\t\tvar curr_date_time = new Date();\r\n\r\n\t\t\t\t\t\t// assign properties to task object\r\n\t\t\t\t\t\tnoteObj.txt = tsk_txt;\r\n\t\t\t\t\t\tnoteObj.date = tsk_dt; // date will later on be formatted to the requested format display\r\n\t\t\t\t\t\tnoteObj.time = tsk_tm;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// id property will later be used to uniquely identify a note prior to its deletion, if & when done by the user\r\n\t\t\t\t\t\tnoteObj.id = curr_date_time.getTime().toString();\r\n\r\n\t\t\t\t\t\tdisplayNote(noteObj); // calling function to display current note. its object is passed as argument to function\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tconsole.log(\"*** new note created: ***\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tnotesObj.notes.push(noteObj); // update notes array with the new note object\r\n\t\t\t\t\t\tlocalStorage.setItem(\"notes\", JSON.stringify(notesObj)); // update local storage\r\n\t\t\t\t\t\tconsole.log(\"*** local storage updated! ***\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tclearInputFields(); // clear all input fields filled by the user\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t}\r\n}", "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "function addTask() {\r\n let text = document.getElementById(\"inptTxt\").value;\r\n let date = document.getElementById(\"inptDate\").value;\r\n let time = document.getElementById(\"inptTime\").value;\r\n\r\n //validation checks \r\n // I didn't put in a submit button to check required feilds because in that case if there was a date missing the text in the text area would have been earased,\r\n //and I wanted the text to stay even in a case that there was not date - to give user chance to put in a date without loosing text\r\n \r\n //date and text are required\r\n if (!text) {\r\n alert('Task text should not be empty - Please enter text');\r\n }\r\n else if (!date) {\r\n alert('Date must be supplied - please enter date');\r\n }\r\n //checks date and time have not passed\r\n else if (!checkDate(date, time)) {\r\n alert('Date and/or time supplied has past - Please enter a new date or time');\r\n document.getElementById(\"inptDate\").value = null;\r\n document.getElementById(\"inptTime\").value = null;\r\n }\r\n else {\r\n let tempTask = new Task(text, date, time);\r\n //if the array is empty the first id will be one if it is not then it will put one larger then the last id\r\n if (tasks.length > 0) {\r\n tempTask.id = Number(tasks[tasks.length - 1].id + 1);\r\n }\r\n else {\r\n tempTask.id = Number(1);\r\n }\r\n //adds new task to local storage\r\n tasks.push(tempTask);\r\n localStorage.tasks = JSON.stringify(tasks);\r\n showTasksOnPage();\r\n }\r\n\r\n}", "function saveTask(){\n var title = UI.$txtTitle.val();\n var date = UI.$txtDate.val();\n var desc = UI.$txtDescription.val();\n var location = UI.$txtLocation.val();\n\n // Create task object\n var task = new Task(title, important, date, desc, alert, location);\n\n //Push into task array\n taskList.push(task);\n\n // clear the form\n clearForm();\n\n console.log(taskList);\n\n\n //Parsify this Task Object to string. \n // var data = JSON.stringify(task);\n //http request \n // save the task on the backend\n // 'send Task Object to our server database\n $.ajax({\n // Url is always a string type\n url: 'http://fsdi.azurewebsites.net/api/tasks',\n //POST b/c we're sending and recieving data\n type: 'POST',\n // data to be sent. Parse to string. \n data: JSON.stringify(task),\n\n //Always used with 'data' to specify what type\n contentType: \"application/json\",\n success: function(res){\n //print our server repsponse\n console.log(res);\n //show success to user\n $('#alertSuccess').removeClass('hide');\n\n //set a timer(mili) to remove \n setTimeout(function(){\n //hide success to user\n $('#alertSuccess').addClass('hide');\n } , 3000);\n },\n error: function(details){\n //print if error \n console.log(\"Error :(\", details);\n }\n\n\n });\n\n //show success to user\n $('#alertSuccess').removeClass('hide');\n\n}", "function addNewTask() {\n buttonAdd.onclick = function () {\n if (!newText.value || !newText.value.trim()) return alert('Please, input your text')\n newContainer.classList.add(hiddenClass)\n let id = listTask.length ? listTask[listTask.length - 1].id + 1 : 0\n let date = new Date().toJSON()\n const task = {\n id,\n text: newText.value.trim(),\n date,\n completed: false\n }\n listTask.push(task)\n addTaskToDom(task, listBlock)\n newText.value = ''\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n }", "addTask(task, successHandler, errorHandler) {\n var taskList = this.get(TASK_LIST)\n taskList.push(task);\n this.set(TASK_LIST, taskList);\n return saveData(this, sucessHandler, errorHandler)\n\n }", "function addTask(currentDiv){\n var parent = currentDiv.parentNode;\n var d=document.createElement(\"div\");\n d.classList.add(\"tasks\");\n parent.appendChild(d);\n d.innerHTML += '<div class=\"taskTitle\">Titre de la tâche</div>' +\n '<input class=\"hide_title none\" placeholder=\"Titre\" type=\"text\"/>' +\n '<input class=\"none input_text\" value=\"Valider\" type=\"submit\"/>' +\n '<div class=\"all_info_task\">' +\n '<div class=\"all_icons_task\">' +\n '<a href=\"#\" class=\"icon dezoomButton none\"> <img src=\"../asset/img/dezoom.png\"/></a>' +\n '<a href=\"#\" class=\"icon zoomButton\"><img src=\"../asset/img/zoom.png\"/></a>' +\n '<a href=\"#\" class=\"empty_task icon\" ><img src=\"../asset/img/empty.png\"/></a>' +\n '<a href=\"#\" class=\"empty_task none icon\"><img src=\"../asset/img/edit.png\"/></a>' +\n '<a href=\"#\" class=\"icon deleteTask\"><img src=\"../asset/img/remove_task.png\"/></a>'+\n '</div>' +\n '<span class=\"title_column none\">Titre de la colonne</span>' +\n '<div class=\"taskDescription none\">Description</div>' +\n '<textarea cols=\"100\" rows=\"10\" class=\"textarea none\" placeholder=\"Description...\"></textarea>' +\n '<input class=\"none\" value=\"Valider\" type=\"submit\"/>'+\n '</div>';\n\n refresh_for_tasks();\n var array = {id:parent.childNodes[4].value, title:\"Titre de la tâche\", description:\"Description\"};\n arraytasks.push(array);\n localStorage.setItem(\"tasks\", JSON.stringify(arraytasks));\n }", "save() {\n // Create a JSON string of the tasks\n const tasksJson = JSON.stringify(this.tasks);\n\n // Store the JSON string in localStorage\n localStorage.setItem(\"tasks\", tasksJson);\n\n // Convert the currentId to a string;\n const currentId = String(this.currentId);\n\n // Store the currentId in localStorage\n localStorage.setItem(\"currentId\", currentId);\n }", "save() {\n // Create a JSON string of the tasks\n const tasksJson = JSON.stringify(this.tasks);\n\n // Store the JSON string in localStorage\n localStorage.setItem(\"tasks\", tasksJson);\n\n // Convert the currentId to a string;\n const currentId = String(this.currentId);\n\n // Store the currentId in localStorage\n localStorage.setItem(\"currentId\", currentId);\n }", "function storeData(tasks) {\n storedData = localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function addToLocalStorage(task) {\n let tasks;\n if (!localStorage.getItem('tasks')) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function addTask(list) {\n console.log(task);\n createList(task).then((data) => {\n if (data.error) {\n console.log(data.error);\n } else {\n console.log(data.data);\n setItems((prevValues) => {\n return [...prevValues, data.data];\n });\n setTask('');\n }\n });\n }", "function saveFile() {\n let json = JSON.stringify(tasks);\n fs.writeFileSync(taskFileName, json, \"utf-8\")\n}", "function getTaskfromLocalStorage(){\r\n let tasks;\r\n///we want to now pull whatever there is in the local storage that can be - either added to tasks array or else tasks can be set as an empty array.\r\n//initialise a tasks varibale to create the array\r\n\r\nif(localStorage.getItem('tasks') === null){\r\ntasks = [];\r\n}else{\r\n tasks = JSON.parse(localStorage.getItem('tasks'))///this will be a string and hence we will have to parse this an object that can be used, hence we will add the \"JSON parse\" wrapper.\r\n}\r\n//We would now want to run a loop and add eack task to the DOM as we do for addTask(); except that when creating a text node and appending it to li we will pass in task instead of taskInput value as we are getting this task from local storage rather than receiving it as an input\r\ntasks.forEach(function(task){\r\n/// We first want to create an li element for when an task input is added as follow:\r\nconst li = document.createElement('li');\r\n\r\n//Add a class\r\nli.className = 'collection-item';//This is a materialize requirment where for aesthetics a ul has to have a className as 'collection' and each li for that ul className of 'collection-item\r\n\r\n//Create a text node and append to the li\r\nli.appendChild(document.createTextNode(task));\r\n\r\n///Create new link element for delete item\r\nconst link = document.createElement('a');\r\n\r\n///Add class to the link element\r\nlink.className = 'delete-item secondary-content';///the secondary-content class is needed in materialize to have an element to the right of a list item (li)\r\n\r\n///Add icon html (x icon to delete)\r\nlink.innerHTML = '<i class = \"fa fa-remove\"></i>'//fa fa-remove class is a font awesome class for remove item (x) icon\r\n\r\n///Append the link to li\r\nli.appendChild(link);\r\n\r\n//Append the li to ul(taskList)\r\ntaskList.appendChild(li);\r\n\r\n})\r\n\r\n}", "function storeTaskLocalStorage(newTask){\n let storedTasks;\n if (localStorage.getItem('tasks') === null) {\n storedTasks = [];\n } else {\n storedTasks = JSON.parse(localStorage.getItem('tasks'));\n }\n storedTasks.push(newTask);\n storedTasks.sort();\n localStorage.setItem('tasks', JSON.stringify(storedTasks));\n}", "function addTask(event) {\n event.preventDefault();\n\n let text = document.getElementById('to-do').value; \n let date = document.getElementById('deadline').value;\n let imp = document.getElementById('importance').value;\n var tasksList = document.getElementById('task-list');\n \n //Checking if sth was written\n if (text === '' || text.trim() === '') {\n alert('You need to write down Your task');\n } else if (Date.parse(date) < Date.parse(`${yyyy}-${mm}-${dd}`)) {\n alert('Your deadline is in past!');\n } else {\n \n //Creates a task\n const task = {\n text,\n date,\n imp,\n id: listOfTasks.length,\n checked: false\n }\n\n //Adds task to the list\n listOfTasks.push(task);\n\n //Prints the list\n console.log(listOfTasks); \n\n //Makes input blank again\n document.getElementById('to-do').value = '';\n document.getElementById('deadline').value = '';\n document.getElementById('importance').value = 'Normal';\n\n //Saving values in local storage\n localStorage.setItem('tasks', JSON.stringify(listOfTasks));\n }\n}", "addTask(task) {\n const taskList = this.state.taskList;\n\n // might want to arrange this as a dictionary later on\n let newTask = {\n // generate unique id\n id: crypto.randomBytes(16).toString(\"hex\"),\n name: task[0],\n date: task[1],\n type: task[2],\n isFinished: task[3],\n notes: task[4]\n }\n\n // add the new task into the state\n this.setState({\n taskList: taskList.concat(newTask),\n taskListLength: taskList.length,\n })\n\n // API call to insert into DB \n this.createNewTask(newTask);\n }", "addTask(taskObj) {\n\t\tconst todos = this.getAndParse('tasks');\n\t\ttodos.push(taskObj);\n\t\tthis.stringifyAndSet(todos, 'tasks');\n\t}", "function saveData() {\n localStorage.removeItem(\"tasks\");\n localStorage.setItem(\"tasks\", JSON.stringify(taskList));\n}", "function createNewTasks(body, tasksArray){\n const task = body;\ntasksArray.push(task); \n//overwriting original tasks json file\nfs.writeFileSync(\n path.join(__dirname, './db/db.json'),\n //we need to save the JavaScript array data as JSON, so we use JSON.stringify\n //()The null argument means we don't want to edit any of our existing data; \n //if we did, we could pass something in there. The 2 indicates we want to create white \n //space between our values to make it more readable.\n JSON.stringify({ tasks: tasksArray }, null, 2)\n);\n return task;\n}", "function add_task() {\n const task = NEW_TASK.value.trim();\n if (task !== '') {\n COMPLETE_ALL.checked = false;\n TASK_LIST.appendChild(create_task(task, false));\n }\n NEW_TASK.value = '';\n save();\n}", "function addTask(e) {\n if (taskInput.value === '') {\n alert('Add a task');\n }\n // Create li element\n const li = document.createElement('li');\n // Add class\n li.className = 'collection-item';\n // Create text node and append to li\n li.appendChild(document.createTextNode(taskInput.value));\n // Create new link element\n const link = document.createElement('a');\n // Add class\n link.className = 'delete-item secondary-content';\n link.addEventListener('click', removeTask)\n // Add icon html\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // Append the link to li\n li.appendChild(link);\n // Append li to ul\n taskList.appendChild(li);\n //Store in Ls\n storeTaskInLocalStorage(taskInput.value);\n\n //// another way to JSON ////\n // localStorage.setItem('taskList', Array.from(JSON.stringify(taskList.textContent)))\n\n // Clear input\n taskInput.value = '';\n e.preventDefault();\n}", "function createTask (task) {\n\t return $http.post(url, task)\n\t .then(function successCallback(res){\n\t return res.data;\n\t }, function errorCallback (error) {\n console.log('ERRRRR');\n \tconsole.log(error);\n });\n\t}" ]
[ "0.75604033", "0.75434726", "0.7478239", "0.7440815", "0.74116105", "0.7353173", "0.7320234", "0.72908735", "0.72757107", "0.72400296", "0.7221497", "0.72191143", "0.72005016", "0.71956885", "0.7181239", "0.7180007", "0.71798396", "0.7177128", "0.7173657", "0.715233", "0.7142972", "0.7129204", "0.71231204", "0.71087253", "0.710815", "0.7103439", "0.7100439", "0.70999396", "0.70974576", "0.70788246", "0.7076899", "0.70594037", "0.7052556", "0.7051029", "0.7050371", "0.70469", "0.70438796", "0.7032286", "0.70165664", "0.7010012", "0.700959", "0.70030296", "0.69873536", "0.6986134", "0.69837636", "0.6968487", "0.6953033", "0.6946331", "0.69434977", "0.69365656", "0.69336176", "0.69310486", "0.69208354", "0.691633", "0.69109887", "0.6909135", "0.6893099", "0.68914783", "0.6884716", "0.6878067", "0.68748105", "0.687392", "0.6871918", "0.6868732", "0.68676", "0.6847701", "0.6844691", "0.68341595", "0.6833866", "0.681908", "0.68180025", "0.68170077", "0.6812724", "0.6811263", "0.6810264", "0.68078303", "0.68030405", "0.68006116", "0.67952675", "0.6784743", "0.6778407", "0.6775527", "0.6767968", "0.67678505", "0.67591536", "0.67591536", "0.6739049", "0.6735914", "0.6731414", "0.6723904", "0.6715409", "0.6704733", "0.67026013", "0.66968256", "0.6693406", "0.66924536", "0.66889447", "0.6687987", "0.66761637", "0.6668699" ]
0.7582319
0
This function will add the entries in the add Task form to the JSON allTasks
function addTask() { let t = gererateTaskObject(); allTasks.push(t); document.getElementById('loading').classList.remove('d-none'); tasksString = JSON.stringify(allTasks); saveJSONToServer(allTasks) .then(function (result) { //then(function (variable vom server)) console.log('Laden erfolgreich!', result); document.getElementById('loading').classList.add('d-none'); load(); }) .catch(function (error) { // Fehler console.error('Fehler beim laden!', error); document.getElementById('loading').classList.add('d-none'); document.getElementById('error').classList.remove('d-none'); }); //localStorage.setItem('data', tasksString); disabled - the JSON is saved on the Server emptyFields(); /** * The following 5 lines would be a popup which shows the name and the category of the added Tast. * It has been replaced by the loading screen */ //let html = "<div id='popup' class='transparentgray'><div class='popup'><h5>A new Task with the Title " + t.title + " has been added!</h5>You have set " + t.importance + " and " + t.urgency + "!</div></div>"; //document.getElementById("mainWindow").insertAdjacentHTML('beforeEnd', html); //setTimeout(function () { // document.getElementById('popup').remove(); //}, 5000); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "addTask() {\n const input = qs('#addTask');\n saveTask(input.value, this.key);\n this.showList();\n }", "function addTask() {\n values={};\n values.task=$('#task').val();\n\n $.ajax({\n type: 'POST',\n url: '/task',\n data: values,\n success: function(){\n updateTaskList();\n }\n });\n}", "function addTask() {\n event.preventDefault();\n currentTask = {\n name: document.getElementById('newTaskForm').elements.taskName.value,\n status: document.getElementById('newTaskForm').elements.taskStatus.value,\n date: document.getElementById('newTaskForm').elements.taskDate.value,\n };\n // adding this object to the overall array\n console.log(currentTask);\n myTasks.push(currentTask);\n \n alert(\"Task added: \" + currentTask.name + \".\");\n document.getElementById('newTaskForm').reset();\n \n // updating/replacing the localStorage version.\n updateTasks();\n\n deleteDisplayList(-1);\n createTaskList(myTasks);\n \n // collapse the Property form\n document.getElementById('btnAddTaskCollapser').nextElementSibling.style.display = \"none\";\n}", "addTask() {\n\t\tif (taskTitle.value !== undefined && taskTitle.value !== '') {\n\t\t\t//This next line adds the newly defined goal to an array of goals created in this session\n\t\t\tnewTaskList.push(taskTitle.value);\n\t\t\tconsole.log(`New Task List: ${newTaskList}`); //Goals are stored correctly\n\t\t\tthis.addTaskDOM(taskTitle.value, false);\n\t\t\tfetch('/items', {\n\t\t\t\tmethod: 'POST',\n\t\t\t\theaders: {\n\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t 'Content-Type': 'application/json'\n\t\t\t\t},\n\t\t\t\t body: JSON.stringify({\n\t\t\t\t\t title: taskTitle.value, \n\t\t\t\t\t goal_id: userGoals.goals[userGoals.goalIndex].id\n\t\t\t\t\t})\n\t\t\t })\n\t\t\t .then(res => res.json())\n\t\t\t .then(res => {\n\t\t\t\t userGoals.goals[userGoals.goalIndex].items.push(res);\n\t\t\t\t this.setId(res.id);\n\t\t\t\t})\n\t\t\t .catch(error => console.error(error));\n\n\t\t\ttaskTitle.value = '';\n\t\t\t\n\t\t\tcloseTaskForm();\n\t\t}\n\t\telse{\n\t\t\talert('Please enter new tasktitle');\n\t\t}\n\t\t// this.edit();\n\t}", "addTask(taskObj) {\n\t\tconst todos = this.getAndParse('tasks');\n\t\ttodos.push(taskObj);\n\t\tthis.stringifyAndSet(todos, 'tasks');\n\t}", "function add_task() {\n const task = NEW_TASK.value.trim();\n if (task !== '') {\n COMPLETE_ALL.checked = false;\n TASK_LIST.appendChild(create_task(task, false));\n }\n NEW_TASK.value = '';\n save();\n}", "function addTasks() {\n const text =\n document.getElementById('enter-task').value;\n if (text) {\n tasks.push(new Task(text)); // somehow connect the tasks to the list they are in (optional-ish)\n showTasks();\n }\n // window.localStorage.setItem(lists, JSON.stringify(text));\n }", "function addData(json) {\r\n\tvar tasks = json.tasks;\r\n\tfor(var i=0;i<tasks.length;i++)\r\n\t{\r\n\t\t// adding tasks\r\n\t\tdocument.getElementById('taskname').value = tasks[i];\r\n\t\tCreateListItem()\r\n\t}\r\n\t// clearing text field\r\n\tdocument.getElementById('taskname').value = \"\";\r\n}", "function addTask()\n{\n //The month scales from 0-11 so we need to add one.\n var tempMonth = new Date().getMonth() + 1;\n\n var td = new Date().getFullYear() + \"-\" + tempMonth + \"-\" + new Date().getDate() + \"|\" + new Date().getHours() + \":\" + new Date().getMinutes() + \":\" + new Date().getSeconds();\n var taskDate = td.toString();\n\n var md = new Date();\n var mDate = md.getTime();\n\n //Adding the input values to the array\n taskArr.push({Name: taskTitle.value, Description: taskDetails.value, Date: taskDate, MDate: mDate});\n console.log(taskArr);\n\n //calling the for loop to create the elements.\n floop();\n\n //Adding the listed items to the incompleteTaskList.\n incompletetaskList.appendChild(listItem);\n\n //Calls the BindTaskEvents and passes in the buttons' function.\n bindTaskEvents(listItem);\n\n //Resets the values of the input field.\n taskTitle.value = \"\";\n taskDetails.value = \"\";\n}", "function insertNewTask() {\n let newTask = document.getElementById(\"input_new_task\").value;\n let obj = {};\n obj['id'] = taskCount;\n obj['task'] = newTask;\n obj['complete'] = false;\n tasksList.push(obj);\n taskCount += 1;\n const finalData = generateTasksList();\n document.getElementById(\"divTasksList\").innerHTML = finalData;\n document.getElementById(\"input_new_task\").value = '';\n}", "function placeTasks(){\n let app = $(\"#current-tasks\");\n let taskList = document.createElement('ul');\n app.append(taskList);\n loadTasks().then((tasks)=>{\n tasks.forEach(task=>{\n newTask(task.name, task.id);\n });\n });\n }", "function addtasklists() {\n var x, ob, taskname, taskId, txt = \"\";\n var task = document.getElementById(\"taskLisName\").value;\n var taskpass = { \"Taskname\": task };\n var xmlhttp = new XMLHttpRequest(); // new HttpRequest instance \n\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n // console.log(taskpass);\n\n ob = JSON.parse(this.responseText);\n\n console.log(ob._id, ob.Taskname);\n\n taskId = ob._id;\n taskname = ob.Taskname;\n loadTask(taskId, taskname);\n task = \"\";\n /* for (x in ob) {\n console.log(ob);\n addRow(ob[x].name ,ob[x].Created_date,ob[x].status);\n \n \n }*/\n\n }\n };\n\n xmlhttp.open(\"post\", \"http://localhost:3000/todolists\");\n xmlhttp.setRequestHeader(\"Content-Type\", \"application/json\");\n xmlhttp.send(JSON.stringify(taskpass));\n\n}", "function addTask(task) {\n var appTaskList = $('[phase-id=' + task.phase + '] .list');\n var allTasksList = $('.tasks-Pending .list');\n var taskItem ={\n _id: task._id,\n phase: task.phase,\n completed: task.completed,\n description: task.description,\n dueDate: task.dueDate\n };\n\n // if no tasks in pending list, create the pending list\n if(allTasksList.children().length==0) {\n var list = $('#task-list');\n list.prepend(Handlebars.templates['tasks']({\n label: 'Pending Tasks',\n tasks: [taskItem]\n })); \n } else {\n allTasksList.append(Handlebars.templates['task'](taskItem));\n }\n\n appTaskList.append(Handlebars.templates['task'](taskItem));\n $('.ui.checkbox').checkbox();\n}", "function addTask(task) {\n task.elapsed = task.elapsed.hours + \":\" + task.elapsed.minutes + \":\" + task.elapsed.seconds;\n task.color = task.color.replace('#', '');\n task.description = \"(No description)\";\n task._csrf = document.getElementById('csrf').value;\n delete task.color;\n var req = new XMLHttpRequest();\n req.open('post', '/tasks');\n req.setRequestHeader('Content-Type', 'application/json');\n req.setRequestHeader('csrfToken', task._csrf);\n req.send(JSON.stringify(task));\n var taskAmt = document.getElementById('task-amt');\n taskAmt.value = taskAmt.placeholder = document.getElementById('hidden-value').value; //Set the value and placeholder to the projects default value\n}", "function addTask(){\n\t\tif (item.value.length >= 1) {\n\t\t\tincompleteUl.append('<li>' + '<p>' + item.value + '</p>' + complete + remove + '</li>');\n\t\t\ttoDoList.push(item.value);\n\t\t}else {\n\t\t\talert(\"Please add a task\");\n\t\t}\n\n\t\ttoDoCount();\n\t\tnotToDoCount();\n\t\tcompleteTask();\n\t\tremoveTask();\n\t\taddClear();\n\t\titem.value = \"\";\n\t}", "function addTask() {\n // Create task\n let newTask;\n \n // Get task name from form\n taskName = $(\"#task-input\").val()\n\n // Add caracteristics to newTask\n newTask = new Task(taskName, false, tasks.length);\n\n // Add task to list of tasks\n tasks.push(newTask);\n\n // Reset value of field\n $(\"#task-input\").val(\"\")\n updateUI();\n\n}", "function addTask() {\r\n\r\n var taskId = \"task_\" + taskCount++;\r\n\r\n var task = createTask(taskId, \"\", \"\");\r\n taskList[taskId] = task;\r\n\r\n var domElement = createNewTaskDOMElement(task);\r\n taskListDOMElements[taskId] = domElement;\r\n\r\n showTaskDetail(task);\r\n}", "function addTask() {\n Task.addTask(info.newTask);\n info.newTask = \"\";\n }", "addTasks(newTask)\n {\n this._tasks.push(newTask);\n }", "addTask(e) {\n e.preventDefault();\n const value = this.addTaskForm.querySelector('input').value;\n if (value === '') return;\n this.tasks.createTask(new Task(value));\n this.renderTaskList(this.tasks.tasks);\n this.clearInputs();\n }", "addTask(task, successHandler, errorHandler) {\n var taskList = this.get(TASK_LIST)\n taskList.push(task);\n this.set(TASK_LIST, taskList);\n return saveData(this, sucessHandler, errorHandler)\n\n }", "function addAllTasks(pendingTasks, completedTasks) {\n var list = $('#task-list');\n list.empty();\n if (pendingTasks.length != 0) {\n list.append(Handlebars.templates['tasks']({\n label: 'Pending Tasks',\n tasks: pendingTasks\n }));\n }\n\n if (completedTasks.length != 0) {\n list.append(Handlebars.templates['tasks']({\n label: 'Completed Tasks',\n tasks: completedTasks\n }));\n }\n $('.ui.checkbox').checkbox();\n}", "function addTask(list) {\n console.log(task);\n createList(task).then((data) => {\n if (data.error) {\n console.log(data.error);\n } else {\n console.log(data.data);\n setItems((prevValues) => {\n return [...prevValues, data.data];\n });\n setTask('');\n }\n });\n }", "async function addTask() {\n\n // the next line is only for testing purposes\n allTasks = await getArrayFromBackend('allTasks');\n\n let task = getValues();\n allTasks.push(task);\n\n saveArrayToBackend('allTasks', allTasks);\n\n // the next line is only for testing purposes\n allTasks = await getArrayFromBackend('allTasks');\n\n clearFields();\n showSnackbar(\"Task pushed to backlog!\");\n\n //Show backlog page with new task added\n setTimeout(function () {\n document.location.href = \"../pages/backlog.html\";\n }, 3000);\n}", "function addTask(){\n //update localstorage\n todos.push({\n item: $newTaskInput.val(),\n done: false\n })\n localStorage.setItem('todos', JSON.stringify(todos))\n //add to ui\n renderList()\n $newTaskInput.val('')\n $newTaskInput.toggleClass('hidden')\n $addTask.toggleClass('hidden')\n $addBtn.toggleClass('hidden')\n}", "function addTask(name) {\n // Construct the Object from the given name\n let newTask = { title: name, isCompleted: 0 };\n\n todoListService.addTask(newTask).then((response) => {\n newTask.id = response.data.data[\"insertId\"];\n // Update the state\n setTasks([...tasks, newTask]);\n });\n\n // Update the server\n }", "function add_new_task()\n {\n //get task text\n let tmp_tsk_txt = document.getElementById(\"new_tsk_txt\").value;\n \n //check that task text not empty-cells\n if(tmp_tsk_txt == \"\")\n {\n doc_alert(\"You cannot submit a blank task.\");\n return false;\n }\n else\n {\n \n let tmp_task = create_new_task(tmp_tsk_txt);\n add_task(tmp_task);\n //add task to the task list\n curr_list.todos.push(tmp_task);\n update_list(curr_list);\n return true;\n }\n }", "function addtask(task) {\n event.preventDefault()\n $.ajax({\n type: 'POST',\n url: '/tasks',\n data: task\n }).then(function(response){\n console.log('back from POST', response);\n $('#listedTasks').empty();\n getTask();\n task = {\n task: $('#nameTask').val(''),\n notes: $('#notes').val('')\n };\n }).catch(function(error) {\n console.log('error in POST', error)\n alert('cannot to add');\n });\n}", "function loadTasks() {\n for (let j = 0; j < toDoList.length; j++) {\n // Checking if the Task has been marked as completed\n if (toDoList[j].isDone === true) {\n // Check to see wether the completed section has already been created\n if (!completedSectionCreated) {\n createCmpltHeader();\n clearAllBtn();\n completedSectionCreated = true;\n }\n completedTasksHandler(toDoList[j], toDoList[j].idNum);\n } else {\n addTask(toDoList[j]);\n }\n }\n}", "function addNewTask() {\n buttonAdd.onclick = function () {\n if (!newText.value || !newText.value.trim()) return alert('Please, input your text')\n newContainer.classList.add(hiddenClass)\n let id = listTask.length ? listTask[listTask.length - 1].id + 1 : 0\n let date = new Date().toJSON()\n const task = {\n id,\n text: newText.value.trim(),\n date,\n completed: false\n }\n listTask.push(task)\n addTaskToDom(task, listBlock)\n newText.value = ''\n setTaskValue()\n localStorage.setItem('listTask', JSON.stringify(listTask))\n }\n }", "function addTask(projectid) {\n const task_name = document.querySelector('.todo_name').value; //get input data from dom\n const task_description = document.querySelector('.todo_description').value;\n const task_date = document.querySelector('.todo_date').value;\n let task_priority = '';\n\n if (document.querySelector('.todo_priority1').checked)\n task_priority = '1';\n else if (document.querySelector('.todo_priority2').checked)\n task_priority = '2';\n else if (document.querySelector('.todo_priority3').checked)\n task_priority = '3';\n else if (document.querySelector('.todo_priority4').checked)\n task_priority = '4';\n\n if (task_name == '' || task_description == '' || task_date == '' || task_priority == '')\n return;\n\n data.projects[projectid].tasks.push(new task(task_name, task_description, task_date, task_priority)) //add new project with name and id to list\n\n }", "function addTask(task){\n\ttasks.push(task);\n}", "function AddTask()\n{\n\t// get to do item from user input\n\tvar name = document.getElementsByName('task')[0].value;\n\n\tif(name == \"\") {\n\t\talert('Please enter task name.');\n\t\treturn;\n\t}\n\n\tvar status = false;\n\tvar completeDate = \"\";\n\n\t// create new task\n\tvar newTask = new task(name, status, completeDate);\n\t// add new task to list\n\ttodos.push(newTask);\n\t\t\n\t//update view\n\tthis.view();\n}", "addNewTask() {\n let task = new Task(this.newTaskName);\n task.id = new Date().getMilliseconds();\n this.tasks.push(task);\n }", "function AddTask() {\n const valid = validateForm()\n if (valid) {\n const newTaskInput = document.getElementById('newItem')\n const tagNameInput = document.getElementById('Tag')\n const tagColorInput = document.querySelector('input[name=\"inlineRadioOptions\"]:checked')\n\n const task = {\n title: newTaskInput.value,\n tag: {\n name: tagNameInput.value,\n color: tagColorInput.value\n },\n type: 'todo',\n state: false\n }\n\n list.items.push(task)\n localStorage.setItem('lists', JSON.stringify(allLists))\n resetForm()\n renderTasks()\n } else {\n const toast = new bootstrap.Toast(document.querySelector('.toast'))\n toast.show()\n }\n}", "function addTask(newTask) {\n\n console.log('in addTask', newTask);\n $.ajax({\n type: 'POST',\n url: '/todo',\n data: newTask,\n }).then(function (response) {\n console.log('Response from server-side:', response);\n getList();\n }).catch(function (error) {\n console.log('Error in POST client side', error);\n });\n}", "function addAppTasks(tasks, phaseId) { \n var list = $('.tasks[phase-id=' + phaseId + ']');\n list.append(Handlebars.templates['tasks']({\n label: 'Tasks',\n tasks: tasks\n }));\n \n $('.ui.checkbox').checkbox();\n\n // add a new add task label\n $('[phase-id=' + phaseId + '] .list').append(Handlebars.templates['new-task']);\n}", "function addListTask(data) {\n listTask.push(data)\n saveData()\n openModal()\n}", "function addNewTask(task) {\n let uniqueID = timeStamp();\n let data = {\n text: task,\n isDone: false,\n idNum: uniqueID,\n };\n toDoList.push(data);\n addTask(data);\n commitToLocalStorage(toDoList);\n}", "function addTask() {\n console.log('addTask called')\n if (!!taskInputValue) { // makes sure that taskInputValue is not blank\n setToDoArray(toDoArray.concat(taskInputValue))\n setTaskInputValue('')\n }\n }", "function createTask(e) {\n /* the data that is stored in allTasks variable is updated here with the localstorage */\n allTasks = JSON.parse(localStorage.getItem('data'));\n if (allTasks === null) {\n allTasks = [];\n }\n const newTask = {\n description: '',\n completed: false,\n index: allTasks.length + 1,\n };\n newTask.description = e;\n /* This procedure here verify if input text value contains nothing. */\n if (newTask.description === '') {\n document.getElementById('task').placeholder = 'this field cannot be blank';\n } else {\n allTasks.push(newTask);\n updateTasks(allTasks);\n }\n}", "function addTasks(e) {\n\t\n\t//Condition to check the user input, if not an empty string add the task\n\tif((inputElem.value !== '') || (e.target.className === 'add-new-todo-button')) {\n\t\t\n\t\t//focusing the input for guiding the user to add next task\n\t\tinputElem.focus();\n\t\t\n\t\t//Declaration for adding new tasks \n\t\tconst checkBox = document.createElement('input');\n\t\tconst newTask = document.createElement('li');\n\t\tconst editButton = document.createElement('button');\n\t\tconst removeButton = document.createElement('button');\n\t\tconst divChild = document.createElement('div');\n\t\tconst output = document.querySelector('.output');\n\t\t\t\t\t\n\t\tcheckBox.type = 'checkbox';\n\t\tcheckBox.className = 'done';\n\t\t\n\t\tnewTask.appendChild(document.createTextNode(inputElem.value));\n\t\t\n\t\teditButton.className = 'edit-button';\n\t\teditButton.appendChild(document.createTextNode('Edit'));\n\t\t\n\t\tremoveButton.className = 'remove-button';\n\t\tremoveButton.appendChild(document.createTextNode('Remove'));\n\t\t\n\t\t\t\t\t\n\t\tdivChild.appendChild(checkBox);\n\t\tdivChild.appendChild(newTask);\n\t\tdivChild.appendChild(editButton);\n\t\tdivChild.appendChild(removeButton);\n\t\t\n\t\tif(newTaskState === 0) {\n\t\t\t\n\t\t\tconst listOfTask = document.createElement('div');\n\t\t\tconst div = document.createElement('div');\n\t\t\t\n\t\t\tlistOfTask.className = `tasks main-${uniqueKey}`;\n\t\t\tlistOfTask.appendChild(div);\n\t\t\t\n\t\t\tdiv.className = `task-list task-list-main-${uniqueKey}`;\n\t\t\t\n\t\t\toutput.appendChild(listOfTask);\n\t\t\taddTaskTitle(e);\n\t\t\t\n\t\t\tif(e.target.className !== 'add-new-todo-button') {\n\t\t\t\tdiv.appendChild(divChild);\n\t\t\t\thideDescription();\n\t\t\t\tnewTask.addEventListener('click', addTaskDescription);\n\t\t\t\t\n\t\t\t\tupdateSidebar(e);\n\t\t\t}\n\t\t\t\n\t\t\tnewTaskState = newTaskState + 1;\n\t\t} else {\n\t\t\tconst div = output.querySelector(`.task-list-main-${targetUniqueKey}`);\n\t\t\tdiv.appendChild(divChild);\n\t\t\thideDescription();\n\t\t\tnewTask.addEventListener('click', addTaskDescription);\n\t\t\t\n\t\t\tupdateSidebar(e);\n\t\t}\n\t\t\n\t\t//Making the input value to empty string\n\t\tinputElem.value = '';\n\t\t\n\t\teditButton.addEventListener('click', editTasks);\n\t\tremoveButton.addEventListener('click', removeTask);\n\t\tcheckBox.addEventListener('change', strikeTask);\n\t}\n\t\n\telse {\n\t\terror();\n\t}\n\t\n\t\n\t//Prevent default behaviour of form element\n\te.preventDefault();\n}", "function saveTask(e) {\n\n let action = document.getElementById('action').value;\n let description = document.getElementById('description').value;\n\n\n\n let task = {\n action, description\n };\n\n if (localStorage.getItem('tasks') === null) {\n\n let tasks = [];\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n }\n\n else {\n\n let tasks = JSON.parse(localStorage.getItem('tasks'));\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n\n\n }\n\n getTask();\n document.getElementById('formtask').reset();\n e.preventDefault();\n\n}", "function addTask(task) {\n return toDoList.push(task);\n}", "function addTaskData() {\n var tasks = document.getElementsByTagName(\"task\");\n for (i = 0; i < tasks.length; i++) {\n var emptyTask = tasks[i];\n var text = emptyTask.getElementsByTagName(\"text\");\n var dates = emptyTask.getElementsByTagName(\"date\");\n var input = emptyTask.getElementsByTagName(\"input\");\n var task = orderedTasks[i];\n text[0].innerHTML = task[0];\n if (!(task[2] === \"\")) {\n dates[0].innerHTML = task[2];\n }\n else {\n dates[0].innerHTML = \"Invalid date\";\n }\n input[0].checked = task[1];\n }\n }", "addTask({panelName = 'todos', task}) {\n if(task && (task.title || task.description)) {\n let data = {...this.data}\n if(Object.keys(data).length === 0) {\n data = {\n todos: { name: 'To-Do', tasks: new Array() },\n inProgress: { name: 'In-Progress', tasks: new Array() },\n done: { name: 'Done', tasks: new Array() }\n } \n }\n\n const {tasks} = data[panelName]\n const newTaskId = tasks.length ? tasks[tasks.length-1].id++ : 11\n const updatedTask = {...task, createdAt: new Date().getTime(), id: newTaskId }\n tasks.push(updatedTask)\n this.data = {...data}\n /** \n * Write this new data to `this.data` to write it in persistent storage\n * and invoke all subscribers about the updated data\n */\n this.set(this.data)\n return this.data\n }\n console.error('At least title or description should be filled')\n return false\n }", "function loadTasks() {\n document.getElementById(\"newTask\").innerHTML = `\n <button id=\"addNewTask\">Add New Task</button>\n `\n document.getElementById(\"newTask\").addEventListener(\"click\", loadTaskForm)\n //console.log(\"Hi\")\n //console.log(sessionUser.getActiveUser().id)\n let findUser = sessionUser.getActiveUser().id\n let findTasks = taskManager.getAllTasks(findUser)\n //console.log(findUser)\n //console.log(findTasks)\n\n findTasks.then(result => {\n //console.log(result)\n document.getElementById(\"taskListInfo\")\n taskListInfo.textContent = \"\"\n result.forEach(element => {\n document.getElementById(\"taskListInfo\").innerHTML += `\n \n <h4>Task: ${element.name}</h4>\n <h5>Date to complete: ${element.completeDate}</h5>\n <input type=\"checkbox\" name=\"completed\" value=\"completed\" id=\"completed--${element.id}\">Completed<br>\n <input type=\"checkbox\" name=\"edit\" value=\"edit\" id=\"editIt--${element.id}\">Edit<br>\n `\n\n })\n })\n\n \n\n}", "function handleAddClick() {\n console.log('add button clicked');\n let newTask = {};\n //puts input fields into an object\n newTask.task = $('#taskIn').val();\n newTask.type = $('#homeOrWork').val();\n newTask.notes = $('#notesIn').val();\n addTask(newTask);\n $('#taskIn').val('');\n $('#notesIn').val('');\n}", "function addTask(event) {\n event.preventDefault();\n\n let text = document.getElementById('to-do').value; \n let date = document.getElementById('deadline').value;\n let imp = document.getElementById('importance').value;\n var tasksList = document.getElementById('task-list');\n \n //Checking if sth was written\n if (text === '' || text.trim() === '') {\n alert('You need to write down Your task');\n } else if (Date.parse(date) < Date.parse(`${yyyy}-${mm}-${dd}`)) {\n alert('Your deadline is in past!');\n } else {\n \n //Creates a task\n const task = {\n text,\n date,\n imp,\n id: listOfTasks.length,\n checked: false\n }\n\n //Adds task to the list\n listOfTasks.push(task);\n\n //Prints the list\n console.log(listOfTasks); \n\n //Makes input blank again\n document.getElementById('to-do').value = '';\n document.getElementById('deadline').value = '';\n document.getElementById('importance').value = 'Normal';\n\n //Saving values in local storage\n localStorage.setItem('tasks', JSON.stringify(listOfTasks));\n }\n}", "function addTask() {\n 'use strict';\n var task = document.getElementById('task'); // Get form references\n // If task is entered, add it to the array and print array\n if (task.value) {\n tasks.push(task.value);\n printArray();\n // Update task input field with the blank string:\n document.getElementById('task').value = '';\n }\n return false;\n } // End of addTask() function.", "function submitTasks() {\n GetAllTasksAndRes(function(tasks, resources) {\n // <visualization>\n $.each(tasks, function(index, task) {\n console.dir(JSON.stringify(task));\n });\n // </visualization>\n\n // @Anand: here you can make the AJAX request to the API\n });\n}", "function addTodo() {\n this.all.push({\n task: this.newTodo.task,\n done: false\n });\n\n this.newTodo.task = '';\n }", "push(task){\n task.id = this.list.length;\n this.list.push(task); \n }", "function addTask(e) {\n\tvar inputEl = document.getElementById(\"input-task\");\n\t\n\tif (!inputEl.value.isNullOrWhitespace())\n\t{\n\t\t// Create a unique ID\n\t\tvar id = \"item-\" + tasks.length;\n\t\t\n\t\t// Create a new task\n\t\tvar task = new Task(id, inputEl.value, taskStatus.active);\n\t\t\n\t\t// Append the task to the DOM\n\t\taddTaskElement(task);\n\t\t\n\t\t// Reset input\n\t\tinputEl.value = \"\";\n\t}\n}", "function addNewTask() {\r\n let textInput = document.querySelector(\"#taskInput\");\r\n let allTasksFromMemory = JSON.parse(localStorage.getItem(\"tasks\"));\r\n\r\n if (textInput.value == \"\") {\r\n return;\r\n }\r\n\r\n // dio za kreiranje novog taska:\r\n let newLi = document.createElement(\"li\");\r\n let textNode = document.createTextNode(\"\");\r\n newLi.appendChild(textNode);\r\n newLi.classList.add(\"task\", \"unfinished\");\r\n\r\n //dole je novo\r\n newLi.innerHTML =\r\n '<img class=\"emptyCircle\" src=\"SVG/empty-circle.svg\" onclick=\"completeTask(this)\"/><img class=\"tickedCircle\" src=\"SVG/ticked-circle.svg\"/><div class=\"textPartofTask\"><p class=\"taskText\">' +\r\n textInput.value +\r\n '</p><p class=\"taskDate\"></p></div><div class=\"right-task-buttons\"><img src=\"SVG/edit-circle.svg\" class=\"right-hidden-button editCircle\" onclick=\"footerVisibilitySwitch(\\'edit\\',this)\"/><img src=\"SVG/thrash-circle.svg\" class=\"right-hidden-button thrashCircle\" onclick=\"deleteTask(this)\"/><img src=\"SVG/date-circle.svg\" class=\"right-hidden-button dateCircle\" onclick=\"showCalendar(this)\"/><img src=\"SVG/options-circle.svg\" class=\"optionsCircle\" onclick=\"expandRightButton(this)\"/></div>';\r\n\r\n newLi.setAttribute(\"id\", taskCounter);\r\n document.querySelector(\".allTasksUl\").appendChild(newLi);\r\n\r\n let attrib;\r\n if (allTasksFromMemory) {\r\n attrib = {\r\n id: taskCounter,\r\n taskText: textInput.value,\r\n state: \"unfinished\",\r\n };\r\n } else {\r\n attrib = [\r\n {\r\n id: taskCounter,\r\n taskText: textInput.value,\r\n state: \"unfinished\",\r\n },\r\n ];\r\n }\r\n\r\n if (allTasksFromMemory) {\r\n allTasksFromMemory.push(attrib);\r\n localStorage.setItem(\"tasks\", JSON.stringify(allTasksFromMemory));\r\n } else {\r\n localStorage.setItem(\"tasks\", JSON.stringify(attrib));\r\n }\r\n\r\n //skrivanje footera i clear-anje input forme\r\n taskCounter++;\r\n localStorage.setItem(\"taskCounter\", taskCounter);\r\n textInput.value = \"\";\r\n footerVisibilitySwitch(\"default\");\r\n}", "function createNewObject(jsonData) {\n jsonData.forEach(task => {\n const tasks = Object.create(taskPrototype);\n tasks.id = task.id;\n tasks.day = task.day;\n tasks.time = task.time;\n tasks.description = task.desc;\n //push to array\n arrayTasks.push(task);\n });\n // console.log(arrayTasks);\n displayTasks(arrayTasks);\n}", "function addTask(title) {\n info.tasks.push({title: title, added: new Date()});\n }", "function addTask() {\n\t\t\tvm.totalTime = 0;\n\t\t\ttaskDo.service.addTask(vm).then(function (response) {\n\t\t\t\tvm.sample=\"vamsi\";\n\t\t\t});\n\t\t}", "function addTask() {\n\n // TODO: look javascript with the dom(document || javascript with html)\n let taskInput = document.getElementById(\"taskinput\");\n\n // TODO: look up conditionals if else\n if (taskInput.value === \"\") {\n alert(\"Invalid Value\")\n } else {\n taskList.push(taskInput.value)\n\n taskinput.value = \"\";\n }\n\n listTasks();\n\n // returns false for form so it doesn't reload\n return false;\n}", "addTask(name, description, assignedTo, dueDate, status) {\n // increment id\n let id = this.currentId++;\n\n // push to tasks array\n this.tasks.push({\n id,\n name,\n description,\n assignedTo,\n dueDate,\n status,\n });\n }", "addTasks(descriptions){\n descriptions.forEach(function(item){\n this.addTask(item);}.bind(this));\n }", "function addTask(req,res){\n\t\n\tconsole.log('******',req.body);\n\t\n\t// taskList.push(req.body);\n\tTodoList.create({\n\t\ttaskName:req.body.taskName,\n\t\tcategory:req.body.category,\n\t\tdueDate:req.body.dueDate\n\t},\n\t\tfunction(err, toDoList){\n\t\t\tif(err){\n\t\t\t\tconsole.log(\"Error in adding tasks\");\n\t\t\t\treturn\n\t\t\t}\n\t\t\tconsole.log('*******', toDoList);\n\t\t\treturn res.redirect('back');\n\t\t}\n\t)\t\n\t}", "function addTask(event) {\n event.preventDefault();\n const taskDiv = document.createElement(\"div\");\n taskDiv.classList.add(\"task\");\n\n //List - append\n const newTask = document.createElement(\"li\");\n newTask.innerText = inpTask.value;\n newTask.classList.add(\"task-item\");\n taskDiv.appendChild(newTask);\n\n //Legg til i liste lokalt på pc\n\n saveLocalTasks(inpTask.value);\n\n\n //Done-button\n const doneBtn = document.createElement(\"button\");\n doneBtn.innerHTML = \"Done\";\n doneBtn.classList.add(\"done-btn\");\n taskDiv.appendChild(doneBtn);\n\n //Delete-button\n const deleteBtn = document.createElement(\"button\");\n deleteBtn.innerHTML = \"Delete\";\n deleteBtn.classList.add(\"del-btn\");\n taskDiv.appendChild(deleteBtn);\n\n //Add div to list\n taskList.appendChild(taskDiv);\n\n //Remove inp value\n inpTask.value = \"\";\n\n}", "addTask(task) {\n const taskList = this.state.taskList;\n\n // might want to arrange this as a dictionary later on\n let newTask = {\n // generate unique id\n id: crypto.randomBytes(16).toString(\"hex\"),\n name: task[0],\n date: task[1],\n type: task[2],\n isFinished: task[3],\n notes: task[4]\n }\n\n // add the new task into the state\n this.setState({\n taskList: taskList.concat(newTask),\n taskListLength: taskList.length,\n })\n\n // API call to insert into DB \n this.createNewTask(newTask);\n }", "function saveTask(){\n var title = UI.$txtTitle.val();\n var date = UI.$txtDate.val();\n var desc = UI.$txtDescription.val();\n var location = UI.$txtLocation.val();\n\n // Create task object\n var task = new Task(title, important, date, desc, alert, location);\n\n //Push into task array\n taskList.push(task);\n\n // clear the form\n clearForm();\n\n console.log(taskList);\n\n\n //Parsify this Task Object to string. \n // var data = JSON.stringify(task);\n //http request \n // save the task on the backend\n // 'send Task Object to our server database\n $.ajax({\n // Url is always a string type\n url: 'http://fsdi.azurewebsites.net/api/tasks',\n //POST b/c we're sending and recieving data\n type: 'POST',\n // data to be sent. Parse to string. \n data: JSON.stringify(task),\n\n //Always used with 'data' to specify what type\n contentType: \"application/json\",\n success: function(res){\n //print our server repsponse\n console.log(res);\n //show success to user\n $('#alertSuccess').removeClass('hide');\n\n //set a timer(mili) to remove \n setTimeout(function(){\n //hide success to user\n $('#alertSuccess').addClass('hide');\n } , 3000);\n },\n error: function(details){\n //print if error \n console.log(\"Error :(\", details);\n }\n\n\n });\n\n //show success to user\n $('#alertSuccess').removeClass('hide');\n\n}", "function new_Task(response, request)\n{\n if(request.method== \"POST\")\n {\n var body = '';\n\n request.on('data', function (data) {\n body += data;\n });\n request.on('end', function ()\n {\n body = qs.parse(body);\n\n\n\n task_tab.tasks_tab_entries(body.taskName, body.taskDepartment, body.taskStartDate, body.taskEndDate, body.taskProject, body.task_Description, response);\n });\n }\n}", "addTask(newTask){\n this.tasks.push(newTask);\n }", "function getTask(){\n // Clear UL of all task before adding new one...\n document.getElementById(\"taskList\").innerHTML = \"\";\n // Input value\n let getTask = document.getElementById(\"task\").value;\n \n if(getTask === null || getTask === \"\" || getTask === undefined) return false;\n // Timeduration for new task\n let timeDuration = document.getElementsByName(\"timeDuration\");\n \n let pickedTime;\n for(let i = 0; i < timeDuration.length; i++){\n if(timeDuration[i].checked){\n pickedTime = timeDuration[i].value;\n }\n }\n // Creating timestamp\n let getTimeStamp = (new Date().getTime() + Number(pickedTime*1000));\n // Object for task\n let objTask = {\n task: getTask,\n time: getTimeStamp,\n classState: \"list-group-item mb-1\"\n };\n \n allObjTask.push(objTask);\n \n // Set LS\n localStorage.setItem('items', JSON.stringify(allObjTask));\n // Restarting Input field\n document.getElementById(\"task\").value = \"\";\n // Printing new task in UI\n printUI();\n}", "function addTasks(e) {\n\t\n\t//Condition to check the user input, if not an empty string add the task\n\tif(inputElem.value !== '') {\n\t\t\n\t\t//addTaskTitle();\n\t\t\n\t\t//focusing the input for guiding the user to add next task\n\t\tinputElem.focus();\n\t\t\n\t\t//Creating new div and li element and append it to output div\n\t\tconst div = document.createElement('div');\n\t\t\t\t\n\t\tconst newTask = document.createElement('li');\n\t\tnewTask.appendChild(document.createTextNode(inputElem.value));\n\t\t\t\t\t\n\t\tconst checkBox = document.createElement('input');\n\t\tcheckBox.type = 'checkbox';\n\t\tcheckBox.className = 'done';\n\t\t\t\t\t\n\t\tdiv.appendChild(checkBox);\n\t\tdiv.appendChild(newTask);\n\t\t\t\t\t\n\t\tconst listOfTask = document.querySelector('.output');\n\t\tlistOfTask.appendChild(div);\n\t\t\n\t\t//Making the input value to empty string\n\t\tinputElem.value = '';\n\t\t\n\t\t\n\t\t//edit and remove button added to the end\n\t\tconst editButton = document.createElement('button');\n\t\teditButton.className = 'edit-button';\n\t\teditButton.appendChild(document.createTextNode('Edit'));\n\t\t\n\t\tdiv.appendChild(editButton);\n\t\t\n\t\t//adding event listener to edit button\n\t\teditButton.addEventListener('click', editTasks);\n\t\t\n\t\tconst removeButton = document.createElement('button');\n\t\tremoveButton.className = 'remove-button';\n\t\tremoveButton.appendChild(document.createTextNode('Remove'));\n\t\t\n\t\tdiv.appendChild(removeButton);\n\t\t\n\t\t//adding event listener to remove button\n\t\tremoveButton.addEventListener('click', removeTask);\n\t\t\n\t\t//adding eventlistener to checkBox\n\t\tcheckBox.addEventListener('change', strikeTask);\n\t}\n\t\n\telse {\n\t\terror();\n\t}\n\t\n\t\n\t//Prevent default behaviour of form element\n\te.preventDefault();\n}", "function saveTask(e){\n // Get task value from form\n var taskName = document.getElementById(\"taskName\").value;\n\n // Validation\n if(validateForm(taskName) == false){\n return false;\n }\n // Create JS task object\n var task = {\n name: taskName\n }\n // Store in local storage\n // If ARRAY with tasks in LOCALSTORAGE == NULL\n if(localStorage.getItem(\"storedTasks\") === null){\n // Create new task array\n var storedTasks = [];\n // Add taskl object to array\n storedTasks.push(task);\n // Store new array in localStorage\n localStorage.setItem(\"storedTasks\", JSON.stringify(storedTasks));\n } else {\n var storedTasks = JSON.parse(localStorage.getItem(\"storedTasks\"));\n storedTasks.push(task);\n // Store new array in localStorage\n localStorage.setItem(\"storedTasks\", JSON.stringify(storedTasks));\n }\n\n // Clear Form\n document.getElementById(\"taskForm\").reset();\n // Get tasks\n getTasks();\n // Prevent form submission\n e.preventDefault();\n}", "function addTask(e){\n e.preventDefault();\n \n // 3. read what is inside the input / validate input\n const taskName = inputTask.value.trim();\n const taskDescr = inputDescription.value.trim();\n const taskDate = inputDate.value.trim();\n \n \n if (taskName.length > 0 && taskDescr.length > 0 && taskDate.length > 0) {\n const startBtn = el(\"button\", \"Start\", {className: \"green\"});\n const finishBtn = el(\"button\", \"Finish\", {className: \"orange\"});\n const deleteBtn = el(\"button\", \"Delete\", {className: \"red\"});\n \n const btnDiv = el(\"div\", [\n startBtn,\n deleteBtn,\n ], {className: \"flex\"});\n const task = el(\"article\", [\n el(\"h3\", taskName),\n el(\"p\", `description: ${taskDescr}`),\n el(\"p\", `Due Date: ${taskDate}`),\n btnDiv\n ])\n startBtn.addEventListener(\"click\", () => {\n progressDiv.appendChild(task);\n startBtn.remove();\n btnDiv.appendChild(finishBtn);\n })\n finishBtn.addEventListener(\"click\", () => {\n finishDiv.appendChild(task);\n btnDiv.remove();\n })\n deleteBtn.addEventListener(\"click\", () => {\n task.remove();\n })\n openDiv.appendChild(task);\n }\n }", "function addTask(event) {\n\tevent.preventDefault();\n\tvar array = ['Title', 'Name', 'Description'];\n\tfor (i=0;i < array.length;i++) {\n\t\tdocument.getElementById('add' + array[i]).value = '';\n\t}\n\tif(form.style.display == \"block\") {\n\t\tform.style.display = \"none\";\n\t} else {\n\t\tpanel.style.display = 'none';\n\t\tform.style.display = \"block\";\n\t\tvar add = document.createElement('a');\n\t\tfunction setAttributes(el, attrs) {\n\t\t for(var key in attrs) {\n\t\t el.setAttribute(key, attrs[key]);\n\t\t }\n\t\t}\n\t\tsetAttributes(add, {\"href\": \"#\", \"id\": \"saveTask\", \"class\": \"todo__btn\"});\n\t\tadd.innerHTML = 'Save changes';\n\t\tform.insertBefore(add, form.children[4]);\n\t}\n\tdocument.getElementById('saveTask').addEventListener('click', saveTask);\n}", "function addTask(newTask) {\n //create list element and set its class\n const newTaskItem = document.createElement('li');\n newTaskItem.setAttribute('class', 'task_item');\n\n // create checkbox element and set its type and class\n const newCheckBtn = document.createElement('div');\n newCheckBtn.setAttribute('class', 'task_check_btn');\n\n // create span element and set its class and add new task input\n const newTaskBio = document.createElement('span');\n newTaskBio.setAttribute('class', 'task_bio');\n\n // add input value to li\n newTaskBio.innerText = newTask;\n\n // insert li tag inside the ul tag\n taskList.appendChild(newTaskItem);\n\n // insert checkbox to li\n newTaskItem.appendChild(newCheckBtn);\n\n // insert newTask into li\n newTaskItem.appendChild(newTaskBio);\n\n // run Function when task is completed and checkbox is check.\n onTaskComplete(newCheckBtn);\n}", "function addTask(e){\n \n e.preventDefault();\n const taskTitle = document.querySelector('.task-title').value;\n const taskID = document.getElementById('id').value;\n if(taskTitle.trim()=== ''){\n ui.showAlertMessage('Please enter valid information','alert alert-danger');\n //console.log('Please enter valid information');\n }else{\n const data = {\n title : taskTitle,\n complete : false, \n }\n http.post('http://localhost:3000/Tasks',data)\n .then(data=>{\n ui.clearFiled();\n //showing message\n ui.showAlertMessage('New Task added successfully','alert alert-success');\n //getting tasks\n getTasks();\n });\n }\n \n}", "function saveTasksUpdates() {\n var updates = [];\n $('#index-page ul.connected').each(function(i, ul) {\n $(ul).find('li').each(function(i, li) {\n updates.push({\n id: $(li).attr('name'),\n description: $(li).find('.description').text(),\n duration: $(li).find('.duration').text(),\n labels: $(li).find('.labels').text(),\n status: $(ul).attr('id'),\n rank: i\n });\n });\n });\n\n $.ajax({\n url: '/task/update_via_json',\n type: 'POST',\n contentType: \"application/json; charset=utf-8\",\n data: JSON.stringify({\n updates: updates\n }),\n error: function(data) {\n alert(JSON.parse(data.responseText).message);\n }\n });\n\n updateTimesAndPercentages(updates);\n highlightFirstItem();\n }", "function addToTaskList(name, date, status){\r\n let task = document.createElement('li');\r\n task.classList.add('task');\r\n\r\n let taskActions = document.createElement('div');\r\n taskActions.classList.add('taskActions');\r\n\r\n let editTask = document.createElement('button');\r\n editTask.classList.add('editTask');\r\n editTask.innerHTML = editTaskIcon;\r\n\r\n let removeTask = document.createElement('button');\r\n removeTask.classList.add('deleteTask');\r\n removeTask.innerHTML = removeTaskIcon;\r\n // On click remove task icon, remove task from task list \r\n removeTask.addEventListener('click', removeTaskItem);\r\n\r\n let checkComplete = document.createElement('label');\r\n // check the value of task status, and add checked attribute if needed \r\n (status == 1) ? status = 'checked' : '';\r\n checkComplete.classList.add('checkbox-container', 'taskStatus');\r\n checkComplete.innerHTML = `<input type=\"checkbox\" ${status}/><span class=\"checkmark\"></span>`;\r\n // On click, set taskStatus as completed(1)\r\n checkComplete.querySelector('input').addEventListener('click', setTaskStatus);\r\n\r\n let taskHeading = document.createElement('p');\r\n taskHeading.classList.add('taskName');\r\n taskHeading.innerText = name;\r\n\r\n let taskDescr = document.createElement('p');\r\n taskDescr.classList.add('taskDescr');\r\n //taskDescr.innerText = name;\r\n\r\n taskActions.appendChild(editTask);\r\n taskActions.appendChild(removeTask);\r\n\r\n task.appendChild(checkComplete);\r\n task.appendChild(taskHeading);\r\n task.appendChild(taskDescr);\r\n task.appendChild(taskActions);\r\n\r\n toDoList.appendChild(task);\r\n}", "function add() {\n var task = document.getElementById(\"task\").value;\n\n document.getElementById(\"task\").value = \"\";\n\n var d = new Date();\n var h = d.getHours();\n var m = d.getMinutes();\n var s = d.getSeconds();\n if (m < 10) {\n m = `0${m}`;\n }\n if (s < 10) {\n s = `0${s}`;\n }\n var text = `(${h}:${m}:${s})`;\n\n var todos = get_todos();\n\n if (task !== \"\") {\n todos.push(`${task} - ${text}`);\n localStorage.setItem(\"todo\", JSON.stringify(todos));\n show();\n }\n\n return false;\n}", "async addTask(input = { tasklistId: '0' }) {\n\n return await this.request({\n name: 'task.add',\n args: [input.tasklistId],\n params: {\n 'todo-item': input['todo-item']\n }\n });\n\n }", "function addTask() {\r\n let text = document.getElementById(\"inptTxt\").value;\r\n let date = document.getElementById(\"inptDate\").value;\r\n let time = document.getElementById(\"inptTime\").value;\r\n\r\n //validation checks \r\n // I didn't put in a submit button to check required feilds because in that case if there was a date missing the text in the text area would have been earased,\r\n //and I wanted the text to stay even in a case that there was not date - to give user chance to put in a date without loosing text\r\n \r\n //date and text are required\r\n if (!text) {\r\n alert('Task text should not be empty - Please enter text');\r\n }\r\n else if (!date) {\r\n alert('Date must be supplied - please enter date');\r\n }\r\n //checks date and time have not passed\r\n else if (!checkDate(date, time)) {\r\n alert('Date and/or time supplied has past - Please enter a new date or time');\r\n document.getElementById(\"inptDate\").value = null;\r\n document.getElementById(\"inptTime\").value = null;\r\n }\r\n else {\r\n let tempTask = new Task(text, date, time);\r\n //if the array is empty the first id will be one if it is not then it will put one larger then the last id\r\n if (tasks.length > 0) {\r\n tempTask.id = Number(tasks[tasks.length - 1].id + 1);\r\n }\r\n else {\r\n tempTask.id = Number(1);\r\n }\r\n //adds new task to local storage\r\n tasks.push(tempTask);\r\n localStorage.tasks = JSON.stringify(tasks);\r\n showTasksOnPage();\r\n }\r\n\r\n}", "function addTask(newTask) {\n // console.log(newTask);\n axios.post(\"/tasks\",newTask)\n .then(function (response) {\n newTask.Id = response.data;\n console.log(response.data);\n const path = location.pathname;\n axios.post(path,{task:newTask.Id})\n .then((res) => {\n });\n setTasks(prevTasks => {\n return [...prevTasks, newTask];\n });\n })\n .catch(function (error){\n console.log(error)\n });\n }", "function addTask(event) {\n event.preventDefault();\n const number = form.task.value;\n const task = {\n userId: 1,\n title: form.task.value,\n completed: false\n }\n const data = JSON.stringify(task);\n const url = 'https://jsonplaceholder.typicode.com/todos';\n const headers = new Headers({\n 'Accept': 'application/json',\n 'Content-Type': 'application/json'\n });\n const request = new Request(url,\n {\n method: 'POST',\n header: headers,\n body: data\n }\n )\n fetch(request)\n .then( response => response.json() )\n .then( task => console.log(`Task saved with an id of ${task.id}`) )\n .catch( error => console.log('There was an error:', error))\n}", "async addTasklist(input = { projectId: '0' }) {\n\n return await this.request({\n name: 'tasklist.add',\n args: [input.projectId],\n params: {\n 'todo-item': input['todo-item']\n }\n });\n\n }", "function addTask(id, taskManager, projectName) {\n \n //content HTML parent\n const content = document.getElementById(\"content\");\n\n //the container\n const addNewTaskDiv = document.createElement(\"div\");\n addNewTaskDiv.id = \"add-new\";\n \n //contains the form with display-none\n const hiddenContainer = document.createElement(\"div\");\n hiddenContainer.classList.add(\"hidden-container\");\n hiddenContainer.style.display = \"none\";\n \n //contains submit and cancel btns\n const hiddenButtons = document.createElement(\"div\");\n hiddenButtons.classList.add(\"hidden-buttons\");\n hiddenButtons.style.display = \"flex\";\n \n //the form where user inputs task info\n const form = formConstructor(\"add-task\");\n hiddenContainer.appendChild(form);\n \n //add task btn\n const addNewBtn = btnConstructor(\"add-new-btn\", \"+\", \"block\");\n \n //on click display hidden form and hide add task btn\n addNewBtn.addEventListener('click',() => {\n\n toogleVisibility(hiddenContainer, \"block\");\n toogleVisibility(addNewBtn, \"none\");\n });\n addNewTaskDiv.appendChild(addNewBtn);\n \n //submit btn\n const submitBtn = btnConstructor(\"submit-btn\", \"Submit\", \"block\");\n \n //on click event triggers task creation logic\n submitBtn.addEventListener(\"click\", () => {\n //gets values from the input fields and returns and array\n const valuesArray = getValuesForm(\"add-task\");\n //if input != empty\n if(formValidation(valuesArray)) {\n \n taskItem(id, projectName); //create the DOM element \n const taskObj = new Task (id, valuesArray[0], valuesArray[1], valuesArray[2], valuesArray[3]); //create the coresponding object\n taskManager.set(`task-${id}`, taskObj); //map() stores the obj\n localStorage.setItem(nameForLocalStorage(projectName), JSON.stringify(Array.from(taskManager.entries())));//localy store map() with the projects name\n id ++;\n localStorage.setItem(\"id\", id); //localy store id\n setTask(taskObj); //fills the DOM element with the taskobj values\n clearForm(\"add-task\"); //clears form\n toogleVisibility(hiddenContainer, \"none\");\n toogleVisibility(addNewBtn, \"block\");\n document.getElementById(\"all-required\").style.display = \"none\";\n\n }else {\n\n document.getElementById(\"all-required\").style.display = \"block\";\n }\n });\n hiddenButtons.appendChild(submitBtn);\n \n //cancel button\n const cancelBtn = btnConstructor(\"cancel-btn\", \"Cancel\", \"block\");\n \n //cancels the form and hides it\n cancelBtn.addEventListener(\"click\", () => {\n\n document.getElementById(\"all-required\").style.display = \"none\";\n toogleVisibility(hiddenContainer,\"none\");\n toogleVisibility(addNewBtn, \"block\");\n clearForm(\"add-task\");\n });\n hiddenButtons.appendChild(cancelBtn);\n \n //append all elements to the DOM element\n hiddenContainer.appendChild(hiddenButtons);\n addNewTaskDiv.appendChild(hiddenContainer);\n content.appendChild(addNewTaskDiv);\n}", "function agregar(e) {\n\t\tsetTasks(e);\n\t}", "function loadJSON(){\n if(localStorage){\n if(localStorage.taskjson){\n var taskArray = JSON.parse(localStorage.taskjson);\n taskArray.forEach(function(taskObject,index){\n var ul = document.getElementsByTagName(\"fieldset\")[1].children[1];\n var li = document.createElement(\"li\");\n li.innerHTML=taskObject.id+ \" \"+taskObject.name+\" \"+taskObject.desc;\n li.addEventListener(\"click\",toogleTask);\n ul.appendChild(li);\n });\n taskId = taskArray.length;\n taskOperations.taskList = taskArray;\n }\n }\n}", "function loadTasks() {\n fetch('/list-tasks').then(response => response.json()).then((tasks) => {\n const taskListElement = document.getElementById('task-list');\n tasks.forEach((task) => {\n taskListElement.appendChild(createTaskElement(task));\n })\n });\n}", "function handAddTask(event) {\n\t\tif (event.keyCode == 13 && task !== \"\") {\n\t\t\t//&& task !== \"\" que no suceda cuando este vacio\n\t\t\tsetListarray([...listarray, task]);\n\t\t\tsetTask(\"\"); //esto sirve para evitar que agrege cosas en blanco\n\t\t}\n\t\t//keycode es para asignar una letra al keyup, 13 es codigo del enter\n\t\t//es agregar todo lo que ya tenia mas la nueva, list tiene toda la lista de tarea\n\t}", "function addTask() {\n 'use strict';\n\n // Get the task:\n var task = document.getElementById('task');\n\n // Reference to where the output goes:\n var output = document.getElementById('output');\n\n \n // For the output:\n var message = '';\n\n if (task.value) {\n \n // Add the item to the array:\n tasks.push(task.value);\n \n // Update the page:\n message = '<h2>To-Do</h2><ol>';\n for (var i = 0, count = tasks.length; i < count; i++) {\n message += '<li>' + tasks[i] + '</li>';\n }\n message += '</ol>';\n output.innerHTML = message;\n \n } // End of task.value IF.\n\n \n\n // Return false to prevent submission:\n return false;\n \n} // End of addTask() function.", "function Task() {\n // const getTask = (name, priority, date, projectid) => {\n // const task = {};\n // const storage = StorageTasks();\n // const dataSize = storage.getDataLength(TASK_KEY);\n // task.name = name;\n // task.id = dataSize;\n // task.priority = priority;\n // task.duedate = date;\n // task.projectid = projectid;\n // return task;\n // };\n // const AppendTasksToContainer = (tasksArr, tasksDiv) => {\n // for (let i = 0; i < tasksArr.length; i++) {\n // const item = document.createElement(\"li\");\n // item.setAttribute(\"data-id\", tasksArr[i].id);\n // item.setAttribute(\"id\", \"task-item\");\n // item.innerText = `${tasksArr[i].name} ${tasksArr[i].priority} ${tasksArr[i].duedate}`;\n // const delBtn = document.createElement(\"button\");\n // delBtn.innerText = \"del\";\n // delBtn.setAttribute(\"id\", \"task-delete\");\n // delBtn.setAttribute(\"data-id\", tasksArr[i].id);\n // item.appendChild(delBtn);\n // tasksDiv.appendChild(item);\n // }\n // return tasksDiv;\n // };\n // const makeTaskList = (tasksArr) => {\n // const tasksDiv = document.createElement(\"ul\");\n // tasksDiv.setAttribute(\"id\", \"tasks-list\");\n // return AppendTasksToContainer(tasksArr, tasksDiv);\n // };\n // const getTasksContainer = () => document.querySelector(\"#tasks-list\");\n // const removeTasks = () => {\n // const tasksContainer = getTasksContainer();\n // while (tasksContainer.firstChild) {\n // tasksContainer.removeChild(tasksContainer.firstChild);\n // }\n // };\n // const updateTaskListDisplay = (tasksArr) => {\n // removeTasks();\n // const TasksContainer = getTasksContainer();\n // return AppendTasksToContainer(tasksArr, TasksContainer);\n // };\n // return { getTask, makeTaskList, updateTaskListDisplay };\n}", "function appendNewTask() {\n $.ajax({\n type: 'GET',\n url: '/task/newtask',\n success: function(data){\n for (var i = 0; i < data.length; i++) {\n $('#newTasksContainer').append(\n '<div class=\"newTaskLine\"><input data-id=\"' + data[i].id +\n '\" class=\"checkbox\" type=\"checkbox\" name=\"complete' + [i] +\n '\"><p class=\"tasks\">' + data[i].task +\n '</p><button data-id=\"' + data[i].id +\n '\" class=\"delete\">DELETE</button></div>');\n }\n }\n });\n}", "function addTaskToList(task, list){\r\n //What is the task? @parameter task\r\n //Where is the task going? @List Parameter\r\n //What order / priority? lowest on the bottom(push)\r\n return list.push({\r\n text: task, completed: false\r\n });\r\n}", "function initialpostTask() {\n event.preventDefault();\n var task = {};\n $.each($('#task-input').serializeArray(), function(i, field) {\n task[field.name] = field.value;\n });\n // $.each($('#registerPet').serializeArray(), function(i, field) {\n // pet[field.name] = field.value;});\n task.taskStatus = \"NO\";\n $.ajax({\n type: 'POST',\n url: '/tasks',\n data: task,\n success: function() {\n console.log(\"task was posted to db\");\n document.getElementById(\"taskSummary\").value = \"Task Description:\";\n document.getElementById(\"taskName\").value = \"Task:\";\n // document.getElementById(\"#summary\").children().value = \"Summary of Task...\"\n getTasks();\n },\n error: function() {\n\n console.log('/POST didnt work');\n }\n\n });\n}", "function addTask(task){\n var txt = document.createTextNode(task);\n var li = document.createElement(\"LI\");\n li.appendChild(txt);\n li.id=counter;\n counter++;\n myTaskList.incomplete.push(li);\n addCloseButton(li);\n addChecked(li);\n updateTaskList();\n}", "function loadList(array) {\n array.forEach(function (item) {\n addTask(item.name, item.id, item.done, item.trash);\n });\n}", "function addTask () {\r\n tasks.setSelected(tasks.add())\r\n taskOverlay.hide()\r\n\r\n tabBar.updateAll()\r\n addTab()\r\n}", "function saveButtonClicked(event) {\n event.preventDefault(); // prevent default action for the submit button to trigger\n\n var title = taskTitle.value; // assign values from input box to the array\n\n var description = taskDescription.value;\n var assignedTo = taskAssignedTo.value;\n var date = taskDueDate.value;\n var time = taskDueTime.value;\n var status = selectedStatus(); // returns value for the radio button depending on the selection\n\n if (validationTaskForm(title, description, assignedTo, date, status)) {\n // check all parameters passed to this function\n if (!taskForm.classList.item(0)) {\n // if index does not match, go to add task\n taskManager.addTask(title, description, assignedTo, date, time, status); // add task function\n\n refreshPage(); // refresh the page (clears inner HTML and list the updated array)\n\n clearAllFieldValues(); // clear all field value and assign null to fields and false to radio button value\n\n clearValidations(); // removes all is-invalid and is-valid classes to the span elements\n\n statusStats(); // updates status counter\n } else {\n var id = taskForm.classList.item(0); // assigns array position 0 to the id (id=0)\n\n var task = {\n id: id,\n title: title,\n description: description,\n assignedTo: assignedTo,\n date: date,\n time: time,\n status: status\n };\n taskManager.editTask(task); // if index match, go to edit task\n\n refreshPage(); // refresh the page (clears inner HTML and list the updated array)\n\n clearAllFieldValues(); // clear all field value and assign null to fields and false to radio button value\n\n clearValidations(); // removes all is-invalid and is-valid classes to the span elements\n\n statusStats(); // updates status counter\n // Local Storage Update Task\n\n var mynewtasks = JSON.parse(localStorage.getItem(\"mytasks\")); // alert(mynewtasks.length);\n\n for (var i = 0; i < mynewtasks.length; i++) {\n // alert(mynewtasks[i].id);\n // alert(id);\n if (mynewtasks[i].id == id) {\n // alert(\"Inside For Loop\");\n mynewtasks[i].title = title;\n mynewtasks[i].description = description;\n mynewtasks[i].assignedTo = assignedTo;\n mynewtasks[i].date = date;\n mynewtasks[i].time = time;\n mynewtasks[i].status = status;\n localStorage.setItem(\"mytasks\", JSON.stringify(mynewtasks));\n break;\n }\n }\n\n taskForm.classList.remove(\"\".concat(id)); // removed the class id from the task form\n }\n\n $(\"#newTaskInput\").modal(\"hide\"); // new task modal hidden\n } else {\n alert(\"Please complete all fields.\"); // else alert to complete all fields\n }\n\n refreshPage(); // clear innerHTML and creates a list of all the items in the array\n\n statusStats(); // update status counter buttons\n}", "updateAllTasks(){\n const taskField = document.getElementById(\"task-field\")\n let targetTeamId = this.teamId;\n // let teamTasks = Task.all.filter(task => task.teamId === targetTeamId)\n let teamTasks = Task.all.filter(task => task.teamId === targetTeamId).sort(function(a, b){return a.urgency - b.urgency}).sort(function(a, b){return a.dueDate - b.dueDate}).sort(function(a, b){return a.complete - b.complete})\n let taskArr = ''\n // d\n for (const task of teamTasks){\n taskArr += task.createTaskForDom()\n }\n taskField.innerHTML = taskArr;\n document.querySelectorAll(\".complete\").forEach(btn => btn.addEventListener(\"click\", completeStatus));\n document.querySelectorAll(\".delete-tasks\").forEach(btn => btn.addEventListener(\"click\", removeTask));\n }", "function handleAddTask(e) {\n const taskName = taskNameRef.current.value\n if (taskName === '') return e.preventDefault()\n setTasks(prevTask => {\n return [...prevTask, { \n id: uuidv4(), \n name: taskName, \n complete: false\n }]\n })\n taskNameRef.current.value = null\n\n e.preventDefault()\n }", "function addToDo() {\n let tasks = document.getElementById('tasks')\n let newTask = document.createElement('li')\n let lastTask = tasks.appendChild(newTask)\n lastTask.innerHTML = document.getElementById('new-task-description').value;\n }", "function addEmptyTask() {\n $(\"#taskList\").append(\n \"<task class=\\\"task\\\">\" +\n \"<text class=\\\"action\\\"></text> \" +\n \"<date class=\\\"action\\\"></date> \" +\n \"<button onclick='model.editTask(this)'>Edit</button> \" +\n \"<button onclick='model.deleteTask(this)'>Delete</button> \" +\n \"<label for=\\\"action\\\">Done</label> \" +\n \"<input class=\\\"checkBox\\\" onclick='model.updateTask(this)' type=\\\"checkbox\\\">\" +\n \"<br>\" +\n \"</task>\"\n );\n }" ]
[ "0.74009436", "0.73298407", "0.7279283", "0.71342075", "0.7107193", "0.70822555", "0.7081464", "0.69990146", "0.6975628", "0.6961249", "0.6958753", "0.69441974", "0.6937239", "0.6922008", "0.69003916", "0.6893678", "0.6887847", "0.6885101", "0.68815035", "0.68679476", "0.6863992", "0.6856577", "0.6832412", "0.68216276", "0.673647", "0.67144555", "0.6713792", "0.6705619", "0.66879356", "0.6665333", "0.6622766", "0.6592207", "0.65858996", "0.6584348", "0.6574235", "0.65693223", "0.656539", "0.6555729", "0.6548804", "0.65308076", "0.6522119", "0.65213335", "0.6520768", "0.65145284", "0.6512809", "0.65049005", "0.6482001", "0.6477951", "0.6472634", "0.64645827", "0.64632124", "0.6456891", "0.64378184", "0.6424953", "0.6424418", "0.6423488", "0.64182466", "0.64166373", "0.6409499", "0.6408931", "0.6408612", "0.6407144", "0.64018124", "0.6399542", "0.6396878", "0.6386355", "0.63762504", "0.63688695", "0.6362399", "0.63599694", "0.63526845", "0.63509345", "0.6324211", "0.6321534", "0.6315151", "0.63032526", "0.630076", "0.62981623", "0.6289204", "0.6278872", "0.6273945", "0.6265692", "0.62580955", "0.62580657", "0.62521", "0.62479866", "0.62478024", "0.6245953", "0.62380207", "0.62239367", "0.62222064", "0.6221366", "0.6215918", "0.6212998", "0.621164", "0.6211451", "0.6201973", "0.6200502", "0.62001914", "0.6199469" ]
0.66647017
30
loads the JSON allTasks from local storage, if ther is no 'data' it will be created
function loadTasks() { load(); showMyJSON(); //if (localStorage.getItem('data') == null) { //if ther is no existing 'data' file in localStorage it will be created // localStorage.setItem('data', JSON.stringify([])); //} else { // let tasksString = localStorage.getItem('data'); // allTasks = JSON.parse(tasksString); //} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadData() {\n ul.innerHTML = \"\";\n taskList.loadFromJson(JSON.parse(localStorage.getItem(\"tasks\")) || []);\n taskList.getAllTasks().forEach(task => loadTask(task));\n}", "load() {\n if (localStorage.getItem('tasks')) {\n const tasksJson = localStorage.getItem('tasks');\n this.tasks = JSON.parse(tasksJson);\n }\n if (localStorage.getItem('currentId')) {\n const currentId = localStorage.getItem('currentId');\n this.currentId = Number(currentId);\n }\n }", "load(){\n this.list = []; \n $(\"#theTasks\").empty();\n var descriptionArray = JSON.parse(localStorage.getItem(this.key));\n this.addTasks(descriptionArray);\n\n }", "function loadTasks() {\n return JSON.parse(localStorage.getItem(KEY_TASKS) || \"[]\");\n}", "load() {\n // Check if any tasks are saved in localStorage\n if (localStorage.getItem(\"tasks\")) {\n // Get the JSON string of tasks in localStorage\n const tasksJson = localStorage.getItem(\"tasks\");\n\n // Convert it to an array and store it in our TaskManager\n this.tasks = JSON.parse(tasksJson);\n }\n\n // Check if the currentId is saved in localStorage\n if (localStorage.getItem(\"currentId\")) {\n // Get the currentId string in localStorage\n const currentId = localStorage.getItem(\"currentId\");\n\n // Convert the currentId to a number and store it in our TaskManager\n this.currentId = Number(currentId);\n }\n }", "load() {\n // Check if any tasks are saved in localStorage\n if (localStorage.getItem(\"tasks\")) {\n // Get the JSON string of tasks in localStorage\n const tasksJson = localStorage.getItem(\"tasks\");\n\n // Convert it to an array and store it in our TaskManager\n this.tasks = JSON.parse(tasksJson);\n }\n\n // Check if the currentId is saved in localStorage\n if (localStorage.getItem(\"currentId\")) {\n // Get the currentId string in localStorage\n const currentId = localStorage.getItem(\"currentId\");\n\n // Convert the currentId to a number and store it in our TaskManager\n this.currentId = Number(currentId);\n }\n }", "loadTask() {\n \n //check if the localStoge is empty\n if (localStorage.getItem('tasks')) {\n const tasksJson = localStorage.getItem('tasks');\n // convert into array\n this.tasks = JSON.parse(tasksJson);\n }\n //check if the currentId is save in localStorage\n if (localStorage.getItem('currentId')) {\n const currentId = localStorage.getItem('currentId');\n\n //convert the currentId to a Number and store in taskManager\n this.currentId = Number(currentId);\n\n }\n}", "function getTask() {\n\tlet tasks;\n\tif(localStorage.getItem('tasks')===null) {\n\t\ttasks = []; \n\t} else {\n\t\ttasks =JSON.Parse(localStorage.getItem('tasks'));\n\t}\n}", "function getTasks() {\n if (!localStorage.getItem('tasks')) {\n tasksArray = [\n { task: 'Drink water' },\n { task: 'Read my book' },\n { task: 'Exercise' },\n { task: 'Take the staris' },\n { task: 'Reply to emails' }\n ];\n populateInput();\n populateTrack();\n } else {\n tasksArray = JSON.parse(localStorage.getItem('tasks'));\n populateInput(tasksArray);\n populateTrack(tasksArray);\n }\n // populateStats(tasksArray); // add later when d3 ready\n}", "function loadData() {\n\tlet data = JSON.parse(localStorage.getItem(\"tasks\"))\n\tlet li = \"\";\n\tfor (let i = 0; i < data.length; i++) {\n\t\tli += dataGenerat(data[i], i);\n\t\t$(\"ul\").html(\"\").append(li);\n\t}\n}", "function getLocalStorageTasks() {\n\n const store = JSON.parse(localStorage.getItem(\"tasks\"));\n // turn object into array to use foreach function and display tasks\n Array.from(store).forEach(elem => renderTask(elem));\n\n return store;\n}", "function datatoLocalstorage() {\r\n localStorage.setItem('tasksData', JSON.stringify(tasksData));\r\n}", "function loadJSON(){\n if(localStorage){\n if(localStorage.taskjson){\n var taskArray = JSON.parse(localStorage.taskjson);\n taskArray.forEach(function(taskObject,index){\n var ul = document.getElementsByTagName(\"fieldset\")[1].children[1];\n var li = document.createElement(\"li\");\n li.innerHTML=taskObject.id+ \" \"+taskObject.name+\" \"+taskObject.desc;\n li.addEventListener(\"click\",toogleTask);\n ul.appendChild(li);\n });\n taskId = taskArray.length;\n taskOperations.taskList = taskArray;\n }\n }\n}", "static getTasks() {\n let tasks;\n if (localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n return tasks;\n }", "function getTasks(){\n let tasks;\n // We want to save the tasks in the local storage \n if(localStorage.getItem('tasks')===null)\n {\n tasks=[];\n }\n else{\n // We want to parse it as JSON coz the local storage accepts only strings\n tasks=JSON.parse(localStorage.getItem('tasks'));\n }\n tasks.forEach(function(task)\n {\n const li=document.createElement('li');\n li.className='collection-item';\n li.appendChild(document.createTextNode(task));\n const link=document.createElement('a');\n link.className='delete-item secondary-content';\n link.innerHTML='<i class=\"fa fa-remove\"></i>';\n li.appendChild(link);\n //Append the li to the ul\n taskList.appendChild(li);\n });\n}", "function storeTaskInLocalStorage(task) {\r\n let tasks;//All Task Will Be Include//\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];//Checking local Storage If Tasks Exist Or Not//\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n\r\n }\r\n tasks.push(task);//Adding Task Will Be Pushed//\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n}", "function storeTaskInLocalStorage(task){\n //Initialize the Tasks Array\n let tasks;\n //getting the Tasks Array from the Local Storage and Checking if there is no Tasks yet, Define it as Empty Array\n if(localStorage.getItem('tasks') == null){\n tasks = [];\n //Else Take it ready and assign it to Tasks Array\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n //Push th Task to it\n tasks.push(task)\n //Save it back to the Local Storage\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function getTasks()\n{\n let tasks\n if(localStorage.getItem('tasks') === null)\n {\n tasks=[]\n }\n else\n {\n tasks=JSON.parse(localStorage.getItem('tasks')) \n }\n tasks.forEach(function(task)\n {\n let li = document.createElement('li')\n li.className = 'list-item'\n li.innerText = task \n let link = document.createElement('a')\n link.className = 'item-link'\n let del = document.createElement('i')\n del.className = 'fa fa-remove delete-item'\n link.appendChild(del)\n li.appendChild(link)\n list.appendChild(li)\n\n })\n}", "function getTaskLocalStorage() {\n var tasks;\n // Revisamos los valoes de local storage\n if (localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n return tasks;\n}", "function loadTasks(){\n return fetch(\"/task/json\").then(response=>response.json());\n }", "function getFromLocalStorage() {\n const localSto = localStorage.getItem('listTask')\n\n if(localSto) {\n listTask = JSON.parse(localSto);\n renderTask(listTask)\n }\n}", "function getTasks() {\n let tasks;\n if (localStorage.getItem(\"tasks\")===null) {\n tasks=[];\n }else {\n tasks= JSON.parse(localStorage.getItem(\"tasks\"));\n }\n\n tasks.forEach(function (task) {\n //create li element\n\n const li = document.createElement(\"li\")\n\n //add class name\n\n li.className=\"list-group-flush\"\n\n //create text node and append\n\n li.appendChild(document.createTextNode(task));\n\n //create new link element\n\n const link = document.createElement(\"a\")\n\n //add class\n link.className=\" ml-5 fa fa-remove\"\n\n\n //append link to li\n\n li.appendChild(link);\n\n //store in ls\n storeTaskInLocalStorage(task);\n\n //append li to ui\n tasklist.appendChild(li);\n\n});\n}", "function storeTaskInLocalStorage(task){\r\n let tasks;\r\n if(localStorage.getItem('tasks')===null){ // local storage a check korbe task na theake faka array dibe\r\n tasks=[];\r\n }\r\n else{\r\n tasks=JSON.parse(localStorage.getItem('tasks')); // jodi task pay seta k json obejct a dibe\r\n }\r\n tasks.push(task); // new task add hobe\r\n\r\n localStorage.setItem('tasks', JSON.stringify(tasks)); // new task a ke local storage a add korbe\r\n}", "function getTasks() {\n let tasks;\n if (localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n return tasks;\n}", "function addTask() {\n let t = gererateTaskObject();\n allTasks.push(t);\n document.getElementById('loading').classList.remove('d-none');\n tasksString = JSON.stringify(allTasks);\n saveJSONToServer(allTasks)\n .then(function (result) { //then(function (variable vom server))\n console.log('Laden erfolgreich!', result);\n document.getElementById('loading').classList.add('d-none');\n load(); \n })\n .catch(function (error) { // Fehler\n console.error('Fehler beim laden!', error);\n document.getElementById('loading').classList.add('d-none');\n document.getElementById('error').classList.remove('d-none');\n });\n \n //localStorage.setItem('data', tasksString); disabled - the JSON is saved on the Server\n\n emptyFields();\n \n /**\n * The following 5 lines would be a popup which shows the name and the category of the added Tast.\n * It has been replaced by the loading screen\n */\n //let html = \"<div id='popup' class='transparentgray'><div class='popup'><h5>A new Task with the Title \" + t.title + \" has been added!</h5>You have set \" + t.importance + \" and \" + t.urgency + \"!</div></div>\";\n //document.getElementById(\"mainWindow\").insertAdjacentHTML('beforeEnd', html);\n //setTimeout(function () {\n // document.getElementById('popup').remove();\n //}, 5000);\n}", "function getTasks() {\n if (localStorage.getItem('tasks') !== null) {\n var tasks = JSON.parse(localStorage.getItem('tasks'));\n for (var i = 0; i < tasks.length; i++) {\n $$('.taskList').append(`\n <li class=\"accordion-item\">\n <a href=\"#\" class=\"item-content item-link\">\n <div class=\"item-inner\">\n <div class=\"item-title\">${tasks[i].name}</div>\n </div>\n </a>\n <div class=\"accordion-item-content\">\n <div class=\"content-block\">\n <p>${tasks[i].body}</p>\n <p>Due: ${tasks[i].due}</p>\n <br>\n <a id=\"${tasks[i].id}\" class=\"deleteTask button\">Delete</a>\n <br>\n </div>\n </div>\n </li>\n `);\n }\n }\n}", "function saveData() {\n localStorage.removeItem(\"tasks\");\n localStorage.setItem(\"tasks\", JSON.stringify(taskList));\n}", "function storeTasks() {\n localStorage.setItem(\"userTasks\", JSON.stringify(myTimeBlocks));\n }", "function getTasks(){\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n tasks.forEach(function(task){\n const li = document.createElement('li');\n li.className = 'collection-item';\n li.appendChild(document.createTextNode(task));\n const link = document.createElement('a');\n link.className = 'delete-item secondary-content';\n link.innerHTML = '<i class=\"fas fa-times\"></li>';\n li.appendChild(link);\n taskList.appendChild(li);\n });\n}", "function getTasks(){\n // 先检查localStorage是否有内容\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n } else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n // foreach循环一遍,把内容从local\n tasks.forEach(function(task){\n // create li element\n const li = document.createElement('li');\n // add class\n li.className = 'collection-item';\n // create text node and append to li\n li.appendChild(document.createTextNode(task));\n // create new link element\n const link = document.createElement('a');\n // add class\n link.className = 'delete-item secondary-content';\n // add icon html\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // append the link to li\n li.appendChild(link);\n // append li to ul\n ulTaskList.appendChild(li);\n });\n}", "function getTasks() {\n let makeLi;\n if (localStorage.getItem('tasks') === null) {\n makeLi = []\n } else {\n makeLi = JSON.parse(localStorage.getItem('tasks'))\n }\n let item = ''\n for (let j = 0; j < makeLi.length; j++) {\n item = makeLi[j]\n let li = document.createElement('li')\n li.className = 'collection-item'\n let liT = document.createTextNode(item)\n let a = document.createElement('a')\n a.className = 'delete-item secondary-content'\n let i = document.createElement('i')\n i.className = 'fa fa-remove'\n li.appendChild(a)\n a.appendChild(i)\n li.appendChild(liT)\n taskList.appendChild(li)\n //intitialize task\n //check if there is any tasks in LS\n //if tasks === null then tasks = []\n //else tasks = the array from LS\n //loop in tasks array\n //for every item create list item\n //the text is the task\n }\n}", "function fetchTasks(e) {\n // Firstly check wether there is an tasks or not\n let taskContain;\n if (localStorage.length === 0) {\n // There is no data\n taskContain = [];\n } else {\n // There is some data\n taskContain = JSON.parse(localStorage.getItem(\"task\"));\n }\n\n taskContain.forEach(function (task) {\n // Create task item\n const taskItem = document.createElement(\"li\");\n // Adding class\n taskItem.className = \"task-item\";\n // Setting the text inside it\n let taskTxt = document.createTextNode(task);\n taskItem.appendChild(taskTxt);\n // Creating delete btn\n const taskDelBtn = document.createElement(\"a\");\n // Setting attribute\n taskDelBtn.setAttribute(\"href\", \"#\");\n // Adding class to the btn\n taskDelBtn.className = \"delete-task-btn\";\n // Adding icon to our btn\n taskDelBtn.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // Adding btn to task item\n taskItem.appendChild(taskDelBtn);\n // Now adding the whole task item into the item list\n taskLists.appendChild(taskItem);\n // Clear the field after the task added successfully\n });\n}", "static saveTasks() {\n localStorage.setItem('tasks', JSON.stringify(taskArr));\n }", "function storeData(tasks) {\n storedData = localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "getTasks() {\n\t\tif (!localStorage.tasks) {\n\t\t\tlocalStorage.setItem('tasks', '[]');\n\t\t} else {\n\t\t\tconst localTasks = localStorage.getItem('tasks');\n\t\t\tconst todos = JSON.parse(localTasks);\n\t\t\treturn todos;\n\t\t}\n\t}", "function getTasks() {\r\n let tasks;\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n tasks.forEach(function (task) {\r\n // CREATE LI\r\n const item = document.createElement('li');\r\n // ADD CLASS TO LI\r\n item.className = \"collection-item\";\r\n // ADD VALUE TO LI\r\n item.appendChild(document.createTextNode(task));\r\n // CREATE LINK\r\n const link = document.createElement('a');\r\n // ADD CLASS TO LINK\r\n link.className = \"delete-item secondary-content\";\r\n // ADD TAG TO LINK\r\n link.innerHTML = '<i class=\"fas fa-times\"></i>';\r\n // APEND LINK TO LI\r\n item.appendChild(link);\r\n // APEND LI TO UL\r\n taskList.appendChild(item);\r\n });\r\n}", "function saveInLocalStorage(){\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function saveTasks() {\n //local storage is global variable\n localStorage.setItem(tasksKey, angular.toJson($scope.tasks));\n>>>>>>> 8618b52f1f130b0f8450375e3847289e36947cea\n }", "function storeTaskInLocalStorage(task){\n let tasks\n\n // check if theres already something there\n if(localStorage.getItem('tasks') === null) {\n tasks = [] //if not => then set tasks to empty array\n } else {\n // if there's => then get it and convert it to json\n // because localStorage stores only string\n tasks = JSON.parse(localStorage.getItem('tasks'))\n }\n\n // now we got the data from localStorage => it's time to push it\n tasks.push(task)\n\n // now we have to store the data back to localStorage\n // remoember the data should be stored as string\n localStorage.setItem('tasks', JSON.stringify(tasks))\n}", "function getTasks(){\n let tasks;\n if(localStorage.getItem(\"tasks\")===null){\n tasks=[];\n }else{\n tasks=JSON.parse(localStorage.getItem(\"tasks\"))\n }\n\n tasks.forEach(function(task){\n const li=document.createElement(\"li\");\n\n // add class \n li.className= \"collection-item\";\n \n // create text node and append child\n li.appendChild(document.createTextNode(task));\n \n // create new link element\n const link= document.createElement(\"a\");\n \n // add a class\n link.className=\"delete-item secondary-content\";\n \n // add icon html\n link.innerHTML='<i class=\"fa fa-remove\"></i>'\n \n // append the link to li\n li.appendChild(link);\n \n //append li to ul\n taskList.appendChild(li);\n })\n }", "function getTasks() {\r\n let tasks;//All Task Will Be Include//\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];//Checking local Storage If Tasks Exist Or Not//\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n\r\n }\r\n tasks.forEach(task => {\r\n //Tasks In li Element Part Copying//\r\n let li = document.createElement('li');\r\n\r\n li.appendChild(document.createTextNode(task + \" \"));//taskList.value Modifed by task//\r\n let link = document.createElement('a');\r\n link.setAttribute('href', '#');\r\n link.innerHTML = 'x';\r\n li.appendChild(link);\r\n taskList.appendChild(li);\r\n });\r\n\r\n}", "function getTasks(){\r\n\tlet tasks;\r\n\r\n\tif(localStorage.getItem('tasks') === null){\r\n\t\ttasks = [];\r\n\t} else {\r\n\t\ttasks = JSON.parse(localStorage.getItem('tasks'));\r\n\t}\r\n\r\n\ttasks.forEach(function(task){\r\n\t\tlet li = document.createElement('li');\r\n\t\tli.className = 'collection-item';\r\n\t\tli.appendChild(document.createTextNode(task));\r\n\t\r\n\t\tlet linkDelete = document.createElement('a');\r\n\t\t\tlinkDelete.className = 'delete-item secondary-content';\r\n\t\t\tlinkDelete.innerHTML = '<i class=\"fa fa-remove\"></i>';\r\n\t\t\t\r\n\t\tli.appendChild(linkDelete);\r\n\r\n\t\ttaskList.appendChild(li);\r\n\t});\r\n}", "function store() {\n let list = JSON.parse(localStorage.getItem('taskList'));\n if (list !== null) {\n taskList = list;\n } else {\n return list;\n }\n}", "function gettasks() {\n let tasks;\n if(localStorage.getItem('tasks') === null) {\n tasks = [];\n }else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach(function(task){\n // Add li to ul\n const liTodo = document.createElement('li');\n liTodo.className = 'list-group-item';\n liTodo.textContent = task;\n // add li todo text \n const liText = document.createElement('span');\n liText.className = 'badge';\n liText.innerHTML = '<i class=\"glyphicon glyphicon-remove\"></i>'; \n liTodo.appendChild(liText); \n // Add li text to ul\n ulTodo.appendChild(liTodo); \n });\n}", "function storeTaskInLocalStorage(task){\n let tasks;\n if(localStorage.getItem(\"tasks\") === null){\n tasks = []\n }\n else{\n tasks = JSON.parse(localStorage.getItem(\"tasks\"))\n }\n tasks.push(task);\n localStorage.setItem('tasks',JSON.stringify(tasks));\n\n\n}", "function getTasks() {\r\n let tasks;\r\n if (localStorage.getItem(\"tasks\") === null) { //check by key\r\n tasks = [];\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem(\"tasks\")); // returns array of values from the Local Storage and removes the quotes\r\n }\r\n\r\n tasks.forEach(function (task) { // for each element from array of local storage\r\n // Create li element\r\n const li = document.createElement(\"li\");\r\n\r\n // Add a class\r\n li.className = \"collection-item\";\r\n\r\n // Create text node and append to li\r\n li.appendChild(document.createTextNode(task));\r\n\r\n // Create new link element\r\n const link = document.createElement('a');\r\n // Add a class\r\n link.className = 'delete-item secondary-content';\r\n\r\n // Add icon hmtl\r\n link.innerHTML = \"<i class='fa fa-times'></i>\";\r\n\r\n\r\n // Append the link to the li\r\n li.appendChild(link);\r\n\r\n\r\n // Append to UL\r\n\r\n taksList.appendChild(li);\r\n\r\n })\r\n}", "function getTasks(){\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach((task) => {\n let li = document.createElement('li');\n li.className = 'collection-item';\n li.appendChild(document.createTextNode(task));\n\n let link = document.createElement('a');\n link.className = 'delete-item secondary-content';\n link.innerHTML = '<i class=\"fa fa-remove\"><i/>';\n\n li.appendChild(link);\n taskList.appendChild(li);\n });\n}", "function getTasks() {\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach(function(task){\n // Create li element\n const li = document.createElement('li');\n // Add class\n li.className = 'collection-item';\n // Create text node and append to li\n li.appendChild(document.createTextNode(task));\n // Create new link element\n const link = document.createElement('a');\n // Add class\n link.className = 'delete-item secondary-content';\n // Add icon html\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // Append the link to li\n li.appendChild(link);\n\n // Append li to ul\n taskList.appendChild(li);\n });\n}", "function getTasks() {\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach(function(task){\n // Create li element\n const li = document.createElement('li');\n // Add class\n li.className = 'collection-item';\n // Create text node and append to li\n li.appendChild(document.createTextNode(task));\n // Create new link element\n const link = document.createElement('a');\n // Add class\n link.className = 'delete-item secondary-content';\n // Add icon html\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // Append the link to li\n li.appendChild(link);\n\n // Append li to ul\n taskList.appendChild(li);\n });\n}", "function storeTaskInLocalStorage(task){\r\n let tasks;\r\n\r\n // If we do not have any tasks in localStorage we set up empty array\r\n if(localStorage.getItem('tasks') ===null){\r\n tasks = [];\r\n } else {\r\n // If we have some taska we will load them in the variable first\r\n tasks = JSON.parse(localStorage.getItem('tasks'))\r\n }\r\n\r\n // Add new task to the array\r\n tasks.push(task);\r\n\r\n // Store newly created array of tasks in localStorage\r\n localStorage.setItem('tasks', JSON.stringify(tasks))\r\n}", "function saveDataToLocalStorage(data) {\n let tasks = getTasks();\n tasks.push(data);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "async function searchLocal() {\n if (localStorage.getItem(\"tasks\") != null && localStorage.getItem(\"tasks\") != undefined) {\n tasks = JSON.parse(await localStorage.getItem(\"tasks\"));\n createList();\n }\n}", "function storeTaskLS(task){\n let tasks;\n if(localStorage.getItem('tasks')===null){\n tasks=[];\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n tasks.push(task);\n localStorage.setItem('tasks',JSON.stringify(tasks));\n}", "function getTasks() {\n let tasks;\n if (localStorage.getItem(\"tasks\") === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n tasks.forEach(task => {\n const li = document.createElement(\"li\");\n li.className = \"tasks-list__item\";\n li.appendChild(document.createTextNode(task));\n const link = document.createElement(\"a\");\n link.className = \"delete-item li-aside\";\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n li.appendChild(link);\n\n taskList.appendChild(li);\n });\n}", "function getTaskfromLocalStorage(){\r\n let tasks;\r\n///we want to now pull whatever there is in the local storage that can be - either added to tasks array or else tasks can be set as an empty array.\r\n//initialise a tasks varibale to create the array\r\n\r\nif(localStorage.getItem('tasks') === null){\r\ntasks = [];\r\n}else{\r\n tasks = JSON.parse(localStorage.getItem('tasks'))///this will be a string and hence we will have to parse this an object that can be used, hence we will add the \"JSON parse\" wrapper.\r\n}\r\n//We would now want to run a loop and add eack task to the DOM as we do for addTask(); except that when creating a text node and appending it to li we will pass in task instead of taskInput value as we are getting this task from local storage rather than receiving it as an input\r\ntasks.forEach(function(task){\r\n/// We first want to create an li element for when an task input is added as follow:\r\nconst li = document.createElement('li');\r\n\r\n//Add a class\r\nli.className = 'collection-item';//This is a materialize requirment where for aesthetics a ul has to have a className as 'collection' and each li for that ul className of 'collection-item\r\n\r\n//Create a text node and append to the li\r\nli.appendChild(document.createTextNode(task));\r\n\r\n///Create new link element for delete item\r\nconst link = document.createElement('a');\r\n\r\n///Add class to the link element\r\nlink.className = 'delete-item secondary-content';///the secondary-content class is needed in materialize to have an element to the right of a list item (li)\r\n\r\n///Add icon html (x icon to delete)\r\nlink.innerHTML = '<i class = \"fa fa-remove\"></i>'//fa fa-remove class is a font awesome class for remove item (x) icon\r\n\r\n///Append the link to li\r\nli.appendChild(link);\r\n\r\n//Append the li to ul(taskList)\r\ntaskList.appendChild(li);\r\n\r\n})\r\n\r\n}", "function getTasks() {\n let tasks;\n if(localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n tasks.forEach((task) => { \n // Create a list element\n const list = document.createElement('li');\n // Add class \n list.className = 'collection-item';\n // Create text node and Append to the newly created List\n list.appendChild(document.createTextNode(task.toUpperCase()));\n \n // THE DELETE ICON\n // Create HTML element\n const link = document.createElement('a');\n // Add class\n link.className = 'delete-item secondary-content';\n // Add delete icon\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // Append it to the list\n list.appendChild(link);\n // Finally, Append that List to the ul i.e. taskList\n taskList.appendChild(list);\n });\n }\n}", "function gettasks(){\n // console.log('hay');\n\n let tasks;\n\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach(task => {\n // console.log(task);\n\n // create li element \n const li = document.createElement('li');\n \n // add class \n // li.classList.add('collection-item')\n li.className = \"collection-item\";\n\n // create test node append to li \n li.appendChild(document.createTextNode(task));\n \n // create link \n const link = document.createElement(\"a\");\n \n // add class \n link.className = \"delete-item secondary-content\";\n \n // add icon \n link.innerHTML = `<i class=\"far fa-trash-alt\"></i>`;\n\n // append link to li \n li.appendChild(link);\n\n // append li to ul \n tasklist.appendChild(li);\n });\n}", "function getTasks() {\n let tasks;\n if (localStorage.getItem('tasks') === null) { // check if anything in storage already\n tasks = []; // if nothing, set to empty array\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n //local storage can only store strings, so we must parse as JSON when it comes out\n }\n\n tasks.forEach(function (task) {\n // Create li element\n const li = document.createElement('li');\n\n // Add class\n li.className = 'collection-item'; // following Materialize.css standards for li's\n // Create text node and append to li\n li.appendChild(document.createTextNode(task));\n // Create new link element\n const link = document.createElement('a');\n // Add Class\n link.className = 'delete-item secondary-content'; // Materialize.css 'secondary-content'\n // Add icon html\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // Append the link to li\n li.appendChild(link);\n\n // Append the li to the ul\n taskList.appendChild(li);\n });\n\n}", "function addTaskLocalstorage(){\n \n \n if(validation() == false)\n return ; \n\n\n let taskObject = { task : document.getElementById(\"task\").value, status : \"active\" }\t;\n let dataList = JSON.parse(localStorage.getItem(\"allData\"));\n dataList.push(taskObject);\n\n localStorage.setItem(\"allData\" , JSON.stringify(dataList));\n\n addShowList(taskObject) ;\n decideToShowOrHide(taskObject) ;\n\n document.getElementById(\"task\").value = \"\" ; // Make the input field null again \n\n }", "function getTasksFromLS() {\n let tasks\n if (localStorage.getItem('tasks') === null) {\n tasks = []\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'))\n }\n\n tasks.forEach(task => {\n const li = document.createElement('li')\n li.className = 'collection-item'\n li.appendChild(document.createTextNode(task))\n\n const link = document.createElement('a')\n link.className = 'delete-item secondary-content'\n link.innerHTML = '<i class=\"fa fa-remove\"></i>'\n\n li.appendChild(link)\n taskList.appendChild(li)\n })\n}", "function getTasks() {\n let tasks;\n if(localStorage.getItem('tasks') === null){\n tasks = [];\n }else {\n tasks =JSON.parse(localStorage.getItem('tasks'));\n }\n tasks.forEach(function(tasks){\n //Ceate li Element \n const li = document.createElement(\"li\");\n\n //Add Class Name To Li Element \n li.className = \"collection-item\";\n\n //Create Text Node For Task\n let taskText = document.createTextNode(tasks);\n\n // Append Text Node into Li element\n li.appendChild(taskText);\n\n //Create A Element To A Element \n const link = document.createElement(\"a\");\n\n //Add Class Name \n link.className = \"delete-task\";\n\n //Add Font to A\n link.innerHTML = '<i class=\"fas fa-trash-alt\"></i>';\n\n //Append a Element to Li Element\n li.appendChild(link);\n\n\n //Append Li to Ul (Task COllection)\n taskCollection.appendChild(li);\n\n })\n}", "function loadTask() {\n var loadTaskUrl = baseUrl + '/api/call.php?loadtask=true';\n $.ajax({\n url: loadTaskUrl,\n type: 'POST',\n success: function (data) {\n var tasks = $.parseJSON(data);\n appendData(tasks);\n },\n error: function (tasks) {\n }\n });\n}", "function storeTaskLocalStorage(task){\n let tasks;\n if(localStorage.getItem(\"tasks\")===null){\n tasks=[];\n }else{\n tasks=JSON.parse(localStorage.getItem(\"tasks\"))\n }\n tasks.push(task);\n localStorage.setItem(\"tasks\",JSON.stringify(tasks));\n }", "function storeInLS(task) {\n //get Data means tasks\n let tasks = getTasks();\n //set in LS\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n}", "function getTasks(){\r\n let tasks;\r\n if(localStorage.getItem('tasks') ===null){\r\n tasks = [];\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'))\r\n }\r\n\r\n tasks.forEach(function(task){\r\n //Create li elemtnt\r\n const li = document.createElement('li');\r\n\r\n // Add class to the li\r\n li.classList = \"collection-item\";\r\n\r\n //Create text node\r\n const textNode = document.createTextNode(task)\r\n li.appendChild(textNode);\r\n\r\n // Create new link element\r\n const link = document.createElement('a');\r\n link.classList =\"delete-item secondary-content\";\r\n\r\n //add the icon html\r\n link.innerHTML = '<i class=\"fa fa-remove\"></i>'\r\n\r\n // Append finished li to ul\r\n li.appendChild(link)\r\n\r\n taskList.appendChild(li);\r\n\r\n })\r\n}", "function storeTaskInLocalStorage(task) {\n let allTask;\n if (localStorage.getItem('allTask') === null) {\n allTask = [];\n } else {\n allTask = JSON.parse(localStorage.getItem('allTask'))\n }\n allTask.push(task);\n\n localStorage.setItem('allTask', JSON.stringify(allTask))\n}", "function getTask() {\r\n\r\n let taskDate = document.getElementById(\"date\").value;\r\n if (!taskDate) {\r\n let message = \"Please enter the date!\";\r\n addAlert(message);\r\n return;\r\n }\r\n let taskTime = document.getElementById(\"time\").value;\r\n if (!taskTime) {\r\n let message = \"Please enter the time!\";\r\n addAlert(message);\r\n return;\r\n }\r\n let taskDetails = document.getElementById(\"details\").value;\r\n if (!taskDetails) {\r\n let message = \"Please enter the task details!\";\r\n addAlert(message);\r\n return;\r\n }\r\n\r\n let listItem = new task(taskDate, taskTime, taskDetails);\r\n taskList.push(listItem);\r\n\r\n for (let i = 0; i < taskList.length; i++) {\r\n taskList[i].id = i;\r\n }\r\n\r\n localStorage.setItem(\"taskList\", JSON.stringify(taskList));\r\n displayTask(listItem);\r\n document.getElementById(\"date\").value = \"\";\r\n document.getElementById(\"time\").value = \"\";\r\n document.getElementById(\"details\").value = \"\";\r\n}", "function storeTaskInLocalStorage(task){\n let tasks;\n if (localStorage.getItem('tasks') === null){ // check if anything in storage already\n tasks = []; // if nothing, set to empty array\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks')); \n //local storage can only store strings, so we must parse as JSON when it comes out\n }\n\n tasks.push(task); // add to the array\n localStorage.setItem('tasks', JSON.stringify(tasks)); // save to local storage\n}", "function getTasks () {\n\t// Proveravamo da li ima ista tamo u LS\n\tlet tasks; // Samo se ovde pominje \n\tif (localStorage.getItem('tasks') === null) {\n\t\ttasks = [];\t\t\n\t} else {\n\t\ttasks = JSON.parse(localStorage.getItem('tasks'));\n\t}\n\n\ttasks.forEach(function (task) {\n\t\t// Ovo TASK vazi samo za ovu funkciju i nigde vise\n\t\t//-- Sada ponovo definisemo sta da uradi kad krene da ucitava iz LS --//\n\n\t\t//// Create li element // Kreiranje list item-a\n\t \tconst li = document.createElement('li');// definisali li \n\t \t//// Add class\n\t \tli.className = 'collection-item'; // Definisali koju klasu dodajemo\n\t \t//// Create text node and append to li\n\t \tli.appendChild(document.createTextNode(task));//umesto tekstInput.value(ovog puta dolazi oz LS)\n\t \t/* Sve sto se ukuca u form/loadEventListeners/addTask to upada u li */\n\n\t \t/*-------------------------------------------------------------------------------*/\n\n\t \t////Create New link element\n\t \tconst link = document.createElement('a');\n\t \t////Add class\n\t \tlink.className = 'delete-item secondary-content';// Definisali koju klasu dodajemo\n\t \t//// Add icon html\n\t \tlink.innerHTML = '<i class=\"fa fa-remove\"></i>';// Definisali element koji cemo dodati NE class vec ceo jedan element da se doda\n\t \t//// Append the link to li\n\t \tli.appendChild(link);\n\t \t/* Sve sto se ukuca u form/loadEventListeners/addTask to upada u li a on je definisan kako izgleda upravo preko document.createElement('a') */\n\n\t \t/*-------------------------------------------------------------------------------*/\n\n\t\t//// Appending li to ul (sve sto je do sada definisano treba ubaciti u ul)\n\t\ttaskList.appendChild(li); //tako je definisan UL gore na pocetku\n\n\t});\n}", "function getTasks(){\nlet tasks;\nif(localStorage.getItem('tasks') === null){\n tasks = [];\n} else{\n tasks = JSON.parse(localStorage.getItem('tasks'))\n}\ntasks.forEach((task)=>{\n const lis = document.createElement('li')\n lis.className = 'collection-item'\n lis.appendChild(document.createTextNode(task))\n const link = document.createElement('a')\n link.classList = 'delete-item secondary-content';\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n lis.appendChild(link)\n taskList.appendChild(lis)\n})\n}", "function getTasks() {\n let tasks;\n if (localStorage.getItem(\"tasks\") === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n\n tasks.forEach(function (task) {\n // создаем элемент li\n const li = document.createElement(\"li\");\n // add class\n li.className = \"collection-item\";\n // создаем текстовый узел и добавляем в li\n li.appendChild(document.createTextNode(task)); // здесь task, а не taskInput.value (см. ниже)\n // создаем новую ссылку(link)\n const link = document.createElement(\"a\");\n // add class\n link.className = \"delete-item secondary-content\";\n // создаем иконку\n link.innerHTML = '<i class=\"fa fa-remove\"></i>';\n // добавляем link в li\n li.appendChild(link);\n // добавляем li в ul ( у нас он taskList )\n taskList.appendChild(li);\n });\n}", "function storeLocalStorage(task){\r\n let tasks;\r\n if(localStorage.getItem('tasks') ===null){\r\n tasks = [];\r\n }else{\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n tasks.push(task);\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n}", "function addTasktoLocalStorage(task){\n // init tasks\n let tasks;\n // Check if LS has tasks\n if (localStorage.getItem(\"tasks\") === null){\n // Init tasks as an array\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n tasks.push(task)\n\n localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n}", "function getTasks() {\n let tasks;\n if (localStorage.getItem(\"tasks\") === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem(\"tasks\"));\n }\n // console.log(tasks);\n tasks.forEach(task => {\n //Create li element\n const li = document.createElement(\"li\");\n //Add class to li\n li.className = \"collection-item\";\n //Create Text Node and append to li\n li.appendChild(document.createTextNode(task));\n //Create new link element\n const link = document.createElement(\"a\");\n //Add class to a tag\n link.className = \"delete-item secondary-content\";\n //Add icon html element\n link.innerHTML = \"<i class='fad fa-trash-alt fa-lg'></i>\";\n //Append the link to li\n li.appendChild(link);\n //Append li to ul\n taskList.appendChild(li);\n });\n}", "function loadTasks() {\n for (let j = 0; j < toDoList.length; j++) {\n // Checking if the Task has been marked as completed\n if (toDoList[j].isDone === true) {\n // Check to see wether the completed section has already been created\n if (!completedSectionCreated) {\n createCmpltHeader();\n clearAllBtn();\n completedSectionCreated = true;\n }\n completedTasksHandler(toDoList[j], toDoList[j].idNum);\n } else {\n addTask(toDoList[j]);\n }\n }\n}", "async function saveLocal() {\n await localStorage.setItem(\"tasks\", JSON.stringify(tasks));\n}", "function saveTasks(){\n localStorage.setItem(tasksKey, angular.toJson($scope.tasks))//will encode into JSON string format to save or post on the internet\n }", "function storeTaskInLocalStorage(task){\r\n\r\n let tasks;\r\n///we want to now pull whatever there is in the local storage that can be - either added to tasks array or else tasks can be set as an empty array.\r\n//initialise a tasks varibale to create the array\r\n\r\nif(localStorage.getItem('tasks') === null){\r\ntasks = [];\r\n}else{\r\n tasks = JSON.parse(localStorage.getItem('tasks'))///this will be a string and hence we will have to parse this an object that can be used, hence we will add the \"JSON parse\" wrapper.\r\n}\r\n///we would now want to push the task added through the input into this task array\r\n\r\ntasks.push(task);\r\n\r\n//this wont add anything to the local storage so we need reset(set) local storage with this array\r\nlocalStorage.setItem('tasks', JSON.stringify(tasks));///but since it has to store strings in local storage we will have to wrap the passed value of task as string in a \"JSON stringify\" wrapper\r\n}", "save(){\n var tasks = []; \n this.list.forEach(function(item){\n var task = {}\n task.text = item.text;\n task.priority = item.priority;\n task.duedate = item.duedate;\n task.tag = item.tag;\n task.done = item.done;\n tasks.push(task);\n });\n var stringArray = JSON.stringify(tasks);\n localStorage.setItem(this.key, stringArray);\n }", "function saveTasks(task) {\r\n let tasks;\r\n if (localStorage.getItem('tasks') === null) {\r\n tasks = [];\r\n } else {\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n }\r\n tasks.push(task);\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n}", "function storeTaskInLocalStorage(task) {\r\n let tasks;\r\n\r\n // Check if there are any tasks present in localStorage\r\n if(localStorage.getItem('tasks') === null) {\r\n tasks = [];\r\n } else {\r\n // set the tasks to whatever is in localStorage \r\n //(localStorage only stores strings, therefore we need to do parsing)\r\n tasks = JSON.parse(localStorage.getItem('tasks'));\r\n\r\n }\r\n\r\n // Push the task to tasks[]\r\n tasks.push(task);\r\n\r\n // Set back to localStorage\r\n localStorage.setItem('tasks', JSON.stringify(tasks));\r\n}", "function getTasks() {\n let tasks;\n //If there are no tasks in the local storage set it to an empty area\n if (localStorage.getItem('tasks') === null){\n tasks = [];\n } else {\n //if there are tasks, set it to whatever is there\n //since local storage only stores string we need to convert it to a JS object\n //tasks is basically where all the inputted tasks go to\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n //this forEach will execute for each task in the LS\n //After copying we replace addTaskText to task so it doesnt exist in this scope and it wouldnt make sense\ntasks.forEach(function(task){\n //We basically want to create the DOM elements just like we did with Add task, so we can copy it\n // Create li element\n const li = document.createElement('li');\n //Add Class for styling\n li.className = 'collection-item';\n // Create text node and append to li (so whatever is typed in input gets appended)\n li.appendChild(document.createTextNode(task)); \n // Create new link element\n const link = document.createElement('a')\n // Add class to link, secondary content added to place it to the right\n link.className = 'delete-item secondary-content';\n // Add icon html inside the link\n link.innerHTML = '<li class=\"fa fa-remove\"ß></i>';\n // Append the link to li\n li.appendChild(link);\n\n // Append li to ul, taskList because we define the ul to be that variable at the start\n taskList.appendChild(li);\n});\n\n}", "function get_Tasks() {\n let tasks;\n if (localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach(task => {\n let li = document.createElement('li');\n li.appendChild(document.createTextNode(task + \" \"));\n // taskInput.value = ''; // task input field khali kore ditesi\n\n\n let link = document.createElement('a');\n link.setAttribute('href', '#');\n link.innerHTML = 'X';\n li.appendChild(link);\n taskList.appendChild(li);\n });\n}", "function getTasks() {\n var keys = Object.keys(localStorage);\n var tasks = [];\n var i = keys.length;\n while (i--) {\n tasks.push(localStorage.getItem(keys[i]));\n }\n return tasks;\n }", "function addTaskToLocalStorage(task){\r\n\tlet tasks;\r\n\r\n\tif(localStorage.getItem('tasks') === null){\r\n\t\ttasks = [];\r\n\t} else {\r\n\t\ttasks = JSON.parse(localStorage.getItem('tasks'));\r\n\t}\r\n\r\n\ttasks.push(task);\r\n\r\n\tlocalStorage.setItem('tasks', JSON.stringify(tasks));\r\n\r\n}", "function get() {\n //if localstorage is empty\n if (JSON.parse(localStorage.getItem('toDo') === null || localStorage.getItem('toDo')).length <= 0 || localStorage.length == 0) {\n lists.innerHTML = `<h1> Nothing to Show Please add items </h1>`\n console.log('delete')\n //setting all the localstorage item into tasks array by parsing them\n } else {\n //pasing localstorage items\n localToDo = JSON.parse(localStorage.getItem('toDo'));\n //setting task as empty before adding all the localstorage items into tasks array\n tasks = [];\n //forEach loop in localstorage items to push each element in tasks array one by one\n localToDo.forEach(element => {\n tasks.push(element);\n });\n // setting html into empty before populating the dom to avoid duplicate task\n html = '';\n //running populate to populate dom after setting localstorage items into tasks array\n populate();\n }\n}", "function saveData() {\n let saveTask = JSON.stringify(listTask)\n window.localStorage.setItem(\"task_management\", saveTask)\n\n updateHtml()\n}", "function getTask(){\n//define taskArr\n let taskArr;\n if (localStorage.getItem('taskArr') == null){\n taskArr = [];\n }\n else{\n //when some taskItem is already present in taskArr --> get that taskItem from taskArr\n taskArr = JSON.parse(localStorage.getItem('taskArr')); \n }\n//for each taskItem, create a li(with link) & append it to ui \ntaskArr.forEach(function(taskItem){\n //create li element\n const li = document.createElement('li');\n //Add class\n li.className = 'collection-item';\n // Create text node & append\n li.appendChild(document.createTextNode(taskItem));\n //create link element\n const link = document.createElement('a');\n //Add class\n link.className = \"delete-item secondary-content\";\n // Add icon html\n link.innerHTML = '<i class=\"fas fa-trash\"></i>';\n //append link to li\n li.appendChild(link);\n //append li to ul\n taskList.appendChild(li);\n})\n}", "function storeTask(task) {\n // Initially checking wether there is some data or not\n let taskContain;\n if (localStorage.length === 0) {\n // There is no data\n taskContain = [];\n } else {\n // Fetch the existing data into the task array through JSON.parse()\n taskContain = JSON.parse(localStorage.getItem(\"task\"));\n }\n\n // Add the inputed task into the taskContain array\n taskContain.push(task);\n // Now store all the tasks into the local storage through JSON.stringify()\n localStorage.setItem(\"task\", JSON.stringify(taskContain));\n // alert(\"Task saved\");\n}", "function loadTasks() {\n fetch('/list-tasks').then(response => response.json()).then((tasks) => {\n const taskListElement = document.getElementById('task-list');\n tasks.forEach((task) => {\n taskListElement.appendChild(createTaskElement(task));\n })\n });\n}", "function storeTasks(taskObject) \n{\n\tlet tasksArray = localStorage.getItem(\"tasks\") ? JSON.parse(localStorage.getItem(\"tasks\")) : [];\n\ttasksArray.push(taskObject);\n\tlocalStorage.setItem(\"tasks\", JSON.stringify(tasksArray));\n}", "function storeTaslToLocalStorage(task){\n let tasks ;\n if (localStorage.getItem('tasks') === null)\n {\n tasks = [] ;\n }\n else{\n tasks = JSON.parse(localStorage.getItem('tasks')) ;\n }\n tasks.push(task)\n localStorage.setItem('tasks' , JSON.stringify(tasks));\n}", "function getTask() {\n\n let tasks\n\n if (localStorage.getItem('tasks') == null) {\n tasks = []\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'))\n }\n\n tasks.forEach(function(task) {\n let li = document.createElement('li')\n li.className = 'list-group-item text-dark float-left justify-content-between'\n li.appendChild(document.createTextNode(task))\n let removeIcon = document.createElement('a')\n removeIcon.className = \"remove-task\"\n removeIcon.innerHTML = '<i class=\"d-block float-right mt-1 text-danger active fa fa-trash\"></i>'\n li.appendChild(removeIcon)\n taskList.appendChild(li)\n })\n}", "function getTasks(e) {\n let storedTasks;\n if (localStorage.getItem('tasks') != null) {\n taskList.innerHTML = '';\n storedTasks = JSON.parse(localStorage.getItem('tasks')).sort();\n storedTasks.forEach(function(task){\n // Generate new list item based on the task form input value\n // Class names are set according to the materializecss framework\n const listItem = document.createElement('li');\n listItem.className = 'collection-item';\n listItem.setAttribute('title', 'New Item');\n listItem.appendChild(document.createTextNode(task));\n\n // Create link element within the list item to facilitate its removal\n const listItemLink = document.createElement('a');\n listItemLink.className = 'delete-item secondary-content';\n listItemLink.setAttribute('href', '#');\n listItemLink.innerHTML = '<i class=\"fas fa-times\"></i>';\n listItem.appendChild(listItemLink);\n\n // Finally append the list element, complete with its link, to the list\n // so it is rendered by the browser. Also store the task in local storage\n taskList.appendChild(listItem);\n });\n }\n}", "function saveTask(e) {\n\n let action = document.getElementById('action').value;\n let description = document.getElementById('description').value;\n\n\n\n let task = {\n action, description\n };\n\n if (localStorage.getItem('tasks') === null) {\n\n let tasks = [];\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n }\n\n else {\n\n let tasks = JSON.parse(localStorage.getItem('tasks'));\n tasks.push(task);\n localStorage.setItem('tasks', JSON.stringify(tasks));\n\n\n }\n\n getTask();\n document.getElementById('formtask').reset();\n e.preventDefault();\n\n}", "function getData() {\n return new Promise((resolve) => {\n return resolve(fs.readFileSync(TASK_STORAGE_PATH))})\n .then(data => {return JSON.parse(data)})\n // .catch(console.log(`No tasks added yet.`));\n}", "function storeTaskInLocalStorage(task) {\n let tasks;\n if (localStorage.getItem('tasks') === null) { //localStorage.getItem(keyname)\n tasks = [];\n } else {\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n tasks.push(task);\n\n localStorage.setItem('tasks', JSON.stringify(tasks)); //localStorage.setItem(keyname, value)\n}", "function getTasks() {\n let tasks;\n // Check if tasks already exists in Local Storage \n if(localStorage.getItem('tasks') === null) {\n tasks = [];\n } else {\n // Since local storage only stores data as strings we have to parse it as JSON data while retrieving it\n // so that the retrieved data can be read by JS\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n \n // Display retrieved task \n tasks.forEach(function(task){\n // Create li element\n const li = document.createElement('li');\n // Add class\n // If in materialize-css you want your list to look good then ul should have a class called collection\n // & each list item should have a class called collection-item\n li.className = 'collection-item'; \n // Create text node and append to li\n li.appendChild(document.createTextNode(task));\n // Create new link element\n const link = document.createElement('a');\n // Add class\n // secondary-content class will set item to the right in materialize-css\n link.className = 'delete-item secondary-content';\n // Add icon html\n // fa = Font Awesome icons\n link.innerHTML = '<i class =\"fa fa-remove\"></i>'\n // Append the link to li\n li.appendChild(link);\n\n // Append li to ul\n taskList.appendChild(li);\n })\n}", "async function loadAllTasks() {\n const response = await fetch(url + '/api/tasks');\n if (!response.ok) {\n throw new ResponseException(response.status + \" \" + response.statusText);\n }\n\n const tasks = await response.json();\n return tasks.map(t => {\n t = ({ ...t, important: (Boolean(t.important)), priv: (Boolean(t.private)), deadline: t.deadline !== null ? dayjs(t.deadline) : undefined, completed: (Boolean(t.completed)) });\n delete t.user;\n delete t.private;\n return t;\n });\n\n}", "function getTasks() {\n let tasks;\n if (localStorage.getItem('tasks') === null) {\n tasks = [];\n }else{\n tasks = JSON.parse(localStorage.getItem('tasks'));\n }\n\n tasks.forEach(task => {\n const li = document.createElement('li');\n li.classList.add('collection-item');\n li.appendChild(document.createTextNode(task));\n\n //Create link element\n const link = document.createElement('a');\n link.className = 'delete-item secondary-content';\n link.innerHTML = `<li class=\"fa fa-remove\"></li>`\n li.appendChild(link)\n\n //Append li to ul\n ul.appendChild(li);\n });\n}" ]
[ "0.80026203", "0.7730027", "0.7722346", "0.7708222", "0.76990056", "0.76990056", "0.7509049", "0.74723417", "0.74707496", "0.74477684", "0.74283814", "0.73855597", "0.73526436", "0.7328146", "0.72697294", "0.7239915", "0.7232198", "0.7212441", "0.72117156", "0.7210158", "0.7205196", "0.7196401", "0.71714085", "0.7164542", "0.7155248", "0.7147947", "0.714683", "0.7135372", "0.71328634", "0.7121869", "0.7104315", "0.7084267", "0.70821744", "0.70755", "0.70706075", "0.704678", "0.7043193", "0.70402837", "0.70280224", "0.70228946", "0.70140415", "0.7010051", "0.70064056", "0.70043075", "0.6996085", "0.69916874", "0.6982987", "0.69792783", "0.69792783", "0.6978686", "0.69777614", "0.6977547", "0.697711", "0.69698733", "0.6966835", "0.69613886", "0.6958718", "0.69565564", "0.69563353", "0.69522536", "0.69510835", "0.6935105", "0.6927416", "0.69233984", "0.6920412", "0.69164824", "0.69159955", "0.6906312", "0.6905805", "0.69002736", "0.68844384", "0.68833035", "0.68812805", "0.6866982", "0.6862491", "0.6862081", "0.68503237", "0.6847401", "0.6841648", "0.6835882", "0.6827294", "0.68247074", "0.68231434", "0.6820061", "0.68040067", "0.67965525", "0.67922944", "0.67886657", "0.67878795", "0.67867607", "0.67856705", "0.67854947", "0.6782225", "0.6777891", "0.67750496", "0.67733073", "0.67691356", "0.6761428", "0.6759725", "0.6758772" ]
0.8766415
0
lets date be minimum the date of today
function getToday() { let today = new Date(); let dd = today.getDate(); let mm = today.getMonth() + 1; let yyyy = today.getFullYear(); if (dd < 10) { dd = '0' + dd } if (mm < 10) { mm = '0' + mm } today = yyyy + '-' + mm + '-' + dd; document.getElementById("date").setAttribute("min", today); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function beginningOfToday(date)\r\n{\r\n // log(date.toString().replace(/..:..:../, '00:00:00'));\r\n return new Date(date.toString().replace(/..:..:../, '00:00:00'));\r\n}", "get minDate() { return this._minDate; }", "get minDate() { return this._minDate; }", "get minDate() { return this._minDate; }", "get minDate() { return this._minDate; }", "get minDate() { return this._minDate; }", "get minDate() { return this._minDate; }", "get minDate() { return this._minDate; }", "get minDate() { return this._minDate; }", "function dateRestrict() {\n let today = new Date();\n const dd = String(today.getDate()).padStart(2, '0');\n const mm = String(today.getMonth() + 1).padStart(2, '0');\n const yyyy = today.getFullYear();\n const dateToday = yyyy+'-'+mm+'-'+dd;\n const dateFuture = addDays(today, 16);\n const ddFuture = String(dateFuture.getDate()).padStart(2, '0');\n const mmFuture = String(dateFuture.getMonth() + 1).padStart(2, '0');\n const yyyyFuture = dateFuture.getFullYear();\n const dateMax = yyyyFuture+'-'+mmFuture+'-'+ddFuture;\n document.getElementById('date').min = dateToday;\n document.getElementById('date').max = dateMax;\n}", "function getMinDate(){\r\n var now = new Date();\r\n\t var subMilliSeconds = (now.getDay()+7) * 86400000;\r\n subMilliSeconds += now.getHours() * 3600000;\r\n subMilliSeconds += now.getMinutes() * 60000;\r\n subMilliSeconds += now.getSeconds() * 1000;\r\n subMilliSeconds += now.getMilliseconds();\r\n return new Date(now.getTime() - subMilliSeconds);\r\n }", "function minDate() \r\n{\r\n var today = new Date();\r\n var dd = today.getDate();\r\n var mm = today.getMonth()+1; //January is 0!\r\n var yyyy = today.getFullYear();\r\n if(dd<10){\r\n dd='0'+dd\r\n } \r\n if(mm<10){\r\n mm='0'+mm\r\n } \r\n today = yyyy+'-'+mm+'-'+dd;\r\n document.getElementById(\"projectEndDate\").setAttribute(\"min\", today);\r\n}", "_getMinDate() {\n return this._min;\n }", "_getMinDate() {\n return this._min;\n }", "function minDate(date, minDate) {\n return date instanceof Date && date.getTime() >= minDate.getTime();\n}", "function dateValidation() {\n\nlet currentDate = new Date();\nconst year = currentDate.getFullYear();\nlet month = currentDate.getMonth() + 1;\nlet day = currentDate.getDate();\n\n if(day < 10){\n day = '0' + day;\n }\n if(month < 10){\n month ='0' + month;\n }\n\ncurrentDate = year + '-' + month + '-' + day;\ndocument.getElementById(\"cwDueDate\").setAttribute(\"min\", currentDate);\n}", "function blockPastDates() {\n var dtToday = new Date();\n\n var month = dtToday.getMonth() + 1;\n var day = dtToday.getDate();\n var year = dtToday.getFullYear();\n if(month < 10)\n month = '0' + month.toString();\n if(day < 10)\n day = '0' + day.toString();\n\n var maxDate = year + '-' + month + '-' + day;\n $('#date').attr('min', maxDate);\n}", "function calenderMinToday() {\n let today = new Date(),\n day = today.getDate(),\n month = today.getMonth() + 1, //January is 0\n year = today.getFullYear();\n if (day < 10) {\n day = '0' + day\n }\n if (month < 10) {\n month = '0' + month\n }\n today = year + '-' + month + '-' + day;\n\n document.getElementById(\"countdownDate\").setAttribute(\"min\", today);\n // document.getElementById(\"countdownDate\").setAttribute(\"value\", today);\n}", "function setMinDateOnStartDate() {\n var todaysDate = ConvertDateFormat(new Date());\n //Sets the min date on the start date input to the current date.\n document.getElementById(\"MainContent_startDate\").setAttribute(\"min\", todaysDate);\n}", "function setCheckOutMinDay() {\n console.log(\"OK\");\n console.log(document.getElementById(\"checkInDate\").value);\n let d = new Date(document.getElementById(\"checkInDate\").value);\n d.setDate(d.getDate() + 1);\n document.getElementById(\"checkOutDate\").min = d.toISOString().split(\"T\")[0];\n}", "_getMinDate() {\n return moment.utc().add(5, 'minutes');\n }", "_getMinDate() {\n return this._rangeInput.min;\n }", "_getMinDate() {\n return this._rangeInput.min;\n }", "setMin(min) {\n self.datePicker.min = new Date(min);\n }", "function restrictPassedDate(){\n let date = new Date(),\n day = date.getDate(),\n month = date.getMonth()+1,\n year = date.getFullYear();\n if(day < 10){\n day = `0${day}`;\n }\n if(month < 10){\n month = `0${month}`;\n }\n dateStart.min = `${year}-${month}-${day}`;\n dateEnd.min = `${year}-${month}-${day}`;\n}", "expiryDate(now) {\n const millisec = this.expiryTime(now);\n if (millisec == Infinity) {\n return new Date(MAX_TIME);\n } else if (millisec == -Infinity) {\n return new Date(MIN_TIME);\n } else {\n return new Date(millisec);\n }\n }", "expiryDate(now) {\n const millisec = this.expiryTime(now);\n if (millisec == Infinity) {\n return new Date(MAX_TIME);\n } else if (millisec == -Infinity) {\n return new Date(MIN_TIME);\n } else {\n return new Date(millisec);\n }\n }", "today() {\n const that = this;\n\n let today = new Date();\n\n today.setHours(0, 0, 0, 0);\n\n if (today.getTime() < that.min.getTime() || today.getTime() > that.max.getTime()) {\n today = new Date(that.max);\n }\n else {\n that.selectedDates = [today];\n }\n\n that._handleMonths(today);\n return today;\n }", "_getMinDate() {\n return this._datepickerInput && this._datepickerInput.min;\n }", "_getMinDate() {\n return this.datepickerInput && this.datepickerInput.min;\n }", "function today() {\n return new Date();\n }", "getInitialDate() {\r\n const currentDate = new Date();\r\n currentDate.setDate(currentDate.getDate() - currentDate.getDay());\r\n return currentDate;\r\n }", "get minDate() {\n return minDate?.clone();\n }", "defineInitialDate() {\n let date = new Date();\n\n let todayYear = date.getFullYear();\n let todayMonth =\n date.getMonth() + 1 < 10\n ? `0${date.getMonth() + 1}`\n : date.getMonth() + 1;\n let todayDay = date.getDate() < 10 ? `0${date.getDate()}` : date.getDate();\n\n let initialDate = `${todayYear}-${todayMonth}-${todayDay}`;\n\n return initialDate;\n }", "static validate(date) {\n if (!date || !moment(date).isValid()) { return null; }\n // Check if date is greater than minimum date\n if (date < minimumDate) { return null; }\n return date;\n }", "function isDatePriorToCurrentDate(date) {\n var dd = date.getDate();\n var mm = date.getMonth() + 1; //January is 0!\n var yyyy = date.getFullYear();\n var currentDateTime = new Date();\n if (currentDateTime.getTime() >= date.getTime()) {\n if (currentDateTime.getDate() == dd && currentDateTime.getMonth() == mm && currentDateTime.getFullYear() == yyyy) {\n return false;\n } else {\n return true;\n }\n }\n return false;\n}", "function isDateBiggerThanMinDate(dateInfo) \n{\n\t var valid=false;\n\t var newDate=new Date(MIN_DATE); \n\t var newDateInfo=new Date(dateInfo);\t \n\t if (newDate<newDateInfo) \n\t\tvalid=true; \n\t return valid;\n}", "function earlierDate() {\n return moment().subtract(Math.pow(365.25*3,Math.random()),'days').format(\"YYYY-MM-DD\");\n }", "function _today() {\n this.dt = new Date();\n }", "function get_min_date(period) {\n var min_date = new Date(Date.now());\n \n var min = min_date.setMinutes(min_date.getMinutes() - period)\n console.log(min)\n return min;\n }", "function resetMinDates() {\n document.getElementById(\"checkInDate\").min = getLocalDate();\n document.getElementById(\"checkOutDate\").min = getLocalDate();\n console.log(getLocalDate());\n console.log(document.getElementById(\"checkInDate\").min);\n console.log(document.getElementById(\"checkOutDate\").min);\n}", "function cleanUpDate(){\n let today = new Date().getDate();\n today = today + 1;\n let month = new Date().getMonth();\n month = month + 1;\n let year = new Date().getFullYear();\n if(month <= 9){\n month = \"0\" + month;\n }\n if(today <= 9){\n today = \"0\" + today;\n }\n let todayDateDefault = year + \"-\" + month + \"-\" + today;\n return todayDateDefault;\n}", "function getStartOfToday() {\n\tvar startOfToday = new Date(Date.now());\n\tstartOfToday.setUTCMilliseconds(0);\n\tstartOfToday.setUTCSeconds(0);\n\tstartOfToday.setUTCMinutes(0);\n\t// 11am UTC is 3am Pacific, which is when we reset trophies.\n\tif (startOfToday.getUTCHours() < 11) {\n\t\tstartOfToday.setUTCDate(startOfToday.getUTCDate() - 1);\n\t}\n\tstartOfToday.setUTCHours(11);\n\treturn startOfToday;\n}", "function getMinExpirationDate() {\n const date = new Date();\n date.setDate(date.getDate() + 3);\n\n const month = String(date.getMonth() + 1).padStart(2, '0');\n const day = String(date.getDate()).padStart(2, '0');\n const year = date.getFullYear();\n const output = `${year}-${month}-${day}`;\n return output;\n}", "function todayDate() {\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth()+1; //January is 0!\n var yyyy = today.getFullYear();\n \n if(dd<10) {\n dd = '0'+dd\n } \n \n if(mm<10) {\n mm = '0'+mm\n } \n \n today = dd + '/' + mm + '/' + yyyy;\n return today;\n }", "function minDate() {\n // var allowed = document.getElementById('allowed')\n // let date = new Date();\n // let day = date.getDay('calender');\n // console.log(day)\n // return day;\n var today = new Date();\n var dd = String(today.getDate()).padStart(2, '0');\n var mm = String(today.getMonth() + 1).padStart(2, '0');\n var yyyy = today.getFullYear();\n \n today = mm + '/' + dd + '/' + yyyy;\n //SPLIT -- Look Up.\n // SLICE -- seperates 1999-11-11 \n // let variable = obj.slice(0,4); //1999\n // let variable2 = obj.slice(5,7); // 11\n // let variable3 = obj.slice(8,10); //11\n //Substring similar to SLICE index=>(0,0)<= how many character to move from there\n let inputDate = document.getElementById('input2').value;\n let d = new Date(inputDate)\n let day = d.getUTCDate();\n let month = d.getUTCMonth() + 1;\n let year = d.getUTCFullYear();\n\n let allow = document.getElementById('allowed');\n\n if (yyyy - year > 18) {\n\n allow.innerHTML = \"Welcome to Here.\"\n } else if (yyyy - year < 18) {\n\n allow.innerHTML = \"Leave my Website.\"\n } else {89\n if (month < mm) {\n\n allow.innerHTML = \"Welcome to Here.\"\n } else if (month > mm) {\n\n allow.innerHTML = \"Leave my Website.\"\n } else {\n if (day <= dd) {\n allow.innerHTML = \"Welcome to Here.\"\n } else {\n \n allow.innerHTML = \"Leave my Website.\"\n }\n }\n }\n \n}", "function validateStartDate (date) {\n if (new Date(date) <= new Date()) {\n return false\n }\n}", "function dateForToday() {\n return new Date().toMidnight();\n}", "function getAvailableDate() {\n const date = new Date();\n date.setDate(date.getDate() + 1);\n return date;\n}", "function date(d = today()) {\n console.log(d);\n}", "function getToday()\r\n{\r\n var now = new Date();\r\n return new Date(now.getFullYear(), now.getMonth(), now.getDate());\r\n}", "function setMinDate(val) {\n searchObj.minDate = val;\n }", "function Currentdaydate() {\n var date = new Date();\n var dd = date.getDate();\n var mm = date.getMonth() + 1;\n var yyyy = date.getFullYear();\n if (dd < 10) {\n dd = '0' + dd;\n }\n if (mm < 10) {\n mm = '0' + mm;\n }\n var today = mm + '/' + dd + '/' + yyyy;\n return today;\n }", "function getCurrentDate(date) {\n\tvar today = date,\n\t\tdd = checkTime(today.getDate()),\n\t\tmm = checkTime(today.getMonth() + 1), // January is 0!\n\t\tyyyy = today.getFullYear();\n\n\treturn dd + '-' + mm + '-' + yyyy;\n}", "function setDateToToday()\n {\n var today = new Date();\n\n /* The following idiocy is due to bizarre incompatibilities\n\t in the behaviour of getYear() between Netscrape and\n\t Exploder. The ideal solution is to use getFullYear(),\n\t which returns the actual year number, but that would\n\t break this code on versions of JavaScript prior to\n\t 1.2. So, for the moment we use the following code\n\t which works for all versions of JavaScript and browsers\n\t for all year numbers greater than 1000. When we're willing\n\t to require JavaScript 1.2, this may be replaced by\n\t the single line:\n\n\t document.gregorian.year.value = today.getFullYear();\n\n\t Thanks to Larry Gilbert for pointing out this problem.\n */\n\n var y = today.getYear();\n if (y < 1000) {\n\t y += 1900;\n }\n\n document.gregorian.year.value = y;\n document.gregorian.month.selectedIndex = today.getMonth();\n document.gregorian.day.value = today.getDate();\n document.gregorian.hour.value =\n document.gregorian.min.value =\n document.gregorian.sec.value = \"00\";\n }", "function validateDate() {\n let date = new Date(document.forms[formName]['fechaContrato'].value);\n let today = new Date();\n return date <= today;\n}", "getValidDate(currentDate){\n //console.info(`[${this.constructor.name}].getValidDate`, currentDate);\n\n // only allow today and future dates\n //const yesterday = moment().subtract(1, 'day');\n //return currentDate.isAfter(yesterday);\n const now = moment();\n return currentDate.isAfter(now);\n }", "function CurrentDate(){\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth()+1;\n var yyyy = today.getFullYear();\n if(dd<10){dd='0'+dd}\n if(mm<10){mm='0'+mm}\n today = mm+'/'+dd+'/'+yyyy;\n return today\n }", "validateDate(date, minDate){\n if(!moment(date,this.getDateFormat(this.props.type), true).isValid()){\n this.setState({\n validationErrorText: <FormattedMessage id=\"invalid-date-format\" />,\n showValidationError: true,\n })\n return false\n }\n if(minDate){\n if(moment(date).isBefore(minDate)){\n this.setState({\n validationErrorText: <FormattedMessage id=\"validation-afterStartTimeAndInFuture\" />,\n showValidationError: true,\n })\n return false\n }\n }\n\n this.setState({\n showValidationError: false,\n })\n return true\n }", "function todayDate() {\nvar today = new Date();\nvar dd = today.getDate();\nvar mm = today.getMonth()+1; //January is 0!\nvar yyyy = today.getFullYear();\n\nif(dd<10) {\n dd = '0'+dd\n} \n\nif(mm<10) {\n mm = '0'+mm\n} \n\ntoday = dd + '/' + mm + '/' + yyyy;\nreturn today;\n}", "function set_time_picker_min_val_today(){\n var today = new Date();\n var date = today.getFullYear()+'-'+((\"0\" + (today.getMonth() + 1)).slice(-2))+'-'+(\"0\" + today.getDate()).slice(-2);\n return date+\"T00:00\";\n}", "function initializeCurrentDate(){\n\tcurrentYear=d.getFullYear();\n\tcurrentMonth=d.getMonth();\t\n\ttodaysYear=d.getFullYear();\n\ttodaysMonth=d.getMonth();\n\ttodaysDate=d.getDate();\t\n}", "function isToday(date) {\n const today = new Date();\n return (date.getDate() == today.getDate() &&\n date.getMonth() == today.getMonth() &&\n date.getFullYear() == today.getFullYear());\n}", "function setMinDate(val) {\n searchObj.minDate = val;\n }", "static get since() {\n\t\treturn new Date(Date.UTC(1999, 0, 1));\n\t}", "static get since() {\n\t\t// The UTC representation of 2016-01-01\n\t\treturn new Date(Date.UTC(2016, 0, 1));\n\t}", "function getTodayDate(){\n\tvar today = new Date();\n\tvar dd = today.getDate();\n\tvar mm = today.getMonth()+1;//January is 0, so always add + 1\n\n\tvar yyyy = today.getFullYear();\n\tif(dd<10){dd='0'+dd}\n\tif(mm<10){mm='0'+mm}\n\ttoday = dd+'/'+mm+'/'+yyyy;\n\treturn today;\n}", "function date_today() {\n var d = new Date();\n var days = [\"Jan\",\"Feb\",\"Mar\",\"Apr\",\"May\",\"Jun\",\"Jul\",\"Aug\",\"Sep\",\"Oct\",\"Nov\",\"Dec\"];\n var month = days[d.getMonth()];\n var day = d.getDate();\n var year = d.getFullYear();\n var hour = d.getHours();\n var min = d.getMinutes();\n if(hour < 10){\n hour = '0'+hour;\n }\n if(min < 10){\n min = '0'+min;\n }\n var today = month+' '+day+', '+year+' '+hour+':'+min;\n return today;\n}", "async dateToCompare(context, date) {\n try {\n let d = new Date(date),\n month = \"\" + (d.getMonth() + 1),\n day = \"\" + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) {\n month = \"0\" + month;\n } \n if (day.length < 2) {\n day = \"0\" + day;\n }\n\n const today = year + \"-\" + month + \"-\" + day;\n\n context.commit('updateToday', today);\n\n } catch (error) {\n context.commit('getError', error);\n }\n }", "function isToday(date) {\n let dateDay = new Date().getDate();\n let dateMonth = new Date().getMonth();\n let dateYear = new Date().getFullYear();\n\n let pDay = date.getDate();\n let pMonth = date.getMonth();\n let pYear = date.getFullYear();\n\n if (dateDay === pDay && dateMonth === pMonth && dateYear === pYear) {\n return true\n } else {\n return false\n }\n }", "function getNowDate() {\n return new Date()\n}", "function getCurrentDate(){\n let newDate = new Date()\n let date = newDate.getDate();\n let month = newDate.getMonth() + 1;\n let year = newDate.getFullYear();\n return `${year}-${month<10?`0${month}`:`${month}`}-${date<10?`0${date}`:`${date}`}`\n }", "function getToday(){\n var year = new Date();\n year = year.getFullYear();\n\n var month = new Date();\n month = month.getUTCMonth() + 1;\n if (month < 10) {\n month = \"0\" + month;\n }\n\n var day = new Date();\n day = day.getUTCDate();\n if (day < 10) {\n day = \"0\" + day;\n }\n\n var date = year + \"-\" + month + \"-\" + day;\n console.log(date);\n return date;\n}", "get_oldest_starting_date() {\n return this.tasks\n .map(task => task._start)\n .reduce(\n (prev_date, cur_date) =>\n cur_date <= prev_date ? cur_date : prev_date\n );\n }", "function getToday() {\nlet today = new Date();\nlet dd = today.getDate();\nlet mm = today.getMonth()+1;\nconst yyyy = today.getFullYear();\nif(dd<10) {dd=`0${dd}`;}\nif(mm<10) {mm=`0${mm}`;}\nreturn `${yyyy}-${mm}-${dd}`;\n}", "_setFromDate(date) {\n let dates = get(this, '_dates');\n let [, dateTo] = dates;\n let vals;\n\n if (dateTo && date.valueOf() > dateTo.valueOf()) {\n vals = Ember.A([date, null]);\n } else {\n vals = Ember.A([date, dateTo || null]);\n }\n\n set(this, '_dates', vals);\n }", "function currentDate() {\r\n const today = new Date(); \r\n const nullBeforeMonth = today.getMonth() <= 9 ? '0' : '' \r\n const nullBeforeDay = today.getDate() <= 9 ? '0' : '' \r\n const date = nullBeforeDay + today.getDate() + '.' + nullBeforeMonth + (today.getMonth() + 1) + '.' + today.getFullYear();\r\n return date\r\n }", "function currentDate() {\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd;\n }\n\n if (mm < 10) {\n mm = '0' + mm;\n }\n\n today = yyyy + '-' + mm + '-' + dd;\n return today;\n}", "function checkInput (date, city){\n\n // get the current date and check if the entered date is less than it \n // if its less show an alert\n var varDate = new Date(date); //will be in the format dd-mm-YYYY\n var today = new Date();\n today.setHours(0,0,0,0);\n if(varDate > today) {\n return true\n } else{\n alert (\"enter a correct date\")\n return false;\n }\n }", "function getDateToday() {\n const today = new Date();\n return new Date(today.getFullYear(), today.getMonth(), today.getDate());\n}", "function currentDate() {\n var date = document.getElementsByClassName(\"date\")[0];\n if (!date) return;\n var dateString = date.textContent;\n\n var today = new Date().toISOString().substr(0, 10);\n\n if (dateString === \"today\") {\n date.textContent = today;\n }\n}", "function currentDate() {\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd;\n }\n\n if (mm < 10) {\n mm = '0' + mm;\n }\n\n today = yyyy + '-' + mm + '-' + dd;\n return today;\n}", "function getToday() {\n\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd\n }\n\n if (mm < 10) {\n mm = '0' + mm\n }\n\n today = yyyy + '-' + mm + '-' + dd;\n return today;\n}", "function DateToday(today){\r\n\tdd = today.getDate();\r\n\tmm = today.getMonth()+1; //January is 0!\r\n\tyyyy = today.getFullYear();\r\n\t\r\n\tif(dd < 10){\r\n\t dd = '0' + dd\r\n\t} \r\n\r\n\tif(mm<10) {\r\n\t mm = '0' + mm\r\n\t} \r\n\r\n\treturn today = yyyy + \"-\" + mm + \"-\" + dd;\r\n}", "function setMinDate() {\n let aus = new Date();\n aus.setDate = aus.getDate();\n aus.setFullYear(aus.getFullYear() - 8); //imposto come data di nascita massima 8 anni fa\n let data = aus.toISOString().split('T')[0];\n $(\"#dataNascitaModProfilo\").attr(\"max\", data);\n}", "_noEntry(){\n const tomorrow = this.date.getDate() + 1;\n this.date.setDate(tomorrow);\n }", "function getMaxDate() {\n var d = new Date();\n var year = d.getFullYear();\n var month = d.getMonth();\n var day = d.getDate();\n return new Date(year + 50, month, day);\n }", "function get_today(){\n\n var d = new Date(); var meses=\"\"; var dias=\"\"; var horas=\"\"; var minutos=\"\"; var date = \"\";\n meses = d.getMonth()+1; if (meses<10) { meses = \"0\"+meses; };\n dias = d.getDate(); if (dias<10) { dias = \"0\"+dias; }; \n date = d.getFullYear()+\"-\"+ meses + \"-\" +dias;\n return date;\n}", "function validateDateIsCorrect(dateObject){\n let currentDate = new Date();\n if(dateObject<currentDate){\n return false;\n }else { return true; }\n}", "function getCurrentDate( date ){\n return datetime = date.getDate() + \"/\" + (date.getMonth() + 1) + \"/\" + date.getFullYear() + ' at ' + date.getHours() + ':' + date.getMinutes();\n}", "function sc_currentDate() {\n return new Date();\n}", "function isDateToday(date) {\n return dayjs(date.format('YYYY-MM-DD')).isSame(dayjs().format('YYYY-MM-DD'));\n}", "getDatePickerOpenDate(defaultValue, minDate){\n if(defaultValue)\n return new Date(defaultValue)\n else if(minDate)\n return new Date(minDate)\n else\n return new Date(this.roundDateToCorrectUnit(moment()))\n }", "function minDate(table, datefield) {\n return new Promise((resolve, reject) => {\n let querySQL = `\n SELECT\n DATE_FORMAT(MIN(${datefield}), '%Y-%m-%d') as min_date\n FROM\n ${table}\n `;\n resolve(pool.origin.query(querySQL));\n reject(`Error`);\n });\n}", "function blockdates(){\n \n var dateToday = new Date();\n var dtToday = dateToday;\n var ndtToday = dateToday;\n dtToday.setDate(dtToday.getDate() - 14);\n var month = dtToday.getMonth() + 1;\n var day = dtToday.getDate();\n var year = dtToday.getFullYear();\n if(month < 10)\n month = '0' + month.toString();\n if(day < 10)\n day = '0' + day.toString();\n \n var maxDate = year + '-' + month + '-' + day;\n \n $('#positive_date').attr('max', maxDate);\n\n //block by default negetive, not old than positive date\n blockNegativeDate(dtToday);\n //disabled negative date\n document.getElementById(\"negative_date\").disabled = true;\n}", "getPast ({ date }) {\n if (typeof date === 'string') {\n return isBefore(parseISO(date), new Date())\n }\n return isBefore(date, new Date())\n }", "function getCurrentDate() {\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth()+1; //January is 0!\n var yyyy = today.getFullYear();\n\n if(dd<10) {\n dd = '0'+dd\n }\n\n if(mm<10) {\n mm = '0'+mm\n }\n\n today = yyyy + '-' + mm + '-' + dd;\n return today;\n\n}", "function dateValidRef() {\r\n //today w/o timestamp\r\n const y = new Date(\r\n new Date().getFullYear(),\r\n new Date().getMonth(),\r\n new Date().getDate()\r\n );\r\n //today minus 1 millisecond\r\n const ref = new Date(y.setMilliseconds(y.getMilliseconds() - 1));\r\n return ref;\r\n}", "function getFutureDate(date) {\n if (isValid(date) && _.isDate(date)) {\n date.setDate(date.getDate() + 1);\n return date;\n }\n }", "function getDate() {\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n\n if (dd < 10) {\n dd = '0' + dd\n }\n\n if (mm < 10) {\n mm = '0' + mm\n }\n\n today = yyyy + '-' + mm + '-' + dd;\n return today;\n}" ]
[ "0.71951675", "0.7100402", "0.7100402", "0.7100402", "0.7100402", "0.7100402", "0.7100402", "0.7100402", "0.7100402", "0.7095181", "0.6978378", "0.6918838", "0.69152147", "0.69152147", "0.6909236", "0.6876167", "0.68493015", "0.6843313", "0.6829618", "0.6700222", "0.668252", "0.66757596", "0.66757596", "0.6665447", "0.6660725", "0.6635152", "0.6635152", "0.6613631", "0.65943575", "0.6566652", "0.65611917", "0.6548318", "0.6527889", "0.6490765", "0.6479757", "0.6452902", "0.64225435", "0.63866365", "0.63749707", "0.6358432", "0.63567317", "0.6353518", "0.6351936", "0.63304406", "0.632094", "0.6290264", "0.627034", "0.62189835", "0.619992", "0.61982155", "0.6188641", "0.61873645", "0.61822414", "0.6146275", "0.613946", "0.6127025", "0.6116638", "0.6114312", "0.6110518", "0.6107265", "0.6103064", "0.61028206", "0.6100561", "0.6095139", "0.6087919", "0.6087331", "0.6074836", "0.6072424", "0.60708493", "0.60702807", "0.60639083", "0.6052307", "0.6048404", "0.6038629", "0.6023883", "0.60138047", "0.6011282", "0.60111964", "0.6009587", "0.60032207", "0.6001321", "0.59991723", "0.59981155", "0.59927434", "0.5991991", "0.599157", "0.59890234", "0.5981972", "0.59774977", "0.59743005", "0.5969949", "0.5969465", "0.59688073", "0.59676933", "0.59539866", "0.5952135", "0.5945635", "0.5934977", "0.59305304", "0.5923834" ]
0.74183327
0
Loads myJSON from Server
function load() { document.getElementById('loading').classList.remove('d-none'); loadJSONFromServer() .then(function (result) { //then(function (variable vom server)) console.log('Laden erfolgreich!', result); allTasks = JSON.parse(result); document.getElementById('loading').classList.add('d-none'); }) .catch(function (error) { // Fehler console.error('Fehler beim laden!', error); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _loadJSON(path, callback) { \n var xhr = new XMLHttpRequest();\n xhr.overrideMimeType(\"application/json\");\n xhr.open('GET', path, false);\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.status == \"200\") {\n callback(xhr.responseText);\n }\n };\n xhr.send(null); \n }", "function getJSON(myUrl, view) { // function that allows us to request json from a url; executes when we query our api\n var request = new XMLHttpRequest();\n request.open('GET', myUrl, true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n var data = JSON.parse(request.responseText);\n handleData(data, view); //once the data is parsed handle the data\n } else {\n console.log('The target server returned an error');\n }\n };\n\n request.onerror = function() {\n console.log('There was a connection error');\n };\n request.send()\n }", "function loadJSON(url, callback) { \n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', url, true);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n callback(JSON.parse(xobj.responseText));\n }\n };\n xobj.send(null); \n }", "loadJSON(path, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function()\n {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n if (success)\n success(JSON.parse(xhr.responseText));\n } else {\n if (error)\n error(xhr);\n }\n }\n };\n xhr.open(\"GET\", path, true);\n xhr.send();\n }", "function loadJSON(callback) {\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', props.imgURL.replace(/.png|.jpg|.jpeg|.gif/, \".json\"), true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n }", "loadJSON(path, success, error) {\n let xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function()\n {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n if (success)\n success(JSON.parse(xhr.responseText));\n } else {\n if (error)\n error(xhr);\n }\n }\n };\n xhr.open(\"GET\", path, true);\n xhr.send();\n }", "function loadJSON(fileUrl) {\n // Declare our xhr object\n const xhr = new XMLHttpRequest();\n // Set up the callback for our successful request\n xhr.onload = function() {\n // Parse the JSON\n arry = JSON.parse(xhr.responseText);\n console.log(arry);\n renderAll(arry);\n };\n // Open the request\n xhr.open('GET', fileUrl, true);\n // Send the request\n xhr.send();\n}", "function loadJSON() {\r\n $.getJSON(/nodeshift/, function (data) {\r\n glob_data = data;\r\n });\r\n }", "function getJSONFile() {\n var xhttp = new XMLHttpRequest();\n xhttp.open(\"GET\", \"/JSON/ThegooniesList.html\", true);\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n //Convert the JSON text back to an object\n goonies = JSON.parse(this.responseText);\n showGoonies();\n }\n }\n xhttp.send(); \n}", "function loadJSON(path, success, error) {\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n if (success) success(JSON.parse(xhr.responseText));\n } else {\n if (error) error(xhr);\n }\n }\n };\n xhr.open(\"GET\", path, true);\n xhr.send();\n }", "function loadJSONs( url, which ){\n var AJAX_req = new XMLHttpRequest();\n AJAX_req.overrideMimeType(\"application/json\");\n AJAX_req.open('GET',url,false);\n AJAX_req.onreadystatechange = function(){\n if(AJAX_req.readyState==4 && AJAX_req.status==\"200\"){\n if( which == 0){\n pre = JSON.parse( AJAX_req.responseText ); \n }\n else{\n post = JSON.parse( AJAX_req.responseText );\n }\n }\n };\n\n AJAX_req.send();\n}", "function loadJSON(fnJSON,callback) { \n\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', fnJSON, true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback( JSON.parse(xobj.responseText) );\n }\n };\n xobj.send(null);\n }", "function loadJSON(json_file_url, callback) {\n //console.log(json_file_url);\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', json_file_url, true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function() {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n\n main();\n }\n };\n xobj.send(null);\n}", "function loadJSON(callback, path) {\n\n var xmlObj = new XMLHttpRequest();\n xmlObj.overrideMimeType(\"application/json\");\n xmlObj.open('GET', path, false);\n xmlObj.onreadystatechange = function() {\n if (xmlObj.readyState == 4 && xmlObj.status == \"200\") {\n callback(xmlObj.responseText);\n }\n };\n xmlObj.send(null);\n}", "function load() {\n loadJSONfromServer()\n .then(function (result) {\n console.log('Laden erfolgreich!', result);\n myJSON = JSON.parse(result);\n for (let i = 0; i < myJSON.length; i++) {\n docsList[i] = myJSON[i];\n }\n displayDocsImages();\n Profiles();\n })\n .catch(function (error) {\n console.error('Fehler beim laden!', error);\n });\n}", "function loadJson(url) {\n $.ajax({\n url: url,\n dataType: 'json',\n success: function(data) {\n setJsonData(data);\n },\n error: function(e) {\n console.log(e);\n }\n });\n }", "function getJSON(path, callback) {\n var xhr = new XMLHttpRequest();\n xhr.open('GET', encodeURI(serverAddress + path));\n xhr.onload = function() {\n callback(xhr.status === 200 ? JSON.parse(xhr.responseText) : null);\n };\n xhr.send();\n }", "function loadJSON() {\n fetch(\"tasks.json\")\n .then(response => response.json())\n .then(myJson => {\n jsonData = myJson;\n createNewObject(myJson);\n });\n}", "function loadJSON(file) {\n var request = new XMLHttpRequest();\n request.open(\"GET\", file, false);\n request.send(null)\n return JSON.parse(request.responseText);\n}", "function loadJSON(filename, callback) { \n\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n // Replace 'my_data' with the path to your file\n xobj.open('GET', filename, true); \n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT\n // return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n xobj.send(null); \n }", "function loadJSON(path, callback) {\n const xhr = new XMLHttpRequest()\n xhr.overrideMimeType(\"application/json\")\n xhr.open(\"GET\", path, true)\n xhr.responseType = 'json';\n xhr.onreadystatechange = function () {\n if (xhr.readyState == 4 && xhr.status == \"200\") {\n callback(xhr.response)\n }\n }\n xhr.send(null)\n}", "function loadJSON(file, callback) {\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', 'https://www.mocky.io/v2/5da9b4023100000e004e0b21', true);\n xobj.onreadystatechange = function() {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n }", "function loadData(){ \n xhrMyData = new XMLHttpRequest(); \n xhrMyData.open(\"GET\",\"Scripts/paragraphs.json\",true); \n xhrMyData.send(null); \n xhrMyData.addEventListener(\"readystatechange\",readData); \n }", "function loadJSON(callback, endpoint, loadingFakeData=false) { \n\n console.log(\"Creating GET request for JSON\");\n\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', endpoint, true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText, loadingFakeData);\n }else{\n console.log(\"Could not fetch data! Status \" + xobj.status);\n }\n };\n xobj.send(null); \n }", "async function loadJSON(path,callback) {\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', path, true);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n}", "function loadJSON(path, success, error){\n var xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function()\n {\n if (xhr.readyState === XMLHttpRequest.DONE) {\n if (xhr.status === 200) {\n if (success)\n success(JSON.parse(xhr.responseText));\n } else {\n if (error)\n error(xhr);\n }\n }\n };\n xhr.open(\"GET\", path, true);\n xhr.send();\n}", "function loadJSON(callback) {\n let xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', filePath, true);\n xobj.onreadystatechange = function() {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n}", "function loadJSON(file,callback){\n var ajax=new XMLHttpRequest();\n ajax.overrideMimeType(\"application/json\");\n ajax.open(\"GET\",file,true);\n ajax.onreadystatechange=()=>{\n if(ajax.readyState ===4 && ajax.status===200){\n callback(ajax.responseText);\n }\n }\n ajax.send();\n}", "function loadJSON() {\n fetch(\"https://petlatkea.dk/2019/hogwarts/students.json\")\n .then(res => res.json())\n .then(myJSON => {\n studentJSON = myJSON;\n prepareObjects();\n });\n}", "function loadJSON(path, success, error) {\n let request = new XMLHttpRequest();\n request.onreadystatechange = function () {\n if (request.readyState === XMLHttpRequest.DONE) {\n if (request.status === 200) {\n if (success) success(JSON.parse(request.responseText));\n } else {\n if (error) error(request);\n }\n }\n };\n request.open(\"GET\", path, true);\n request.send();\n}", "getJson() {\n\n // create the new XMLHttpRequest\n var xhr = new XMLHttpRequest();\n\n // setting up the request\n xhr.open('GET', JSON_PATH, false);\n\n // when the JSON loads, parse it into an object and pass into this.parseEvents()\n xhr.onload = () => {\n this.events = this.parseEvents(JSON.parse(xhr.responseText));\n };\n\n // send the request\n xhr.send();\n\n }", "function loadJSON(url, onLoaded) {\n\n function onDocLoaded(doc, onLoaded) {\n var responseText = doc.responseText;\n if (responseText.length === 0) {\n onLoaded(null, \"Response is empty\");\n return;\n }\n\n try {\n // try to parse\n var loadedObj = JSON.parse(responseText);\n onLoaded(loadedObj, \"\");\n }\n catch (err) {\n onLoaded(null, err.message);\n }\n }\n\n var doc = new XMLHttpRequest();\n doc.onreadystatechange = function() {\n if (doc.readyState === XMLHttpRequest.DONE) {\n if (doc.status === 200)\n onDocLoaded(doc, onLoaded);\n else\n onLoaded(null, doc.statusText);\n }\n }\n\n doc.open(\"get\", url);\n doc.setRequestHeader(\"Content-Encoding\", \"UTF-8\");\n doc.send();\n}", "function load() {\n m_data.load(\"b4w/obj/moto.json\", load_cb);\n}", "loadJsonData() {\n }", "function loadJSON(callback) { \n\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', '/books.json', true);\n\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n\n xobj.send(null); \n}", "function loadData(){\n $.ajax({\n type: \"GET\",\n url: \"data/tuition.json\",\n dataType: \"json\",\n success: parseData\n });\n}", "function loadJSON(callback) { \n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', 'prizes.json', true);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n xobj.send(null); \n }", "function loadJsonData() {\n $.ajax({\n url: 'results.json',\n type: 'POST',\n dataType : 'json',\n async: false,\n success: function(data){\n getDataJson = data;\n }\n });\n }", "function loadJSON(path, success, error) {\n const xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function () {\n if (xhr.readyState === 4) {\n if (xhr.status === 200) {\n success(JSON.parse(xhr.responseText));\n } else {\n error(xhr);\n }\n }\n };\n xhr.open(\"GET\", path, true);\n xhr.send();\n}", "load($url) {\n const me = this;\n var request = new XMLHttpRequest();\n\n request.open('GET', $url, true);\n request.send(null);\n request.onreadystatechange = function () {\n if (request.readyState === 4 && request.status === 200) {\n try {\n me.data = JSON.parse(request.responseText);\n me.resetSorting();\n me.render();\n } catch (err) {\n // TODO: process error\n }\n }\n }\n }", "function loadJSON(callback) {\n\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', 'data/complete.json', true);\n xobj.onreadystatechange = function() {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // .open will NOT return a value but simply returns undefined in async mode so use a callback\n callback(xobj.responseText);\n }\n }\n xobj.send(null);\n }", "function loadIslands() {\n var request = new XMLHttpRequest();\n request.open('GET', 'juice.json', true);\n\n request.onload = function() {\n if (request.status >= 200 && request.status < 400) {\n // Success!\n var data = JSON.parse(request.responseText);\n processIslands(data);\n } else {\n // We reached our target server, but it returned an error\n\n }\n };\n\n request.onerror = function() {\n // There was a connection error of some sort\n };\n\n request.send();\n}", "function fetch() {\n $.ajax({\n url: window.silvupleOptions.jsonContentLister,\n dataType: 'json',\n data: null,\n success: success,\n error : fail\n });\n }", "function loadJSON(callback) {\n\n let xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"../\");\n xobj.open('GET', 'goods.json', true);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n}", "function loadJSON(path, args) {\n var request = issueRequest(path, 'json', args, false);\n request.done(function (result) {\n $.extend(rootObject, result);\n });\n return request;\n }", "function loadJSON(callback) {\n const xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', './seats.json', true);\n xobj.onreadystatechange = function () {\n if (xobj.readyState === 4 && xobj.status === 200) {\n data = JSON.parse(xobj.responseText).data;\n new SeatLayout(document.getElementById('seat-layout'));\n }\n };\n xobj.send(null);\n}", "function loadJSON(file, callback) {\n \n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType('application/json');\n xobj.open('GET', file, true);\n \n xobj.onreadystatechange = function() {\n if (xobj.readyState === 4) {\n if (typeof callback === 'function') {\n callback(JSON.parse(xobj.responseText));\n }\n else {\n return JSON.parse(xobj.responseText);\n }\n }\n };\n \n xobj.send(null);\n }", "function load_servers(){ //Load the server list to the server object\n\tvar servers = require(\"./prof_walnut/servers.json\");\n}", "function loadSeatsFile() {\n var xhttp = new XMLHttpRequest();\n xhttp.onload = function() {\n var file = xhttp.responseText;\n seats = JSON.parse(file);\n };\n xhttp.open(\"GET\", \"assets/js/custom/seats.json\", false);\n xhttp.send();\n}", "function loadJSON(file, callback) {\n\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', file, true);\n xobj.onreadystatechange = function () {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n}", "load (url, callback) {\n\n\t\tvar jsonLoadedCallbackFn = callback;\n\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.onload = function (e) {\n\t\t\tthis.on_REPLY.apply(this, [e, jsonLoadedCallbackFn]);\n\t\t}.bind(this);\n\t\trequest.onerror = this.on_LOAD_ERROR.bind(this);\n\t\trequest.open('GET', url, true);\n\t\trequest.responseType = 'json';\n\t\trequest.send();\n\t}", "function returnLoadedJSON(pathName) {\n var file;\n loadJSON(function(response) {\n // Parse JSON string into object\n var actual_JSON = JSON.parse(response);\n file = actual_JSON;\n }, pathName);\n return file;\n}", "function fetchJSON(){\n mRequest.onreadystatechange = function(){\n if(this.readyState == 4 && this.status == 200){\n mJson = JSON.parse(mRequest.responseText);\n iterateJSON(mJson)\n }\n }\n mRequest.open(\"GET\",mURL, true);\n mRequest.send();\n}", "function loadJSON(url) {\n var xmlHttpRequest = new XMLHttpRequest();\n xmlHttpRequest.overrideMimeType('application/json')\n xmlHttpRequest.open('GET', url, true);\n xmlHttpRequest.onreadystatechange = function() {\n console.log(\"State :\" + xmlHttpRequest.readyState);\n if (xmlHttpRequest.readyState == 4 && xmlHttpRequest.status == \"200\") {\n setDropdown(xmlHttpRequest.responseText);\n }\n };\n xmlHttpRequest.send(null);\n}", "function loadJson(url) {\n return fetch(url).then(response => response.json());\n}", "function loadJson() {\n\t\tvar xmlhttp = new XMLHttpRequest();\n\t\txmlhttp.onload = function() {\n\t \tif (xmlhttp.status == 200) { //this.readyState == 4 not used with onload handler\n\t\t \t\tdocument.getElementById(\"vieworder\").innerHTML = xmlhttp.responseText;\n\t\t \tvar order = JSON.parse(xmlhttp.responseText);\n\t\t \tfillOrder(order);\n\t \t}\n\t\t}\n\t\txmlhttp.open(\"GET\", \"getOrder.json\", true);\n\t\txmlhttp.send();\n\t}", "function loadJSON($scope, $http, statsURL) {\n $http.get(statsURL).\n success(function(data) { $scope.stats = data; }).\n error(function() { /* TODO */ });\n }", "function load() {\n var p_cb = PRELOADING ? preloader_callback : null;\n m_data.load(\"dalena_web.json\", load_cb, p_cb, !true);\n}", "function loadJSON(file, _callback){\r\n let req = new XMLHttpRequest();\r\n req.open('GET', file, true);\r\n req.responseType = 'text';\r\n req.onload = () => {\r\n let json_data = JSON.parse(req.response);\r\n _callback(json_data);\r\n }\r\n req.send(null);\r\n}", "function requestJSON(callback){\n var xhr=new XMLHttpRequest();\n xhr.responseType='json';\n xhr.onreadystatechange=function(){\n\tif(xhr.readyState===4 && (xhr.status===200 || xhr.status===0)){\n\t callback(xhr.response);\n\t}\n };\n xhr.open('GET','./data/all.json',true);\n // xhr.setRequestHeader('Access-Control-Allow-Methods','GET');\n // xhr.setRequestHeader('Content-Type','application/json');\n xhr.send(null);\n}", "function loadJSON(arg, param, callback) {\n var fullQuery = param + \"/\"\n\n for (var key in arg) {\n fullQuery += arg[key] + \"/\"\n }\n\n console.log(fullQuery);\n var xobj = new XMLHttpRequest();\n xobj.overrideMimeType(\"application/json\");\n xobj.open('GET', fullQuery, true); // Replace 'my_data' with the path to your file\n xobj.onreadystatechange = function() {\n if (xobj.readyState == 4 && xobj.status == \"200\") {\n // Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n callback(xobj.responseText);\n }\n };\n xobj.send(null);\n}", "function LoadData(){\n\t$.ajax(\"/cgi-bin/main.py\", {\n\t\tformat: \"json\"\n\t}).done(function(data) {\n\t\tdatajson = JSON.parse(data);\n\t\tLoadCheckboxes();\n\t\tLoadMarkers();\n\t});\n}", "function fetchJSON() {\n // TODO\n fetch('examples/animals.json')\n\t.then(validateResponse) // 2\n\t.then(readResponseAsJSON) // 3\n\t.then(logResult) // 4\n\t.catch(logError);\n\n}", "function loadData(){\n $.ajax({\n method:\"GET\",\n url:URL+\".json\",\n }).then(handleSuccess)\n .catch(function(err){\n console.log(err)\n })\n}", "function getBicicletas(){\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n var bicicletas = JSON.parse(this.responseText);\n //console.log(bicicletas);\n loadBicicletas(bicicletas);\n }\n };\n xmlhttp.open(\"GET\", \"JSON_Bicicletas.php\", true);\n xmlhttp.send();\n}", "function JSONLoader(path) {\n var self = this;\n\n fs.readFile(path, function (err, data) {\n var json;\n\n if (err) {\n return self.emit('error', err);\n }\n\n try {\n json = JSON.parse(data);\n } catch (e) {\n return self.emit('error', e);\n }\n\n self.emit('load', json);\n });\n}", "function read_json(fname) {\n\t\t\tconsole.log(\"in read_json\");\n\t\t\t$.getJSON(fname, function(data) {\n\t\t\t\tconsole.log(\"returned from read_json to execute function\");\n\t\t\t\tsurface.renderSurface(data);\n\t\t\t});\t\t\t\n\t\t}", "function load() {\r\n\r\n\r\n fetch('zooland.json')\r\n .then(function(result){\r\n return result.json();\r\n })\r\n .then(function(data){\r\n createZooland(data);\r\n });\r\n}", "function jsonGet(url, callback) {\r\n var xhr = new XMLHttpRequest();\r\n\r\n xhr.open('GET', url, true);\r\n xhr.setRequestHeader('Content-Type', 'application/json');\r\n\r\n xhr.onreadystatechange = callback;\r\n\r\n xhr.send();\r\n}", "function getJSONServer(filepath) {\n //Return a promise\n return new Promise(function(resolve, reject) {\n //Use jsonFile npm package to load the level\n jsonFile.readFile(filepath, function(err, obj) {\n if (err) {\n reject(err);\n }\n resolve(obj);\n });\n });\n }", "async function loadJSON(path) {\n\tlet response = await fetch(path);\n\tlet df = await response.json();\n\treturn df;\n}", "function loadQuests(callback) {\n\tvar xobj = new XMLHttpRequest();\n\txobj.overrideMimeType(\"application/json\");\n\txobj.open('GET', './js/quests.json', true);\n\txobj.onreadystatechange = function () {\n\t\tif (xobj.readyState == 4 && xobj.status == \"200\") {\n\t\t\t// Required use of an anonymous callback as .open will NOT return a value but simply returns undefined in asynchronous mode\n\t\t\tcallback(xobj.responseText);\n\t\t}\n\t};\n\txobj.send(null);\n}", "function loadData() {\n loadJson('am');\n loadJson('pm');\n}", "function retrieveRoomListFromServerJSON(url) {\n\tvar xmlhttp = new XMLHttpRequest();\n\txmlhttp.onreadystatechange = function() {\n\t\tif (xmlhttp.readyState == 4 && xmlhttp.status == 200) {\n\t\t\tvar room = JSON.parse(xmlhttp.responseText);\n populateRoomListView(room,UserID);\n\t\t\t\n\t\t}\n\t}\n\txmlhttp.open(\"GET\", url, true);\n\txmlhttp.send();\n}", "function loadFromJson(){\n\tvar canvas_url = '/facesix/api/geo/poi/'+spid;\n\t$.ajax({\n\t url:canvas_url+'/canvas',\n\t type:'GET', \n\t success: function(data){\n\t \tconsole.log('Received poi canvas data');\n\t \tconsole.log(data);\t \t\t \t\n \t\tvar jsonObj = JSON.parse(JSON.stringify(data));\n \t\tif(jsonObj.fg_json != ''){\n \t\t\tvar s = JSON.parse(JSON.stringify(jsonObj.fg_json));\t \t\n \t\t\tfg_canvas.loadFromJSON(s,fg_canvas.renderAll.bind(fg_canvas));\n \t\t} \n\t }\n\t });\n}", "function httpGetJson(theUrl) {\n var responseText = httpGet(theUrl);\n return JSON.parse(responseText);\n }", "function _load(path) {\n var actual_JSON = {};\n _loadJSON(path||'', function(response) {\n try{\n actual_JSON = JSON.parse(response); \n }catch(ex){\n debuglog('ColorCode.load: Error parse JSON file.');\n }\n });\n return actual_JSON;\n }", "function getJSON(file){\n reader.onload = function (file) {\n var obj = JSON.parse(file.target.result);\n for(var i = 0; i < obj.Result.length; i++)\n appendToScreen(obj.Result[i].title, obj.Result[i].url, obj.Result[i].description);\n };\n reader.readAsText(file);\n}", "function openJSON() {\n\tvar url_input = \"temp.json\";\n\tvar objex = new XMLHttpRequest();\n\tobjex.onreadystatechange = function() {\n\t\tif(this.readyState == 4 && this.status == 200) {\n\t\t\tjson_array = JSON.parse(objex.responseText);\n\t\t\tconsole.log(json_array);\n\t\t\tdisplayData();\n\t\t}\n\t};\n\tobjex.open(\"GET\", url_input, true);\n\tobjex.send();\n}", "constructor (json) {\n\t\tthis.loadJSON(json);\n\t}", "function loadJSON() {\n info(\"<img src='assets/img/web/preload-2.gif'>\");\n $.post('core/action-design.php', {\n 'act': 'get_design',\n 'a': ''\n })\n .done(function(data) {\n canvas.loadFromJSON(data);\n })\n }", "function loadJSON (path) {\n return new Promise((resolve, reject) => {\n let xhr = new XMLHttpRequest();\n xhr.overrideMimeType('application/json');\n xhr.open('GET', path, true);\n xhr.onload = function () {\n if (xhr.status == '200') {\n resolve(JSON.parse(xhr.responseText));\n } else {\n reject(xhr.statusText);\n }\n }\n xhr.onerror = () => reject(xhr.statusText);\n xhr.send();\n });\n}", "function loadData() {\n var jsonRovereto = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/rovereto\");\n dataRovereto = JSON.parse(jsonRovereto);\n var jsonPergine = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/pergine_valsugana\");\n dataPergine = JSON.parse(jsonPergine);\n var jsonTrento = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/trento\");\n dataTrento = JSON.parse(jsonTrento);\n //console.log(dataTrento);\n}", "async function jsonladen(_url) {\n let rückgabe = await fetch(_url);\n let serverrückgabe = await rückgabe.json();\n anzeigenlassen(serverrückgabe);\n}", "function getJSON(json_file) {\n\tvar request = new XMLHttpRequest();\n\trequest.open(\"GET\", json_file, false);\n\trequest.send(null);\n\tvar json = request.responseText;\n\treturn json;\n}", "function loadData() {\n $.getJSON(\"../Mini-project-2-data.json\", function(json) {\n console.log(json); // this will show the info it in firebug console\n });\n}", "function readJSON(url, success, error) {\n var xmlhttp = \"\";\n xmlhttp = new XMLHttpRequest();\n xmlhttp.open(\"GET\", url, true);\n\n xmlhttp.onreadystatechange = function () {\n if (xmlhttp.readyState === 4) { // `DONE`\n if (xmlhttp.status === 200) {\n success(JSON.parse(xmlhttp.responseText));\n } else {\n error(xmlhttp.status);\n }\n }\n };\n\n xmlhttp.send();\n}", "function GetJson(yourUrl) {\n \n var Httpreq = new XMLHttpRequest(); // a new request\n Httpreq.overrideMimeType(\"application/json\");\n Httpreq.open(\"GET\", yourUrl, false);\n Httpreq.send(null);\n \n return JSON.parse(Httpreq.responseText);\n}", "function loadInventory (callback) {\n var inventoryLoader = new XMLHttpRequest();\n inventoryLoader.open(\"GET\", \"inventory.json\");\n inventoryLoader.send();\n\n inventoryLoader.addEventListener(\"load\", function (e) {\n carData = JSON.parse(e.target.responseText);\n populatePage(carData);\n });\n\n\n}", "componentWillMount() {\n var url = location.protocol + '//' + location.hostname +\n (location.port ? ':' + location.port : '') + '/menu.json';\n this.load(url); //load data from a server asynchronously\n }", "function loadChores() {\r\n // variables\r\n xmlhttp = new XMLHttpRequest();\r\n\r\n // open file\r\n xmlhttp.open(\"GET\", \"chores.json\", true);\r\n\r\n // load file\r\n xmlhttp.onreadystatechange = function() {\r\n if(this.readyState == 4 && this.status == 200) {\r\n localStorage.setItem(\"chores\", this.responseText);\r\n }\r\n };\r\n\r\n // Display information\r\n xmlhttp.send();\r\n // alert(\"Chores are Loaded\");\r\n}", "async function loadJSON(){\n try {\n let url = document.location.pathname.replace('index','items').replace('html','json')\n if(document.location.href.startsWith('file')){\n console.log('what');\n url = \"file://\"+url\n }\n \n itemsPortfolio = filterByQueryCategory(globalItems)\n console.log(itemsPortfolio);\n itemsPortfolio = filterByQuery(itemsPortfolio);\n currentPage = 0\n let itemsPaginated = paginatorItem(itemsPortfolio);\n buildItems(itemsPaginated)\n } catch (error) {\n console.error('errrr ',JSON.stringify(error), error.message)\n }\n}", "function getAnimals() {\n\n\t$.ajax({\n\t\turl: \"data/animals.json\"\n\t}).done(function(animals){\n\n\t\tconsole.log(\"the contents of animals.json\");\n\t\tconsole.log(animals);\n\n\t});\n}", "function getJSON() {\n let xhr = new XMLHttpRequest();\n\n xhr.addEventListener('load', dataParser);\n xhr.open('GET', 'form.json', true);\n xhr.send();\n}", "function getJSONdata(url) {\n\t\tvar request = new XMLHttpRequest();\n\t\trequest.open('GET', url);\n\t\trequest.onreadystatechange = function(){\n\t\t\tif((request.status==200) && (request.readyState==4)){\n\t\t\t\tconsole.log(request.responseText);\n\t\t\t}\n\t }\n \t\n\t request(send);\n }", "function getDataFromLocalJson(url, callback) {\n fetch(url)\n .then(res => res.json())\n .then(data => movies = data)\n .then(() => callback(movies))\n}", "function loadJson(url){\n return fetch(url)\n .then(response => {\n if (response.status == 200){\n return response.json();\n } else {\n throw new Error(response.status);\n }\n })\n}", "function load() {\n m_data.load(APP_ASSETS_PATH + \"ded_moroz_06.json\", load_cb, preloader_cb);\n}", "function readFile(serverPort, filename) {\n let url = 'http://localhost:' +\n serverPort + //port number from data.gui\n '/js/' + //url path\n filename + //file name from dat.gui\n '.json'; //extension\n let request = new XMLHttpRequest();\n request.open('GET', url);\n request.responseType = 'text';\n request.send();\n request.onload = () => {\n let data = request.responseText;\n let parsedJSON = JSON.parse(data)\n createGame(parsedJSON);\n }\n}", "loadJson() {\n return readFile(this.jsonPath, { encoding: 'utf8' }).then((jsonText) => {\n this.jsonText = jsonText;\n return (this.jsonData = JSON.parse(jsonText));\n });\n }", "function getData(){\t\r\nvar data;\r\nvar jsonurl = './tnow.json';\r\n$.ajax({\r\n\ttype: \"GET\",\r\n\turl: jsonurl,\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Daten-Stream url\r\n\tdata: data,\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Variable für json Container\r\n\tasync: true,\t\t\t\t\t\t\r\n\tdataType: \"json\",\r\n\tsuccess: function(data){\t\t\t\t\t\t\t\t\t\t// nur ausführen wenn getJson (hier ajax) erfolgreich war sonst zu error:\t\r\n\tlogger('get ./tnow.json');\r\n\tcelsius = data.temperature_record;\r\n\tgrenze();\r\n\t},\r\n\t//error: function(){alert('Der Server antwortet nicht!'); schalter = \"error\";}\r\n\t});\t\r\n}" ]
[ "0.7167346", "0.708768", "0.70452756", "0.70082563", "0.6996618", "0.69458365", "0.69410115", "0.6849939", "0.68459904", "0.6840019", "0.6833021", "0.6815813", "0.681503", "0.67908573", "0.67872316", "0.6786793", "0.67764145", "0.6774145", "0.6771716", "0.67575264", "0.675694", "0.6755545", "0.67117155", "0.6701376", "0.6685845", "0.66713566", "0.66650796", "0.665215", "0.6647193", "0.6644447", "0.6635462", "0.6624765", "0.6589026", "0.657997", "0.6555667", "0.6551541", "0.6549989", "0.6543554", "0.654172", "0.6525607", "0.6516254", "0.64960253", "0.64816344", "0.64780587", "0.6473064", "0.64401156", "0.64340067", "0.64203805", "0.6415778", "0.64036626", "0.63997334", "0.63703066", "0.6357533", "0.6356885", "0.6353952", "0.63352317", "0.63297987", "0.63022006", "0.6296419", "0.6282631", "0.62736857", "0.6240954", "0.6210783", "0.6207082", "0.61925113", "0.61923164", "0.6185955", "0.61741954", "0.6173518", "0.6167741", "0.6166771", "0.61617935", "0.616056", "0.61588067", "0.61568254", "0.6150443", "0.6139189", "0.6129013", "0.6119958", "0.61189437", "0.6107876", "0.6092139", "0.6085614", "0.60837644", "0.6082743", "0.6065699", "0.60614693", "0.6056795", "0.6054278", "0.60532516", "0.6052598", "0.60483617", "0.604222", "0.6033135", "0.60156643", "0.6006449", "0.5996804", "0.59959036", "0.59952426", "0.59915644", "0.59888184" ]
0.0
-1
This function open the responsive Menu
function showMenu(){ document.getElementById("overlay-menu").classList.add("show-overlay-menu"); document.getElementById("burger-menu").classList.add("d-none"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function openNav_responsive() {\n options.jq.contentWell.css({\n position : 'absolute',\n top : 0,\n left : 0,\n height : '100%',\n overflow : 'hidden'\n });\n options.jq.navContainer.animate({marginLeft: 0}, animConfig());\n options.jq.contentWell.animate({left: '100%'}, animConfig(function () {\n options.jq.contentWell.hide();\n }));\n setNavState(1);\n }", "function showMenuBtn(){\n\t\tif($(window).width()<1199.98){\n\t\t\t$(\".open_menu\").addClass(\"d-block\");\n\t\t\t$(\"header nav\").addClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}else{\n\t\t\t$(\".open_menu\").removeClass(\"d-block\");\n\t\t\t$(\"header nav\").removeClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}\n\t}", "function showMenuBtn(){\n\t\tif($(window).width()<1199.98){\n\t\t\t$(\".open_menu\").addClass(\"d-block\");\n\t\t\t$(\"header nav\").addClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}else{\n\t\t\t$(\".open_menu\").removeClass(\"d-block\");\n\t\t\t$(\"header nav\").removeClass(\"d-none\");\n\t\t\t$(\".navigation_mobile\").removeClass(\"opened\");\n\t\t}\n\t}", "function show_responsive_menu() {\n var menuEl = $('#main-navigation ul');\n if (window.innerWidth <= 767) { // mobile \n if (visibleMobileMenu) {\n menuEl.show().css('opacity', 1);\n } else {\n menuEl.hide();\n }\n } else { // desktop\n menuEl.show().css('opacity', 1);\n }\n }", "function openMobileMenu(){\n menuButton.classList.add(\"isOpen\");\n menuO.style.display=\"none\";\n menuX.style.display=\"block\";\n mobileMenu.style.display = \"block\";\n activateScrollMenu()\n }", "function OCM_simpleDropdownOpen() {\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('#mobile-menu').show();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('header#top .slide-out-widget-area-toggle:not(.std-menu) .lines-button').addClass('close');\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('body.material').length > 0) {\r\n\t\t\t\t\t\t$('header#top .slide-out-widget-area-toggle a').addClass('menu-push-out');\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t$('.slide-out-widget-area-toggle > div > a').removeClass('animating');\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function HB_ShowMenuMobile() {\n\t \t$( '.wr-mobile .hb-menu .has-children-mobile' ).click( function() {\n\t \t\tvar _this = $( this );\n\t \t\tvar parent = _this.closest( '.item-link-outer' );\n\t \t\tvar parent_li = _this.closest( 'li' );\n\t \t\tvar submenu = parent_li.find( ' > ul:first' );\n\n\t \t\tif ( parent.hasClass( 'active-submenu' ) ) {\n\t \t\t\tsubmenu.stop( true, true ).slideUp( function() {\n\t \t\t\t\tvar menu = _this.closest( '.site-navigator-inner' );\n\t \t\t\t\tvar menu_inner = _this.closest( '.site-navigator' );\n\t \t\t\t\tvar menu_info = menu_inner[ 0 ].getBoundingClientRect();\n\t \t\t\t\tvar height_broswer = $( window ).height();\n\t \t\t\t\tvar height_scroll = height_broswer - menu_info.top;\n\n\t \t\t\t\tif ( menu_info.height <= height_scroll ) {\n\t \t\t\t\t\tmenu.css( 'height', '' );\n\t \t\t\t\t}\n\t \t\t\t} );\n\t \t\t\tparent.removeClass( 'active-submenu' );\n\t \t\t} else {\n\t \t\t\tsubmenu.stop( true, true ).slideDown( function() {\n\t \t\t\t\tvar menu = _this.closest( '.site-navigator-inner' );\n\t \t\t\t\tvar menu_info = menu[ 0 ].getBoundingClientRect();\n\t \t\t\t\tvar height_broswer = $( window ).height();\n\t \t\t\t\tvar height_scroll = height_broswer - menu_info.top;\n\n\t \t\t\t\tif ( menu_info.height > height_scroll ) {\n\t \t\t\t\t\tmenu.height( height_scroll );\n\t \t\t\t\t}\n\t \t\t\t} );\n\t \t\t\tparent.addClass( 'active-submenu' );\n\t \t\t}\n\t \t} );\n\n\t \t$( '.wr-mobile .hb-menu .menu-icon-action' ).click( function() {\n\t \t\tvar _this = $( this );\n\t \t\tvar parent = _this.closest( '.hb-menu' );\n\t \t\tvar menu = parent.find( '.site-navigator-inner' );\n\n\t \t\tif ( _this.hasClass( 'active-menu' ) ) {\n\t \t\t\tmenu.stop( true, true ).slideUp();\n\t \t\t\t_this.removeClass( 'active-menu' );\n\t \t\t} else {\n\t \t\t\tWR_Click_Outside( _this, '.hb-menu', function( e ) {\n\t \t\t\t\tmenu.stop( true, true ).slideUp();\n\t \t\t\t\t_this.removeClass( 'active-menu' );\n\t \t\t\t} );\n\n\t \t\t\tmenu.stop( true, true ).slideDown( function() {\n\t \t\t\t\tvar menu_info = menu[ 0 ].getBoundingClientRect();\n\t \t\t\t\tvar height_broswer = $( window ).height();\n\t \t\t\t\tvar height_scroll = height_broswer - menu_info.top\n\n\t \t\t\t\tif ( menu_info.height > height_scroll ) {\n\t \t\t\t\t\t$( this ).height( height_scroll );\n\t \t\t\t\t}\n\t \t\t\t} );\n\t \t\t\t_this.addClass( 'active-menu' );\n\t \t\t}\n\t \t} );\n\n\t \t$.function_rotate_device.menu_mobile = function() {\n\t \t\t$.each( $( '.wr-mobile .hb-menu .menu-icon-action.active-menu' ), function( key, val ) {\n\t \t\t\tvar _this = $( val );\n\t \t\t\tvar parent = _this.closest( '.hb-menu' );\n\t \t\t\tvar menu = parent.find( '.site-navigator-inner' );\n\t \t\t\tmenu.css( 'height', '' );\n\n\t \t\t\tvar menu_info = menu[ 0 ].getBoundingClientRect();\n\t \t\t\tvar height_broswer = $( window ).height();\n\t \t\t\tvar height_scroll = height_broswer - menu_info.top;\n\n\t \t\t\tif ( menu_info.height > height_scroll ) {\n\t \t\t\t\tmenu.height( height_scroll );\n\t \t\t\t} else {\n\t \t\t\t\tmenu.css( 'height', '' );\n\t \t\t\t}\n\t \t\t} );\n\t \t};\n\n\t }", "function openMenu() {\r\n var x = document.getElementById(\"portfolio Topnav\");\r\n\r\n if (x.className === \"topnav\") {\r\n x.className += \" responsive\";\r\n } else {\r\n x.className = \"topnav\";\r\n }\r\n }", "function openMenu () {\n $(this).toggleClass('open');\n $('ul, .social-links').toggleClass('active open');\n }", "function openMobileMenu() {\n\t\tsetClick(!click);\n\t}", "function menuToggle() {\n if (window.innerWidth < 768) {\n $(\".dropdown\").slideToggle(\"400\");\n }\n }", "function mobileMenu() {\n \"use strict\";\n if (jQuery(window).width() < 768) {\n jQuery('.mega-menu .mega').attr('id', 'menu-menu');\n jQuery('#menu-all-pages').removeClass('mega');\n jQuery('.mega-menu > ul').removeClass('mega');\n } else {\n jQuery('.mega-menu .mega > ul').addClass('mega');\n jQuery('.mega-menu .mega > ul').attr('id', 'menu-menu');\n }\n jQuery(\".main-navigation\").addClass('toggled-on');\n jQuery('.menu-toggle').click(function() {\n if (jQuery(this).parent().hasClass('active')) {\n jQuery(this).parent().removeClass('active');\n } else {\n jQuery('.menu-toggle').parent().removeClass('active');\n jQuery(this).parent().addClass('active');\n }\n });\n}", "function circloidContentMobileMenu(){\n\t\t$(\".within-content-navbar-toggle\").each(function(){\n\t\t\tvar target = $(this).data(\"c-target\");\n\n\t\t\t$(this).on(\"click\", function(){\n\t\t\t\t$(target).slideToggle(300);\n\t\t\t});\n\n\t\t\t// Display target menu when window is above 750px (desktop view)\n\t\t\t$(window).resize(function(){\n\t\t\t\tif($(window).width() > \"750\"){\n\t\t\t\t\t$(target).removeAttr(\"style\");\n\t\t\t\t}\n\t\t\t});\n\t\t});\n\t}", "function showMobileMenu(event){\n\n $ = jQuery;\n\n $(event).toggleClass('close-mobile-menu');\n $(event).find('.fa').toggleClass('fa-bars fa-close');\n $(event).closest('.topNav').find('ul').first().slideToggle(200);\n return false;\n\n}", "function showMenu() {\n var x = document.getElementById(\"menu-right\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n}", "function showMenu() {\n var x = document.getElementById(\"Navigatie\");\n if (x.className === \"hoofdnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"hoofdnav\";\n }\n}", "function mobileMenu() {\n //check if mobile menu button is shown\n if ($mobileButton.css(\"display\") === \"block\") {\n //if mobile menu button is shown then hide menu links\n $subMenu.removeClass(\"sub-menu\");\n $subMenu.addClass(\"menu-slideIn\");\n $(\".mobile_third ul\").addClass(\"menu-slideIn\");\n $mobileLinkContain.hide();\n } else if ($mobileButton.css(\"display\") === \"none\") {\n //if mobile menu button is hidden then show menu links\n $mobileLinkContain.show();\n $subMenu.removeClass(\"menu-slideIn\");\n $(\".mobile_third ul\").removeClass(\"menu-slideIn\");\n $subMenu.addClass(\"sub-menu\");\n }\n }//end mobileMenu function", "function openMenu(object) {\r\n if ($(document).width() > $responsiveWidth) {\r\n if (!object.closest(\".menu__dropdown__control\").hasClass(\"active\")) {\r\n // Closes all other open menus.\r\n $menuDropDown.slideUp().closest(\".menu__dropdown__control\").removeClass(\"active\");\r\n // Open the menu being hovered.\r\n object.closest(\".menu__dropdown__control\").addClass(\"active\")\r\n .find(\".menu__dropdown\").slideDown().attr(\"aria-hidden\",\"false\");\r\n }\r\n }\r\n }", "function callMegaMenu() {\n \"use strict\";\n var e, menucolumn = 4;\n if ((jQuery(window).width() >= 768) && (jQuery(window).width() < 980)) {\n menucolumn = 2;\n }\n if (jQuery(window).width() >= 768) {\n e = \"hover\";\n jQuery(\".mega-menu .mega\").dcMegaMenu({\n rowItems: menucolumn,\n speed: \"fast\",\n effect: \"fade\",\n event: e,\n fullWidth: false,\n mbarIcon: true\n })\n }\n}", "function callMegaMenu() {\n \"use strict\";\n var e, menucolumn = 4;\n if ((jQuery(window).width() >= 768) && (jQuery(window).width() < 980)) {\n menucolumn = 2;\n }\n if (jQuery(window).width() >= 768) {\n e = \"hover\";\n jQuery(\".mega-menu .mega\").dcMegaMenu({\n rowItems: menucolumn,\n speed: \"fast\",\n effect: \"fade\",\n event: e,\n fullWidth: false,\n mbarIcon: true\n })\n }\n}", "function expandMenu() {\n var windowsize = $window.width();\n if (windowsize < hamburgerWidth) {\n // hamburger menu\n $(\".ked-navigation .sidebar\").css(\"height\", \"100vh\");\n $(\".sv-grid-ksgs12\").first().addClass('hamburger'); // So CSS can adjust padding rule accordingly\n pinIcon.hide(); // Don't support pinning when in hamburger menu yet.\n } else {\n // normal menu\n $(\".ked-navigation .sidebar\").css(\"width\", \"290px\");\n $(\".sv-grid-ksgs12\").first().removeClass('hamburger'); // So CSS can adjust padding rule accordingly\n }\n timeoutId = null;\n if (!pinned) pinIcon.css(\"opacity\", 0.5);\n $(\".ked-navigation .logo span\").css(\"opacity\", \"1\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"1\");\n $(\".ked-navigation .offcanvas-nav li a .state-indicator\").css(\"opacity\", \"1\");\n $(\".ked-navigation .search .search-field\").css(\"opacity\", \"1\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"1\");\n }", "toggleMenuInMobile () {\n try {\n const windowWidth = window.innerWidth\n if (windowWidth > MENU_HIDE_WIDTH) return\n const toggleEle = document.getElementsByClassName('sidebar-toggle')\n toggleEle[0].click()\n } catch (error) {}\n }", "function openMobileMenu() {\n document.querySelector('body').classList.add('no-scroll');\n document.querySelector('[data-mobile-menu]').classList.add('is-visible');\n}", "function menuResponsive() {\n\tdocument.getElementById('contentNav').classList.toggle('active');\n\t//document.getElementById('button-menu').classList.toggle('active');\n\tdocument.getElementById('button-menu').classList.toggle('is-active');\n}", "function mediaQueryMenu(){\r\n\t\tif (window.matchMedia(\"(max-width:\"+change_menu_to_mobile_view+\")\").matches) {\r\n\t\t\t$(\".row_01\").addClass(\"hide\");\r\n\t\t\t$(\".row_01-content\").addClass(\"hide\");\r\n\t\t\t$(\"#burger_menu_icon\").removeClass(\"hide\");\r\n\t\t\t$(\".menu\").removeClass(\"fixed_menu\");\r\n\t\t\tmenuBottom();\r\n\t\t\tyoffset();\r\n\t\t\tburger_menu_active=true;\r\n\t\t} else {\r\n\t\t\t$(\".menu\").removeClass(\"fixed_menu\");\r\n\t\t\tburgerMenuUnactive();\r\n\t\t\t$(\".row_01\").removeClass(\"hide\");\r\n\t\t\t$(\"#burger_menu_icon\").addClass(\"hide\");\r\n\t\t\t$(\".menu_content\").css({\"display\":\"block\"});\r\n\t\t\tmenuBottom();\r\n\t\t\tyoffset();\r\n\t\t\tburger_menu_active=false;\r\n\t\t\tburger_menu_expanded=false;\r\n\t\t\t$(\".row_01\").removeClass(\"row_01-mouseover\");\r\n\t\t\t$(\".row_01 a\").removeClass(\"row_01-mouseover_nobackground\");\r\n\t\t}\r\n\t}", "function openHeaderMenuOnMobile() {\n $('#nav-icon-menu').click(function(){\n $(this).toggleClass('open');\n $('body').toggleClass('navigation-opened');\n });\n}", "function openMenu() {\n\n\t\t$(\"#menu-items\").css(\"display\",\"block\");\n \n $(\"#app-canvas\").velocity({\n\t\t\tleft:\"85%\",\n }, {\n duration: 300,\n complete: function() {\n\t\t\t\tsetTimeout(function(){\n isMenuOpen=true;\n },150);\n\t\t\t}\n }); \n }", "function displayMobileMenu($btn) {\n $btn.addEventListener('click', function () {\n document.querySelector('.nav__menu__overlay').classList.toggle('opacity');\n document.querySelector('body').classList.toggle('no_scroll');\n if ($btn === btnOpen) {\n changeTabIndex(btnClose, 0);\n changeTabIndex(menuLink, 0);\n for (let i = 0; i < menuLinks.length; i++) {\n let delay = \"move__in--\" + i;\n menuLinks[i].classList.toggle('move__in');\n menuLinks[i].classList.toggle(delay);\n }\n } else {\n changeTabIndex(btnClose, -1);\n changeTabIndex(menuLink, -1);\n for (let i = 0; i < menuLinks.length; i++) {\n let delay = \"move__in--\" + i;\n menuLinks[i].classList.toggle('move__in');\n menuLinks[i].classList.toggle(delay);\n }\n }\n });\n }", "function toggleMenu(){\n var isDisplay = $j('.menu').css('display');\n\n if (isDisplay == 'none'){\n $j('.menu').show(500);\n }else if (isDisplay == 'block'){\n $j('.menu').hide(500);\n }\n\n if ($j(window).width() <= 720) {\n $j('nav').width($j('header').width());\n } else {\n $j('nav').css('width','');\n }\n}", "function openMainNav() {\n var x = document.getElementById(\"mainNav\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n }", "function menu () {\r\n var x = document.getElementById(\"menu\");\r\n if (x.className === \"topnav\") {\r\n x.className += \" responsive\";\r\n } else {\r\n x.className = \"topnav\";\r\n }\r\n }", "function responsive_menu() {\n if(is_tablet_and_down()) {\n $('.mobile-menu .lines-button').on('click', function() {\n $(this).toggleClass('active');\n $('.mobile-side-menu').toggleClass('open');\n $('.mobile-menu-push').toggleClass('mobile-menu-push-to-left');\n });\n } else {\n $('.mobile-menu .lines-button').off('click');\n $('.pill-container').off('click');\n $('.reaction-list li').off('click');\n }\n}", "function mobileMenu($item) {\r\n if($item.length === 0) return;\r\n $item.each(function() {\r\n var $self = $(this),\r\n $selfParent = $self.closest('li.has-submenu'),\r\n $target = $self.next('.menu__dropdown');\r\n if($(window).innerWidth() > 767 - 17) {\r\n $target.removeAttr('style');\t\t\t}\r\n else if($(window).innerWidth() <= 767 - 17) {\r\n //$target.hide();\r\n }\r\n $('.menu--primary').on('click', function(e) {\r\n e.stopPropagation();\r\n });\r\n $self.on('click', function(e) {\r\n $self.toggleClass('closer opener');\r\n $target.stop(true).slideToggle({\r\n duration: 800,\r\n easing: 'easeInOutExpo'\r\n });\r\n e.stopPropagation();\r\n });\r\n });\r\n}", "function mobileMenu() {\n var x = document.getElementById(\"myLinks\");\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n }", "function OpenSideMenu() {\n if ($(\"body\").hasClass(\"mode-translation\")) {\n ToggleSideMenu(true);\n }\n}", "openMobileMenu() {\n $('.mobile.slice').addClass('active');\n this.$navbar.addClass('mobile open');\n $('body').addClass('mobile open');\n\n setTimeout(() => {\n this.$navbar.find('.ui.mobile.container').fadeIn(350);\n }, 300);\n }", "function openMenu() {\n g_IsMenuOpen = true;\n}", "function openNav() {\n\tvar links = document.getElementById(\"mobileNavLinks\");\n\tvar hamburger = document.getElementById(\"mobileNav\");\n\n\tif (links.style.display === \"block\" && hamburger.classList.contains(\"fa-times\")) {\n\t\tlinks.style.display = \"none\";\n\t\thamburger.classList.remove(\"fa-times\");\n\t\thamburger.classList.add(\"fa-bars\");\n\t}\n\telse {\n\t\tlinks.style.display = \"block\";\n\t\thamburger.classList.remove(\"fa-bars\");\n\t\thamburger.classList.add(\"fa-times\");\n\t}\n}", "function showMenu($this){\n $this.css('display', 'none');\n $('#mobileMenu-'+$this.attr('id')).show();\n }", "function showMenu($this){\n $this.css('display', 'none');\n $('#mobileMenu_'+$this.attr('id')).show();\n }", "function showNavMenuDesktop() {\n\tif (getBrowserWidth() >= 992) {\n\t\tshowElement(navMenu, \"none\");\n\t} else if (getBrowserWidth() < 992) {\n\t\thideElement(navMenu, \"translateX(100%)\");\n\t}\n}", "function hamburgerMenu(){\n\tdocument.getElementsByClassName(\"menu\")[0].classList.toggle(\"responsive\");\n}", "function showMenu(fast) {\n\t\t\t\tif ((smallBreakpoint && !opt.everySizes) || opt.everySizes) {\n\t\t\t\t\tmenuOpen = true;\n\t\t\t\t\t$html.addClass('extra-menu-open');\n\t\t\t\t\t$html.removeClass('extra-menu-close');\n\t\t\t\t\tif (fast) {\n\t\t\t\t\t\ttimeline.totalProgress(1);\n\t\t\t\t\t\t$window.trigger('extra:menu:ShowComplete');\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttimeline.play();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\thideMenu(true);\n\t\t\t\t}\n\t\t\t}", "function clickOnMobileMenu() {\n /* toggle the mobile nav menu */\n $('.js--mobile-menu').click(function() {\n const mainNav = $('.js--main-nav');\n mainNav.slideToggle(200);\n\n /* toggle the mobile menu icon */\n if ($('.js--menu-outline').hasClass('icon-hidden')) {\n $('.js--menu-outline').removeClass('icon-hidden');\n $('.js--close-outline').addClass('icon-hidden');\n } else {\n $('.js--menu-outline').addClass('icon-hidden');\n $('.js--close-outline').removeClass('icon-hidden');\n }\n\n });\n}", "function openMobileMenu() {\n document.querySelector('.mobile-menu-icon').addEventListener('click', function() {\n document.querySelector('.mobile-nav-dropdown').style.display = 'block';\n console.log('clicked');\n })\n}", "function responsiveMenuHandler() {\n if (responsive === \"navbar bigNav\") {\n setResponsive(\"navbar bigNav responsive\");\n } else {\n setResponsive(\"navbar bigNav\")\n }\n }", "function smMenu(){\n\t\t// Clears out other menu setting from last resize\n\t\t$('.menu-toggle a').off('click')\n\t\t$('.expand').removeClass('expand');\n\t\t$('.menu-toggle').remove();\n\t\t// Displays new menu\n\t\t$('.main-nav').before(\"<div class='menu-toggle'><a href='#'>menu<span class='indicator'> +</span></a></div>\");\n\t\t// Add expand class for toggle menu and adds + or - symbol depending on nav bar toggle state\n\t\t$('.menu-toggle a').click(function() {\n\t\t\t$('.main-nav').toggleClass('expand');\n\t\t\tvar newValue = $(this).find('span.indicator').text() == ' -' ? ' +' : ' -';\n\t\t\t$(this).find('span.indicator').text(newValue);\n\t\t});\n\t\t// Set window state\n\t\tvar windowState = 'small';\n\t}", "openMenu() {\n this.isNavMenuOpen = true;\n window.requestAnimationFrame(() => this.expand());\n }", "function showMenuOnHover() {\n\n\n //only expand menu on hover on screens bigger than 640px \n if (viewportSize.getWidth() > 640) {\n $('#nav-expander').on('mouseenter', function() {\n $('.main-navigation').addClass('visible');\n });\n $('.home #header-wrap').on('mouseleave', function() {\n $('.main-navigation').removeClass('visible');\n });\n } else if (viewportSize.getWidth() <= 640) {\n //only expand menu on click on screens smaller than 640px \n $('#nav-expander').on('click', function(e) {\n $('.offset-canvas-mobile').addClass('open-canvas');\n e.preventDefault();\n });\n $('.mobile-nav-close-btn').on('click', function() {\n $('.offset-canvas-mobile').removeClass('open-canvas');\n });\n $('.mobile-nav-holder a').on('click', function() {\n $('.offset-canvas-mobile').removeClass('open-canvas');\n });\n }\n }", "function menuMobile () {\n\t\tvar btnMenu = $('.site-header_menu-mob-nav');\n\t\tvar searchBtn = $('.site-header_menu-mob-search');\n\t\tvar searchForm = $('.site-header_search-wrap');\n\t\tvar body = $('body');\n\t\tvar viewport = $('.page-viewport');\n\t\tvar btnClose = $('.nav-close-mob');\n\t\tvar primaryNav = $('.primary-nav');\n\t\tvar aClass = 'active';\n\t\tvar oClass = 'open';\n\t\tvar oNavClass = 'primary-nav-open';\n\n\t\tfunction focusMenu () {\n\t\t\tif (body.hasClass(oNavClass)) {\n\t\t\t\t$('a', primaryNav).removeAttr('tabindex');\n\t\t\t\tprimaryNav.attr('tabindex', '-1').focus();\n\t\t\t} else {\n\t\t\t\t$('a', primaryNav).attr('tabindex', '-1');\n\t\t\t\tprimaryNav.removeAttr('tabindex');\n\t\t\t}\n\t\t}\n\n\t\tfunction focusSearch () {\n\t\t\tif (searchForm.hasClass(oClass)) {\n\t\t\t\t$('input', searchForm).focus();\n\t\t\t}\n\t\t}\n\n\t\tfunction openMenu () {\n\t\t\tprimaryNav.show();\n\t\t\tTM.to(viewport, 0.6, { easing: tmEasing, onComplete: focusMenu, x: '-70%' });\n\t\t\tbody.addClass(oNavClass);\n\t\t}\n\n\t\tfunction closeMenu () {\n\t\t\tTM.to(viewport, 0.6, { easing: tmEasing, onComplete: function () {\n\t\t\t\tfocusMenu();\n\t\t\t\tbody.removeClass(oNavClass);\n\t\t\t\tprimaryNav.hide();\n\t\t\t}, x: '0%' });\n\t\t}\n\n\t\tfunction toggleMenu (e) {\n\t\t\te.preventDefault();\n\t\t\tif (window.matchMedia(mq.xs).matches) {\n\t\t\t\tif (body.hasClass(oNavClass)) {\n\t\t\t\t\tcloseMenu();\n\t\t\t\t} else {\n\t\t\t\t\topenMenu();\n\t\t\t\t}\n\n\t\t\t\t$(this).toggleClass(aClass);\n\t\t\t}\n\t\t}\n\n\t\tfunction toggleSearch (e) {\n\t\t\te.preventDefault();\n\t\t\tif (window.matchMedia(mq.xs).matches) {\n\t\t\t\tif (searchForm.hasClass(oClass)) {\n\t\t\t\t\tTM.to(searchForm, 0.45, { easing: tmEasing, height: 0 });\n\t\t\t\t} else {\n\t\t\t\t\tTM.set(searchForm, { height: 'auto' });\n\t\t\t\t\tTM.from(searchForm, 0.45, { easing: tmEasing, onComplete: focusSearch, height: 0 });\n\t\t\t\t}\n\t\t\t\tsearchForm.toggleClass(oClass);\n\n\t\t\t\t$(this).toggleClass(aClass);\n\t\t\t}\n\t\t}\n\n\t\tfunction closeMenuBtn (e) {\n\t\t\te.preventDefault();\n\t\t\tif (window.matchMedia(mq.xs).matches) {\n\t\t\t\tbtnMenu.removeClass(aClass);\n\t\t\t\tcloseMenu();\n\t\t\t}\n\t\t}\n\n\t\t// do responsive things to primary-nav\n\t\tenquire.register(mq.xs, {\n\t\t\tsetup: function () {\n\t\t\t\tif (window.matchMedia(mq.xs).matches) {\n\t\t\t\t\tprimaryNav.hide();\n\t\t\t\t} else {\n\t\t\t\t\tprimaryNav.show();\n\t\t\t\t}\n\t\t\t},\n\t\t\tmatch: function () {\n\t\t\t\tprimaryNav.hide();\n\t\t\t},\n\t\t\tunmatch: function () {\n\t\t\t\tprimaryNav.show();\n\t\t\t}\n\t\t});\n\n\t\tbtnMenu.on('click', toggleMenu);\n\t\tbtnClose.on('click', closeMenuBtn);\n\n\t\tsearchBtn.on('click', toggleSearch);\n\n\t\t$('.primary-nav a').attr('tabindex', '-1');\n\t}", "function showMenu() {\r\n\tvar x = document.getElementById(\"topnav\");\r\n\tif (x.classList.contains(\"responsive\")) {\r\n\t\tx.classList.remove(\"responsive\");\r\n\t} else {\r\n\t\tx.classList.add(\"responsive\");\r\n\t}\r\n}", "function openNav() {\n\tdocument.querySelector(\".mobile-navigation\").style.display = \"block\";\n\n\tif (document.getElementById(\"close\").src == \"icon-close.svg\") {\n\t\tdocument.getElementById(\"open\").src = \"icon-hamburger.svg\";\n\t} else {\n\t\tdocument.getElementById(\"close\").src = \"icon-close.svg\";\n\t\tdocument.getElementById(\"close\").style.display = \"block\";\n\t\tdocument.getElementById(\"open\").style.display = \"none\";\n\t}\n\n }", "function myMobileMenu() {\n if (detectMob()) {\n var x = document.getElementById(\"myLinks\");\n if (x.style.display === \"block\") {\n x.style.display = \"none\";\n } else {\n x.style.display = \"block\";\n }\n }\n}", "function mobileNav() {\n var width = $(window).width();\n $(\".submenu\").on(\"click\", function () {\n if (width < 992) {\n $(\".submenu ul\").removeClass(\"active\");\n $(this).find(\"ul\").toggleClass(\"active\");\n }\n });\n }", "function menuForSmallScreen() {\n navMenuList.hide();\n\n hideMenuBtn.addClass(ClassName.NONE);\n showMenuBtn.removeClass(ClassName.NONE);\n\n function toggleSmallMenu() {\n navMenuList.fadeToggle();\n toggleButtons();\n }\n\n function toggleMenuEventHandler(event) {\n event.preventDefault();\n toggleSmallMenu();\n }\n\n hideMenuBtn.click(toggleMenuEventHandler);\n showMenuBtn.click(toggleMenuEventHandler);\n menuEl.click(function () {\n setTimeout(toggleSmallMenu, 600);\n });\n }", "openMenu() {\n $(this.openMenuTrigger).toggleClass(\"mobile-open\");\n // if (!$(this.openMenuTrigger).hasClass(\"mobile-open\")) {\n // $(\".main-nav__top\").removeClass(\"sub-open\");\n // $(\".main-nav__top li\").removeClass(\"open\");\n // $(this.appended).remove();\n // }\n $(\".navigation\").addClass(\"mobile-open\");\n // $(document)\n // .find(this.menuContainer)\n // .toggleClass(\"mobile-open\");\n // $(document)\n // .find(this.closeMenuTrigger)\n // .addClass(\"mobile-open\");\n // //Add close button only to left layout\n // if ($(\".main-nav.layout-left\").length) {\n // $(\".main-nav ul\").append('<li class=\"mobile-nav-close\">&#10005;</li>');\n // }\n // this.toggle.toggleClass(\"mobile-open\");\n // $(document)\n // .find(this.menuBackground)\n // .addClass(\"mobile-open\");\n }", "function myFunction(){\r\n if(location.href === \"http://localhost/thefabexperience/index.html#!/menu\"){\r\n document.getElementById(\"defaultOpen\").click();\r\n if(w >= 775 && w <= 1104 ){\r\n console.log(\"we\");\r\n menuElements(document.querySelector('body'), document.querySelector('header'), document.querySelector('main'));\r\n }\r\n }\r\n}", "function openNav() {\n $(\"#swim-overlay-menu\").css({\"width\" : \"100%\"});\n}", "function menuShow() {\n ui.appbarElement.addClass('open');\n ui.mainMenuContainer.addClass('open');\n ui.darkbgElement.addClass('open');\n}", "function MenuOpen () {\n\tmenuDiv.style.marginLeft='0px';\n\tbodyDiv.style.marginLeft=menuWidth+'px';\n\tif (siteWdth<560) bodyDiv.style.width='100%';\n\telse bodyDiv.style.width='calc(100% - '+(menuWidth+1)+'px)';\n\tmenu_holderDiv.style.display=\"block\";\n\tmenuOpened=1;\n\t// body height\n\tdocument.getElementById('body').style.minHeight=document.getElementById('menu_holder').clientHeight + 20;\n\t// myhome\n\t//if (document.location.href.split('/')[3]=='myhome') ResizeButs();\n}", "function openMenu() {\n vm.showMenu=!vm.showMenu;\n }", "function openMobileMainMenu() {\r\n $(\".main-menu-container\").addClass(\"opened\");\r\n $(\".mobile-menu-icon-container\").addClass(\"opened-menu-icon\");\r\n}", "function toggleMobileMenu() {\n let wrapper = $(\".m-menu-wrapper\");\n wrapper.toggleClass(\"active\");\n $(\"body\").toggleClass(\"locked\");\n }", "function openMenu(toggler, menu) {\n menu.slideDown('fast');\n toggler.toggleClass('open');\n }", "function verificaMenu() {\n const menuMax = window.matchMedia('(max-width: 720px)');\n\n if(menuMax.matches) {\n const menu = document.querySelector('.menu');\n menu.classList.add('menu-mobile');\n } else {\n \n }\n}", "showMenu() {\n this.$('jira-sidebar__menu').removeClass('jira-hidden');\n this.animate('in', width.sidebarSmall);\n }", "function toggleMenu() {\n document.getElementsByClassName(\"navigation\")[0].classList.toggle(\"responsive\");\n}", "function toggleMenu() {\n document.getElementsByClassName(\"navigation\")[0].classList.toggle(\"responsive\");\n}", "function determineNavAction_responsive() {\n if (options.jq.contentWell.is(':hidden')) {\n closeNav_responsive();\n } else {\n openNav_responsive();\n }\n }", "function mobileMenu() {\n $('button.menu').click(() => {\n // Ajout de la classe open et animating qui sert pour la durée de la transition\n $('header nav').toggleClass('open animating');\n\n // Blocage de la fermeture le temps de la transition\n $('header nav').one('webkitTransitionEnd otransitionend oTransitionEnd msTransitionEnd transitionend', () => {\n $('header nav').removeClass('animating');\n });\n });\n\n $('.overlay').click(() => {\n $('header nav.open:not(.animating)').removeClass('open');\n });\n}", "function showMenu(){opts.parent.append(element);element[0].style.display='';return $q(function(resolve){var position=calculateMenuPosition(element,opts);element.removeClass('md-leave');// Animate the menu scaling, and opacity [from its position origin (default == top-left)]\n\t// to normal scale.\n\t$animateCss(element,{addClass:'md-active',from:animator.toCss(position),to:animator.toCss({transform:''})}).start().then(resolve);});}", "function mainMenu() {\n // Variables\n var var_window = $(window),\n navContainer = $('.nav-container'),\n pushedWrap = $('.nav-pushed-item'),\n pushItem = $('.nav-push-item'),\n pushedHtml = pushItem.html(),\n pushBlank = '',\n navbarToggler = $('.navbar-toggler'),\n navMenu = $('.nav-menu'),\n navMenuLi = $('.nav-menu ul li ul li'),\n closeIcon = $('.navbar-close');\n // navbar toggler\n navbarToggler.on('click', function() {\n navbarToggler.toggleClass('active');\n navMenu.toggleClass('menu-on');\n });\n // close icon\n closeIcon.on('click', function() {\n navMenu.removeClass('menu-on');\n navbarToggler.removeClass('active');\n });\n\n // adds toggle button to li items that have children\n navMenu.find('li a').each(function() {\n if ($(this).next().length > 0) {\n $(this)\n .parent('li')\n .append(\n '<span class=\"dd-trigger\"><i class=\"flaticon-down-arrow\"></i></span>'\n );\n }\n });\n // expands the dropdown menu on each click\n navMenu.find('li .dd-trigger').on('click', function(e) {\n e.preventDefault();\n $(this)\n .parent('li')\n .children('ul')\n .stop(true, true)\n .slideToggle(350);\n $(this).parent('li').toggleClass('active');\n });\n\n // check browser width in real-time\n function breakpointCheck() {\n var windoWidth = window.innerWidth;\n if (windoWidth <= 1199) {\n navContainer.addClass('breakpoint-on');\n\n pushedWrap.html(pushedHtml);\n pushItem.hide();\n } else {\n navContainer.removeClass('breakpoint-on');\n\n pushedWrap.html(pushBlank);\n pushItem.show();\n }\n }\n\n breakpointCheck();\n var_window.on('resize', function() {\n breakpointCheck();\n });\n }", "function setMenu() {\n\n\t\tvar w = parseInt($(\"nav\").css(\"width\"), 10);\n\n\t\tif (w < 1200) {\n\n\t\t\tif ($(\"#navigator2\").is(':empty')) {\n\t\t\t\t$(\"#navigator2\").prepend($(\"#IndexNav\"), $(\"#productsNav\"),$(\"#contactNav\"),$(\"#accountNav\"), $(\"#cartNav\"));\n\t\t\t\t$(\"#productsNavUl\").attr(\"class\", \"subNav2\");\n\t\t\t\t$(\"#accountNavUl\").attr(\"class\", \"subNav2\");\n\t\t\t\t$(\"#miniNavigator\").show();\n\t\t\t\t$(\"#miniNavigator\").effect(\"highlight\", { color: 'green' }, 500);\n\t\t\t\t$(\"#navigator2\").hide();\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$(\"#navigator\").prepend($(\"#IndexNav\"), $(\"#productsNav\"),$(\"#contactNav\"),$(\"#accountNav\"), $(\"#cartNav\"));\n\t\t\t$(\"#productsNavUl\").attr(\"class\", \"subNav\");\n\t\t\t$(\"#accountNavUl\").attr(\"class\", \"subNav\");\n\t\t\t$(\"#miniNavigator\").hide();\n\t\t\t}\n\t}", "function showSubmenu(element) {\n var li = $(element);\n var panel = '';\n // var panel = $('#'+$(li).attr('data-target'));\n if (window.innerWidth <= 767) {\n panel = $('#myNavbar').find('#' + $(li).attr('data-target'));\n var menuImg = $(li).find('img.menu-arrow');\n if ($(menuImg).hasClass('arrow-down')) {\n $(menuImg).removeClass('arrow-down').addClass('arrow-up');\n $(menuImg).attr('src', '/content/dam/adc/fsl/images/global/en/mobileImages/menu-arrow-up.png');\n } else {\n $(menuImg).removeClass('arrow-up').addClass('arrow-down');\n $(menuImg).attr('src', '/content/dam/adc/fsl/images/global/en/mobileImages/menu-arrow-down.png');\n }\n $('img.menu-arrow').not(menuImg).addClass('arrow-down').removeClass('arrow-up');\n $('img.menu-arrow').not(menuImg).attr('src', '/content/dam/adc/fsl/images/global/en/mobileImages/menu-arrow-down.png');\n } else /*For desktop, show active menu with a border*/ {\n panel = $('.submenuContainer').find('#' + $(li).attr('data-target'));\n var isCurrentMenu = false;\n if (currentMenu.length > 0) {\n if (currentMenu.attr('id') == $(li).attr('id'))\n isCurrentMenu = true;\n }\n //do not toggle Active class for the current page menu.\n if (!(isCurrentMenu)) {\n $('.menu').find('.nav-pills').find('li').not($(li)).find('span').removeClass('active-menu');\n $(li).find('span').toggleClass('active-menu');\n if ($(li).find('span').hasClass('active-menu') == false && isIpad)\n $(currentMenu).find('span').addClass('active-menu');\n } else if (isIpad) {\n $('.menu').find('.nav-pills').find('li').find('span').removeClass('active-menu');\n $(currentMenu).find('span').addClass('active-menu');\n }\n }\n $('.submenu-panel').not(panel).hide();\n }", "toggleMenu() {\n if (!Foundation.MediaQuery.atLeast(this.options.hideFor)) {\n /**\n * Fires when the element attached to the tab bar toggles.\n * @event ResponsiveToggle#toggled\n */\n if(this.options.animate) {\n if (this.$targetMenu.is(':hidden')) {\n Foundation.Motion.animateIn(this.$targetMenu, this.animationIn, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n this.$targetMenu.find('[data-mutate]').triggerHandler('mutateme.zf.trigger');\n });\n }\n else {\n Foundation.Motion.animateOut(this.$targetMenu, this.animationOut, () => {\n this.$element.trigger('toggled.zf.responsiveToggle');\n });\n }\n }\n else {\n this.$targetMenu.toggle(0);\n this.$targetMenu.find('[data-mutate]').trigger('mutateme.zf.trigger');\n this.$element.trigger('toggled.zf.responsiveToggle');\n }\n }\n }", "function onOpen() {\n createMenu();\n}", "function mobileMenuOpener($menu) {\r\n if($menu.length === 0) return;\r\n var $self = $($menu),\r\n $html = $('html');\r\n //Attch click event\r\n $self.on('click', function(e) {\r\n var $target = $('.' + $self.attr('data-toggle-target'));\r\n\r\n $self.toggleClass('closer opener');\r\n $target.addClass('active-menu').stop(true).slideToggle({\r\n duration: 700,\r\n easing: 'easeInOutExpo'\r\n });\r\n $html.toggleClass('lock-html-x no-scroll-x');\r\n e.preventDefault();\r\n });\r\n}", "function toggleMenuDesktop () {\r\n\tif($(\"#toggle_menu_wrapper\").length) {\r\n\t\t$(\".toggle_button\").on('click', function() {\r\n\t\t\t$('.toggle_dropdown').addClass(\"open_toggle\");\r\n\t\t\t$('.toggle_dropdown .main_menu').fadeIn(1300);\r\n\t\t});\r\n\t\t$(\".toggle_button.dismiss\").on('click', function() {\r\n\t\t\t$('.toggle_dropdown').removeClass(\"open_toggle\");\r\n\t\t\t$('.toggle_dropdown .main_menu').fadeOut(100);\r\n\t\t});\r\n\t} \r\n}", "function toggleMobileMenu() {\n if (mobileMenuVisible) {\n //close menu\n nav.style.removeProperty(\"top\");\n burgerMenuSpan.forEach(span => {\n span.style.removeProperty(\"background\");\n });\n } else {\n //open menu\n nav.style.top = \"0px\";\n burgerMenuSpan.forEach(span => {\n span.style.background = \"#e9e9e9\";\n });\n }\n mobileMenuVisible = !mobileMenuVisible;\n}", "function toggleMenu(el) {\n if(screen.width <= 768) {\n var listView = document.querySelector('.list-view');\n var menuContainer = document.querySelector('.menu-container');\n\n menuContainer.classList.toggle('change');\n if(window.getComputedStyle(listView).display === 'none') {\n listView.style.display = 'block';\n } else if(window.getComputedStyle(listView).display === 'block') {\n listView.style.display = 'none';\n }\n }\n}", "showMobilemenu() {\n document.getElementById('main-wrapper').classList.toggle('show-sidebar');\n }", "function toogleMenus(){\r\n var dropdown = document.getElementById(\"menu\");\r\n if (dropdown.style.display === \"none\") {\r\n if(window.innerWidth > 853) {\r\n dropdown.style.display = \"flex\";\r\n dropDownMenuOpenStatus = false;\r\n } else {\r\n dropdown.style.display = \"block\";\r\n dropDownMenuOpenStatus = true;\r\n }\r\n } else {\r\n if(window.innerWidth < 853) {\r\n dropDownMenuOpenStatus = false;\r\n dropdown.style.display = \"none\";\r\n }\r\n }\r\n}", "function openNav() {\n document.getElementById(\"myNav\").style.display = \"block\";\n document.getElementsByClassName(\"menu-toggle\")[0].style.display = \"none\";\n navOpen = true;\n}", "function menu() {\r\n\r\n//Mobile Menu\r\n \"use strict\";\r\n\tvar items = $('.menuoverlay, .slideLeft, .submenu, .primary-toggle'),\r\n\t menucontent = $('.menucontent'),\r\n \r\n //Toggle Menu Open/Closed\r\n\t menuopen = function () {\r\n\t $(items).removeClass('menuclose').addClass('menuopen');\r\n $(\"body\").addClass(\"no-scroll\");\r\n },\r\n\t menuclose = function () {\r\n\t $(items).removeClass('menuopen').addClass('menuclose');\r\n $(\"body\").removeClass(\"no-scroll\");\r\n\t };\r\n \r\n\t$('.primary-toggle, .menuoverlay').click(function () {\r\n\t\tif (menucontent.hasClass('menuopen')) {$(menuclose);\r\n } else {\r\n $(menuopen);\r\n }\r\n \r\n $(window).on('resize', function () {\r\n \r\n if ($(window).width() > 1200) {\r\n $(\"body\").removeClass(\"no-scroll\");\r\n \r\n } else {\r\n \r\n if ($('.menucontent').hasClass('menuopen')) {\r\n $(\"body\").addClass(\"no-scroll\");\r\n }\r\n \r\n }\r\n \r\n });\r\n \r\n\t});\r\n \r\n\tmenucontent.click(function () {\r\n\t\tif (menucontent.hasClass('menuopen')) {$(menuclose); }\r\n\r\n\t});\r\n\r\n//Desktop Menu\t\r\n\r\n //use dropdown-menu hide function via jquery to utilize display:flexbox\r\n\r\n $(\".menu > ul > li > a\").click(function (e) {\r\n $(\".menu > ul > li > a\").removeClass(\"active\");\r\n \r\n $(this).addClass(\"active\");\r\n $(\".dropdown-menu\").slideUp(5, 'linear'); //slide up all the sub divs\r\n\r\n if ($(this).next().is(\":visible\")) { // check if item is visible\r\n $(this).toggleClass('active'); //remove active class\r\n\r\n //submenu\r\n $(\".dropdown-menu > ul > li > ul\").slideUp(5, 'linear');\r\n } else {\r\n $(this).next().slideDown(5, 'linear'); // else slide the current down\r\n }\r\n\r\n });\r\n\r\n //Sub-submenu\r\n $(\".dropdown-menu > ul > li > ul\").hide();\r\n $(\".dropdown-menu > ul > li > a.menu-submenu\").click(function (e) {\r\n \r\n $(\".dropdown-menu > ul > li > a.menu-submenu\").removeClass(\"active\");\r\n $(this).addClass(\"active\");\r\n \r\n $(\".dropdown-menu > ul > li > ul\").slideUp(5, 'linear'); //slide up all the sub divs\r\n \r\n if ($(this).next().is(\":visible\")) { // check if item is visible\r\n $(this).next().slideUp('fast'); // slide current up\r\n $(this).toggleClass('active'); //remove active class\r\n } else {\r\n $(this).next().slideDown(10, 'linear');\r\n } // else slide the current down\r\n \r\n });\r\n \r\n \r\n \r\n \r\n //Secondary menu within page content - submenu\r\n $(\".section-submenu ul li ul\").hide();\r\n $(\".submenu\").click(function (e) {\r\n \r\n $(\".section-submenu ul li a.submenu\").removeClass(\"active\");\r\n $(this).addClass(\"active\");\r\n \r\n $(\".section-submenu ul li ul\").slideUp(10, 'linear'); //slide up all the submenus\r\n $(this).addClass(\"active\"); // active \r\n $(\".dropdown-menu, .dropdown-menu > ul > li > ul\").slideUp(10, 'linear');// slide up Main menu \r\n \r\n if ($(this).next().is(\":visible\")) { // check if item is visible\r\n $(this).removeClass('active'); //remove active class\r\n $(this).next().slideUp('fast'); // slide current up\r\n } else {\r\n $(this).next().slideDown(10, 'linear'); // else slide the current down\r\n }\r\n });\r\n \r\n //Body click - Close Menus\r\n\r\n $('body').click(function () {\r\n $(\".dropdown-menu, .dropdown-menu > ul > li > ul, .section-submenu ul li ul\").slideUp(10, 'linear');\r\n $(\".menu > ul > li > a, .dropdown-menu > ul > li > a.menu-submenu, .submenu\").removeClass(\"active\");\r\n });\r\n\r\n $(\".menu > ul > li > a, .dropdown-menu > ul > li > a.menu-submenu, .submenu\").click(function (e) {\r\n e.stopPropagation();\r\n });\r\n\r\n}//menu()", "function toggleMobileMenu() {\n\t\tvar menuCont \t= $('.mobileMenu'), \n\t\t\t\ttoggle \t\t= $('.mobileMenuToggle'),\n\t\t\t\tclose\t\t\t= $('.mobileMenuClose');\n\t\ttoggle.on('click', function() {\n\t\t\tmenuCont.toggleClass('mobileMenu--vis');\n\t\t});\n\t\tclose.on('click', function() {\n\t\t\tmenuCont.toggleClass('mobileMenu--vis');\n\t\t});\n\t}", "function toggleMobileMenu(e) {\n e.preventDefault();\n toggleButtonIcon();\n if (!navListOpen) {\n navListOpen = true;\n gsap.to(\".navbar__list\", 0.5, {\n height: \"auto\",\n });\n } else {\n navListOpen = false;\n gsap.to(\".navbar__list\", 0.5, {\n height: \"0\",\n });\n }\n}", "mianMenu() {\n // Variables\n var var_window = $(window),\n navContainer = $('.nav-container'),\n pushedWrap = $('.nav-pushed-item'),\n pushItem = $('.nav-push-item'),\n pushedHtml = pushItem.html(),\n pushBlank = '',\n navbarToggler = $('.navbar-toggler'),\n navMenu = $('.nav-menu'),\n navMenuLi = $('.nav-menu ul li ul li'),\n closeIcon = $('.navbar-close');\n // navbar toggler\n navbarToggler.on('click', function() {\n navbarToggler.toggleClass('active');\n navMenu.toggleClass('menu-on');\n });\n // close icon\n closeIcon.on('click', function() {\n navMenu.removeClass('menu-on');\n navbarToggler.removeClass('active');\n });\n\n // adds toggle button to li items that have children\n navMenu.find('li a').each(function() {\n if ($(this).next().length > 0) {\n $(this)\n .parent('li')\n .append(\n '<span class=\"dd-trigger\"><i class=\"fas fa-angle-down\"></i></span>'\n );\n }\n });\n // expands the dropdown menu on each click\n navMenu.find('li .dd-trigger').on('click', function(e) {\n e.preventDefault();\n $(this)\n .parent('li')\n .children('ul')\n .stop(true, true)\n .slideToggle(350);\n $(this).parent('li').toggleClass('active');\n });\n\n // check browser width in real-time\n function breakpointCheck() {\n var windoWidth = window.innerWidth;\n if (windoWidth <= 991) {\n navContainer.addClass('breakpoint-on');\n\n pushedWrap.html(pushedHtml);\n pushItem.hide();\n } else {\n navContainer.removeClass('breakpoint-on');\n\n pushedWrap.html(pushBlank);\n pushItem.show();\n }\n }\n\n breakpointCheck();\n var_window.on('resize', function() {\n breakpointCheck();\n });\n }", "openMenu() {\n $('body').addClass('menu-open');\n }", "function showMobileBar(){\n\t\t\t$(menu).hide(0);\n\t\t\t$(showHideButton).show(0).click(function(){\n\t\t\t\tif($(menu).css(\"display\") == \"none\")\n\t\t\t\t\t$(menu).slideDown(settings.showSpeed);\n\t\t\t\telse\n\t\t\t\t\t$(menu).slideUp(settings.hideSpeed).find(\".dropdown, .megamenu\").hide(settings.hideSpeed);\n\t\t\t});\n\t\t}", "function showMobileBar(){\n\t\t\t$(menu).hide(0);\n\t\t\t$(showHideButton).show(0).click(function(){\n\t\t\t\tif($(menu).css(\"display\") == \"none\")\n\t\t\t\t\t$(menu).slideDown(settings.showSpeed);\n\t\t\t\telse\n\t\t\t\t\t$(menu).slideUp(settings.hideSpeed).find(\".dropdown, .megamenu\").hide(settings.hideSpeed);\n\t\t\t});\n\t\t}", "showMobilemenu() {\n document.getElementById(\"main-wrapper\").classList.toggle(\"show-sidebar\");\n }", "function showNav() {\n \n if (this.wasClicked == false) {\n menuStyle.setAttribute(\"class\", \"responsive-style\");\n this.wasClicked = true;\n } else if (this.wasClicked == true) {\n menuStyle.removeAttribute(\"class\", \"responsive-style\");\n this.wasClicked = false;\n } \n}", "function toggleMobileNavi() {\n\n\tif (isMobile == 1) {\n\t\t$('.touchclick').parent().removeClass('hover');\n\t\t$('.nav-primary').show();\n\t\t$('.hamburger').toggleClass('is-active');\n\t\t$('nav').toggleClass('on');\n\t\t$('#navi-lightbox').toggleClass('on');\n\t} else if (isMobile == 0) {\n\t\ttoggleMainNavi();\n\t}\n}", "function openNav(){\n\t// change type of button\n\tdocument.getElementById(\"open-button\").style.display= \"none\";\n\tdocument.getElementById(\"close-button\").style.display= \"inline-block\";\n\t// change width menu\n\tdocument.getElementById(\"navbar-respon\").style.width = \"100%\";\n\t\n\t\n\n}", "function showNavWeb() {\n if (window.innerWidth > 768) {\n showButton.parentElement.className = 'hamburger-button hide';\n menuContent.className = 'modal-navigation-mobile hide';\n menuNavWeb.className = 'nav-link-container flex row';\n } else {\n showButton.parentElement.className = 'hamburger-button flex row';\n menuContent.className = 'modal-navigation-mobile hide';\n menuNavWeb.className = 'nav-link-container hide';\n }\n}", "function smallMenuButton() {\n var x = document.querySelector(\"topnav\");\n if (x.className === \"topnav\") {\n x.className += \" responsive\";\n } else {\n x.className = \"topnav\";\n }\n}", "function mobileDetect() {\n if( $('.menu-button').css('display')==='inline-block') {\n isMobile = true; \n }\n \n if (isMobile === true) {\n $('#toggle1').click();\n } \n}", "function menuToggler() {\r\n\t\tif ($('.mobile-menu-closer').length) {\r\n\t\t\t$('.mobile-menu-closer').on('click', function () {\r\n\t\t\t\t$('.mobile-menu').css({\r\n\t\t\t\t\t'right': '-150%'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\t\tif ($('.mobile-menu-opener').length) {\r\n\t\t\t$('.mobile-menu-opener').on('click', function () {\r\n\t\t\t\t$('.mobile-menu').css({\r\n\t\t\t\t\t'right': '0%'\r\n\t\t\t\t});\r\n\t\t\t});\r\n\t\t};\r\n\t}", "function togglemenu() {\n var vw = $(window)[0].innerWidth;\n if ($(\".pcoded-navbar\").hasClass('theme-horizontal') == false) {\n if (vw <= 1200 && vw >= 992) {\n $(\".pcoded-navbar\").addClass(\"navbar-collapsed\");\n }\n if (vw < 992 || vw > 1200) {\n $(\".pcoded-navbar\").removeClass(\"navbar-collapsed\");\n }\n }\n}", "function open_navbar() {\n\n\tif (mobile === false) {\n\t\tdocument.querySelector(\".nav-bar-outerdiv\").style.width = \"30rem\";\n\t\tdocument.querySelector(\"#nav-bar-icon-close\").style.display = \"inline-block\";\n\t\tdocument.querySelector(\"#nav-bar-icon-open\").style.display = \"none\";\n\t}\n\n\telse {\n\t\tdocument.querySelector(\".nav-bar-outerdiv\").style.width = \"100%\";\n\t\tdocument.querySelector(\"#nav-bar-icon-close\").style.display = \"inline-block\";\n\t\tdocument.querySelector(\"#nav-bar-icon-open\").style.display = \"none\";\n\t}\n}", "function menu_open(){\r\n document.getElementById(\"menupage\").style.display = \"inline-block\";\r\n document.getElementById(\"close_menu\").style.display = \"inline-block\";\r\n document.getElementById(\"menu\").style.display = \"none\";\r\n}" ]
[ "0.75090635", "0.74564654", "0.74564654", "0.7387518", "0.7352951", "0.7333574", "0.72990775", "0.7268785", "0.72237355", "0.71683425", "0.71355635", "0.7081245", "0.7050028", "0.7031337", "0.70153886", "0.700344", "0.69877833", "0.6938438", "0.6930763", "0.6930763", "0.691977", "0.6899172", "0.68960124", "0.68959224", "0.6890572", "0.68902844", "0.68891567", "0.6886573", "0.68820703", "0.68694097", "0.6869243", "0.68677145", "0.686731", "0.6851589", "0.6845046", "0.68249893", "0.6821613", "0.68181753", "0.681431", "0.67887074", "0.6781619", "0.6781423", "0.67753035", "0.67709374", "0.6766326", "0.67604727", "0.67566055", "0.67549056", "0.6740427", "0.6716345", "0.6713754", "0.670474", "0.67038774", "0.66966623", "0.6686438", "0.666919", "0.6645909", "0.6624799", "0.6622347", "0.66189903", "0.6617848", "0.6606916", "0.65886974", "0.6586599", "0.6586082", "0.65698224", "0.65604734", "0.65604734", "0.6559767", "0.65554494", "0.6551826", "0.65511495", "0.6550218", "0.6549669", "0.65460014", "0.65436906", "0.65214026", "0.6520492", "0.6519068", "0.65094805", "0.6504998", "0.6504517", "0.6502505", "0.64982957", "0.6490164", "0.64799076", "0.64776254", "0.6471608", "0.6461621", "0.6461621", "0.6458219", "0.6458167", "0.6453937", "0.64467835", "0.6441546", "0.64316934", "0.642855", "0.6426998", "0.64267427", "0.6425219", "0.6423654" ]
0.0
-1
This function close the responsive menu
function closeMenu() { document.getElementById("overlay-menu").classList.remove("show-overlay-menu"); document.getElementById("burger-menu").classList.remove("d-none"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function closeMobileNav(){\n if (window.innerWidth >= 750){\n closeMobileMenu();\n deactivateScrollMenu();\n mobileMenuIsOpen = false;\n }\n }", "function closemenu(){\n\t\t\tif ( $menu && timer ){\n\t\t\t\t$menu.children('a').removeClass( settings.parentMO ).siblings('ul')[ settings.hide ]();\n\t\t\t\ttimer = clearTimeout( timer );\n\t\t\t\t$menu = false;\n\t\t\t}\n\t\t}", "function closeMobileMenu() {\n if (mediaQ(\"tabletL\")) {\n overlay.classList.remove(\"navbar__dark-overlay--visible\");\n burgerBtn.classList.remove(\"burger-btn--open\");\n mainNav.classList.remove(\"main-nav--visible\");\n setAriaExpandedOnBtn();\n }\n toggleTabIndex();\n }", "function closeNav_responsive() {\n options.jq.contentWell.show().animate({left: 0}, animConfig());\n options.jq.navContainer.animate({marginLeft: '-100%'}, animConfig(function () {\n options.jq.contentWell.removeAttr('style');\n options.jq.navContainer.removeAttr('style');\n }));\n setNavState(0);\n }", "function OCM_simpleDropdownClose() {\r\n\t\t\t\t\t$('#mobile-menu').hide();\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.slide-out-widget-area-toggle:not(.std-menu) .lines-button').removeClass('close');\r\n\t\t\t\t\t\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\tif ($('body.material').length > 0) {\r\n\t\t\t\t\t\t\t$('header#top .slide-out-widget-area-toggle a').removeClass('menu-push-out');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t$('.slide-out-widget-area-toggle a').removeClass('animating');\r\n\t\t\t\t\t}, 350);\r\n\t\t\t\t}", "function closemenu() {\n mcroyal.classList.remove('active');\n nav.classList.remove('active');\n }", "function closeMenu(menuMobile) {\n menuMobile.animate({opacity:'toggle'}, 400);\n }", "function close_mobile_menu() {\n jQuery('#web-shadow').css('display', 'none');\n return close_mobile_menu_leave_shadow();\n}", "function closeNav() {\r\n menu.classList.toggle(\"change\");\r\n checkQuery(query768);\r\n}", "function closeMobileMenu() {\n document.querySelector('body').classList.remove('no-scroll');\n document.querySelector('[data-mobile-menu]').classList.remove('is-visible');\n}", "function mobileMenuCloseClicked() {\r\n\t\tdom.mobileMenu.animate({\r\n\t\t marginLeft: '-450px',\r\n\t\t},500)\r\n\t}", "menuClose(event) {\n var navItem = document.getElementsByTagName('nav')[0];\n if (navItem.style.display === 'block') {\n navItem.style.display = 'none';\n navItem.classList.remove('menuhidden');\n }\n }", "function closeMenuEvent() {\n // Vars\n var firstLevelMenuItem = '#tablet-mobile-menu ul.menu li a';\n var page = jQuery(\"body, html\");\n\n jQuery('#menu-btn-toggle').removeClass('open');\n jQuery(firstLevelMenuItem).parent().removeClass('active-open');\n\n //TODO Change the skin position only when present\n jQuery(page).css(\"background-position\", \"center top\").css(\"position\", \"initial\");\n}", "closeMobileMenu() {\n this.$mobileMenu.find('.menu-item-has-children ul').slideUp(300).removeClass('open');\n this.$navbar.find('.ui.mobile.container').fadeOut(300);\n $('body').removeClass('mobile open');\n\n setTimeout(() => {\n this.$navbar.removeClass('mobile open');\n $('.mobile.slice').removeClass('active');\n }, 300);\n }", "function closeMenuOutMenuClick(e){\n\t\tif(!$(e.target).closest('.menu-wrap').length && !$(e.target).closest('.fa-compass').length && $(window).width()<991){\n\t\t\tmenuWrap.slideUp(100);\n\t\t}\n\t}", "function closeMenu() {\n g_IsMenuOpen = false;\n}", "function navCloseHandler() {\n if (!widthFlg) {\n $navigation.removeClass('show');\n $navigation.attr('style', '');\n $btnMenu.text(\"menu\");\n $dropdownItem.removeClass('active');\n $dropdownItem.attr('style', '');\n $dropdownListItem.find(\"ul\").removeAttr('style');\n $(\"body\").removeClass(\"push_right\");\n $(\"body\").removeAttr('style');\n $btnMenu.css('display', 'none');\n $navItem.not(\".dropdown_list\").find(\"a > i.material-icons\").text(\" \");\n $dropdownItem.find('i.material-icons').text(\" \");\n } else {\n $btnMenu.css('display', 'block');\n $navItem.not(\".dropdown_list\").find(\"a > i.material-icons\").text(\"remove\");\n $dropdownItem.find('i.material-icons').text(\"keyboard_arrow_right\");\n }\n }", "function autoClose() {\n var isMobile_2 = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEmobile|Windows Phone|WPDesktop/i.test(navigator.userAgent);\n if (!isMobile_2) {\n closeInClose();\n // On resize event\n $(window).resize(function() {\n closeInClose();\n $('div.shadow').removeClass('active-form');\n $('body').removeClass('ind');\n });\n\n // On click another menu item event\n $('.skip-links2 a').click(function() {\n closeInClose();\n $('div.shadow').removeClass('active-form');\n $('body').removeClass('ind');\n });\n };\n }", "function closeMenu() {\n\t\tburgerMenu.classList.remove(\"toggleOn\");\n\t\ttopNav.classList.remove(\"toggleOn\");\n\t\tcloseBtn.style.display = \"none\";\n\t}", "function closeMobileMainMenu() {\r\n $(\".main-menu-container\").removeClass(\"opened\");\r\n $(\".mobile-menu-icon-container\").removeClass(\"opened-menu-icon\");\r\n}", "function closeMenu() {\n var myTopnav = document.getElementById(\"myHeader\");\n if (myTopnav.className === \"row responsive\") {\n myTopnav.className = \"row\";\n }\n}", "function closeMenu() {\n $('#menuContainer').css('right', '-300px');\n }", "function closeMenu() {\r\n\t var menus = document.getElementsByClassName('menu');\r\n\t for (var i=0 ; i<menus.length ; i++) {\r\n\t\t menus[i].parentNode.removeChild(menus[i]);\r\n\t }\r\n }", "function closeMobileCustomerMenu() {\r\n $(\".customer-logged-menu-container\").removeClass(\"opened\");\r\n}", "function closeMenu() {\r\n\tmenu.classList.remove('show');\r\n\tdocument.body.style.overflow = 'auto';\r\n\ticon.classList.toggle('close');\r\n}", "function closeNav()\n {\n $('body')\n .removeClass('nav-expanded');\n }", "function closeHamMenu() {\n var hmb = document.querySelector('.hmb');\n var hmbHolder = document.querySelector('.hmb_holder');\n hmbHolder.style.visibility = 'hidden';\n hmbHolder.style.opacity = '0';\n hmb.style.marginRight = '-250px';\n}", "function cerrar_nav() {\n\t\t$('.menu-responsive, .submenu-productos').animate({\n\t\t\twidth: 0\n\t\t}, {queue:false, duration: 300, complete: function() {\n\t\t\t$('.r-overlay').css('height', '0%').animate({\n\t\t\t\topacity: 0\n\t\t\t}, 200);\n\t\t}});\n\t\t$('.nav-mobile-close').hide();\n\t\t// $('.nav-mobile').show();\n\t}", "function clickMenuClose() {\n navList.addEventListener('click', function () {\n if (!mq1.matches) {\n menu[0].classList.add('hide');\n header[0].style.overflow = 'hidden';\n }\n });\n}", "function closeDrawerMenu() {\n\t\t\t$('.pure-toggle-label').click();\n\t\t}", "function hideMenu() {\n\t\t\tvar currentMenu = element.querySelector('.' + SETTINGS.open);\n\n\t\t\t// if there is a submenu opened, then close it\n\t\t\tif (currentMenu) {\n\t\t\t\tcurrentMenu.classList.remove(SETTINGS.open);\t\n\t\t\t}\n\t\t}", "function closeNav() {\n $(\"#swim-overlay-menu\").css({\"width\" : \"0%\"});\n}", "function menu_close() {\r\n mySidebar.removeClass('show-menu');\r\n mySidebar.addClass('hide-menu');\r\n}", "function handleMenuClose() {\n setMenuOpen(null);\n }", "function closeNav() {\n sidenav.css(\"margin-left\", \"-270px\");\n sidenav.css(\"overflow\", \"hidden\");\n backButton.removeClass(\"active_background\");\n disableHamburger();\n menuOpen = false;\n}", "navClose() {\n this.htmlData.header.classList.remove(\"open\");\n this.htmlData.overlay.classList.remove(\"show\");\n this.closeAllMenus();\n }", "function closeMenusOnResize() {\n\t\tif (window.innerWidth >= 768) {\n\t\t\tcloseMenus();\n\t\t\t// collapse.classList.add('mtn-navbar__collapse');\n\t\t\tcollapse.classList.remove('in');\n\t\t\ttoggle.classList.add('navbar-collapsed');\n\t\t}\n\t}", "_close() {\n const that = this;\n\n that._discardKeyboardHover(true);\n\n if (that._minimized && that._minimizedDropDownOpened) {\n that._positionDetection.removeOverlay();\n that.$view.addClass('jqx-visibility-hidden');\n\n if (that._edgeMacFF) {\n that.$.view.style.left = '';\n that.$.view.style.top = '';\n that.$view.addClass('not-in-view');\n }\n\n that.$hamburgerIcon.removeClass('jqx-close-button');\n that._minimizedDropDownOpened = false;\n }\n }", "function navCloseHandler() {\n if (!widthFlg) {\n\n }\n }", "function closeExcursionsMenu() {\n !!list.excursionMenu && list.excursionMenu.hide();\n }", "function closeMenu() {\n myLinks.style.display = \"none\";\n}", "w3_close() {\n\t\tthis.mySidenav.style.display = \"none\";\n\t\tthis.overlayBg.style.display = \"none\";\n\t}", "function closeMenu() {\n\n //Hide the menu\n setVisibility(document.getElementById(\"menuPopup\"), false);\n}", "function closeMenu(toggler, menu) {\n menu.slideUp('fast');\n toggler.toggleClass('open');\n }", "function closeNavMobile() {\n document.getElementById(\"nav-slide\").style.height = \"0\";\n }", "function closeNav() {\n document.getElementById(\"menu\").style.width = \"0\";\n document.getElementsByTagName(\"main\")[0].style.opacity = \"1\";\n\n if ((document.getElementById(\"menu\").style.width = \"0\")) {\n var btn = document.getElementById(\"menubutton\");\n btn.style.display = \"block\";\n } else {\n btn.style.display = \"none\";\n }\n}", "closeMenu() {\n this._itemContainer.visible = false;\n this.accessible.expanded = false;\n this._label.accessible.expanded = false;\n }", "function swipeMenuClose()\n{\n $swipeMenu.classList.remove('active');\n $swipeMenu.style.cssText = 'transition: transform 0.15s linear';\n $overlay.classList.remove('active');\n $overlay.style.cssText = 'transition: opacity .15s linear, visibility .2s linear';\n moveDistance = -menuWidth;\n menuLastX = moveDistance;\n}", "function closeNav()\r\n{\r\n header_side_nav.style.width = \"0\";\r\n setTimeout(function()\r\n {\r\n document.querySelector(\".header-menu_icon\").style.display = 'block';\r\n }, 500);\r\n\r\n}", "function close_toggle() {\n if ($(window).width() <= 768) {\n $('.navbar-collapse a').on('click', function () {\n $('.navbar-collapse').collapse('hide');\n });\n }\n else {\n $('.navbar .navbar-default a').off('click');\n }\n }", "function closeNav() {\r\n $('.hamburger_menu, .bannerContainer, .storiesContainer, footer').animate({\r\n marginLeft: \"0\"\r\n });\r\n $('#mobile_menu').animate({\r\n marginLeft: \"-250px\"\r\n });\r\n}", "function closeNavSlider(){\n let mobileNav=document.querySelector('.mobile-nav-div');\n //console.log(mobileNav);\n if(mobileNav.classList.contains('show-nav')){\n mobileNav.classList.remove('show-nav');\n mobileNav.classList.add('hide-nav');\n } else {\n return;\n }\n}", "function closeMenu(e) {\n var target = e.target;\n var its_menu = target == menu || menu.contains(target);\n var its_hamburger = target == btn;\n var menu_is_active = menu.classList.contains('active');\n \n if (!its_menu && !its_hamburger && menu_is_active) {\n openMenu();\n }\n}", "function hideMenu() {\n if (isMobile()) {\n $('.menu-bar').toggleClass('menu-open');\n $('.menu').toggleClass('menu-list-open');\n }\n}", "function collapseMenu() {\n var windowsize = $window.width();\n if (windowsize < hamburgerWidth) {\n // hamburger menu\n $(\".ked-navigation .sidebar\").css(\"height\", \"\");\n } else {\n // normal menu\n $(\".ked-navigation .sidebar\").css(\"width\", \"\");\n }\n pinIcon.css(\"opacity\", 0);\n $(\".ked-navigation .logo span\").css(\"opacity\", \"0\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"0\");\n $(\".ked-navigation .offcanvas-nav li a .state-indicator\").css(\"opacity\", \"0\");\n $(\".ked-navigation .search .search-field\").css(\"opacity\", \"0\");\n $(\".ked-navigation .offcanvas-nav li a span\").css(\"opacity\", \"0\");\n $(\".subnav\").stop().hide();\n $(\".state-indicator\").removeClass('fa-caret-up').addClass('fa-caret-down');\n }", "function menuHide() {\n ui.languageContainer.removeClass('open');\n ui.appbarElement.removeClass('open');\n ui.mainMenuContainer.removeClass('open');\n ui.darkbgElement.removeClass('open');\n}", "closeBurgerMenu() {\n if (this.state.isOpen === true) {\n this.toggleBurgerMenu();\n\n }\n }", "function close_toggle() {\r\n if ($(window).width() <= 768) {\r\n $('.navbar-collapse a').on('click', function () {\r\n $('.navbar-collapse').collapse('hide');\r\n });\r\n }\r\n else {\r\n $('.navbar .navbar-inverse a').off('click');\r\n }\r\n }", "closeMenu() {\n $(this.openMenuTrigger).removeClass(\"mobile-open\");\n $(\".navigation\").removeClass(\"mobile-open\");\n $(\".navigation\")\n .find(\".open\")\n .removeClass(\"open\");\n // $(document)\n // .find(this.menuContainer)\n // .removeClass(\"mobile-open\");\n // $(this.closeMenuTrigger).remove();\n // $(document)\n // .find(this.menuBackground)\n // .removeClass(\"mobile-open\");\n // $(document)\n // .find(this.closeMenuTrigger)\n // .removeClass(\"mobile-open\");\n }", "function showMenu() {\n document.getElementById('responsive-menu-click').classList.remove('hide-menu');\n document.getElementById('blackbendjava').classList.remove('d-none');\n}", "function closeAllMenus() {\n hideCategoryNav();\n hideMobileMenuDropdown();\n }", "function closeMenuBar() { \n const iconButton = document.getElementsByClassName('icon')[0];\n const navbarSide = document.getElementsByClassName('navbar-side')[0]; \n navbarSide.style.display = 'none';\n iconButton.style.display = 'block';\n\n\n}", "function closeSubMenuOutMenuClick(e){\n\t\tif(!$(e.target).closest('.menu-item-has-children.active').length && $(window).width()>991){\n\t\t\t$('.sub-menu').slideUp(100);\n\t\t\t$('.menu-item-has-children').removeClass('active');\n\t\t}\n\t}", "function closeNav() {\n $(\"#mySidenav\").css('width', '0');\n $(\"#main\").css('marginLeft', '0');\n $(\".resultado\").css('opacity', '1');\n}", "function closeMenu(menu_item){\n\t\t\t\n\t\t\t// Get menu box\n\t\t\tvar menu_box = menu_item.find('> ul, > div').stop(true, true);\n\t\t\t\n\t\t\t// If animation is function\n\t\t\tif(typeof settings.closeAnimation == 'function'){\n\t\t\t\t$(menu_item).removeClass(settings.openMenuClass)\n\t\t\t\tsettings.closeAnimation.call(menu_box);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tswitch(settings.closeAnimation){\n\t\t\t\tcase 'fade':\n\t\t\t\t\tfadeAnimation(menu_box, false);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'size':\n\t\t\t\t\tsizeAnimation(menu_box, false);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tslideAnimation(menu_box, false);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}", "static closeNav() {\n ElementHandler.setElementCSSById('sidebarMenu', 'width', \"0px\");\n ElementHandler.setElementCSSById('openSidebar', 'width', \"0px\");\n ElementHandler.showElementById('openSidebar');\n }", "function closeMenu(){\n menu.classList.remove('active');\n}", "function closeNav() {\n\t\t\tdocument.getElementById(\"mySidenav\").style.width = \"0\";\n\t\t}", "_close() {\n const that = this;\n\n that._positionDetection.removeOverlay();\n that._closeSubContainers(2);\n that._discardKeyboardHover(true);\n\n if (that._minimized && that._minimizedDropDownOpened) {\n that.$mainContainer.addClass('jqx-visibility-hidden');\n\n if (that._edgeMacFF) {\n that.$.mainContainer.style.left = '';\n that.$.mainContainer.style.top = '';\n that.$mainContainer.addClass('not-in-view');\n }\n\n that.$hamburgerIcon.removeClass('jqx-close-button');\n that._minimizedDropDownOpened = false;\n }\n }", "function closeNav() {\n navigation.style.width = \"0\";\n main.style.left = \"0\";\n main.style.position = \"static\";\n main.style.filter = \"opacity(100%)\";\n triggered = 0;\n }", "function closeMenu(event) {\n console.log(\"close menu\");\n menu.classList.remove('showMenu');\n event.preventDefault();\n}", "function closeOnClick() {\n let sidenav = document.querySelector(\"#slide-out\");\n let instance = M.Sidenav.getInstance(sidenav);\n instance.close();\n }", "function closeBurgerMenu(e) {\n\tvar clickedOn = $(e.target) ;\n\tvar navOpened = $('.navbar-collapse').hasClass('show') ;\n\tif (navOpened === true && !clickedOn.hasClass('navbar-toggler')) {\n\t\t$('.navbar-toggler').click() ;\n\t}\n}", "function CloseNav() {\n $(\".navbar-collapse\").stop().css({ 'height': '1px' }).removeClass('in').addClass(\"collapse\");\n $(\".navbar-toggle\").stop().removeClass('collapsed');\n }", "function openCloseMenu() {\n const elem = document.querySelector('#mobile-menu-burger');\n\n const mobile_menu = document.querySelector('.mobile-menu');\n if (elem.dataset.img === 'open') {\n elem.dataset.img = 'close';\n elem.src = 'images/icons/clear.svg';\n mobile_menu.dataset.active = 'true';\n document.querySelector('header').dataset.overflow = 'hidden';\n } else {\n mobile_menu.dataset.active = 'false';\n elem.dataset.img = 'open';\n elem.src = 'images/icons/burger.svg';\n document.querySelector('header').dataset.overflow = '';\n }\n}", "function hideMobileMenuDropdown() {\n $mobileMenuDropdown.slideUp(SLIDE_DURATION).removeClass(OPEN_CLASS);\n }", "closeNav(){\n var navbar = document.getElementById(\"navbar\");\n navbar.classList.remove(\"extend_nav\");\n navbar.classList.add(\"close_nav\");\n\n this.dimScreen();\n\n //call all animation functions to close navbar\n this.animateElements();\n this.animateClosedNav(\"in\");\n }", "function closeNewGameMenu () {\n document.getElementById('menu-background').style.display = 'none';\n document.getElementById('menu-content').style.display = 'none';\n}", "function closeMenu(subMenu) {\r\n const subMenuElement = document.querySelector(subMenu);\r\n subMenuElement.classList.remove(\"nav-open\");\r\n}", "function closeNav() {\r\n document.getElementById(\"menu\").style.width = \"0\";\r\n}", "closeMenu() {\n let closeMenuBtn = document.querySelector(\"#closeMenu\");\n\n closeMenuBtn.addEventListener(\"click\", () => {\n document.getElementById(\"myMenu\").style.width = \"0\";\n this.hideMenu();\n });\n }", "function closeMenu() {\n var startNav = document.getElementById('startNav');\n var boardSection = document.getElementById('board_section');\n var boardContainer = document.getElementById('board_container');\n document.getElementById('mv-scoreboard').style.visibility = \"visible\";\n startNav.style.height = \"0em\";\n for(i = 0; i < startNav.children.length; i++) {\n startNav.children[i].style.display = \"none\";\n }\n \n boardSection.style.height = \"100vh\";\n boardContainer.style.visibility = \"visible\";\n}", "function closeTheMenu() {\n if ($(\".in\").length) {\n $(\".in\").removeClass(\"in\");\n }\n}", "function close_toggle() {\r\n if ($(window).width() <= 768) {\r\n $('.navbar-collapse a').on('click', function () {\r\n $('.navbar-collapse').collapse('hide');\r\n });\r\n }\r\n else {\r\n $('.navbar .navbar-inverse a').off('click');\r\n }\r\n }", "function closeMoreButtonsMenu() {\n\tisMoreButtonsMenu = false;\n\t$('#moreButtonsMenu').html(\"\");\n\t$('#moreButtonsMenu').toggle();\n}", "function closeNav() {\n $('#sidefoot').css('display', 'block');\n $('.footer-inner').css('padding-left', '20px');\n $('#nav-list li').addClass('treelisthidden');\n storage.removeItem(treesettings);\n $('#sideNavigation').css('display', 'none');\n $('#sideNavigation').css('width', '300px');\n $('body.support_kb').find('#sidefoot').css('margin-left', '-250px');\n $('body.support_kb').find('.cover').css('display', 'block');\n //$('body.support_kb').find('#sideNavigation').css('margin-left','0');\n $('body.support_kb').find('#sideNavigation').css('margin-left', '-250px');\n $('body').find('main').css('width', 'calc(100% - 100px)');\n $('#side-toggle').attr('class', 'fa fa-angle-double-right');\n $(\"#sidefoot\").css(\"width\", \"50px\");\n\n (function() {\n try {\n $('#sideNavigation').resizable(\"disable\");\n } catch (err) {\n setTimeout(arguments.callee, 200)\n }\n })();\n }", "function OCM_close(item) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('#slide-out-widget-area.open').length > 0) {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $windowCurrentLocation = window.location.href.split(\"#\")[0];\r\n\t\t\t\t\t\tvar $windowClickedLocation = item.find('> a').attr('href').split(\"#\")[0];\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($windowCurrentLocation == $windowClickedLocation || item.find('a[href^=\"#\"]').length > 0) {\r\n\t\t\t\t\t\t\tif (item.parents('.slide-out-from-right-hover').length > 0) {\r\n\t\t\t\t\t\t\t\t$('.slide-out-widget-area-toggle.slide-out-hover-icon-effect a').trigger('click');\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t$('.slide-out-widget-area-toggle a').trigger('click');\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function closeAll(event) {\n var target = event.target; //target div recorded\n var target = event.target; //target div recorded\n if (!jQuery(target).is('#au-primary-nav a, #mobile-menu-trigger *') ) {\n if(desktop){\n $('.cd-secondary-nav').addClass('is-hidden');\n $('#au-site-nav a').removeClass('selected');\n }\n }\n }", "hideMenu () {\n try {\n const windowWidth = window.innerWidth\n // console.log(\"Window Width : \",windowWidth)\n if (windowWidth > MENU_HIDE_WIDTH) return\n\n // Veryfies if the sideba is open\n const sidebarEle = document.getElementsByClassName('main-sidebar')\n const style = window.getComputedStyle(sidebarEle[0])\n const transform = style.transform // get transform property\n\n // If the transform property has any\n // negative property, means that the menu\n // is not visible on the screen\n if (transform.match('-')) {\n // Returns if the menu is already hidden\n return\n }\n\n const toggleEle = document.getElementsByClassName('sidebar-toggle')\n toggleEle[0].click()\n } catch (error) {\n // console.error(error)\n }\n }", "function closeNavbar() {\r\n navbarIconMenu.classList.add('navbar-open');\r\n navbarIconMenu.classList.remove('navbar-close');\r\n document.querySelector('.menu-icon-close').remove();\r\n navbarIconMenu.innerHTML = variables.menuIconOpen;\r\n navbarMenu.removeAttribute('style');\r\n }", "function closeNav() {\r\n\tdocument.getElementById(\"mysidenav\").style.height = \"0\";\r\n\tmenuopen=false;\r\n}", "function CloseDropdown() {\n if (document.body.classList.contains(\"fullscreen-nav\")) {\n ToggleDropdown();\n }\n}", "function closeNav() {\n$('#mySidenav').css('width', '0');\n$('#main').css('marginLeft','0');\n}", "function menu_close() {\n var mySidenav = document.getElementById(\"mySidenav\");\n mySidenav.style.display = \"none\";\n}", "function closeNav(){\n\t$('#closeNav').removeClass('fadingIn fadingOut').addClass('fadingOut');\n\t$('#openNav').removeClass('fadingIn fadingOut').addClass('fadingIn');\n\t$('#main-menu').hide(\"slide\", { direction: \"right\" }, 500);\n\t$('header, main, footer').animate({opacity: '1'}, 500);\n\t$('.cover-page').css('display', 'none');\n}", "function closeNavMenu() {\n menuClose[0].addEventListener('click', function () {\n menu[0].classList.add('hide');\n header[0].style.overflow = 'hidden';\n });\n}", "function OCM_fullscreenAltClose() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tif ($('body.material').length > 0) {\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t$('header#top .slide-out-widget-area-toggle a').removeClass('menu-push-out');\r\n\t\t\t\t\t\t}, 350);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.slide-out-widget-area-toggle:not(.std-menu) .lines-button').removeClass('close');\r\n\t\t\t\t\t$('.blurred-wrap').removeClass('blurred');\r\n\t\t\t\t\t$offCanvasBG.removeClass('open');\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('#slide-out-widget-area.fullscreen-alt .widget').transition({\r\n\t\t\t\t\t\t'opacity': 0\r\n\t\t\t\t\t}, 500, 'easeOutQuad', function () {\r\n\t\t\t\t\t\t$(this).transition({\r\n\t\t\t\t\t\t\ty: '40px'\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t$('#slide-out-widget-area .bottom-text, #slide-out-widget-area .off-canvas-social-links li').transition({\r\n\t\t\t\t\t\t'opacity': 0\r\n\t\t\t\t\t}, 250, 'easeOutQuad');\r\n\t\t\t\t\t$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');\r\n\t\t\t\t\t\r\n\t\t\t\t\t$('.off-canvas-menu-container .menu').transition({\r\n\t\t\t\t\t\ty: '-13px',\r\n\t\t\t\t\t\t'opacity': 0\r\n\t\t\t\t\t}, 400);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t$('.off-canvas-menu-container .menu > li').stop(true, true).transition({\r\n\t\t\t\t\t\t\ty: '40px',\r\n\t\t\t\t\t\t\t'opacity': 0\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t\t$('#slide-out-widget-area .off-canvas-social-links li').transition({\r\n\t\t\t\t\t\t\t'scale': 0\r\n\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t\t$('#slide-out-widget-area .off-canvas-social-links').removeClass('line-shown');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t// Close submenu items\r\n\t\t\t\t\t\t$('#slide-out-widget-area .menuwrapper .menu').removeClass('subview');\r\n\t\t\t\t\t\t$('#slide-out-widget-area .menuwrapper .menu li').removeClass('subview subviewopen');\r\n\t\t\t\t\t\t$('#slide-out-widget-area.fullscreen-alt .inner .off-canvas-menu-container').css('height', 'auto');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('.mobile #header-outer[data-permanent-transparent=\"false\"]').length > 0 && $('.container-wrap').hasClass('no-scroll')) {\r\n\t\t\t\t\t\t\t$('#ajax-content-wrap').removeClass('at-content');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($('.mobile #header-outer[data-permanent-transparent=\"false\"]').length == 0) {\r\n\t\t\t\t\t\t\t$('#slide-out-widget-area.fullscreen-alt .inner-wrap').css('padding-top', '0');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('.slide-out-widget-area-toggle a').removeClass('animating');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$offCanvasBG.css({\r\n\t\t\t\t\t\t\t'height': '1px',\r\n\t\t\t\t\t\t\t'width': '1px',\r\n\t\t\t\t\t\t\t'left': '-100%'\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t$('#slide-out-widget-area.fullscreen-alt').hide().removeClass('open');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}, 550);\r\n\t\t\t\t\t\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\tif ($('.nectar-social.fixed').length == 0) {\r\n\t\t\t\t\t\t\tshowToTop();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, 600);\r\n\t\t\t\t\t\r\n\t\t\t\t\t// Fade out overlay\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t$offCanvasBG.removeClass('padding-removed');\r\n\t\t\t\t\t}, 50);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar borderDelay = ($bodyBorderHeaderColorMatch == true) ? 150 : 50;\r\n\t\t\t\t\t\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t$offCanvasBG.stop(true).css({\r\n\t\t\t\t\t\t\t'opacity': 0\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tif ($('#header-outer[data-transparent-header=\"true\"]').length > 0) {\r\n\t\t\t\t\t\t\t$('body > div[class*=\"body-border\"]').css('z-index', '10000');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}, borderDelay);\r\n\t\t\t\t\t\r\n\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t$('#header-outer.transparent.small-nav, #header-outer.transparent.detached, #header-outer:not([data-permanent-transparent=\"1\"]).transparent.scrolled-down').removeClass('transparent');\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($headerOuterEl.hasClass('pseudo-data-transparent')) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t$headerOuterEl.attr('data-transparent-header', 'false')\r\n\t\t\t\t\t\t\t\t.removeClass('pseudo-data-transparent')\r\n\t\t\t\t\t\t\t\t.removeClass('transparent');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}, 100);\r\n\t\t\t\t\t\r\n\t\t\t\t}", "function closeNav() {\n $('#mySidenav').fadeOut();\n $('#main').css('margin-left', '0');\n $('#main').css('margin-right', '0');\n $('#mySidenav').css('margin-left', '0');\n $('#mySidenav').css('margin-right', '0');\n}", "function closeNav() {\n \n var cl = site.classList;\n if (cl.contains('open')) {\n cl.remove('open');\n }\n}", "function mobileMenuHide() {\r\n\t\tvar windowWidth = $(window).width();\r\n\t\tif (windowWidth < 1024) {\r\n\t\t\t$('#site_header').addClass('mobile-menu-hide');\r\n\t\t}\r\n\t}" ]
[ "0.80568814", "0.7969944", "0.79092", "0.77921027", "0.7748819", "0.768107", "0.766475", "0.76574033", "0.764836", "0.7645062", "0.76220834", "0.7577997", "0.7572837", "0.7534751", "0.75058335", "0.7495968", "0.74687433", "0.7468362", "0.746368", "0.7455816", "0.7433187", "0.7373541", "0.7322761", "0.7308403", "0.7285959", "0.7261539", "0.72440255", "0.7222234", "0.72093076", "0.7191127", "0.7190009", "0.71820754", "0.7180085", "0.71777385", "0.71585965", "0.7130441", "0.712403", "0.71210086", "0.710266", "0.71011096", "0.70984054", "0.70796216", "0.7072838", "0.7069619", "0.7057409", "0.704446", "0.7041745", "0.70396346", "0.7017189", "0.70117813", "0.69931555", "0.6985899", "0.6985125", "0.6980014", "0.69655436", "0.69641167", "0.69625425", "0.69624424", "0.69606435", "0.69540775", "0.69489574", "0.694656", "0.6946461", "0.69457054", "0.69440275", "0.69362515", "0.6933886", "0.6932014", "0.6924729", "0.6924308", "0.69160587", "0.69110745", "0.6900653", "0.689908", "0.6898716", "0.6893529", "0.68803763", "0.6876993", "0.6874509", "0.68729204", "0.68638605", "0.68512124", "0.68506414", "0.68501824", "0.68496114", "0.68395096", "0.6833343", "0.6832462", "0.68317896", "0.68295115", "0.68253416", "0.6824153", "0.68211967", "0.68160546", "0.6813929", "0.6813838", "0.6810181", "0.6806691", "0.6805901", "0.6805419" ]
0.77642536
4
for optional properties skip the logTrace
function tryAssertHas(ctx, types) { try { assertHas(ctx,types); return true; } catch(e) { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "TraceOnly(...args) { this.do_log(\"TRACE\", args, false); }", "function debuglog(){\n if(false)\n console.log.apply(this,arguments)\n}", "function xxxdebugProperties(jo){\n\tconsole.log('\\n\\n' + jo.data['xath' ] + '\\n\\n' + jo.data['cod']\n\t + '\\n\\n' + jo.data['idn' ] + '\\n\\n' + jo.data['pk' ]\n\t + '\\n\\n' + jo.data['textQr'] + '\\n\\n');\n}", "function silence() {\n replaceLog({\n debug: function () { return null; },\n info: function () { return null; },\n warn: function () { return null; },\n warning: function () { return null; },\n error: function () { return null; }\n });\n}", "isLogSilent() {\n\t\t\treturn process.env.IS_LOG_SILENT ?\n\t\t\t\tcastToBoolen(process.env.IS_LOG_SILENT) :\n\t\t\t\tDEFAULT_IS_LOG_SILENT;\n\t\t}", "stopLog() {\n this.isLogging = false;\n }", "function _log() {\n // logger.trace.apply(logger, arguments)\n}", "function walkObjectSkip()\n\t\t{\n\t\t\tfunction process(value, index, depth)\n\t\t\t{\n\t\t\t\tif(index > 0 && depth > 0 && index % 2 == 0)\n\t\t\t\t{\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\ttrace(indent(depth) + '[' +index+ '] ' + value);\n\t\t\t}\n\n\t\t\tUtils.walk(arr, process);\n\t\t}", "skipProperties() {\n return [];\n }", "function debug(...args) {\n if (false) {\n console.log(...args);\n }\n }", "function isNoTelemetryFlag (args) {\n return args.indexOf('--no-telemetry') > -1;\n}", "enableLogging() {\n this.loggingEnabled = true;\n }", "function skip(target, propertyKey) {\n if (arguments.length === 1) {\n target[onlySymbol] = true;\n }\n else {\n target[propertyKey][skipSymbol] = true;\n }\n}", "get enableOutputDebugLogging() {\n return false;\n }", "function PROFILERTRACE(msg) {\n if (gDebugTrace)\n PROFILERLOG(msg);\n}", "shouldLog(logLevel) {\n return (!!this._logger &&\n logLevel !== exports.HttpPipelineLogLevel.OFF &&\n logLevel <= this._logger.minimumLogLevel);\n }", "shouldLog(logLevel) {\n return (!!this._logger &&\n logLevel !== exports.HttpPipelineLogLevel.OFF &&\n logLevel <= this._logger.minimumLogLevel);\n }", "function logOnlyInNonTestEnvironment(logMessage) {\r\n\tif (process.env.NODE_ENV !== 'test') {\r\n\t\tconsole.log(logMessage);\r\n\t}\t\r\n}", "function option(self, __trace) {\n return fold_(self, () => O.none, O.some, __trace);\n}", "static noop(...args) {\n if (false) {\n console.log(args);\n }\n }", "static noop() {\n if (false) {\n console.log(arguments);\n }\n }", "function debuglog(msg){\n if(!!isDebug) {console.log(msg)};\n }", "debug(log) {\n this.manageLogByLevelName(log, 'debug');\n }", "log(...args) {\n // if the object is either set to debug = true\n // or if there is a string on the Tone.global.with the class name\n if (this.debug || (theWindow && this.toString() === theWindow.TONE_DEBUG_CLASS)) {\n log(this, ...args);\n }\n }", "constructor(props = {}) {\n this.logs = props.logs || false\n this.events = {}\n }", "trace(...args) {\n if (this.isVerbose()) {\n console.warn(this.getColorOn() + args.join(\" \"));\n }\n }", "function testForUnHandledException() {\n let loggerConfig = {\n \"log-level\": customLogger.LOG_LEVEL.verbose\n }\n\n customLogger.setConfig(loggerConfig);\n customLogger.logMessage(\"tion\", customLogger.LOG_LEVEL.error, \"some-business-tag\", txnID);\n\n}", "doSomethingSpecial() {\n this.logger.debug('Only I have this method, my parent does not!');\n }", "createLogDriver(enableLoggingProp, logDriverProp) {\n const enableLogging = enableLoggingProp !== undefined ? enableLoggingProp : true;\n const logDriver = logDriverProp !== undefined\n ? logDriverProp : enableLogging\n ? this.createAWSLogDriver(this.node.id) : undefined;\n return logDriver;\n }", "function Logger() {\n if(process.env.AZURE_STORAGE_ACCOUNT == undefined || process.env.AZURE_STORAGE_ACCESS_KEY == undefined) {\n\t enabled = false;\n }\n}", "_log() {\n if (this.debug) {\n console.log(...arguments);\n }\n }", "_log(param1, param2) {\n if (this.debug)\n console.log(this, ...arguments);\n }", "enableDebugLogging(enable) {\n HyperTrack.enableDebugLogging(enable);\n }", "function logg(stuff) {\n return prod ? void 0 : console.info(stuff)\n}", "set Ignore(value) {}", "function enableLogging() {\n logEnabled = true;\n}", "function skipField(path) {\n if (fieldsFilter && fieldsFilter.indexOf(path) == -1) {\n return true;\n }\n }", "function debuglog(msg, obj) {\n if (obj === void 0) { obj = null; }\n if (debug) {\n console.log(msg, obj);\n }\n }", "renderLogDriver() {\n return {\n logDriver: 'awslogs',\n options: removeEmpty({\n 'awslogs-group': this.logGroup.logGroupName,\n 'awslogs-stream-prefix': this.props.streamPrefix,\n 'awslogs-region': `${new cdk.AwsRegion()}`,\n 'awslogs-datetime-format': this.props.datetimeFormat,\n 'awslogs-multiline-pattern': this.props.multilinePattern,\n }),\n };\n }", "get Ignore() {}", "log() {\n return; // no output for initial application build\n }", "report(label = \"params\") {\n const { showDeleted, showHidden, filterText } = this;\n const dString = showDeleted ? \"showDeleted\" : \"\";\n const hString = showHidden ? \"showHidden\" : \"\";\n\n console.groupCollapsed(label, `(${dString} ${hString}`);\n console.log(\"showDeleted\", showDeleted);\n console.log(\"showHidden\", showHidden);\n console.log(\"filterText\", filterText);\n console.groupEnd();\n }", "function consoleLogNoTest(string){\n if( process.env.NODE_ENV !== \"test\"){\n console.log(string);\n }\n}", "set debug(value) {\n Logger.debug = value;\n }", "exceptionTrack(properties) {\n const description = properties.event || properties.description || properties;\n appInsights.trackException(description);\n }", "emit(...args) {\n const [name, ...params] = args;\n\n if (this.logBlacklist && this.logBlacklist.indexOf(name) === -1) {\n console.info(name, params);\n }\n\n super.emit(...args);\n }", "hasLogger(){ return this.logger !== null }", "log() {}", "skipAttributes_() {\n this.showStep(ENROLLMENT_STEP.SUCCESS);\n }", "get enableInputDebugLogging() {\n return false;\n }", "function LogOperator(){}", "static toLog(param) {\n const restrictionNum = this.LOG_LEVELS[this.logLevel];\n const requiredNum = this.LOG_LEVELS[param];\n return requiredNum > restrictionNum;\n }", "function Nc(t) {\n var e;\n e = t, E.setLogLevel(e);\n}", "function skip() {\n\t this.shouldSkip = true;\n\t}", "function skip() {\n\t this.shouldSkip = true;\n\t}", "function skip() {\n this.shouldSkip = true;\n}", "toLog(){return{total:this.total,progress:this.progress,url:this.url==null?\"\":this.url.url}}", "function cLogElement( elem ) {\n if ( allowLog ) {\n console.log( elem );\n }\n}", "_debug(...args) {\n /* istanbul ignore if */\n if (!debug.enabled)\n return;\n const formatter = args.shift();\n if (typeof formatter === 'string') {\n debug(`[%s] ${formatter}`, this.context.name, ...args);\n }\n else {\n debug('[%s] ', this.context.name, formatter, ...args);\n }\n }", "function assertNoSensitiveFields(tab) {\n ['url', 'pendingUrl', 'title', 'favIconUrl'].forEach(function(field) {\n chrome.test.assertEq(undefined, tab[field],\n 'Sensitive property ' + field + ' is visible')\n });\n}", "function setLogEnabled(enabled) {\n logEnabled = enabled;\n}", "function disable_logs() {\n if (!window.console) window.console = {};\n var methods = [\"log\", \"debug\", \"warn\", \"info\"];\n for (var i = 0; i < methods.length; i++) {\n console[methods[i]] = function () { };\n }\n }", "log(...args) {\n if (this.options && this.options.debug) {\n console.log(...args);\n }\n }", "function cLogElement2( elem1, elem2 ) {\n if ( allowLog ) {\n console.log( elem1, elem2 );\n }\n}", "Trace(...args) { this.do_log(\"TRACE\", args, true); }", "logFallbackEmit( stateSnapshot ) {\n\t\t\n\t\tthis.logEvent( \"fallbackEmit\", { stateSnapshot } );\n\n\t}", "function wc_debugLog(note, priority) {\n if (priority - wc_debugMode > 0) console.log(note);\n}", "function should_ignore(_testCase, testName) {\r\n\tif (_testCase[\"_should\"] == undefined) \r\n\t\t_testCase[\"_should\"] = {};\r\n\tif (_testCase[\"_should\"][\"ignore\"] == undefined) \r\n\t\t_testCase[\"_should\"][\"ignore\"] = {};\r\n\t_testCase[\"_should\"][\"ignore\"][testName] = true;\t\t\r\n}", "function log( ...args ) {\n\n if (!production) {\n\n console.log( ...args );\n\n }\n}", "log(...params) {\r\n console.log(this.getLogStamp(), ...params);\r\n }", "setLog(log) {\n module.exports.log = typeof log === 'function' ? log : null;\n }", "debug(...theArgs) { return this._log('DEBUG', {}, theArgs); }", "function ignore(self, __trace) {\n return fold_(self, _index12.constVoid, _index12.constVoid, __trace);\n}", "log() {\n if (this.debug) {\n console.log(...arguments)\n }\n }", "function eventLogCallback(event) {\n console.log(event);\n alert( `Callback called for element with id: ${this.id}`);\n if(!prop) event.stopPropagation();\n}", "getArgPropertiesWithoutName() {\n return {\n type: this.type,\n alias: this.alias,\n description: this.description,\n nargs: this.nargs,\n demand: this.demand,\n default: this.default,\n }\n }", "function _() {\n return b.logLevel;\n}", "LogWarning() {}", "function skip(reason) {\n if (reason) {\n log.warn(`Skipping ${fsPath} (${reason})`);\n }\n }", "function ignore() { }", "function debuglog(txt) {\n if (DEBUG_ENABLED) log(txt);\n }", "function mylog(msg){\n if (debug == \"1\"){\n console.log(msg)\n }\n}", "function logging(value) {\n return value ? logged : null;\n}", "function logging(value) {\n return value ? logged : null;\n}", "function logging(value) {\n return value ? logged : null;\n}", "function removeTracingAttrs()\n{\n var bodyNode = dreamweaver.getDocumentDOM('document').body;\n\n //look for tracing attributes - if any are found, toggle\n //the global boolean to true and remove all attributes\n if (cbRemoveDWComments.checked){\n if (bodyNode.getAttribute(\"tracingsrc\") ||\n bodyNode.getAttribute(\"tracingopacity\") ||\n bodyNode.getAttribute(\"tracingx\") ||\n bodyNode.getAttribute(\"tracingy\"))\n {\n //remove all tracing image attributes\n bodyNode.removeAttribute(\"tracingsrc\");\n bodyNode.removeAttribute(\"tracingopacity\");\n bodyNode.removeAttribute(\"tracingx\");\n bodyNode.removeAttribute(\"tracingy\");\n bRemovedTracing=true;\n }\n }\n}", "function notIgnoredObj(obj) {\n return (\n obj.type !== \"AmbientLight\" &&\n obj.name !== \"\" &&\n !(obj.isMesh && obj.isMaterialGeneratedMesh) &&\n !obj.isAuxClippingMesh\n );\n }", "function Log2(a, b, c) {\n // setter decorator\n console.log('Setter Getter Decorator');\n console.log(a);\n console.log(b);\n console.log(c);\n}", "N(key, message, ...moreargs) {\n if (this.enabled(key)) console.log(this.prefix + \":\" + key + \": \" + message, ...moreargs);\n }", "trace(...parameters)\n\t{\n\t\tif (this.options.debug)\n\t\t{\n\t\t\tconsole.log(colors.gray(this.preamble, '[trace]', generate_log_message(parameters)))\n\t\t}\n\t}", "function addFilterTrace(filter) {\n\n // We add line number for grokparsefailures\n\n if (!filter.includes(\"tag_on_failure\")) {\n var re = /grok\\s*{/g\n\n filter = filter.replace(re, function(match, index) {\n var sub = filter.substring(0, index) + match\n var currentLine = string.numberOfLinesString(sub) - 1\n\n return match + ' tag_on_failure => [\"_grokparsefailure\", \"failure line ' + currentLine + '\"]'\n })\n }\n\n // We display metadata if any\n\n filter += \"\\n\" + `filter {\n\n ruby {\n code => \"\n metadata = event.get('@metadata')\n unless metadata.nil? || metadata.length == 0\n event.set('@_metadata', Marshal.load(Marshal.dump(metadata)))\n end\n \n \"\n }\n \n }` + \"\\n\"\n\n return filter\n}", "function logger(event, payload) {\n let timestamp = new Date();\n console.log({ timestamp, event, payload });//considered a destructured object\n }", "function emitWarningIfNeeded(set) {\n if ('HTTP' === set || 'HTTP2' === set) {\n process.emitWarning('Setting the NODE_DEBUG environment variable ' +\n 'to \\'' + set.toLowerCase() + '\\' can expose sensitive ' +\n 'data (such as passwords, tokens and authentication headers) ' +\n 'in the resulting log.');\n }\n}", "function getAriaEventInfo(event) {\r\n var values = {\r\n 'CorrelationVector': event.vector.toString(),\r\n 'ValidationErrors': event.validationErrors,\r\n 'WebLog_FullName': event.eventName,\r\n 'WebLog_EventType': EventBase_1.ClonedEventType[event.eventType]\r\n };\r\n if (event.eventType === EventBase_1.ClonedEventType.End) {\r\n values.Duration = event.endTime - event.startTime;\r\n }\r\n var names = event.eventName.split(',');\r\n for (var _i = 0, names_1 = names; _i < names_1.length; _i++) {\r\n var name_1 = names_1[_i];\r\n if (name_1) {\r\n values[\"WebLog_Type_\" + name_1] = 1;\r\n }\r\n }\r\n var data = event.data, context = event.context;\r\n if (context) {\r\n for (var key in context) {\r\n if (Object.prototype.hasOwnProperty.call(context, key)) {\r\n var value = context[key];\r\n if (value === undefined || value === null) {\r\n continue;\r\n }\r\n var loggingName = index_1.capitalize(key);\r\n values[loggingName] = value;\r\n }\r\n }\r\n }\r\n if (data) {\r\n for (var field in data) {\r\n if (Object.prototype.hasOwnProperty.call(data, field)) {\r\n var value = data[field];\r\n if (value === undefined || value === null) {\r\n continue;\r\n }\r\n var propertyMetadata = event.metadata[field];\r\n if (propertyMetadata) {\r\n var loggingName = propertyMetadata.isPrefixingDisabled ?\r\n index_1.capitalize(field) :\r\n index_1.capitalize(propertyMetadata.definedInName) + \"_\" + field;\r\n var type = propertyMetadata.type;\r\n if (type === 4 /* Object */) {\r\n for (var subField in value) {\r\n if (Object.prototype.hasOwnProperty.call(value, subField)) {\r\n var subValue = value[subField];\r\n if (subValue !== undefined && subValue !== null && subValue !== '') {\r\n // Do not write values which would serialize as empty since they do not provide meaningful\r\n // information in instrumentation back-ends.\r\n values[loggingName + \"_\" + subField.replace('.', '_')] = subValue;\r\n }\r\n }\r\n }\r\n }\r\n else {\r\n values[loggingName] = type === 6 /* Enum */ ? propertyMetadata.typeRef[value] : value;\r\n }\r\n }\r\n }\r\n }\r\n }\r\n return {\r\n name: event.isEventTypePrefixingDisabled ? names[names.length - 2] : \"ev_\" + names[names.length - 2],\r\n values: values\r\n };\r\n}", "debug(...message) { this.log.debug(...message); }", "function logDevLogs() {\n var props = PropertiesService.getDocumentProperties();\n var devLog = props.getProperty('devLog');\n Logger.log(devLog);\n}", "function skipHello(){saidHello=true;}", "function debug(v){return false;}", "function dummyLogging()\n{\n console.log.apply(console, arguments);\n}", "function xLog(m) {\r\n if (typeof Y === 'undefined') {\r\n console.log(m);\r\n } else {\r\n Y.log(m);\r\n }\r\n}", "function logger(param) {\n\t\tif (DEBUG)\n\t\t\tconsole.log(param);\n\t}" ]
[ "0.59166044", "0.5436627", "0.53226537", "0.53183687", "0.52871853", "0.5271416", "0.52030814", "0.5189277", "0.51804507", "0.5174211", "0.5123445", "0.5122996", "0.5087792", "0.50668544", "0.5062562", "0.50464076", "0.50464076", "0.5046063", "0.5008581", "0.49955177", "0.49913332", "0.49844417", "0.49751788", "0.4966728", "0.4961306", "0.49459574", "0.49307337", "0.48742688", "0.48741", "0.48737153", "0.4860387", "0.48502526", "0.4846579", "0.48323202", "0.48205617", "0.48117268", "0.48084056", "0.48026365", "0.47696432", "0.47685504", "0.4766364", "0.47629097", "0.47579867", "0.47472712", "0.4741359", "0.47367078", "0.46989447", "0.46988964", "0.4688969", "0.46877185", "0.46863106", "0.4681219", "0.46720287", "0.46643034", "0.46643034", "0.46610838", "0.46575335", "0.4657218", "0.46570012", "0.4656843", "0.46565524", "0.46516287", "0.46423614", "0.46421438", "0.4633723", "0.46293202", "0.46283638", "0.4625653", "0.46183297", "0.4614303", "0.46061072", "0.46049678", "0.46035564", "0.45990336", "0.4596174", "0.45821142", "0.45820698", "0.4573569", "0.45731026", "0.45579118", "0.4555854", "0.45525444", "0.45474985", "0.45474985", "0.45474985", "0.4546704", "0.45437872", "0.45435992", "0.4537914", "0.45318002", "0.45122153", "0.45084542", "0.4506013", "0.44983578", "0.4495228", "0.44936305", "0.44930658", "0.44919056", "0.4490585", "0.44876868", "0.44871697" ]
0.0
-1
assert ctx os an object if types supplied, properties of ctx are of type specified in values
function assertHas(ctx, types) { if (typeof (ctx) !== 'object') { throw new Error('invalid context: ' + typeof (ctx)); } // ctx.assert(types); if (typeof (types) === 'object') { for (var i in types) { if (typeof (ctx[i]) !== types[i]) { throw new Error('assertion ' + i + ' requires ' + types[i] + ', given ' + typeof (ctx[i])); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function ArgumentsOfCorrectType(context) {\n return {\n Argument: function Argument(node) {\n var argDef = context.getArgument();\n if (argDef) {\n var errors = (0, _isValidLiteralValue.isValidLiteralValue)(argDef.type, node.value);\n if (errors && errors.length > 0) {\n context.reportError(new _error.GraphQLError(badValueMessage(node.name.value, argDef.type, (0, _printer.print)(node.value), errors), [node.value]));\n }\n }\n return false;\n }\n };\n}", "function ArgumentsOfCorrectType(context) {\n\t return {\n\t Argument: function Argument(argAST) {\n\t var argDef = context.getArgument();\n\t if (argDef) {\n\t var errors = (0, _utilitiesIsValidLiteralValue.isValidLiteralValue)(argDef.type, argAST.value);\n\t if (errors && errors.length > 0) {\n\t context.reportError(new _error.GraphQLError(badValueMessage(argAST.name.value, argDef.type, (0, _languagePrinter.print)(argAST.value), errors), [argAST.value]));\n\t }\n\t }\n\t return false;\n\t }\n\t };\n\t}", "function ArgumentsOfCorrectType(context) {\n return {\n Argument: function Argument(argAST) {\n var argDef = context.getArgument();\n if (argDef) {\n var errors = (0, _utilitiesIsValidLiteralValue.isValidLiteralValue)(argDef.type, argAST.value);\n if (errors && errors.length > 0) {\n context.reportError(new _error.GraphQLError(badValueMessage(argAST.name.value, argDef.type, (0, _languagePrinter.print)(argAST.value), errors), [argAST.value]));\n }\n }\n return false;\n }\n };\n}", "enterObjectValue(ctx) {\n }", "_init() {\n\t\t// Register all primitive properties\n\t\tthis._registerTypeId(\"BaseProperty\", BaseProperty, \"all\");\n\t\tthis._registerTypeId(\"NodeProperty\", NodeProperty, \"all\");\n\t\tthis._registerTypeId(\"ContainerProperty\", ContainerProperty, \"all\");\n\n\t\t// Register the primitive types for the context single\n\t\tthis._registerTypeId(\"Int8\", Int8Property);\n\t\tthis._registerTypeId(\"Uint8\", Uint8Property);\n\t\tthis._registerTypeId(\"Int16\", Int16Property);\n\t\tthis._registerTypeId(\"Uint16\", Uint16Property);\n\t\tthis._registerTypeId(\"Int32\", Int32Property);\n\t\tthis._registerTypeId(\"Int64\", Int64Property);\n\t\tthis._registerTypeId(\"Uint64\", Uint64Property);\n\t\tthis._registerTypeId(\"Uint32\", Uint32Property);\n\t\tthis._registerTypeId(\"Float32\", Float32Property);\n\t\tthis._registerTypeId(\"Float64\", Float64Property);\n\t\tthis._registerTypeId(\"Bool\", BoolProperty);\n\t\tthis._registerTypeId(\"String\", StringProperty);\n\t\tthis._registerTypeId(\"Reference\", ReferenceProperty);\n\t\tthis._registerTypeId(\"Enum\", EnumProperty);\n\n\t\t// Register the primitive types for the context array\n\t\tthis._registerTypeId(\"Int8\", Int8ArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Uint8\", Uint8ArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Int16\", Int16ArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Uint16\", Uint16ArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Int32\", Int32ArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Uint32\", Uint32ArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Int64\", Int64ArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Uint64\", Uint64ArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Float32\", Float32ArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Float64\", Float64ArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"String\", StringArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Bool\", BoolArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Reference\", ReferenceArrayProperty, \"array\");\n\t\tthis._registerTypeId(\"Enum\", EnumArrayProperty, \"array\");\n\n\t\t// Register the primitive types for the context map\n\t\tthis._registerTypeId(\"Int8\", Int8MapProperty, \"map\");\n\t\tthis._registerTypeId(\"Uint8\", Uint8MapProperty, \"map\");\n\t\tthis._registerTypeId(\"Int16\", Int16MapProperty, \"map\");\n\t\tthis._registerTypeId(\"Uint16\", Uint16MapProperty, \"map\");\n\t\tthis._registerTypeId(\"Int32\", Int32MapProperty, \"map\");\n\t\tthis._registerTypeId(\"Uint32\", Uint32MapProperty, \"map\");\n\t\tthis._registerTypeId(\"Int64\", Int64MapProperty, \"map\");\n\t\tthis._registerTypeId(\"Uint64\", Uint64MapProperty, \"map\");\n\t\tthis._registerTypeId(\"Float32\", Float32MapProperty, \"map\");\n\t\tthis._registerTypeId(\"Float64\", Float64MapProperty, \"map\");\n\t\tthis._registerTypeId(\"Bool\", BoolMapProperty, \"map\");\n\t\tthis._registerTypeId(\"String\", StringMapProperty, \"map\");\n\t\tthis._registerTypeId(\"Reference\", ReferenceMapProperty, \"map\");\n\n\t\t// Register the default templates\n\t\tvar NamedPropertyTemplate = {\n\t\t\ttypeid: \"NamedProperty\",\n\t\t\tproperties: [{ id: \"guid\", typeid: \"String\" }],\n\t\t};\n\n\t\tvar NamedNodePropertyTemplate = {\n\t\t\ttypeid: \"NamedNodeProperty\",\n\t\t\tinherits: [\"NodeProperty\", \"NamedProperty\"],\n\t\t};\n\n\t\tvar RelationshipPropertyTemplate = {\n\t\t\ttypeid: \"RelationshipProperty\",\n\t\t\tinherits: [\"NodeProperty\", \"NamedProperty\"],\n\t\t\tproperties: [{ id: \"to\", typeid: \"Reference\" }],\n\t\t};\n\n\t\tthis._registerTypeId(NamedPropertyTemplate.typeid, NamedPropertyTemplate);\n\t\tthis._registerTypeId(NamedNodePropertyTemplate.typeid, NamedNodePropertyTemplate);\n\t\tthis._registerTypeId(RelationshipPropertyTemplate.typeid, RelationshipPropertyTemplate);\n\t}", "get contextTypes() {\n return defaults({}, result('constructor.contextTypes'), {\n lodash: 'func',\n runtime: 'object',\n skypager: 'object',\n host: 'object',\n project: 'object',\n })\n }", "enterObj(ctx) {\n }", "function assert_event_type (obj, type, inheritsp) {\n if (typeof obj === 'object') {\n var type_str = \"[object \" + type + \"]\";\n inheritsp = (typeof inheritsp === 'boolean') ? inheritsp : false;\n while (obj) {\n if (obj.toString() === type_str || (obj.constructor && obj.constructor.name === type)) {\n return true;\n } else {\n obj = inheritsp ? Object.getPrototypeOf(obj) : null;\n }\n }\n }\n throw new TypeError();\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "static initialize(obj, type) { \n obj['type'] = type;\n }", "function checkTypes(object) {\n if (!object || typeof object !== 'object')\n throw new Error(\"Invalid package. It must be an object\");\n function checkDefinition(key, value, def, obj, parent) {\n if (def === undefined)\n throw new Error(\"Non existing field '\" + key + \"' specified\");\n switch (def.type) {\n case \"int\":\n if (def.enum) {\n if (value.constructor.isEnumItem)\n obj[key] = value = value.value;\n if (!isNaN(value))\n obj[key] = value = parseInt(value, 10);\n if (typeof value !== 'number' || isNaN(value)) {\n var tempValue = def.enum.get(value);\n if (tempValue === undefined)\n throw new Error(\"Invalid value '\" + value + \"' in field '\" + key + \"'\");\n obj[key] = value = tempValue.value;\n }\n if (!def.enum.get(value) || def.enum.get(value).value !== value)\n throw new Error(\"Invalid value '\" + value + \"' in field '\" + key + \"'\");\n }\n else {\n if (!isNaN(value))\n obj[key] = value = parseInt(value, 10);\n if (typeof value !== 'number' || isNaN(value))\n throw new Error(\"Expected int (got '\" + value + \"') in field '\" + key + \"'\");\n }\n break;\n case \"double\":\n if (!isNaN(value))\n obj[key] = value = Number(value);\n if (typeof value !== 'number' || isNaN(value))\n throw new Error(\"Expected double (got '\" + value + \"') in field '\" + key + \"'\");\n break;\n case \"list\":\n if (!Array.isArray(value))\n throw new Error(\"Expected array (got '\" + value + \"') in field '\" + key + \"'\");\n for (var i = 0; i < value.length; i++)\n checkDefinition(i, value[i], def.items, value, key);\n break;\n case \"string\":\n obj[key] = value = String(value);\n break;\n case \"any\":\n if (!isNaN(value))\n obj[key] = value = Number(value);\n else\n obj[key] = value = String(value);\n break;\n case \"object\":\n //Check field by field\n for (var innerKey in def.value) {\n if (value[innerKey] === undefined)\n throw new Error(\"Missing key '\" + innerKey + \"' in '\" + parent + \"'\");\n checkDefinition(innerKey, value[innerKey], def.value[innerKey], value, key);\n }\n break;\n\n default:\n throw new Error(\"Invalid type ('\" + def.type + \") of field \" + key);\n }\n }\n for (var key in object)\n checkDefinition(key, object[key], FIELDS_DEFINITION[key], object, 'package');\n}", "function gen(obj) {\n function sub(m,name) {\n var p, i, typ = gettype(m), rc = {type:typ};\n switch (typ) {\n case 'number':\n case 'boolean':\n case 'string':\n case 'null':\n break;\n case 'array':\n if (m[0]===undefined) throw('array must be non-empty '+name);\n rc.items = sub(m[0], name);\n break;\n case 'object':\n rc.properties = {};\n var req = [];\n for (i in m) {\n rc.properties[i] = sub(m[i], i);\n req.push(i);\n }\n if (req.length)\n rc.required = req;\n break;\n \n default:\n console.log('ignoring unsupported type:', typ);\n }\n return rc;\n }\n return sub(obj,'');\n }", "function checkType(obj, keyName) {\n return obj && typeof obj === 'object' && Object.keys(obj).length === 1 &&\n obj.hasOwnProperty(keyName);\n}", "enterTypeAnnotation(ctx) {\n }", "function protectBuiltInObjects (context) {\n ;[\n 'Object',\n 'Boolean',\n 'Symbol',\n 'Error',\n 'EvalError',\n 'InternalError',\n 'RangeError',\n 'ReferenceError',\n 'SyntaxError',\n 'TypeError',\n 'URIError',\n 'Number',\n 'Math',\n 'Date',\n 'String',\n 'RegExp',\n 'Array',\n 'Int8Array',\n 'Uint8Array',\n 'Uint8ClampedArray',\n 'Int16Array',\n 'Uint16Array',\n 'Int32Array',\n 'Uint32Array',\n 'Float32Array',\n 'Float64Array',\n 'Map',\n 'Set',\n 'WeakMap',\n 'WeakSet',\n 'ArrayBuffer',\n 'SharedArrayBuffer',\n 'Atomics',\n 'DataView',\n 'JSON',\n 'Promise',\n 'Generator',\n 'GeneratorFunction',\n 'Reflect',\n 'Proxy',\n 'Intl',\n 'Buffer'\n ].forEach((str) => {\n try {\n context[str] = _protect(str)\n new context[str]() // eslint-disable-line no-new\n } catch (e) {\n }\n })\n}", "function TypedObjectSet(descr, typedObj, offset, name, fromValue) {\n if (!TypedObjectIsAttached(typedObj))\n ThrowTypeError(JSMSG_TYPEDOBJECT_HANDLE_UNATTACHED);\n\n switch (DESCR_KIND(descr)) {\n case JS_TYPEREPR_SCALAR_KIND:\n TypedObjectSetScalar(descr, typedObj, offset, fromValue);\n return;\n\n case JS_TYPEREPR_REFERENCE_KIND:\n TypedObjectSetReference(descr, typedObj, offset, name, fromValue);\n return;\n\n case JS_TYPEREPR_ARRAY_KIND:\n var length = DESCR_ARRAY_LENGTH(descr);\n if (TypedObjectSetArray(descr, length, typedObj, offset, fromValue))\n return;\n break;\n\n case JS_TYPEREPR_STRUCT_KIND:\n if (!IsObject(fromValue))\n break;\n\n // Adapt each field.\n var fieldNames = DESCR_STRUCT_FIELD_NAMES(descr);\n var fieldDescrs = DESCR_STRUCT_FIELD_TYPES(descr);\n var fieldOffsets = DESCR_STRUCT_FIELD_OFFSETS(descr);\n for (var i = 0; i < fieldNames.length; i++) {\n var fieldName = fieldNames[i];\n var fieldDescr = fieldDescrs[i];\n var fieldOffset = fieldOffsets[i];\n var fieldValue = fromValue[fieldName];\n TypedObjectSet(fieldDescr, typedObj, offset + fieldOffset, fieldName, fieldValue);\n }\n return;\n }\n\n ThrowTypeError(JSMSG_CANT_CONVERT_TO,\n typeof(fromValue),\n DESCR_STRING_REPR(descr));\n}", "enterObj(ctx) {\n\t}", "function ValuesOfCorrectType(context) {\n return {\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if (Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isNonNullType\"])(type)) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](badValueMessage(Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(type), Object(_language_printer__WEBPACK_IMPORTED_MODULE_2__[\"print\"])(node)), node));\n }\n },\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNullableType\"])(context.getParentInputType());\n\n if (!Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isListType\"])(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNamedType\"])(context.getInputType());\n\n if (!Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isInputObjectType\"])(type)) {\n isValidScalar(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var fieldNodeMap = Object(_jsutils_keyMap__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(node.fields, function (field) {\n return field.name.value;\n });\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = Object(_polyfills_objectValues__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields())[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var fieldDef = _step.value;\n var fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isRequiredInputField\"])(fieldDef)) {\n var typeStr = Object(_jsutils_inspect__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(fieldDef.type);\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](requiredFieldMessage(type.name, fieldDef.name, typeStr), node));\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNamedType\"])(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isInputObjectType\"])(parentType)) {\n var suggestions = Object(_jsutils_suggestionList__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(node.name.value, Object.keys(parentType.getFields()));\n var didYouMean = suggestions.length !== 0 ? \"Did you mean \".concat(Object(_jsutils_orList__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(suggestions), \"?\") : undefined;\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](unknownFieldMessage(parentType.name, node.name.value, didYouMean), node));\n }\n },\n EnumValue: function EnumValue(node) {\n var type = Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"getNamedType\"])(context.getInputType());\n\n if (!Object(_type_definition__WEBPACK_IMPORTED_MODULE_3__[\"isEnumType\"])(type)) {\n isValidScalar(context, node);\n } else if (!type.getValue(node.value)) {\n context.reportError(new _error_GraphQLError__WEBPACK_IMPORTED_MODULE_1__[\"GraphQLError\"](badValueMessage(type.name, Object(_language_printer__WEBPACK_IMPORTED_MODULE_2__[\"print\"])(node), enumTypeSuggestion(type, node)), node));\n }\n },\n IntValue: function IntValue(node) {\n return isValidScalar(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidScalar(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidScalar(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidScalar(context, node);\n }\n };\n}", "function c(e){return null!==e&&\"object\"==typeof e}", "function assertType(value,type){var valid;var expectedType=getType(type);if(expectedType==='String'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='string');}else if(expectedType==='Number'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='number');}else if(expectedType==='Boolean'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='boolean');}else if(expectedType==='Function'){valid=(typeof value==='undefined'?'undefined':_typeof(value))===(expectedType='function');}else if(expectedType==='Object'){valid=isPlainObject(value);}else if(expectedType==='Array'){valid=Array.isArray(value);}else{valid=value instanceof type;}return{valid:valid,expectedType:expectedType};}", "checkTypes(args, parameters) {\n for (let i = 0; i < args.length; i++) {\n if (args[i].type != parameters[i]) {\n return {\n valid: false,\n invalidType: args[i].type,\n expected: parameters[i]\n };\n }\n }\n return { valid: true };\n }", "function assertObject(value) {\n if (Object(value) !== value) {\n var kind = value === null? 'null'\n : value === undefined? 'undefined'\n : /* otherwise */ 'a primitive value (' + JSON.stringify(value) + ')';\n\n throw new TypeError(\"Meta:Magical can only associate meta-data with objects, but you're trying to use \" + kind);\n }\n}", "enterEntityType(ctx) {\n\t}", "enterNewEntityType(ctx) {\n\t}", "static createItem(typeName, ctx=null) {\n console.debug(\"Types.createItem\", typeName);\n if (typeof typeName !== 'string') {\n throw new Error(\"expected type string\");\n }\n var ret;\n const type= allTypes.get( typeName );\n if (!type ) {\n throw new Error(`unknown type '${typeName}'`);\n }\n const { uses } = type;\n switch (uses) {\n case \"flow\": {\n const data= {};\n const spec= type.with;\n const { params } = spec;\n for ( const token in params ) {\n const param= params[token];\n if (!param.optional || param.repeats) {\n const val= (!param.optional) && Types.createItem( param.type, {\n token: token,\n param: param\n });\n // if the param repeats then we'll wind up with an array (of items)\n data[token]= param.repeats? (val? [val]: []): val;\n }\n }\n ret= allTypes.newItem(type.name, data);\n }\n break;\n case \"slot\":\n case \"swap\": {\n // note: \"initially\", if any, is: object { string type; object value; }\n // FIX: \"initially\" wont work properly for opts.\n // slots dont have a $TOKEN entry, but options do.\n const pair= Types._unpack(ctx);\n if (!pair) {\n ret= allTypes.newItem(type.name, null);\n } else {\n const { type:slatType, value:slatValue } = pair;\n ret= Types.createItem(slatType, slatValue);\n }\n }\n break;\n case \"str\":\n case \"txt\": {\n // ex. Item(\"trait\", \"testing\")\n // determine default value\n let defautValue= \"\";\n const spec= type.with;\n const { tokens, params }= spec;\n if (tokens.length === 1) {\n const t= tokens[0];\n const param= params[t];\n // FIX: no .... this is in the \"flow\"... the container of the str.\n // if (param.filterVals && ('default' in param.filterVals)) {\n // defaultValue= param.filterVals['default'];\n // } else {\n // if there's only one token, and that token isn't the \"floating value\" token....\n if (param.value !== null) {\n defautValue= t; // then we can use the token as our default value.\n }\n // }\n }\n const value= Types._unpack(ctx, defautValue);\n // fix? .value for string elements *can* be null,\n // but if they are things in autoText throw.\n // apparently default String prop validation allows null.\n ret= allTypes.newItem(type.name, value);\n }\n break;\n case \"num\": {\n const value= Types._unpack(ctx, 0);\n ret= allTypes.newItem(type.name, value);\n }\n break;\n default:\n throw new Error(`unknown type ${uses}`);\n break;\n }\n return ret;\n }", "function isOf(obj) {\n var types = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n types[_i - 1] = arguments[_i];\n }\n var objType = typeof obj;\n return types.some(function (t) { return t === objType; });\n }", "function processProp(input) {\n var _a, _b, _c;\n const { key, target } = input;\n const name = utils.getName(target);\n const rawOptions = Object.assign({}, input.options);\n let Type = Reflect.getMetadata(constants_1.DecoratorKeys.Type, target, key);\n const propKind = (_a = input.whatis) !== null && _a !== void 0 ? _a : detectWhatIsIt(Type);\n logSettings_1.logger.debug('Starting to process \"%s.%s\"', name, key);\n utils.assertion(typeof key === 'string', new errors_1.CannotBeSymbolError(name, key));\n // optionDeprecation(rawOptions);\n {\n // soft errors & \"type\"-alias mapping\n switch (propKind) {\n case constants_1.WhatIsIt.NONE:\n break;\n case constants_1.WhatIsIt.MAP:\n case constants_1.WhatIsIt.ARRAY:\n // set the \"Type\" to undefined if \"ref\" or \"refPath\" are defined, as an fallback in case \"type\" is also not defined\n if (('ref' in rawOptions || 'refPath' in rawOptions) && !('type' in rawOptions)) {\n Type = undefined;\n }\n break;\n }\n }\n if (!utils.isNullOrUndefined(rawOptions.type)) {\n logSettings_1.logger.info('Prop Option \"type\" is set to ', rawOptions.type);\n const gotType = utils.getType(rawOptions.type);\n Type = gotType.type;\n if (gotType.dim > 0) {\n rawOptions.dim = gotType.dim;\n }\n delete rawOptions.type;\n }\n // prevent \"infinite\" buildSchema loop / Maximum Stack size exceeded\n if (Type === target.constructor) {\n throw new errors_1.SelfContainingClassError(name, key);\n }\n // map to correct buffer type, otherwise it would result in \"Mixed\"\n if (Type === typegoose_1.mongoose.Types.Buffer) {\n Type = typegoose_1.mongoose.Schema.Types.Buffer;\n }\n // confirm that \"WhatIsIt\" is an ARRAY and if that the Type is still an *ARRAY, set them to Mixed\n // for issues like https://github.com/typegoose/typegoose/issues/300\n if (propKind === constants_1.WhatIsIt.ARRAY && detectWhatIsIt(Type) === constants_1.WhatIsIt.ARRAY) {\n logSettings_1.logger.debug('Type is still *ARRAY, defaulting to Mixed');\n Type = typegoose_1.mongoose.Schema.Types.Mixed;\n }\n // confirm that \"WhatIsIt\" is an MAP and if that the Type is still an *MAP, set them to Mixed\n if (propKind === constants_1.WhatIsIt.MAP && detectWhatIsIt(Type) === constants_1.WhatIsIt.MAP) {\n logSettings_1.logger.debug('Type is still *Map, defaulting to Mixed');\n Type = typegoose_1.mongoose.Schema.Types.Mixed;\n }\n if (utils.isNotDefined(Type)) {\n (0, typegoose_1.buildSchema)(Type);\n }\n if ('discriminators' in rawOptions) {\n logSettings_1.logger.debug('Found option \"discriminators\" in \"%s.%s\"', name, key);\n const gotType = utils.getType(rawOptions.discriminators, true);\n // REFACTOR: re-write this to be a Error inside errors.ts\n utils.assertion(gotType.dim === 1, new Error(`\"PropOptions.discriminators\" dosnt support Arrays higher and lower than 1 (got \"${gotType.dim}\" dimensions at \"${name}.${key}\") [E020]`));\n const discriminators = gotType.type.map((val, index) => {\n if (utils.isConstructor(val)) {\n return { type: val };\n }\n if (typeof val === 'object') {\n if (!('type' in val)) {\n throw new Error(`\"${name}.${key}\" discriminator index \"${index}\" is an object, but does not contain the \"type\" property!`);\n }\n return val;\n }\n throw new Error(`\"${name}.${key}\" discriminators index \"${index}\" is not an object or an constructor!`);\n });\n const disMap = new Map((_b = Reflect.getMetadata(constants_1.DecoratorKeys.NestedDiscriminators, target.constructor)) !== null && _b !== void 0 ? _b : []);\n disMap.set(key, discriminators);\n Reflect.defineMetadata(constants_1.DecoratorKeys.NestedDiscriminators, disMap, target.constructor);\n delete rawOptions.discriminators;\n }\n // allow setting the type asynchronously\n if ('ref' in rawOptions) {\n const gotType = utils.getType(rawOptions.ref);\n utils.assertion(gotType.dim === 0, new errors_1.OptionRefDoesNotSupportArraysError(gotType.dim, name, key));\n rawOptions.ref = gotType.type;\n utils.assertion(!utils.isNullOrUndefined(rawOptions.ref), new errors_1.RefOptionIsUndefinedError(name, key));\n rawOptions.ref =\n typeof rawOptions.ref === 'string'\n ? rawOptions.ref\n : utils.isConstructor(rawOptions.ref)\n ? utils.getName(rawOptions.ref)\n : rawOptions.ref;\n }\n if (utils.isWithVirtualPOP(rawOptions)) {\n if (!utils.includesAllVirtualPOP(rawOptions)) {\n throw new errors_1.NotAllVPOPElementsError(name, key);\n }\n const virtuals = new Map((_c = Reflect.getMetadata(constants_1.DecoratorKeys.VirtualPopulate, target.constructor)) !== null && _c !== void 0 ? _c : []);\n virtuals.set(key, rawOptions);\n Reflect.defineMetadata(constants_1.DecoratorKeys.VirtualPopulate, virtuals, target.constructor);\n return;\n }\n if ('justOne' in rawOptions) {\n logSettings_1.logger.warn(`Option \"justOne\" is defined in \"${name}.${key}\" but no Virtual-Populate-Options!\\n` +\n 'Look here for more: https://typegoose.github.io/typegoose/docs/api/virtuals#virtual-populate');\n }\n const schemaProp = utils.initProperty(name, key, propKind);\n // do this early, because the other options (enum, ref, refPath, discriminators) should not matter for this one\n if (Type instanceof typegoose_1.Passthrough) {\n logSettings_1.logger.debug('Type is \"instanceof Passthrough\" (\"%s.%s\", %s, direct: %s)', name, key, propKind, Type.direct);\n // this is because the check above narrows down the type, which somehow is not compatible\n const newType = Type.raw;\n if (Type.direct) {\n schemaProp[key] = newType;\n return;\n }\n switch (propKind) {\n case constants_1.WhatIsIt.ARRAY:\n // TODO: somehow this does not work, see https://github.com/Automattic/mongoose/issues/10750\n logSettings_1.logger.warn('Passthrough was used for \"%s.%s\", with WhatIsIt.ARRAY, which currently does not work, see https://github.com/Automattic/mongoose/issues/10750', name, key);\n schemaProp[key] = utils.mapArrayOptions(rawOptions, newType, target, key);\n return;\n case constants_1.WhatIsIt.MAP:\n const mapped = utils.mapOptions(rawOptions, newType, target, key);\n schemaProp[key] = Object.assign(Object.assign({}, mapped.outer), { type: Map, of: Object.assign({ type: newType }, mapped.inner) });\n return;\n case constants_1.WhatIsIt.NONE:\n schemaProp[key] = Object.assign(Object.assign({}, rawOptions), { type: newType });\n return;\n default:\n throw new errors_1.InvalidWhatIsItError(propKind, name, key, 'whatis(Passthrough)');\n }\n }\n // use \"Type\" if it is an suitable ref-type, otherwise default back to \"ObjectId\"\n const refType = utils.isAnRefType(Type) ? Type : typegoose_1.mongoose.Schema.Types.ObjectId;\n if ('ref' in rawOptions) {\n const ref = rawOptions.ref;\n delete rawOptions.ref;\n switch (propKind) {\n case constants_1.WhatIsIt.ARRAY:\n schemaProp[key] = utils.mapArrayOptions(rawOptions, refType, target, key, undefined, { ref });\n break;\n case constants_1.WhatIsIt.NONE:\n schemaProp[key] = Object.assign({ type: refType, ref }, rawOptions);\n break;\n case constants_1.WhatIsIt.MAP:\n const mapped = utils.mapOptions(rawOptions, refType, target, key);\n schemaProp[key] = Object.assign(Object.assign({}, mapped.outer), { type: Map, of: Object.assign({ type: refType, ref }, mapped.inner) });\n break;\n default:\n throw new errors_1.InvalidWhatIsItError(propKind, name, key, 'whatis(ref)');\n }\n return;\n }\n if ('refPath' in rawOptions) {\n const refPath = rawOptions.refPath;\n delete rawOptions.refPath;\n utils.assertion(typeof refPath === 'string' && refPath.length > 0, new errors_1.StringLengthExpectedError(1, refPath, `${name}.${key}`, 'refPath'));\n switch (propKind) {\n case constants_1.WhatIsIt.ARRAY:\n schemaProp[key] = utils.mapArrayOptions(rawOptions, refType, target, key, undefined, { refPath });\n break;\n case constants_1.WhatIsIt.NONE:\n schemaProp[key] = Object.assign({ type: refType, refPath }, rawOptions);\n break;\n default:\n throw new errors_1.InvalidWhatIsItError(propKind, name, key, 'whatis(refPath)');\n }\n return;\n }\n // check if Type is actually a real working Type\n if (utils.isNullOrUndefined(Type) || typeof Type !== 'function') {\n throw new errors_1.InvalidTypeError(name, key, Type);\n }\n const enumOption = rawOptions.enum;\n if (!utils.isNullOrUndefined(enumOption)) {\n // check if the supplied value is already \"mongoose-consumeable\"\n if (!Array.isArray(enumOption)) {\n if (Type === String || Type === typegoose_1.mongoose.Schema.Types.String) {\n rawOptions.enum = Object.entries(enumOption) // get all key-value pairs of the enum\n // no reverse-filtering because if it is full of strings, there is no reverse mapping\n .map(([enumKey, enumValue]) => {\n // convert key-value pairs to an mongoose-usable enum\n // safeguard, this should never happen because TypeScript only sets \"design:type\" to \"String\"\n // if the enum is full of strings\n if (typeof enumValue !== 'string') {\n throw new errors_1.NotStringTypeError(name, key, enumKey, typeof enumValue);\n }\n return enumValue;\n });\n }\n else if (Type === Number || Type === typegoose_1.mongoose.Schema.Types.Number) {\n rawOptions.enum = Object.entries(enumOption) // get all key-value pairs of the enum\n // filter out the \"reverse (value -> name) mappings\"\n // https://www.typescriptlang.org/docs/handbook/enums.html#reverse-mappings\n .filter(([enumKey, enumValue], _i, arr) => {\n // safeguard, this should never happen because typescript only sets \"design:type\" to \"Number\"\n // if the enum is full of numbers\n if (utils.isNullOrUndefined(enumValue) || arr.findIndex(([k]) => k === enumValue.toString()) <= -1) {\n // if there is no reverse mapping, throw an error\n throw new errors_1.NotNumberTypeError(name, key, enumKey, typeof enumValue);\n }\n return typeof enumValue === 'number';\n })\n .map(([enumKey, enumValue]) => {\n // convert key-value pairs to an mongoose-useable enum\n if (typeof enumValue !== 'number') {\n throw new errors_1.NotNumberTypeError(name, key, enumKey, typeof enumValue);\n }\n return enumValue;\n });\n }\n else {\n // this will happen if the enum type is not \"String\" or \"Number\"\n // most likely this error happened because the code got transpiled with babel or \"tsc --transpile-only\"\n // REFACTOR: re-write this to be a Error inside errors.ts\n throw new Error(`Invalid type used for enums!, got: \"${Type}\" (${name}.${key}) [E012]` +\n \"Is the code transpiled with Babel or 'tsc --transpile-only' or 'ts-node --transpile-only'?\\n\" +\n 'See https://typegoose.github.io/typegoose/docs/api/decorators/prop/#enum');\n }\n }\n }\n if (!utils.isNullOrUndefined(rawOptions.addNullToEnum)) {\n rawOptions.enum = Array.isArray(rawOptions.enum) ? rawOptions.enum : [];\n rawOptions.enum.push(null);\n delete rawOptions.addNullToEnum;\n }\n {\n let included = utils.isWithStringValidate(rawOptions);\n if (!utils.isString(Type)) {\n // warn if String-Validate options are included, but is not string\n utils.warnNotCorrectTypeOptions(name, key, 'String', 'String-Validate', included);\n }\n included = utils.isWithStringTransform(rawOptions);\n if (!utils.isString(Type)) {\n // warn if String-Transform options are included, but is not string\n utils.warnNotCorrectTypeOptions(name, key, 'String', 'String-Transform', included);\n }\n included = utils.isWithNumberValidate(rawOptions);\n if (!utils.isNumber(Type)) {\n // warn if Number-Validate options are included, but is not number\n utils.warnNotCorrectTypeOptions(name, key, 'Number', 'Number-Validate', included);\n }\n included = utils.isWithEnumValidate(rawOptions);\n if (!utils.isString(Type) && !utils.isNumber(Type)) {\n // warn if \"enum\" is included, but is not Number or String\n utils.warnNotCorrectTypeOptions(name, key, 'String | Number', 'extra', included);\n }\n }\n /** Is this Type (/Class) in the schemas Map? */\n const isInSchemas = data_1.schemas.has(utils.getName(Type));\n if (utils.isPrimitive(Type)) {\n if (utils.isObject(Type, true)) {\n utils.warnMixed(target, key);\n }\n switch (propKind) {\n case constants_1.WhatIsIt.ARRAY:\n schemaProp[key] = utils.mapArrayOptions(rawOptions, Type, target, key);\n return;\n case constants_1.WhatIsIt.MAP:\n const mapped = utils.mapOptions(rawOptions, Type, target, key);\n schemaProp[key] = Object.assign(Object.assign({}, mapped.outer), { type: Map, of: Object.assign({ type: Type }, mapped.inner) });\n return;\n case constants_1.WhatIsIt.NONE:\n schemaProp[key] = Object.assign(Object.assign({}, rawOptions), { type: Type });\n return;\n default:\n throw new errors_1.InvalidWhatIsItError(propKind, name, key, 'whatis(primitive)');\n }\n }\n // If the 'Type' is not a 'Primitive Type' and no subschema was found treat the type as 'Object'\n // so that mongoose can store it as nested document\n if (utils.isObject(Type) && !isInSchemas) {\n utils.warnMixed(target, key);\n logSettings_1.logger.warn('if someone can see this message, please open an new issue at https://github.com/typegoose/typegoose/issues with reproduction code for tests');\n schemaProp[key] = Object.assign(Object.assign({}, rawOptions), { type: typegoose_1.mongoose.Schema.Types.Mixed });\n return;\n }\n const virtualSchema = (0, typegoose_1.buildSchema)(Type);\n switch (propKind) {\n case constants_1.WhatIsIt.ARRAY:\n schemaProp[key] = utils.mapArrayOptions(rawOptions, virtualSchema, target, key, Type);\n return;\n case constants_1.WhatIsIt.MAP:\n // special handling if the lower type should be an array\n if ('dim' in rawOptions) {\n logSettings_1.logger.debug('Map SubDocument Array for \"%s.%s\"', name, key);\n const _d = utils.mapArrayOptions(rawOptions, virtualSchema, target, key, Type), { type } = _d, outer = (0, tslib_1.__rest)(_d, [\"type\"]);\n schemaProp[key] = Object.assign(Object.assign({}, outer), { type: Map, of: type });\n return;\n }\n const mapped = utils.mapOptions(rawOptions, virtualSchema, target, key, Type);\n schemaProp[key] = Object.assign(Object.assign({}, mapped.outer), { type: Map, of: Object.assign({ type: virtualSchema }, mapped.inner) });\n return;\n case constants_1.WhatIsIt.NONE:\n schemaProp[key] = Object.assign(Object.assign({}, rawOptions), { type: virtualSchema });\n return;\n default:\n throw new errors_1.InvalidWhatIsItError(propKind, name, key, 'whatis(subSchema)');\n }\n}", "isOneOf(...posVals){\n\t\treturn this.addTest((obj) => {\n const isObjOneOfPosVals = posVals.some(\n posVal => Object.is(posVal, obj)\n );\n return new Validity(isObjectOfValidType,\n `${this.name} can only be one of ${posVals.join(', ')}`);\n }, 'isOneOf');\n\t}", "function _getProp(/*Array*/parts, /*Boolean or Object*/create, /*Object*/context){\n\tif(!context){ return {}; }\n\ttry{\n\t\tfor(var i = 0; i < parts.length; i++){\n\t\t\tvar p = parts[i];\n\t\t\tif(!(p in context)){\n\t\t\t\tif (typeof create === 'object' && create.hasOwnProperty('default')) {\n\t\t\t\t\tcontext[p] = create.default;\n\t\t\t\t} else if (create) {\n\t\t\t\t\tcontext[p] = {};\n\t\t\t\t} else {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcontext = context[p];\n\t\t}\n\t\treturn context; // mixed\n\t} catch(e) { }\n}", "function setCType(prop, classContext) {\n\tprop.isPtr = false;\n\tprop.CType = undefined;\n\tprop.CConstType = undefined;\n\tprop.CBaseType = undefined;\n\n\t/*\n\t * map basic JSON types\n\t */\n\tswitch ( prop.type ) {\n\tcase 'string':\n\t\tprop.CBaseType = \"std::string\";\n\t\tprop.isPtr = true;\n\t\tbreak;\n\n\tcase 'number':\n\t\tprop.CBaseType = \"double\";\n\t\tbreak;\n\n\tcase 'integer':\n\t\tprop.CBaseType = \"int64_t\";\n\t\tbreak;\n\n\tcase 'boolean':\n\t\tprop.CBaseType = \"bool\";\n\t\tbreak;\n\n\tcase 'object':\n\t\tprop.isPtr = true;\n\t\tprop.CBaseType = prop.className;\n\t\tbreak;\n\n\tcase 'array':\n\t\tprop.isPtr = true;\n\t\t// get type from array items\n\t\tprop.CBaseType = \"std::vector<\" + prop.items.CType + \">\";\n\t\tbreak;\n\n\tcase 'any':\n\t\tprop.isPtr = true;\n\t\tprop.CBaseType = \"std::string\"; // use the JSON text\n\t\tbreak;\n\n\tdefault:\n\t\t// this should never happen\n\t\tbreak;\n\t}\n\t\n\t/*\n\t * handle extended types\n\t */\n\t\n\t// ID\n\tif ( prop.type == 'string' && prop.exttype == 'id' ) {\n\t\tprop.CBaseType = 'ConnectedVision::id_t';\n\t\tprop.isPtr = false;\n\t}\n\n\t\n\t// timestamp\n\tif ( prop.type == 'integer' && prop.exttype == 'timestamp' ) {\n\t\tprop.CBaseType = 'ConnectedVision::timestamp_t';\n\t\tprop.isPtr = false;\n\t}\n\t\n\t// enforce exttype\n\tif ( !prop.exttype )\n\t\tprop.exttype = prop.type;\n\t\n\t// derive C/C++ type from base type\n\tif ( prop.isPtr ) {\n\t\tprop.CType = 'boost::shared_ptr<' + prop.CBaseType + '>';\n\t\tprop.CConstType = 'boost::shared_ptr<const ' + prop.CBaseType + '>';\n\t} else {\n\t\tprop.CType = prop.CBaseType;\n\t\tprop.CConstType = prop.CBaseType;\n\t}\n}", "function ofTypeOrThrow(obj, type, error) {\n if (typeof obj == type || false) {\n return obj;\n } else {\n throw error || 'Invalid type: must be a ' + type;\n }\n }", "function _checkContext(ctx, fnName) {\n // Check context, because it is easy to mistakenly type\n // `new Model.discriminator()` and get an incomprehensible error\n if (ctx == null || ctx === global) {\n throw new MongooseError('`Model.' + fnName + '()` cannot run without a ' +\n 'model as `this`. Make sure you are calling `MyModel.' + fnName + '()` ' +\n 'where `MyModel` is a Mongoose model.');\n } else if (ctx[modelSymbol] == null) {\n throw new MongooseError('`Model.' + fnName + '()` cannot run without a ' +\n 'model as `this`. Make sure you are not calling ' +\n '`new Model.' + fnName + '()`');\n }\n}", "enterAgType(ctx) {\n }", "buildSingle(endContext, currentContext) {\n\t\tconst keys = Object.keys(endContext);\n\t\tfor(const key of keys) {\n\t\t\tswitch(typeof endContext[key]) {\n\t\t\t\tcase \"number\": {\n\t\t\t\t\tif(typeof currentContext[key] === \"number\") {\n\t\t\t\t\t\tswitch(currentContext[key]) {\n\t\t\t\t\t\t\t// nothing happens for 0 because it is Ignore\n\t\t\t\t\t\t\tcase 0: {\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcase -1:\n\t\t\t\t\t\t\tcase 1: {\n\t\t\t\t\t\t\t\tendContext[key] = currentContext[key];\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tdefault: {\n\t\t\t\t\t\t\t\tthrow Error(`Node value cannot be \"${currentContext[key]}\"`);\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\tbreak;\n\t\t\t\t}\n\t\t\t\tcase \"object\": {\n\t\t\t\t\tif(typeof currentContext[key] === \"object\") {\n\t\t\t\t\t\tthis.buildSingle(endContext[key], currentContext[key]);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function evaluateContext(owner, keys) {\n\tvar evaluated = {};\n\n\tkeys.forEach(function (key) {\n\t\tevaluated[key] = owner.get(key) || throwIfAgainstPolicy(owner, key);\n\t})\n\n\t// inject optional.\n\tevaluated['data'] = owner.get('data');\n\tevaluated['selection'] = owner.get('selection');\n\t\n\treturn evaluated;\n}", "function isSetContext(tokens) {\n if (tokens.length == 4 || tokens.length == 6) {\n if (eq('set', 3, tokens[0]) && eq('context', 4, tokens[1]) && (eq('user', 4, tokens[2]) || eq('person', 5, tokens[2]))) {\n if (tokens.length == 4) {\n return { user: tokens[3], password: '' };\n } else if (eq('password', 4, tokens[4])) {\n return { user: tokens[3], password: tokens[5] };\n }\n }\n }\n}", "function handleValue(arg) {\n if (Number.isInteger(arg)) {\n return new NumNode(arg);\n }\n if (Array.isArray(arg)) {\n return new ArrNode(arg.map(handleValue));\n }\n if ((typeof arg) === 'string') {\n return new StrNode(arg);\n }\n if ((typeof arg) === 'boolean') {\n return new BoolNode(arg);\n }\n if (arg === null) {\n return new NullNode();\n }\n if (arg === undefined) {\n return new UndefNode();\n }\n if (arg.constructor === Object) {\n let pairs = [];\n for (let key in arg) {\n pairs.push(handleValue(key));\n pairs.push(handleValue(arg[key]));\n }\n return new ObjNode(pairs)\n }\n if ((typeof arg) === 'function') {\n return new FuncNode(arg);\n }\n if (arg instanceof ExprNode) {\n return arg\n }\n\n throw TypeError(`Cannot handle arg ${arg}`)\n}", "static initialize(obj, type, items) { \n obj['type'] = type;\n obj['items'] = items;\n }", "toBeObject(expected) {\n if (typeof expected === \"object\" && !Array.isArray(expected)) {\n // typeof is not safe. Must explicitidly check null values and arrays too.\n return {\n message: \"Is Object\",\n pass: true,\n };\n }\n return {\n message: () => `This is not an object, it's::::${typeof expect}`,\n pass: false,\n };\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function objApply(msgId, msg, author, authi, seq) {\n var key = msg.args[0]\n var def = msg.args[1]\n\n if (msg.op == 'declare') return declare()\n return new Error('Unknown operation for the Object type')\n\n function declare() {\n var type = types[def.type]\n if (!type)\n return new Error('Unrecognized type \"' + def.type + '\" in object declare op')\n\n // conflict check\n var meta = state.meta[key]\n if (meta) {\n if (meta.authi <= authi)\n return false // existing authority is greater, abort\n }\n\n meta = {\n key: key,\n type: def.type,\n author: author,\n authi: authi,\n seq: seq,\n prev: msgId\n }\n state.meta[key] = meta\n state.data[key] = type.initialize(msg, meta)\n obj.emit('declare', meta)\n return [key, undefined, state.data[key]]\n }\n }", "enterObject(ctx) {\n\t}", "function check_type(property, value) {\n var result = hintlet.stringToType(property);\n if (result != value) {\n throw new Error(\"hintlet.type.\" + property + \": Expected: \" + value \n + \", Got: \" + result);\n }\n result = hintlet.typeToString(value);\n if (result != property) {\n throw new Error(\"typeToString(): \" + value + \": Expected: \" + property \n + \", Got: \" + result);\n }\n}", "function validateParams(params) {\n if (!params.conversation.context) {\n throw new Error('No context in params.');\n }\n}", "isPlainObject(obj) {\n return _toString.call(obj) === '[object Object]'\n }", "function isPlainObject(input){return typeof input==='object'&&input!==null&&(Object.getPrototypeOf(input)===Object.prototype||Object.getPrototypeOf(input)===null);}", "static newAndTakeCContext(ctxPtr) {\n // assert(typeof ctxPtr === 'number');\n return new MessageInfoCustomParams(ctxPtr);\n }", "static initialize(obj, type, operation, value) { \n obj['type'] = type;\n obj['operation'] = operation;\n obj['value'] = value;\n }", "function checkParam (aObject, aType)\n// --------------------------------------------------------------------\n{\n checkObject (aObject, aType, false);\n}", "createContextProperty(opts) {\n return {\n namespace: this.checkValue(opts.namespace, 'Alexa.EndpointHealth'),\n name: this.checkValue(opts.name, 'connectivity'),\n value: this.checkValue(opts.value, { value: 'OK' }),\n timeOfSample: new Date().toISOString(),\n uncertaintyInMilliseconds: this.checkValue(opts.uncertaintyInMilliseconds, 0),\n };\n }", "static build (typeSig) {\n if (typeof typeSig === 'string') {\n return new ResourceProperty(Schema.locateResource(typeSig))\n } else if (Array.isArray(typeSig) && typeSig.length > 0 && typeof typeSig[0] === 'string') {\n return new ArrayProperty(Property.build(typeSig[0]))\n } else if (typeSig === Date) {\n return new DateProperty()\n } else if ([String, Number, Boolean, Date, Array, Object].includes(typeSig)) {\n return new PrimitiveProperty()\n } else {\n throw new Error(`Type Signature ${inspect(typeSig)} is invalid`)\n }\n }", "set type(value) {}", "function r(t){return t&&\"object\"===typeof t}", "function assert(ctx, msg, test,op) {\r\n\r\n\tif(test=='isMap') {\r\n\t\ttest = _.isObject(op);\r\n\t}else if(test == 'isArray') {\r\n\t\ttest = _.isArray(op);\r\n\t}\r\n\r\n\tif(_.isFunction(test)) {\r\n\t\ttest= test(op);\r\n\t}\r\n\tif(!test) {\r\n\t\tif(_.isFunction(msg)) {\r\n\t\t\tmsg = msg(op);\r\n\t\t}\r\n\t\tctx.failures.push(msg);\r\n\t\tctx.failed = true;\r\n\t}\r\n}", "function ValuesOfCorrectTypeRule(context) {\n return {\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = (0, _definition.getNullableType)(context.getParentInputType());\n\n if (!(0, _definition.isListType)(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = (0, _definition.getNamedType)(context.getInputType());\n\n if (!(0, _definition.isInputObjectType)(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var fieldNodeMap = (0, _keyMap.default)(node.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i2 = 0, _objectValues2 = (0, _objectValues3.default)(type.getFields()); _i2 < _objectValues2.length; _i2++) {\n var fieldDef = _objectValues2[_i2];\n var fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) {\n var typeStr = (0, _inspect.default)(fieldDef.type);\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(type.name, \".\").concat(fieldDef.name, \"\\\" of required type \\\"\").concat(typeStr, \"\\\" was not provided.\"), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = (0, _definition.getNamedType)(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && (0, _definition.isInputObjectType)(parentType)) {\n var suggestions = (0, _suggestionList.default)(node.name.value, Object.keys(parentType.getFields()));\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(node.name.value, \"\\\" is not defined by type \\\"\").concat(parentType.name, \"\\\".\") + (0, _didYouMean.default)(suggestions), node));\n }\n },\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if ((0, _definition.isNonNullType)(type)) {\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat((0, _inspect.default)(type), \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n }\n },\n EnumValue: function EnumValue(node) {\n return isValidValueNode(context, node);\n },\n IntValue: function IntValue(node) {\n return isValidValueNode(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidValueNode(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidValueNode(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidValueNode(context, node);\n }\n };\n}", "function assertType(value, type) {\n\t\t var valid = void 0;\n\t\t var expectedType = void 0;\n\t\t if (type === String) {\n\t\t expectedType = 'string';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Number) {\n\t\t expectedType = 'number';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Boolean) {\n\t\t expectedType = 'boolean';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Function) {\n\t\t expectedType = 'function';\n\t\t valid = typeof value === expectedType;\n\t\t } else if (type === Object) {\n\t\t expectedType = 'Object';\n\t\t valid = isPlainObject(value);\n\t\t } else if (type === Array) {\n\t\t expectedType = 'Array';\n\t\t valid = Array.isArray(value);\n\t\t } else {\n\t\t expectedType = type.name || type.toString();\n\t\t valid = value instanceof type;\n\t\t }\n\t\t return {\n\t\t valid: valid,\n\t\t expectedType: expectedType\n\t\t };\n\t\t}", "function ValuesOfCorrectTypeRule(context) {\n return {\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = (0, _definition.getNullableType)(context.getParentInputType());\n\n if (!(0, _definition.isListType)(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = (0, _definition.getNamedType)(context.getInputType());\n\n if (!(0, _definition.isInputObjectType)(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var fieldNodeMap = (0, _keyMap.default)(node.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i2 = 0, _objectValues2 = (0, _objectValues.default)(type.getFields()); _i2 < _objectValues2.length; _i2++) {\n var fieldDef = _objectValues2[_i2];\n var fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && (0, _definition.isRequiredInputField)(fieldDef)) {\n var typeStr = (0, _inspect.default)(fieldDef.type);\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(type.name, \".\").concat(fieldDef.name, \"\\\" of required type \\\"\").concat(typeStr, \"\\\" was not provided.\"), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = (0, _definition.getNamedType)(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && (0, _definition.isInputObjectType)(parentType)) {\n var suggestions = (0, _suggestionList.default)(node.name.value, Object.keys(parentType.getFields()));\n context.reportError(new _GraphQLError.GraphQLError(\"Field \\\"\".concat(node.name.value, \"\\\" is not defined by type \\\"\").concat(parentType.name, \"\\\".\") + (0, _didYouMean.default)(suggestions), node));\n }\n },\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if ((0, _definition.isNonNullType)(type)) {\n context.reportError(new _GraphQLError.GraphQLError(\"Expected value of type \\\"\".concat((0, _inspect.default)(type), \"\\\", found \").concat((0, _printer.print)(node), \".\"), node));\n }\n },\n EnumValue: function EnumValue(node) {\n return isValidValueNode(context, node);\n },\n IntValue: function IntValue(node) {\n return isValidValueNode(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidValueNode(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidValueNode(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidValueNode(context, node);\n }\n };\n}", "function diffObject(context, expected, actual, strict) {\n diffType(context, expected, actual);\n let expectedKeys = Object.keys(expected);\n let actualKeys = Object.keys(actual);\n\n if (strict) {\n matchKeys(context, expectedKeys, actualKeys);\n }\n\n expectedKeys.forEach(function(key) {\n diff(context.enter(key), expected[key], actual[key]);\n });\n}", "function isArgsProps(content) {\n return Object.prototype.toString.call(content) === '[object Object]' && !!content.content;\n}", "function SanitizeCtx(ctx) {\n var r = {};\n for (var key in ctx) {\n if (!key.startsWith('_')) {\n r[key] = ctx[key];\n }\n }\n return r;\n}", "function ValuesOfCorrectTypeRule(context) {\n return {\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"getNullableType\"])(context.getParentInputType());\n\n if (!Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isListType\"])(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"getNamedType\"])(context.getInputType());\n\n if (!Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isInputObjectType\"])(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var fieldNodeMap = Object(_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(node.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i2 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields()); _i2 < _objectValues2.length; _i2++) {\n var fieldDef = _objectValues2[_i2];\n var fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isRequiredInputField\"])(fieldDef)) {\n var typeStr = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(fieldDef.type);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Field \\\"\".concat(type.name, \".\").concat(fieldDef.name, \"\\\" of required type \\\"\").concat(typeStr, \"\\\" was not provided.\"), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"getNamedType\"])(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isInputObjectType\"])(parentType)) {\n var suggestions = Object(_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(node.name.value, Object.keys(parentType.getFields()));\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Field \\\"\".concat(node.name.value, \"\\\" is not defined by type \\\"\").concat(parentType.name, \"\\\".\") + Object(_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(suggestions), node));\n }\n },\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isNonNullType\"])(type)) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type), \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \".\"), node));\n }\n },\n EnumValue: function EnumValue(node) {\n return isValidValueNode(context, node);\n },\n IntValue: function IntValue(node) {\n return isValidValueNode(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidValueNode(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidValueNode(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidValueNode(context, node);\n }\n };\n}", "function ValuesOfCorrectTypeRule(context) {\n return {\n ListValue: function ListValue(node) {\n // Note: TypeInfo will traverse into a list's item type, so look to the\n // parent input type to check if it is a list.\n var type = Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"getNullableType\"])(context.getParentInputType());\n\n if (!Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isListType\"])(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n }\n },\n ObjectValue: function ObjectValue(node) {\n var type = Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"getNamedType\"])(context.getInputType());\n\n if (!Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isInputObjectType\"])(type)) {\n isValidValueNode(context, node);\n return false; // Don't traverse further.\n } // Ensure every required field exists.\n\n\n var fieldNodeMap = Object(_jsutils_keyMap_mjs__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(node.fields, function (field) {\n return field.name.value;\n });\n\n for (var _i2 = 0, _objectValues2 = Object(_polyfills_objectValues_mjs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(type.getFields()); _i2 < _objectValues2.length; _i2++) {\n var fieldDef = _objectValues2[_i2];\n var fieldNode = fieldNodeMap[fieldDef.name];\n\n if (!fieldNode && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isRequiredInputField\"])(fieldDef)) {\n var typeStr = Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(fieldDef.type);\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Field \\\"\".concat(type.name, \".\").concat(fieldDef.name, \"\\\" of required type \\\"\").concat(typeStr, \"\\\" was not provided.\"), node));\n }\n }\n },\n ObjectField: function ObjectField(node) {\n var parentType = Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"getNamedType\"])(context.getParentInputType());\n var fieldType = context.getInputType();\n\n if (!fieldType && Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isInputObjectType\"])(parentType)) {\n var suggestions = Object(_jsutils_suggestionList_mjs__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(node.name.value, Object.keys(parentType.getFields()));\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Field \\\"\".concat(node.name.value, \"\\\" is not defined by type \\\"\").concat(parentType.name, \"\\\".\") + Object(_jsutils_didYouMean_mjs__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(suggestions), node));\n }\n },\n NullValue: function NullValue(node) {\n var type = context.getInputType();\n\n if (Object(_type_definition_mjs__WEBPACK_IMPORTED_MODULE_7__[\"isNonNullType\"])(type)) {\n context.reportError(new _error_GraphQLError_mjs__WEBPACK_IMPORTED_MODULE_5__[\"GraphQLError\"](\"Expected value of type \\\"\".concat(Object(_jsutils_inspect_mjs__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(type), \"\\\", found \").concat(Object(_language_printer_mjs__WEBPACK_IMPORTED_MODULE_6__[\"print\"])(node), \".\"), node));\n }\n },\n EnumValue: function EnumValue(node) {\n return isValidValueNode(context, node);\n },\n IntValue: function IntValue(node) {\n return isValidValueNode(context, node);\n },\n FloatValue: function FloatValue(node) {\n return isValidValueNode(context, node);\n },\n StringValue: function StringValue(node) {\n return isValidValueNode(context, node);\n },\n BooleanValue: function BooleanValue(node) {\n return isValidValueNode(context, node);\n }\n };\n}", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "function is( obj, type ) {\n return typeof obj === type;\n }", "static isTyped(structure) {\r\n switch (structure.kind) {\r\n case StructureKind_1.StructureKind.Property:\r\n case StructureKind_1.StructureKind.Parameter:\r\n case StructureKind_1.StructureKind.PropertySignature:\r\n case StructureKind_1.StructureKind.VariableDeclaration:\r\n case StructureKind_1.StructureKind.TypeAlias:\r\n return true;\r\n default:\r\n return false;\r\n }\r\n }", "function is(obj, type) {\n return typeof obj === type;\n }", "function is(obj, type) {\n return typeof obj === type;\n }", "function checkObjectInside(obj){\n if(typeof obj.data === 'object'){\n checkObject(obj.data);\n };\n}", "function checkOjects(value, obj) {\n return !!obj[value]\n }", "function checkObjType(objInput, objInputConstructor, blnAllowSubclasses) {\n\ttry {\n\t\t//call confirmObjType\n\t\tconfirmObjType(objInput, objInputConstructor, blnAllowSubclasses);\n\n\t\t//if we didn't get an error in that last call, return true\n\t\treturn true;\n\t} //end try\n\tcatch(e) {\n\t\t//if we got an error, it means confirmObjType failed (wasn't really an obj of that type), so\n\t\treturn false;\n\t} //end catch\n} //end function checkObjType", "function make(type) {\n if (!knowType(type)) {\n return;\n }\n\n switch (type) {\n case Number:\n prop = options['props'][name] = {\n type: Number,\n default: 0\n };\n break;\n case Boolean:\n prop = options['props'][name] = {\n type: Boolean,\n default: false\n };\n break;\n case Array:\n prop = options['props'][name] = {\n type: Array,\n default: []\n };\n break;\n case String:\n prop = options['props'][name] = {\n type: String,\n default: ''\n };\n break;\n case Object:\n prop = options['props'][name] = {\n type: Object,\n default: null\n };\n break;\n case null:\n prop = options['props'][name] = {\n type: null,\n default: null\n };\n break;\n default:\n break;\n }\n }", "function isStylingContext(value) {\n return Array.isArray(value) && typeof value[TYPE] === 'number';\n}", "function assertValidObject(obj) {\n const valid =\n obj &&\n obj.path &&\n obj.statementMap &&\n obj.fnMap &&\n obj.branchMap &&\n obj.s &&\n obj.f &&\n obj.b;\n if (!valid) {\n throw new Error(\n 'Invalid file coverage object, missing keys, found:' +\n Object.keys(obj).join(',')\n );\n }\n}", "function ctx(a, b) {\n console.log(\"parametros: \", a, b)\n console.log(\"contexto: \", this)\n console.log(\"*************\")\n}", "function isObject(val){return null!=val&&\"object\"==typeof val&&!1===Array.isArray(val)}", "function assertType (value, type) {\n\t var valid\n\t var expectedType = getType(type)\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string')\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number')\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean')\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function')\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value)\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value)\n\t } else {\n\t valid = value instanceof type\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}", "function assertType(value, type) {\n var valid = void 0;\n var expectedType = void 0;\n if (type === String) {\n expectedType = 'string';\n valid = typeof value === expectedType;\n } else if (type === Number) {\n expectedType = 'number';\n valid = typeof value === expectedType;\n } else if (type === Boolean) {\n expectedType = 'boolean';\n valid = typeof value === expectedType;\n } else if (type === Function) {\n expectedType = 'function';\n valid = typeof value === expectedType;\n } else if (type === Object) {\n expectedType = 'Object';\n valid = isPlainObject(value);\n } else if (type === Array) {\n expectedType = 'Array';\n valid = Array.isArray(value);\n } else {\n expectedType = type.name || type.toString();\n valid = value instanceof type;\n }\n return {\n valid: valid,\n expectedType: expectedType\n };\n}", "function setContext(c, e, ctx, n) {\n var i;\n var exprName;\n var s;\n Sk.asserts.assert(ctx !== Sk.astnodes.AugStore && ctx !== Sk.astnodes.AugLoad, \"context not AugStore or AugLoad\");\n s = null;\n exprName = null;\n\n switch (e.constructor) {\n case Sk.astnodes.Attribute:\n case Sk.astnodes.Name:\n if (ctx === Sk.astnodes.Store) {\n forbiddenCheck(c, n, e.attr, n.lineno);\n }\n e.ctx = ctx;\n break;\n case Sk.astnodes.Starred:\n e.ctx = ctx;\n setContext(c, e.value, ctx, n);\n break;\n case Sk.astnodes.Subscript:\n e.ctx = ctx;\n break;\n case Sk.astnodes.List:\n e.ctx = ctx;\n s = e.elts;\n break;\n case Sk.astnodes.Tuple:\n if (e.elts.length === 0) {\n throw new Sk.builtin.SyntaxError(\"can't assign to ()\", c.c_filename, n.lineno);\n }\n e.ctx = ctx;\n s = e.elts;\n break;\n case Sk.astnodes.Lambda:\n exprName = \"lambda\";\n break;\n case Sk.astnodes.Call:\n exprName = \"function call\";\n break;\n case Sk.astnodes.BoolOp:\n case Sk.astnodes.BinOp:\n case Sk.astnodes.UnaryOp:\n exprName = \"operator\";\n break;\n case Sk.astnodes.GeneratorExp:\n exprName = \"generator expression\";\n break;\n case Sk.astnodes.Yield:\n exprName = \"yield expression\";\n break;\n case Sk.astnodes.ListComp:\n exprName = \"list comprehension\";\n break;\n case Sk.astnodes.SetComp:\n exprName = \"set comprehension\";\n break;\n case Sk.astnodes.DictComp:\n exprName = \"dict comprehension\";\n break;\n case Sk.astnodes.Dict:\n case Sk.astnodes.Set:\n case Sk.astnodes.Num:\n case Sk.astnodes.Str:\n exprName = \"literal\";\n break;\n case Sk.astnodes.NameConstant:\n exprName = \"True, False or None\";\n break;\n case Sk.astnodes.Compare:\n exprName = \"comparison\";\n break;\n case Sk.astnodes.Repr:\n exprName = \"repr\";\n break;\n case Sk.astnodes.IfExp:\n exprName = \"conditional expression\";\n break;\n default:\n Sk.asserts.fail(\"unhandled expression in assignment\");\n }\n if (exprName) {\n throw new Sk.builtin.SyntaxError(\"can't \" + (ctx === Sk.astnodes.Store ? \"assign to\" : \"delete\") + \" \" + exprName, c.c_filename, n.lineno);\n }\n\n if (s) {\n for (i = 0; i < s.length; ++i) {\n setContext(c, s[i], ctx, n);\n }\n }\n}", "function ContextInformation() {\n\n this._id = \"\";\n this._classes = [];\n this._type = \"\";\n this._min = \"\";\n this._max = \"\";\n this._default = \"\";\n this._chosenValue = \"\"; // set by the author in unit editing\n this._operators = [];\n this._chosenOperator = \"\"; // set by the author in unit editing\n this._enums = [];\n this._parameters = [];\n\n return this;\n}", "function tt(t) {\n return \"nullValue\" in t ? 0 /* NullValue */ : \"booleanValue\" in t ? 1 /* BooleanValue */ : \"integerValue\" in t || \"doubleValue\" in t ? 2 /* NumberValue */ : \"timestampValue\" in t ? 3 /* TimestampValue */ : \"stringValue\" in t ? 5 /* StringValue */ : \"bytesValue\" in t ? 6 /* BlobValue */ : \"referenceValue\" in t ? 7 /* RefValue */ : \"geoPointValue\" in t ? 8 /* GeoPointValue */ : \"arrayValue\" in t ? 9 /* ArrayValue */ : \"mapValue\" in t ? X(t) ? 4 /* ServerTimestampValue */ : 10 /* ObjectValue */ : Gn(\"Invalid value type: \" + JSON.stringify(t));\n}", "testObjectAssertions() {\n var objConstructor = {}.constructor;\n\n this.assertIdentical({ a: 12 }.constructor, objConstructor);\n /* eslint-disable-next-line no-new-object */\n this.assertIdentical(new Object().constructor, objConstructor);\n\n var qxObj = new qx.core.Object();\n this.assertNotIdentical(qxObj.constructor, objConstructor);\n this.assertNotIdentical((1).constructor, objConstructor);\n this.assertNotIdentical(\"Juhu\".constructor, objConstructor);\n this.assertNotIdentical(/abc/.constructor, objConstructor);\n qxObj.dispose();\n }", "function assertType (value, type) {\n\t var valid;\n\t var expectedType = getType(type);\n\t if (expectedType === 'String') {\n\t valid = typeof value === (expectedType = 'string');\n\t } else if (expectedType === 'Number') {\n\t valid = typeof value === (expectedType = 'number');\n\t } else if (expectedType === 'Boolean') {\n\t valid = typeof value === (expectedType = 'boolean');\n\t } else if (expectedType === 'Function') {\n\t valid = typeof value === (expectedType = 'function');\n\t } else if (expectedType === 'Object') {\n\t valid = isPlainObject(value);\n\t } else if (expectedType === 'Array') {\n\t valid = Array.isArray(value);\n\t } else {\n\t valid = value instanceof type;\n\t }\n\t return {\n\t valid: valid,\n\t expectedType: expectedType\n\t }\n\t}" ]
[ "0.54763657", "0.5453822", "0.5323058", "0.5274446", "0.51881903", "0.5146345", "0.5023472", "0.49863532", "0.49738187", "0.49738187", "0.49738187", "0.49626344", "0.49513006", "0.48599276", "0.48473272", "0.48060852", "0.4801074", "0.47916186", "0.4789198", "0.47888517", "0.475041", "0.47374558", "0.4711952", "0.4693402", "0.46900326", "0.46861717", "0.4670429", "0.4644574", "0.46343482", "0.46313855", "0.4625463", "0.4621002", "0.46091315", "0.4589382", "0.45798254", "0.45789096", "0.45652375", "0.45599467", "0.45396945", "0.4527781", "0.452099", "0.4515745", "0.4511362", "0.45081043", "0.45002505", "0.4499267", "0.4495627", "0.44822505", "0.4477301", "0.44756112", "0.44715187", "0.44594327", "0.44565916", "0.44472858", "0.44450444", "0.44427586", "0.44422936", "0.44371435", "0.44263136", "0.44253144", "0.44242176", "0.44219857", "0.44219857", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.44033408", "0.43978044", "0.43734878", "0.43734878", "0.4367914", "0.43647805", "0.4362114", "0.43558672", "0.4352785", "0.43522668", "0.43438616", "0.43374547", "0.4335981", "0.43357214", "0.4329984", "0.43277457", "0.43267107", "0.43182102", "0.43166345" ]
0.6307882
0
this function should be called once at script load time to see if a previous session had connection issues and send all the data
function checkSendBufferCache() { var keys = GM_listValues(); if (keys == null) return; var key = keys[0]; for (var i=0; key != null; key=keys[i++] ) { if(key.match(/^sendBuffer:(.*?):/)) { var route = key.match(/^sendBuffer:(.*?):(.*?):/)[1]; var cbString = key.match(/^sendBuffer:(.*?):(.*?):/)[2]; console.log('sendbuffer post route:' + route); var postData = GM_getValue(key); var data = JSON.parse(postData); GM_deleteValue(key); ctxSendToServer({data:data, route:route, ondispatch:cbString}); } /* if (key.match(/^setting:/)) { GM_deleteValue(key); } if (key.match(/^starMap:/)) { GM_deleteValue(key); } if (key.match(/^sendQ:/)) { GM_deleteValue(key); } */ } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function safeSendData(){\n \n var date = new Date();\n if(webSock.bufferedAmount == 0 && ((date.getTime() - timeOfLastMessage) > 100))\n {\n timeOfLastMessage = date.getTime();\n sendData();\n }\n }", "function initialRequests() {\n socketService.getUserData()\n .success(function (resp) {\n $rootScope.main.responseStatusHandler(resp);\n $scope.userData = globals.userData(resp.userData);\n $rootScope.main.broadcastUserData();\n\n if ($scope.userData.isRegistered) {\n //join a socketRoom for websocket connection, equivalent to user's uniqueCuid\n socket.emit('joinRoom', {\n room: resp.userData.uniqueCuid\n });\n }\n })\n .error(function (errResponse) {\n $rootScope.main.responseStatusHandler(errResponse);\n });\n }", "function _failedReq() {\n\t\t\t\t\t\tif(idataObj.hasOwnProperty('socket')) {\n\t\t\t\t\t\t\tidataObj.socket = undefined;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t//logger.error(JSON.stringify(idataObj));\n\t\t\t\t\t\tif(idataObj.offLineRequest == true) {\n\t\t\t\t\t\t\tdbStore.redisConnPub.publish('FAILURE_DAEMON', JSON.stringify(idataObj));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(socket) {\n\t\t\t\t\t\t\tidataObj.socketId = socket.id;\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "failure(_resp) {\n // server didn't respond, likely network issue.. retry.\n if (_resp.X.status === 0) {\n console.warn('Server Connection Lost: Reconnecting...');\n }\n else {\n console.error('Transporter was unable to complete the synchronization request.');\n }\n Queue.push(() => {\n this.busy = false;\n });\n window.location.reload(true);\n }", "function server_or_connect_error()\n{\n// FIXME: We could display something on screen at this point to let the user know we had a problem completing a reload\n reload_later(reload_interval)\n}", "function keepSessionalive() {\n\t\t\tdailyMailScanDataService.keepSessionalive()\n\t\t\t\t.then(function (response) { });\n\t\t}", "_sendRestart() {\n this._throttledRequestHandler();\n clearTimeout(this._conn._idleTimeout);\n }", "function connect_to_server() {\n var connected = false;\n connect();\n\n function connect() {\n var wsUri = '';\n console.log('protocol', window.location.protocol);\n if (window.location.protocol === 'https:') {\n wsUri = \"wss://\" + bag.setup.SERVER.EXTURI;\n }\n else {\n wsUri = \"ws://\" + bag.setup.SERVER.EXTURI;\n }\n\n ws = new WebSocket(wsUri);\n ws.onopen = function (evt) {\n onOpen(evt);\n };\n ws.onclose = function (evt) {\n onClose(evt);\n };\n ws.onmessage = function (evt) {\n onMessage(evt);\n };\n ws.onerror = function (evt) {\n onError(evt);\n };\n }\n\n function onOpen(evt) {\n console.log(\"WS CONNECTED\");\n connected = true;\n clear_blocks();\n $(\"#errorNotificationPanel\").fadeOut();\n ws.send(JSON.stringify({type: \"chainstats\", v: 2, user: user.username}));\n ws.send(JSON.stringify({type: \"get_papers\", v: 2, user: user.username}));\n if (user.name && user.role !== \"charitymonitor\") {\n ws.send(JSON.stringify({type: 'get_company', company: user.name, user: user.username}));\n }\n }\n\n function onClose(evt) {\n console.log(\"WS DISCONNECTED\", evt);\n connected = false;\n setTimeout(function () {\n connect();\n }, 5000);\t\t\t\t\t//try again one more time, server restarts are quick\n }\n\n\tfunction onMessage(msg) {\n\t\ttry {\n\t\t\tvar data = JSON.parse(msg.data);\n\t\t\tconsole.log('rec', data);\n\t\t\tif (data.msg === 'papers') {\n\t\t\t\ttry{\n\t\t\t\t\tvar papers = JSON.parse(data.papers);\n\t\t\t\t\t//console.log('!', papers);\n\t\t\t\t\tif ($('#auditPanel').is){\n\t\t\t\t\t\tfor (var i in panels) {\n\t\t\t\t\t\t\tbuild_trades(papers, panels[i]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch(e){\n\t\t\t\t\tconsole.log('cannot parse papers', e);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (data.msg === 'chainstats') {\n\t\t\t\tconsole.log(JSON.stringify(data));\n\t\t\t\tvar e = formatDate(data.blockstats.transactions[0].timestamp.seconds * 1000, '%M/%d/%Y &nbsp;%I:%m%P');\n\t\t\t\t$(\"#blockdate\").html('<span style=\"color:#fff\">TIME</span>&nbsp;&nbsp;' + e + ' UTC');\n\t\t\t\tvar temp = {\n\t\t\t\t\tid: data.blockstats.height,\n\t\t\t\t\tblockstats: data.blockstats\n\t\t\t\t};\n\t\t\t\tnew_block(temp);\t\t\t\t\t\t\t\t\t//send to blockchain.js\n\t\t\t}\n\t\t\telse if (data.msg === 'company') {\n\t\t\t\ttry{\n\t\t\t\t\tvar company = JSON.parse(data.company);\n $(\"#accountBalance\").html(formatMoney(company.cashBalance));\n \n\t\t\t\t}\n\t\t\t\tcatch(e){\n\t\t\t\t\tconsole.log('cannot parse company', e);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (data.msg === 'reset') {\n\t\t\t\t// Ask for all available trades and information for the current company\n\t\t\t\tws.send(JSON.stringify({type: \"get_papers\", v: 2, user: user.username}));\n ws.send(JSON.stringify({type: \"chainstats\", v: 2, user: user.username}));\n\t\t\t\tif (user.role !== \"charitymonitor\") {\n\t\t\t\t\tws.send(JSON.stringify({type: 'get_company', company: user.name, user: user.username}));\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (data.type === 'error') {\n\t\t\t\tconsole.log(\"Error:\", data.error);\n\t\t\t}\n\t\t}\n\t\tcatch (e) {\n\t\t\tconsole.log('ERROR', e);\n\t\t\t//ws.close();\n\t\t}\n\t}\n\n function onError(evt) {\n console.log('ERROR ', evt);\n if (!connected && bag.e == null) {\t\t\t\t\t\t\t\t\t\t\t//don't overwrite an error message\n $(\"#errorName\").html(\"Warning\");\n $(\"#errorNoticeText\").html(\"Waiting on the node server to open up so we can talk to the blockchain. \");\n $(\"#errorNoticeText\").append(\"This app is likely still starting up. \");\n $(\"#errorNoticeText\").append(\"Check the server logs if this message does not go away in 1 minute. \");\n $(\"#errorNotificationPanel\").fadeIn();\n }\n }\n\n function sendMessage(message) {\n console.log(\"SENT: \" + message);\n ws.send(message);\n }\n}", "function fireInitialSplunkDotComRequest () {\n\tsendSplunkDotComRequest(\"login\");\n \n // wait for a bit for request to come back; fire next request if no response\n window.cannotConnectTimeout = setTimeout(handleInitUpdateTimeout, REMOTE_SCRIPT_LOAD_TIMEOUT);\n}", "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n location.reload();\n }\n}", "function init(){\r\n checkSession(); \r\n}", "function connectionStatus() {\n if (!window.connecting || retry == 20) {\n window.forcing = false;\n retry = 0;\n connectBtn.disabled = false;\n return;\n }\n retry++;\n setTimeout(connectionStatus, 1000);\n }", "function giveMeResources() {\n if(socket != null && socket.readyState > 0) {\n if(socket.readyState == 1) {\n // already connected and ready, just send the cash\n sendRes();\n } else {\n // something went wrong\n retryConnection();\n }\n } else {\n\n // new connection\n connect();\n }\n}", "keepAlive() {\n\t\tif (this.portalId === undefined) {\n\t\t\treturn\n\t\t}\n\t\tthis.client.send(`R/${this.portalId}/system/0/Serial`, '')\n\t}", "onSessionInterupted() {\n this.emit('sessionInterupted');\n }", "function hasConnectionError() {\n\t\t\treturn settings.connectionError;\n\t\t}", "function _noconn()\n\t{\n\t\tUTILS.msgbox(\"You do not have a good enough signal to complete the request. Please try again later.\", \"No Connection\");\n\t}", "function startSession() {\r\n\tmainSocketStart();\r\n}", "function open_ws() {\n\tconsole.log(\"connecting to the server\");\n\tif(window.location.href.indexOf(\":343\")>=0){\n\t\tcon = new WebSocket('wss://'+IP+':9779/');\n\t\tconsole.log(\"!!!! running experimental port !!!!\");\n\t} else {\n\t\tcon = new WebSocket('wss://'+IP+':9879/');\n\t}\n\tcon.onopen = function(){\n\t\twhile($(\"#rl_msg\").length){\n\t\t\t$.fancybox.close();\t\t\t\t\t\t\t\n\t\t\t$(\"#rl_msg\").remove();\n\t\t};\n\n\t\tconsole.log(\"onOpen\");\n\t\trequest_pre_login();\n\t};\n\n\t// reacting on incoming messages\n\tcon.onmessage = function(msg) {\n\t\tconsole.log(msg);\n\t\tmsg_dec=JSON.parse(msg.data);\n\t\tparse_msg(msg_dec);\n\t};\n\tcon.onclose = function(){\n\t\tconsole.log(\"onClose\");\n\t\t// removed old existing entries\n\t\twhile($(\"#rl_msg\").length){\n\t\t\t$.fancybox.close();\t\t\t\t\t\t\t\n\t\t\t$(\"#rl_msg\").remove();\n\t\t};\n\n\t\t// remove register box .. sorry\n\t\twhile($(\"#register_input_box\").length){\n\t\t\t$.fancybox.close();\n $(\"#register_input_box\").remove();\n };\n\n\t\t// show fancybox\n\t\tshow_fancybox(\"reconnecting...\",\"rl_msg\");\n\n\t\tif(c_freeze_state!=1){\n\t\t\tconsole.log(\"running reconnect in 2 sec\");\n\t\t\tvar timeout=2000;\n\t\t\tif(fast_reconnect){\n\t\t\t\tfast_reconnect=0;\n\t\t\t\ttimeout=0;\n\t\t\t};\n\t\t\tsetTimeout(function(){ open_ws();} , timeout);\n\t\t} else {\n\t\t\tconsole.log(\"will not run reconnect, as cordoba put us to sleep\");\n\t\t};\n\t};\n}", "function atAttemptConnection()\n{\n var listener = {\n finished : function(data){\n dump(data);\n }\n }\n try {\n transportService =\n Components.classes[\"@mozilla.org/network/socket-transport-service;1\"]\n .getService(Components.interfaces.nsISocketTransportService);\n transport = transportService.createTransport(null,0,\"localhost\",5331,null);\n\n outstream = transport.openOutputStream(0,0,0);\n\n stream = transport.openInputStream(0,0,0);\n dump( stream );\n instream = Components.classes[\"@mozilla.org/scriptableinputstream;1\"]\n .createInstance(Components.interfaces.nsIScriptableInputStream);\n instream.init(stream);\n \n var dataListener = {\n data : \"\",\n onStartRequest: function(request, context){},\n onStopRequest: function(request, context, status){\n instream.close();\n outstream.close();\n listener.finished(this.data);\n },\n onDataAvailable: function(request, context, inputStream, offset, count){\n // this.data += instream.read(count);\n\t var theData = instream.read(count);\n\t var theCount = count;\n\t if( theData == 1 )\n\t\t ambientTouchRate( 1 );\n\t else if( theData == 0 )\n\t\t ambientTouchRate( 0 );\n\t else\n\t {\n\t\t dump( \"data:\" );\n\t\t dump( theData );\n\t }\n \t\t\n\t },\n };\n \n \n pump = Components.\n classes[\"@mozilla.org/network/input-stream-pump;1\"].\n createInstance(Components.interfaces.nsIInputStreamPump);\n pump.init(stream, -1, -1, 0, 0, false);\n pump.asyncRead(dataListener,null);\n } catch (ex){\n alert(ex);\n }\n}", "function onConnectionLost(responseObject) {\n\tif (responseObject.errorCode !== 0) {\n\t\tconsole.log(\"onConnectionLost:\"+responseObject.errorMessage);\n\t\tonPageLoad();\n\t\tclearSubs();\n \t}\n}", "function checkConnection(){\n viewModel.notOnline(!navigator.onLine);\n // requests next check in 500 ms\n setTimeout(checkConnection, 500);\n}", "function onErrorHandler() {\n if (!socket_ok) {\n $(\".ws_status\").children().empty();\n $(\".ws_status\").find(\"span\").attr(\"id\", \"ws_offline\");\n $(\".ws_status\").children().append(\"OFFLINE\");\n } else {\n socket_ok = false;\n /* Disable the update timer */\n if (update_timer != null)\n clearTimeout(update_timer);\n /* If the user is visiting a page which depends on the WebSocket,\n * bring it back to the index page. */\n createIndexPage();\n }\n}", "function startSendingData () {\n // Send data to server once in a while, exponential\n UST.sendDataDelay = 300;\n recurseSend();\n }", "function loadSession() {\r\n var parameters = {\r\n type: \"POST\",\r\n url: \"data.php\",\r\n data: {SID: SID, action: 'loadSession'},\r\n dataType: 'json',\r\n success: function(data) {\r\n SID = data.SID;\r\n if (data.teamID) {\r\n if (!confirm(data.message)) { // t(\"restart_previous_contest\") json not loaded yet!\r\n destroySession();\r\n return;\r\n }\r\n $(\"#divCheckGroup\").hide();\r\n checkBrowserID(data, function() {\r\n teamID = data.teamID;\r\n initContestData(data);\r\n loadContestData(contestID, contestFolder);\r\n });\r\n }\r\n }\r\n };\r\n if(window.redirectToHTTPSIfError) {\r\n parameters.timeout = 3000;\r\n parameters.error = function() {\r\n if(window.location.protocol != 'https:') {\r\n window.location.protocol = 'https:';\r\n }\r\n }\r\n }\r\n $.ajax(parameters);\r\n}", "function checkstatus()\n\t{\n\t\tif(disconnectwarned || !AjaxLife.Network.Connected) return;\n\t\tvar now = new Date();\n\t\tif(!now.getTime() - lastmessage.getTime() > 60000)\n\t\t{\n\t\t\tdisconnectwarned = true;\n\t\t\talert(\"No data has been received for over a minute. You may have been disconnected.\");\n\t\t}\n\t}", "function onerror() {\n if (this._socket) {\n this._socket = null;\n this._logger.info('Connection closed.');\n }\n\n this._debuggerObj.setEngineMode(this._debuggerObj.ENGINE_MODE.DISCONNECTED);\n\n if (this._surface.getPanelProperty('chart.active')) {\n this._chart.disableChartButtons();\n if (this._chart.containsData()) {\n this._surface.toggleButton(true, 'chart-reset-button');\n }\n }\n\n if (this._surface.getPanelProperty('watch.active')) {\n this._surface.updateWatchPanelButtons(this._debuggerObj);\n }\n\n if (this._session.isUploadStarted()) {\n this._session.setUploadStarted(false);\n }\n\n // Reset the editor.\n this._session.reset();\n this._surface.reset();\n this._surface.disableActionButtons(true);\n this._surface.toggleButton(true, 'connect-to-button');\n this._surface.continueStopButtonState(this._surface.CSICON.CONTINUE);\n\n if (this._session.isContextReset()) {\n this._session.setContextReset(false);\n\n // Try to reconnect once.\n setTimeout(() => {\n $('#connect-to-button').trigger('click');\n }, 1000);\n }\n}", "function check_conn_timeout() {\n if (fatal_error || last_msg_recv_ts === null) {\n return;\n }\n\n if (Date.now() - last_msg_recv_ts > CONN_TIMEOUT) {\n set_fatal_error('Your connection has been closed after a timeout. ' +\n 'Please reload the page.');\n report_error(init_id, 'connection timed out');\n ws.close();\n }\n }", "function ready() {\n intervalIDArr.map((x) => {\n clearInterval(x)\n });\n conn.on('data', function (data) {\n\n });\n conn.on('close', function () {\n status.innerHTML = \"Connection reset<br>Awaiting connection...\";\n conn = null;\n start(true);\n });\n }", "_cleanUpRedirect() {\n super._cleanUpRedirect();\n this.state = RequestSocket.STATUS;\n this._rawHeaders = undefined;\n this.dataReceived = false;\n }", "onSocketFullyConnected() {\n this.debugOut('socketFullyConnected()');\n this.last_socket_error = null;\n this.emit('open');\n }", "function checkClientAlreadyConnected(request)\n { \n if (all_players_list[request.sessionID] != null)\n {\n request.session.player = all_players_list[request.sessionID];\n request.session.player['ref_count']++;\n console.log(\"This session (client \" + request.session.player.player_tag + \") is already connected. Increasing refcount to \" + request.session.player['ref_count']);\n return true;\n }\n return false;\n }", "function on_policy_check(data) {\n /*\n socket.removeListener('data', on_policy_check);\n socket.on('data', function () {\n on_data(data)\n });\n */\n try {\n if(data == '<policy-file-request/>\\0') {\n socket.write(writeCrossDomainFile()+\"\\0\");\n\n //Send Join confirmation message\n /*\n var duh={};\n duh.info.=\"join\";\n socket.write(JSON.stringify(duh)+\"\\0\");\n */\n }\n else {\n if(!gameStarted)\n startGame();\n //console.log(\"data from flash:: = \" + data);\n var ind=String(data).lastIndexOf(\"}\");\n //console.log(\"index = \" + ind);\n if(ind==-1)\n { /*\n mySocket.write(d);\n sockets.splice(sockets.indexOf(mySocket),1);\n mySocket.end();\n */\n\n }else{\n var trimmed =String(data).substr(0,ind+1);\n buffer.push({\"data\":JSON.parse(trimmed),\"playerSock\":socket});\n console.log(\"From Flash = \" + JSON.parse(trimmed));\n }\n }\n }\n catch (ex) {\n console.log(ex);\n }\n }", "function sendMessages() {\n setTimeout(sendMessages,1000);\n for(var i=0; i<socket.sockets.clients().length; i++) {\n var sock = socket.sockets.clients()[i];\n if(sock) {\n var client = clientMap[sock.sessId];\n logger.debug('Client with sessid: ' + sock.sessId + ' with state: ' + client.state);\n switch(client.state) {\n case 'none':\n break;\n case 'progress':\n sock.emit('progress',client.percent);\n break;\n case 'url':\n sock.emit('url',client.url);\n client.state = 'wait-description';\n break;\n case 'wait-description':\n logger.debug('Waiting for description from: ' + sock.sessId);\n break;\n case 'done':\n break;\n case 'error':\n sock.emit('error','An error has ocurred, please try uploading again!');\n client.state = 'done';\n break;\n default:\n logger.error('Unknown state!');\n }\n }\n }\n}", "function monitor() {\n\n timer = setTimeout(function () {\n\n if (attempts >= MAX_RETRIES) {\n reject(new Error('The maximum number of retries was reached'));\n return;\n }\n\n beyond.showMessage({\n 'id': 'rpc-retrying-connection',\n 'text': 'Reintentando conexión',\n 'duration': 0\n });\n\n monitor();\n send(socket);\n\n }, TIME_OUT + (attempts * 2000));\n\n }", "function check_for_multiplayergame() {\n // Receiver of the game runs this function\n window.gid = window.location.hash;\n var url = window.location.href;\n window.socket = new EasyWebSocket(url);\n window.socket.onopen = function(){\n window.socket.send(window.uid+':LoggedIn');\n }\n window.socket.onmessage = function(event){\n console.log(\"received \"+ event.data);\n var message = event.data.split(':');\n var uid = message[0];\n var status = message[1];\n if (uid != window.uid && window.opponentUid == undefined) {\n // If another user has send the message, check it out\n if (status == 'LoggedIn') {\n // add user as opponent, usually not needed, this function run only when being second player\n window.opponentUid = uid;\n } else if (status == 'Settings') {\n console.log('receiving settings:', message);\n window.opponentUid = uid;\n var opponent_loc = message[2].split(',');\n var own_loc = message[3].split(',');\n window.startPos = new google.maps.LatLng(own_loc[0], own_loc[1]);\n window.goalPosition = new google.maps.LatLng(opponent_loc[0], opponent_loc[1]);\n window.opponentPos = new google.maps.LatLng(opponent_loc[0], opponent_loc[1]);\n set_difficulty(parseInt(message[4]));\n // setup game\n // start game, and send 'Ready' if ready\n startMultiPlayerGame();\n }\n } else if (uid == window.opponentUid) {\n if (status == 'Location') {\n var loc = message[2].split(',');\n window.opponentPos = new google.maps.LatLng(loc[0], loc[1]);\n window.opponentDist = loc[2];\n opponentMoved();\n } else if (status == 'Finish') {\n //finish game, you've probably lost it\n $('pano_canvas').grab(new Element('div.notice', {\n id: 'gameover',\n html: 'Aww!!<br/>You Lost! Your opponent has captured your flag!<br/>Refresh to play again!',\n }));\n $('gameover').highlight('#f88', '#fff');\n }\n }\n }\n}", "function webSocket_onopen()\n\t{\n\t\tlogger_.log(\"webSocket_onopen\", \"WebSocket Verbindung geoeffnet\");\n\t\treadValueList();\n\t\tstatusChange();\n\t}", "function sendPOSTtoServer (){\t\n if($('#peerId').val() != ''){\t\t\t\t\t\t\n $.ajax({\n type:'post',\n url: urlServer+\"/GO\",\n dataType: \"text/plain\",\n data: JSON.stringify({ \"id\": $('#peerId').val() }),\n error: function(a,b,c){\n console.log(a)\n }\n })\n\n var connectionID = $('#peerId').val()\n sessionStorage.setItem(\"connectionID\",connectionID)\n location.href=\"game.html\"\n }\n else{\n $('#message').css('color','red')\n setTimeout(function(){\n $('#message').css('color','#999')\n },1000)\n }\n}", "function on_policy_check(data) {\n /*\n socket.removeListener('data', on_policy_check);\n socket.on('data', function () {\n on_data(data)\n });\n */\n try {\n if(data == '<policy-file-request/>\\0') {\n socket.write(writeCrossDomainFile()+\"\\0\");\n\n //Send Join confirmation message\n /*\n var duh={};\n duh[\"info\"]=\"join\";\n socket.write(JSON.stringify(duh)+\"\\0\");\n */\n }\n else {\n startGame();\n console.log(\"data from flash:: = \" + data);\n var ind=String(data).lastIndexOf(\"}\");\n console.log(\"index = \" + ind);\n if(ind==-1)\n { /*\n mySocket.write(d);\n sockets.splice(sockets.indexOf(mySocket),1);\n mySocket.end();\n */\n\n }else{\n var trimmed =String(data).substr(0,ind+1);\n buffer.push({\"data\":JSON.parse(trimmed),\"playerSock\":socket});\n console.log(\"From Flash = \" + JSON.parse(trimmed));\n }\n }\n }\n catch (ex) {\n console.log(ex);\n }\n }", "trySendInitPayload() {\n const {\n initPayload,\n customData,\n socket,\n initialized,\n isChatOpen,\n isChatVisible,\n embedded,\n connected,\n dispatch,\n } = this.props;\n // Send initial payload when chat is opened or widget is shown\n if (!initialized && connected && ((isChatOpen && isChatVisible) || embedded)) {\n // Only send initial payload if the widget is connected to the server but not yet initialized\n\n const sessionId = this.getSessionId();\n\n // check that session_id is confirmed\n if (!sessionId) return;\n\n // eslint-disable-next-line no-console\n console.log('sending init payload', sessionId);\n console.log('socket:', socket);\n socket.emit('user_uttered', {\n message: initPayload,\n customData,\n session_id: sessionId,\n });\n dispatch(initialize());\n }\n }", "function statusSocket()\n{\n console.log('attempting status socket');\n try {\n Status.replaceData(noReq, '/status/get');\n } catch (e) {\n console.error(e);\n console.log('FAILED STATUS CONNECTION');\n setTimeout(statusSocket, 10000);\n }\n}", "function refresh_serialized_sessions() {\n connect_crashlogs();\n connect_static();\n}", "function receiver() {\n if (self.readyState > WebSocketXHR.OPEN) return\n recv = request(url, 'GET', null, function (err, result) {\n if (err) {\n // aborted request?\n if (err.code === 0) {\n // disconnect the socket with wasClean: true if it is open\n disconnect(self.readyState !== WebSocketXHR.OPEN)\n // request errored\n } else {\n // close the socket with wasClean: false\n disconnect(false)\n }\n recv = null\n } else {\n // N.B. we skip empty messages, they are heartbeats\n if (result) {\n var packets = decodePayload(result)\nconsole.log('PA', result, packets)\n for (var i = 0; i < packets.length; ++i) {\n var type = packets[i].type\n var data = packets[i].data\n // message frame\n if (type === 'message') {\n // report incoming message\n //setTimeout(function () {\n fire('message', { data: data, origin: url })\n //}, 0)\n // ping frame\n } else if (type === 'ping') {\n self.send(encodePacket({ type: 'pong', data: packet.data }))\n // open frame\n } else if (type === 'close') {\n // disconnect with wasClean: false\n disconnect(false)\n // open frame\n } else if (type === 'open' && self.readyState === WebSocketXHR.CONNECTING) {\n // data is session\n // parse session as urlencoded\n session = urldecode(data)\n session.interval = parseInt(session.interval, 10) || 0\nconsole.log('SESS', session)\n // setup receiver URL\n url = url + '/' + session.id\n // mark socket as open\n self.readyState = WebSocketXHR.OPEN\n setTimeout(function () {\n fire('open')\n }, 0)\n // error frame, or error decoding frame\n } else if (type === 'error') {\n disconnect()\n /*if (self.readyState !== WebSocketXHR.OPEN) {\n self.readyState = WebSocketXHR.CLOSED\n }*/\n // unknown frame. ignore\n } else {\nconsole.log('UNKNOWN FRAME', packet)\n disconnect()\n }\n }\n }\n // restart receiver\n setTimeout(receiver, session.interval || 0)\n }\n })\n }", "function connect_to_server(){\n var connected = false;\n \n // Redirect https requests to http so the server can handle them\n if(this.location.href.indexOf(\"https://\") > -1) {\n this.location.href = this.location.href.replace(\"https://\", \"http://\");\n }\n\n connect();\n\n function connect(){\n var wsUri = 'ws://' + document.location.hostname + ':' + document.location.port;\n console.log('Connection to websocket', wsUri);\n\n ws = new WebSocket(wsUri);\n ws.onopen = function(evt) { onOpen(evt); };\n ws.onclose = function(evt) { onClose(evt); };\n ws.onmessage = function(evt) { onMessage(evt); };\n ws.onerror = function(evt) { onError(evt); };\n }\n\n function onOpen(evt){\n console.log('WS CONNECTED');\n connected = true;\n\n $('#connectionStatusMessage').fadeOut();\n\n // Get the corporations on webpage load\n ws.send(JSON.stringify({type: 'get_corporations'}));\n }\n\n function onClose(evt){\n console.log('WS DISCONNECTED', evt);\n connected = false;\n $('#connectionStatusMessage').fadeIn();\n setTimeout(function(){ connect(); }, 5000);\t\t\t\t\t//try again one more time, server restarts are quick\n }\n\n function onMessage(msg){\n // Registry Code\n try {\n var msgObj = JSON.parse(msg.data);\n if(msgObj.msg === 'register') {\n console.log('register!!!', msgObj.msg, msgObj);\n //document.getElementById(\"register\").reset();\n //$('#registerValidationMessage').html('');\n // confirm successful push onto blockchain\n $('#statusPanel').fadeIn(300);\n $('#registerPanel').hide();\n // TODO Show error message here if there is a problem\n $('#statusMessage').html('Your registration was successful. The register transaction was successfully stored in the blockchain.');\n $('#registeringMessage').html('');\n // clear the fields in the register\n\n }\n else if(msgObj.msg === 'nameChange') {\n console.log('nameChange', msgObj.msg, msgObj);\n // confirm successful push onto blockchain\n $('#statusPanel').fadeIn(300);\n $('#name_changePanel').hide();\n // TODO Show error message here if there is a problem\n $('#statusMessage').html('Your name change was successful. The name change transaction was successfully stored in the blockchain.'); \n $('#nameChangingMessage').html('');\n }\n else if(msgObj.msg === 'amalgamate') {\n console.log('amalgamate', msgObj.msg, msgObj);\n // confirm successful push onto blockchain\n $('#statusPanel').fadeIn(300);\n $('#amalgamatePanel').hide();\n // TODO Show error message here if there is a problem\n $('#statusMessage').html('Your amalgamation was successful. The amalgamation transaction was successfully stored in the blockchain.'); \n $('#amalgamatingMessage').html('');\n }\n else if(msgObj.msg === 'report') {\n console.log('report', msgObj.msg, msgObj);\n // confirm successful push onto blockchain\n $('#statusPanel').fadeIn(300);\n $('#reportPanel').hide();\n // TODO Show error message here if there is a problem\n $('#statusMessage').html('Your reporting was successful. The reporting was successfully stored in the blockchain.');\n $('#reportingMessage').html('');\n }\n else if(msgObj.msg === 'dissolve') {\n console.log('dissolve', msgObj.msg, msgObj);\n // confirm successful push onto blockchain\n $('#statusPanel').fadeIn(300);\n $('#dissolvePanel').hide();\n // TODO Show error message here if there is a problem\n $('#statusMessage').html('Your dissolution was successful. The dissolve transaction was successfully stored in the blockchain.');\n $('#dissolvingMessage').html('');\n }\n else if(msgObj.msg === 'corporations'){\n console.log('List of corporations', msgObj.msg, msgObj);\n corporations = msgObj.corporations;\n }\n }\n catch(e){\n console.log('ERROR', e);\n //ws.close();\n }\t\n\n\n }\n\n function onError(evt){\n console.log('ERROR ', evt);\n if(!connected){\t\t\t\t\t\t\t\t\t\t\t//don't overwrite an error message\n $('#connectionStatusMessage').html('<img src=\"/imgs/warning.png\"><b>Warning:</b> Waiting on the node server to open up so we can talk to the blockchain. The app is likely still starting up. Check the server logs if this message does not go away in 1 minute.');\n }\n }\n}", "_handleSocketConnected() {\n this.sendClientHandshake();\n this._bsClientBush.postConnect();\n }", "function wsConnect() {\n //console.log(\"connect\",wsUri);\n ws = new WebSocket(wsUri);\n //var line = \"\"; // either uncomment this for a building list of messages\n ws.onmessage = function(msg) {\n //console.log(msg);\n let json;\n try {\n json = JSON.parse(msg.data);\n console.log(json);\n if (jQuery.isEmptyObject(json)){\n json = false;\n $('#message-alert').html(\"Tarjeta no válida\");\n\n timer = new Timer(function() { // init timer with 5 seconds\n $.when($('#message-alert').fadeOut(500)).done(function() {\n resetMsgCard();\n $('#message-alert').fadeIn(500);\n });\n }, 3000);\n }\n } catch (error) {\n switch (msg.data) {\n case \"wait\":\n $('#message-alert').html(\"por favor espere...\");\n break;\n case \"ok\":\n document.getElementById('status').innerHTML = '<span class=\"badge badge-success\"><h6>Conectado</h6></span>';\n break;\n case \"disconnected\":\n document.getElementById('status').innerHTML = '<span class=\"badge badge-danger\"><h3>Fallo en la red. Sin conexión con base de datos</h3></span>';\n break;\n }\n }\n if (json){\n addClient(json);\n addHistory(json);\n }\n }\n ws.onopen = function() {\n // update the status div with the connection status\n //document.getElementById('status').innerHTML = '<span class=\"badge badge-success\"><h6>Conectado</h6></span>';\n //ws.send(\"Open for data\");\n //console.log(\"connected\");\n }\n ws.onclose = function() {\n // update the status div with the connection status\n \n // in case of lost connection tries to reconnect every 3 secs\n setTimeout(wsConnect,3000);\n }\n ws.onerror = function(error) {\n console.log(error);\n // if isn't production, try to connect to development\n wsUri = \"ws://192.168.1.169:1880/ws/simple\";\n }\n}", "function looping(){\n\t\t\t\tif (status == true) {\n socket.emit('my event', {data:'None'});}}", "function synchronizeData(){\n\t\n\tsynchronizing = true;\n\tvar msg;\n\t\n\t$(\"#infoScreen\").html(\"Connection found, sending local data to server\" +\n\t\t\t\"<br>No new location data is saved while synchronizing\");\n\t\n\tfor (var i=0; i<localStorage.length; i++){\n\t\tmsg = JSON.parse(localStorage.getItem(i.toString()));\n\t\tsendPosition(msg);\n\t}\n\t\n\tlocalStorage.clear();\n\tstorageKey = 0;\n\tsynchronizing = false;\n}", "function ready() {\n conn.on('close', function() {\n status.textContent = 'Connection closed';\n status.className = classNames.warning;\n conn = null;\n });\n }", "function checkConversationPossibility(){\n var obj = {};\n obj = getMessageObj();\n // console.log(\"obj >>\", obj);\n obj[\"job_id\"] = jobId;\n obj[\"name\"] = userName;\n obj[\"resume_id\"] = resumeId;\n obj[\"user_id\"] = user_id;\n obj[\"user_type\"] = user_type;\n obj[\"cid\"] = candidateId;\n obj[\"sll\"] = sll;\n obj[\"all_vars\"] = all_vars;\n socket.emit(\"checkIsConversationPossible\", obj);\n }", "_initialize () {\n this.socket.on('data', data => this._sessionProtocol.chuck(data))\n this.socket.once('close', () => this.disconnect())\n }", "handshake() {\n const request = new XMLHttpRequest();\n request.open('GET', 'http://localhost:8081/handshake', true);\n\n let msg = this.orchestrator.hud.message.string\n request.onload = () => {\n if (JSON.parse(request.responseText) === \"handshake\") {\n console.log(\"Handshake Successful\")\n this.orchestrator.hud.updateMessage(\"HANDSHAKE\")\n } else {\n console.log(\"Handshake Failed\")\n this.orchestrator.hud.updateMessage(\"FAIL HS\")\n }\n setTimeout(() => this.orchestrator.hud.updateMessage(msg), 3000)\n }\n request.onerror = () => {\n console.log(\"Failed to Contact Server\")\n this.orchestrator.hud.updateMessage(\"FAIL HS\")\n setTimeout(() => this.orchestrator.hud.updateMessage(msg), 3000)\n }\n\n request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');\n request.send(); // bloqueia aqui até receber resposta\n }", "function checkConnectionStatus() {\n if (!client.isConnected()) {\n connect();\n }\n}", "function connection_offline() {\n // Block.\n }", "function onConnectionLost(){\r\n console.log(\"connection lost\");\r\n document.getElementById(\"status\").innerHTML = \"Connection Lost\";\r\n document.getElementById(\"status_messages\").innerHTML =\"Connection Lost\";\r\n connected_flag=0;\r\n }", "function keepSessionalive() {\n inatkeDocumentsDataService.keepSessionalive()\n .then(function (response) { });\n }", "function onConnectionLost(responseObject) {\n if (responseObject.errorCode !== 0) {\n console.log(\"onConnectionLost:\" + responseObject.errorMessage);\n write(responseObject.errorMessage);\n }\n}", "function setupSockets() {\r\n\t\tgame = gameEngine.returnSystem( 'game' );\r\n\t\t\r\n\t\tplayerShip = game.returnShip( shipId );\r\n\t\t\r\n\t\ttoken = {};\r\n\t\ttoken.name = playerShip['displayName'];\r\n\t\ttoken.game = 0;\r\n\t\ttoken.ship = playerShip['id'];\r\n\t\t\r\n\t\tsocket = connectToServer();\r\n\t\t\r\n\t\tif(socket !== undefined) {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tsetupSocketTransfers();\t\t\t\r\n\t\t\t}, 1500);\r\n\t\t} else {\r\n\t\t\tsetTimeout(function() {\r\n\t\t\t\tsocket = finishConnection();\r\n\t\t\t\tsetupSocketTransfers();\r\n\t\t\t}, 1500);\r\n\t\t}\r\n\t}", "success(resp) {\n if (!resp.X.responseText) {\n this.failure(resp);\n }\n else {\n const [_sesKey, _values, _scripts] = this.parseResponseArray(resp.X.responseText);\n if (_sesKey === '') {\n console.error('Invalid session key, error message should follow...');\n }\n else if (_sesKey === Session.oldKey) {\n // TODO: (which?) iPad sometimes sends same request 3 times. Skip repsonder if it has same ses key than previous one.\n console.warn('Session key is the same as the previous one; skipping response...');\n }\n else {\n Session.newKey(_sesKey);\n this.setValues(_values);\n this.runScripts(_scripts, _sesKey);\n }\n if (this._serverInterruptView && _sesKey !== '') {\n this._serverInterruptView.die();\n this._serverInterruptView = false;\n }\n }\n }", "function onSessionStateChanged(event) {\n var sessionState = pureweb.getClient().getSessionState();\n if (sessionState === pureweb.client.SessionState.FAILED) {\n if (lastSessionState === pureweb.client.SessionState.CONNECTING) {\n //See note re: alert boxes at the top of the file\n var msg = 'Unable to connect to the Scribble service application.';\n var ex = pureweb.getClient().getAcquireException();\n if (ex) {\n msg += ' ' + ex.getMessage();\n }\n alert(msg);\n } else {\n //See note re: alert boxes at the top of the file\n alert('Connection to the Scribble service application has been lost. Refresh the page to restart.');\n }\n }\n lastSessionState = sessionState;\n}", "function checkServerTimeout()\n{\n\t// Checking server performance\n\tvar receivedDataDelay = (Date.now() - lastPacketReceived) / 1000.0;\n\tif (receivedDataDelay > lagReloadDelay) \n\t{\n\t\tconsole.log(\"things might be a little slow: \" + receivedDataDelay);\n\t\tpostWarningMessage(\"red\", \"things might be a little slow: \" + receivedDataDelay);\n\t\tlastPacketReceived = Date.now() + (lagReloadRetry*1000); // add 10 sec before running this reconnect/reset again\n\t\t\n\t\t//reconnectToServerNode();\n\t\t\n\t\t//location.reload(false);\n\t\t//loadNewGameSessionData();\n\t\t//console.log(\"RELOADED PAGE\");\n\t\t\n\t\tif (reloadOnServerTimeout) {\n\t\t\twindow.location=\"http://sandbox-dane.rhcloud.com/games/voidpirates?autostart=1\";\n\t\t}\n\t}\n}", "function pii_check_if_stats_server_up() {\n var stats_server_url = \"http://woodland.gtnoise.net:5005/\"\n\ttry {\n\t var wr = {};\n\t wr.guid = (sign_in_status == 'signed-in') ? pii_vault.guid : '';\n\t wr.version = pii_vault.config.current_version;\n\t wr.deviceid = (sign_in_status == 'signed-in') ? pii_vault.config.deviceid : 'Not-reported';\n\n\t var r = request({\n\t\t url: stats_server_url,\n\t\t content: JSON.stringify(wr),\n\t\t onComplete: function(response) {\n\t\t\tif (response.status == 200) {\n\t\t\t var data = response.text;\n\t\t\t var is_up = false;\n\t\t\t var stats_message = /Hey ((?:[0-9]{1,3}\\.){3}[0-9]{1,3}), Appu Stats Server is UP!/;\n\t\t\t is_up = (stats_message.exec(data) != null);\n\t\t\t my_log(\"Appu stats server, is_up? : \"+ is_up, new Error);\n\t\t\t}\n\t\t\telse {\n\t\t\t //This means that HTTP response is other than 200 or OK\n\t\t\t my_log(\"Appu: Could not check if server is up: \" + stats_server_url\n\t\t\t\t\t+ \", status: \" + response.status.toString(), new Error);\n\t\t\t print_appu_error(\"Appu Error: Seems like server was down. \" +\n\t\t\t\t\t \"Status: \" + response.status.toString() + \" \"\n\t\t\t\t\t + (new Date()));\n\t\t\t}\n\t\t }\n\t\t});\n\n\t r.post();\n\t}\n\tcatch (e) {\n\t my_log(\"Error while checking if stats server is up\", new Error);\n\t}\n last_server_contact = new Date();\n}", "function resetConnection() {\n //close socket\n GEPPETTO.MessageSocket.close();\n //clear message handlers, all tests within module should have performed by time method it's called\n GEPPETTO.MessageSocket.clearHandlers();\n //connect to socket again for next test\n GEPPETTO.MessageSocket.connect(GEPPETTO.MessageSocket.protocol + window.location.host + '/' + window.BUNDLE_CONTEXT_PATH + '/GeppettoServlet');\n }", "async work() {\n if(this.needConnect) {\n this.log.info(`(Re)Connect due to ${this.needConnect}`);\n await this.evo.login();\n this.needConnect = \"\";\n await this.initObjects();\n this.log.info(\"Connected ok\");\n }\n\n if(this.needConnect) \n return;\n \n await this.mergeStatus();\n \n if(this.evo.structureError) {\n this.log.info(`Structure refresh due to ${this.evo.structureError}`);\n this.needConnect = \"StructureError\";\n await this.initObjects();\n // catch the update next time...\n }\n }", "resume () {\n\t if (this.readyState !== WebSocket.OPEN) throw new Error('not opened');\n\n\t this._socket.resume();\n\t }", "resume () {\n\t if (this.readyState !== WebSocket.OPEN) throw new Error('not opened');\n\n\t this._socket.resume();\n\t }", "function keepSessionAlive() {\n$.post('/fenland/ping');\n}", "function think()\n{\n\tif(!connected)\n\t\tconnect();\n}", "async verifyConnection () {\n try {\n await this.client.checkConnect();\n this.connected = true;\n } \n catch (error) {\n console.log('Error connection to the Report Portal server');\n console.dir(error);\n this.connected = false;\n }\n }", "async connectCurrent(req,res){\n // web3 item should still have no value\n console.log(web3);\n this.isConnected()\n res.render('connectOverview');\n }", "function beginconnexion(msg , data) {\n $( \".mfp-close\" ).trigger( \"click\" );\n $( \"#headernoconnect\" ).hide();\n $( \"#headerajaxconnect\" ).fadeIn( \"slow\" );\n //SpaceCakeBaking\n SpaceCakeBaking(msg, \"log\");\n if (data==\"fb\") {\n location.reload();\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized') {\n setTimeout(checkState,50);\n }\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle) {\n clearTimeout(timeoutHandle);\n }\n timeoutHandle = undefined;\n }\n }", "function webSocket_onopen()\n\t{\n\t\tstatusChange();\n\t\tconsole.log(\"[ASNeG_Client] WebSocket Verbindung geoeffnet\");\n\t\treadValueList();\n\t}", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function checkState() {\n try {\n var state = getDoc(io).readyState;\n log('state = ' + state);\n if (state && state.toLowerCase() == 'uninitialized')\n setTimeout(checkState,50);\n }\n catch(e) {\n log('Server abort: ' , e, ' (', e.name, ')');\n cb(SERVER_ABORT);\n if (timeoutHandle)\n clearTimeout(timeoutHandle);\n timeoutHandle = undefined;\n }\n }", "function sendLog() {\n $.post(\"db.php\", sessHistory); // jQuery AJAX POST\n count = 0; // Resetting command count.\n sessHistory = {branch: BRANCH}; // Resetting session history JSON.\n}", "function processData() {\n try {\n socket.send(JSON.stringify(lastData));\n \n if (!freeze) showData(lastData);\n } catch (err) {\n logError(err);\n }\n \n // Request function to run again when browser has a moment\n window.requestAnimationFrame(processData);\n}", "function onFirstConnection () {\n\t\t\thandleMessage(\"server\", {\n\t\t\t\tnoBroadcast: true,\n\t\t\t\tmessage: \"Welcome @\" + session.username + \", you have joined room #\" + room.id\n\t\t\t});\n\t\t\t// Warn other user that a new user joined the room\n\t\t\thandleMessage(\"server\", {\n\t\t\t\tnoPrivate: true,\n\t\t\t\tmessage: '@' + session.username + ' has joined!'\n\t\t\t});\n\t\t}", "function init() {\n const PORT = process.env.WEBSOCKET_PORT || 3300;\n const wss = new WebSocket.Server({ port: PORT });\n \n wss.on('connection', async (ws, request) => {\n let userID = cookie.parse(request.headers.cookie).user;\n let room = await dbManager.findRoomByUserID(userID);\n if (sockets[room._id] == undefined)\n sockets[room._id] = [];\n sockets[room._id][userID] = ws;\n send(room); //send info to everyone else\n \n ws.on('message', async message => {\n room = await dbManager.findRoomByUserID(userID);\n if (room == null || userID == null || (room.connected > 1 && userID != room.uIDs[0] && userID != room.uIDs[1])) {\n ws.send(\"REDIRECT\");\n return;\n }\n \n let playerNumber = userID == room.uIDs[0] ? 0 : 1;\n \n if (message == null || isNaN(message) || message < 0 || message > 8) {\n ws.send(\"Invalid value\");\n return;\n }\n let position = parseInt(message);\n \n if (playerNumber == room.turn && room.board[position] == null && room.winner == null) {\n room = await dbManager.updateRoom(room._id, playerNumber, position);\n }\n send(room);\n });\n });\n}", "processData() {\n // If we have enough data to process the next step in the SOCKS handshake, proceed.\n if (this._receiveBuffer.length >= this._nextRequiredPacketBufferSize) {\n // Sent initial handshake, waiting for response.\n if (this.state === constants_1.SocksClientState.SentInitialHandshake) {\n if (this._options.proxy.type === 4) {\n // Socks v4 only has one handshake response.\n this.handleSocks4FinalHandshakeResponse();\n }\n else {\n // Socks v5 has two handshakes, handle initial one here.\n this.handleInitialSocks5HandshakeResponse();\n }\n // Sent auth request for Socks v5, waiting for response.\n }\n else if (this.state === constants_1.SocksClientState.SentAuthentication) {\n this.handleInitialSocks5AuthenticationHandshakeResponse();\n // Sent final Socks v5 handshake, waiting for final response.\n }\n else if (this.state === constants_1.SocksClientState.SentFinalHandshake) {\n this.handleSocks5FinalHandshakeResponse();\n // Socks BIND established. Waiting for remote connection via proxy.\n }\n else if (this.state === constants_1.SocksClientState.BoundWaitingForConnection) {\n if (this._options.proxy.type === 4) {\n this.handleSocks4IncomingConnectionResponse();\n }\n else {\n this.handleSocks5IncomingConnectionResponse();\n }\n }\n else if (this.state === constants_1.SocksClientState.Established) {\n // do nothing (prevents closing of the socket)\n }\n else {\n this._closeSocket(constants_1.ERRORS.InternalError);\n }\n }\n }", "function cleanupPreviousSession(){\n\t\t\t\tlogger.debug(\"cleanupPreviousSession\", \"...\");\n\t\t\t\tlogger.debug(\"cleanupPreviousSession\", \"chatInstanceReady=\"+chatInstanceReady\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" collaborationInstanceReady=\"+collaborationInstanceReady\n\t\t\t\t\t\t\t\t\t\t\t\t+ \" windowState = \" + windowState);\n\t\t\t\tif(windowState == windowStateType.DESTRUCTION){\n\t\t\t\t\tif(chatInstanceReady && collaborationInstanceReady){\n\t\t\t\t\t\tlogger.debug(\"cleanupPreviousSession start to clean previous session\", \"...\");\n\t\t\t\t\t\tif(collaborationApi)\n\t\t\t\t\t\t\tcollaborationApi.stopSession();\n\t\t\t\t\t\tif(chat)\n\t\t\t\t\t\t\tchat.disposeVisitor();\n\t\t\t\t\t\tchatOverHandler();\n\t\t\t\t\t\tdeleteAPI_instance();\n\t\t\t\t\t\tsessionMgr.stop();\n\t\t\t\t\t\tresetAll();\n\t\t\t\t\t\tlogger.debug(\"cleanupPreviousSession complete cleaning previous session\", \"...\");\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\tlogger.debug(\"cleanupPreviousSession not ready to clean up previous session\", \"...\");\n\t\t\t\t}\n\t\t\t}", "function reconnectTimer () {\n if (!ws || ws.readyState == WebSocket.CLOSED) {\n reallyConnect();\n }\n }", "function initializeSession() {}", "function checkFeedback()\n{\n xhr = new XMLHttpRequest();\n xhr.onreadystatechange = function(){\n if(this.readyState==4 && this.status == 200)\n {\n dataObtained = JSON.parse(this.responseText);\n if(dataObtained.Status==0)\n {\n $(\"#NotifyError\").text(\"Sorry, we could not connect to server\");\n $(\"label#NotifyError\").show();\n }\n else if(dataObtained.Status==1)\n {\n $(\"#NotifyError\").text(\"Sorry, we could not connect to database\");\n $(\"label#NotifyError\").show();\n }\n else if(dataObtained.Status==2)\n {\n $(\"#NotifyError\").text(\"Data not Recieved\");\n $(\"label#NotifyError\").show();\n }\n else if(dataObtained.Status==3)\n {\n $(\"#QuestionError\").text(\"Error with database\");\n $(\"label#NotifyError\").show();\n }\n else if(dataObtained.Status==6) //record found in database\n {\n $(\"label#NotifyError\").hide();\n //$(\"p#msg2\").append(dataObtained.FeedbackID);\n\n $(\"#Notify\").fadeIn();\n flagIsOld = true;\n \n }\n else if(dataObtained.Status==7)\n {\n $(\"label#NotifyError\").hide();\n flagIsOld = false;\n $('#SecurityFeedback').show();\n //$(\"#SecurityFeedback\").fadeIn();\n }\n else\n {\n $(\"#NotifyError\").text(\"Don't know\");\n $(\"label#NotifyError\").show();\n } \n }\n else\n {\n $(\"#NotifyError\").text(\"Just a moment...\");\n //$(\"#QuestionError\").text(this.readyState + \" \"+ this.status);\n $(\"label#NotifyError\").show();\n }\n\n };\n xhr.open(\"POST\", \"../PHP/SecurityFeedback.php\", true);\n xhr.setRequestHeader(\"Content-type\", \"application/x-www-form-urlencoded\");\n xhr.send(\"Header=\"+2);\n\n}", "function connect(c) {\n \n var globalChat = $('#global_chat');\n\n if(c.label === 'loadRoom') {\n\n if ( peerReconnecting ){\n // do nothing\n } else {\n setTimeout(function(){\n c.send([sessionMessages,sessionTorrents]);\n },4000)\n c.on('data', function(data){\n\n if ( isRoomLoaded ){\n //\n } else {\n sessionMessages= data[0]\n newDataNotification('chat','#textChat','chatNotification',sessionMessages.length);\n sessionMessages.forEach(function(message,index){\n globalChat.append('<div><span class=\"peer\" style=\"color:'+message['color']+'\">' + message['peer'] + '</span>: ' + message['message'] + '</div>');\n globalChat.scrollTop(globalChat.prop(\"scrollHeight\"));\n });\n isRoomLoaded = true;\n }\n\n var torrentList = data[1]\n\n if ( torrentList.length > 0 ){ \n\n }\n\n torrentList.forEach(function(torrent,index){\n var torrentValid = true\n torrentValidation.forEach(function(validInfoHash,index){\n if(validInfoHash==torrent[\"infoHash\"]){\n torrentValid = false;\n }\n })\n if(torrentValid == true){\n newDataNotification(c.label,'#downloads','torrentNotification',torrentNotification);\n torrentValidation.push(torrent[\"infoHash\"]);\n loadPushedTorrents(torrent[\"infoHash\"],torrent[\"name\"],torrent[\"length\"],torrent[\"size\"],torrent[\"fileList\"],c.peer)\n }\n });\n });\n }\n // Handle a chat connection.\n } else if (c.label === 'chat') {\n \n var chatbox = $('<div class=\"peerUsername\"></div>').addClass('connection').addClass('active').attr('id', c.peer);\n var header = $('<div></div>').html(c.peer).appendTo(chatbox);\n var messages = $('<div><em>'+c.peer+' connected.</em></div>').addClass('messages');\n \n chatbox.append(header);\n globalChat.append(messages);\n\n $('.filler').hide();\n $('#chat_user_list').append(chatbox);\n\n // Append message to chat\n c.on('data', function(data) {\n newDataNotification('chat','#textChat','chatNotification',chatNotification);\n globalChat.append('<div><span class=\"peer\" style=\"color:'+data[1]+'\">' + c.peer + '</span>: ' + data[0] +\n '</div>');\n globalChat.scrollTop(globalChat.prop(\"scrollHeight\"));\n\n var messageObject = { \"peer\": c.peer, \"message\": data[0], \"color\": data[1] }\n sessionMessages.push(messageObject);\n });\n\n // Fade peer out on close and destroy users torrents\n c.on('close', function() {\n $('#' + c.peer + 'mouse').fadeOut(1000, function() {\n $(this).remove();\n });\n chatbox.remove();\n if ($('.connection').length === 0) {\n $('.filler').show();\n }\n userNotification = userNotification - 2;\n newDataNotification('user','#userList','userNotification',userNotification);\n var messages = $('<div><em>'+c.peer+' disconnected.</em></div>').addClass('messages');\n globalChat.append(messages);\n // remove disconnecting users torrents\n if ( peerReconnecting ){\n // do nothing\n } else {\n /* $('.'+c.peer+'torrentz').remove();*/\n }\n\n // $.ajax({\n // type: 'delete',\n // url: 'http://allthetime.io/rtos/rooms?userName=' + c.peer,\n // async: false\n // }); \n //delete peer.connections[c.peer]\n //delete connectedPeers[c.peer];\n });\n\n // when info hash is received! \n } else if (c.label === 'torrentz') {\n\n c.on('data', function(data) {\n newDataNotification(c.label,'#downloads','torrentNotification',torrentNotification);\n loadPushedTorrents(data[0],data[1],data[2],data[3],data[4],c.peer);\n });\n\n // Send mouse position of moving mouse to user\n } else if (c.label === 'mouse') {\n newDataNotification('user','#userList','userNotification',userNotification);\n $('<div id=\"' + c.peer + 'mouse\" class=\"mouse\">').appendTo('body');\n \n c.on('data', function(data) {\n var id = '#' + c.peer + 'mouse';\n $(id).css({\n \"top\": data[1] + \"px\",\n \"left\": data[0] + \"px\"\n });\n });\n\n // Start Video \n } else if (c.label === \"videoFeed\") {\n c.on('data', function(data) {\n if(data != \"close\"){\n var call = peer.call(data, mediaStream);\n console.log(\"here comes some video\");\n } else{\n $('#v' + c.peer + 'cam').detach();\n } \n });\n }\n connectedPeers[c.peer] = 1;\n }" ]
[ "0.6048791", "0.585011", "0.57902473", "0.57587487", "0.5641806", "0.5622303", "0.5621419", "0.5603418", "0.5593114", "0.55830985", "0.55806816", "0.5567789", "0.5564455", "0.5550888", "0.5543147", "0.5539069", "0.55349106", "0.5525175", "0.5518297", "0.5511732", "0.54953563", "0.5471947", "0.546967", "0.54695493", "0.5465639", "0.54543746", "0.5444143", "0.54193866", "0.5411006", "0.5406099", "0.53966403", "0.53709793", "0.5363336", "0.536246", "0.53531826", "0.53519934", "0.5341181", "0.53334963", "0.5303931", "0.530349", "0.5301997", "0.5298492", "0.5294503", "0.52934945", "0.5282056", "0.5276223", "0.5264248", "0.52614486", "0.5255322", "0.5250835", "0.52441657", "0.524244", "0.52394414", "0.52385384", "0.52357227", "0.52356064", "0.5226499", "0.52247924", "0.5223223", "0.5218233", "0.52078027", "0.51915604", "0.51894283", "0.5188681", "0.51886696", "0.51886696", "0.51879907", "0.518004", "0.51759374", "0.5175434", "0.5175133", "0.5173976", "0.5173976", "0.5173976", "0.5173976", "0.5173976", "0.5173976", "0.5173976", "0.5173976", "0.5173976", "0.5172757", "0.51724404", "0.51724404", "0.51724404", "0.51724404", "0.51724404", "0.51724404", "0.51724404", "0.51724404", "0.51724404", "0.51724404", "0.5170275", "0.51698583", "0.51687014", "0.5168578", "0.5168119", "0.5164808", "0.5164161", "0.5161391", "0.5148268", "0.5147527" ]
0.0
-1
ripped from ae common return true if a variable exists (is defined)
function exists (obj){ if (typeof (obj) != "undefined" && obj != null) return true; return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function exists(variable) {\n\treturn typeof(variable)!=\"undefined\";\n}", "function isdefined( variable)\r\n{\r\n return (typeof(window[variable]) == \"undefined\")? false: true;\r\n}", "function isDefined(variable){\n/* 609 */ \t\treturn (!(!( variable||false )));\n/* 610 */ \t}", "function isset(aVar)\r\n{\r\n\treturn (typeof aVar == \"undefined\")?false:true;\r\n}", "function isset(varname){\r\n return (typeof(varname)!='undefined');\r\n}", "function isset(varname){\r\n return (typeof(varname)!='undefined');\r\n}", "function isset(variable) {\n\n\treturn typeof variable !== \"undefined\";\n\n}", "function wpsc_var_isset( name ) {\n\tif ( typeof wpsc_vars !== 'undefined' ) {\n\t\treturn wpsc_vars[name] !== undefined;\n\t}\n\n\treturn false;\n}", "function isset(varname) {\n if(typeof( window[ varname ] ) != \"undefined\") return true;\n else return false;\n}", "function variableIsDefined(str)\r\n{\r\n\tvar i = 0\r\n\tvar ret = false\r\n\r\n\tfor (i=0; i < variableCount; i++)\r\n\t{\r\n\t\tif (variableArray[i].name == str.toLowerCase())\r\n\t\t{\r\n\t\t\tvariableLastLookup = i\r\n\t\t\tret = true\r\n\t\t\tbreak\r\n\t\t}\r\n\t}\r\n\t\r\n\t// TODO: more efficient lookup algorithm\r\n\r\n\treturn ret\r\n}", "function isset(variable) {\n return typeof (variable) != \"undefined\" && variable !== null;\n}", "function isDefined(a) {\r\n return a != undefined;\r\n}", "function mapFunctionIsDefined(variable) {\r\n\treturn (typeof(window[variable]) == \"undefined\")? false: true;\r\n}", "function defined (arg) { return arg !== undefined}", "function IsDefined(name, value) {\n\treturn eval('(typeof ' + name.split('.')[0] + ' !== \\'undefined\\') && (typeof ' + name + ' !== \\'undefined\\') && (' + name + ' === ' + value + ')');\n}", "function isset(v){ \n\t//they can pass in the name of a global\n\tif(\"string\" === typeof v) {\n\t\tv = window[v];\n\t}\n\treturn (\"undefined\" !== typeof v && null !== v);\n}", "function isDefined(thing) {\n return typeof thing !== \"undefined\" && thing !== null;\n}", "function isDefined(thing) {\n return typeof thing !== \"undefined\" && thing !== null;\n}", "function isDefined(thing) {\n return typeof thing !== \"undefined\" && thing !== null;\n}", "function isDefined(thing) {\n return typeof thing !== \"undefined\" && thing !== null;\n}", "function isDefined(thing) {\n return typeof thing !== \"undefined\" && thing !== null;\n}", "hasVariable(v) {\n\t\treturn this._vars.includes(v);\n\t}", "function isDefined(x) { return (typeof x != 'undefined' && x != null && x !== null); }", "function isDefined(value) { return typeof value !== \"undefined\"; }", "isDefined(name: string): boolean {\n return this.macros.has(name) ||\n functions.hasOwnProperty(name) ||\n symbols.math.hasOwnProperty(name) ||\n symbols.text.hasOwnProperty(name) ||\n implicitCommands.hasOwnProperty(name);\n }", "function isDefined(input)\r\n{\r\n return (typeof(input) != \"undefined\");\r\n}", "function isDefined(objName) {\n return ( \"undefined\" !== typeof eval(objName) ) ? true : false;\n }", "function isDefined(element) {\n\tif (typeof element == 'undefined' || element==null) {\n\t\treturn false;\n\t}\n\treturn true;\n}", "function isDefined(obj){\n\t\tif (typeof obj == \"undefined\" || obj == \"\"){\n\t\t\treturn false;\n\t\t}else{\n\t\t\treturn true;\n\t\t}\n\t}", "function isDefined(obj)\n{ \n if (typeof obj == 'undefined' || obj == 'undefined' || obj == null)\n {\n return false;\n }\n \n return true;\n}", "function defined(v)\n{\n\treturn (typeof(v) != 'undefined');\n}", "function defined(obj) {\n return typeof obj !== 'undefined';\n }", "function isUndefined(variable) {\n return typeof variable == 'undefined';\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined( value ) {\n return value !== undefined;\n}", "function defined(obj) {\n return typeof obj !== 'undefined';\n }", "function is_there_GET_variables() {\n if( entries.next().value != undefined){\n return true;\n } else {\n return false;\n }\n}", "function $defined(obj){\r\n return (obj != undefined);\r\n }", "function defined$1(obj) {\n return typeof obj !== 'undefined';\n}", "IsDefined() {\n\n }", "function isDefined(x) { return !(x == null && x !== null); }", "function isDefined(x) { return !(x == null && x !== null); }", "function defined (value) {\n\t return typeof value !== 'undefined'\n\t}", "function isset() {\n var a=arguments,l=a.length,i=0;\n if (l===0) {return false;}//end if\n while (i!=l) {if (a[i]===null || typeof(a[i])==='undefined') {return false;} else {i++;}}\n return true;\n}//end function", "function isset(Var)\n{\n\treturn !(typeof Var == 'undefined' || Var === null || Var === \"\");\n}", "function isDefined(testArgument){\n\tif(typeof testArgument == 'undefined'){\n\t\treturn false;\n\t}\n\t return true;\n }", "function isDefined(value) {\r\n\r\n try {\r\n if (typeof value != 'undefined') return true;\r\n } catch (e) {\r\n return false;\r\n }\r\n}", "function isDefined(property){\n return (typeof property != 'undefined');\n}", "function isDefined(a) {\n if( a === undefined || a === null ) return false;\n if( typeof a === \"string\" ) return a != \"\";\n return true;\n}", "function exists(x) {\n return ((x !== undefined) && (x !== null));\n}", "function isDefined(value) {\n return typeof value !== 'undefined';\n}", "function isDefined(value) {\n return typeof value !== 'undefined';\n}", "function isDefined(value) {\n return typeof value !== 'undefined';\n}", "function isDefined(value) {\n return typeof value !== 'undefined';\n}", "function IsDefined(value) {\n return (typeof value) != 'undefined';\n}", "function isDefined(obj) {\n if (typeof obj == 'undefined') {\n return false;\n }\n\n if (!obj) {\n return false;\n }\n\n return obj != null;\n}", "function isDefined(value) {\n\treturn value !== null && typeof value != 'undefined';\n}", "function isVar(x) {\n\treturn x.props && x.props.has('is','variable')\n}", "function isDefined(value) {\n return typeof value !== 'undefined';\n}", "function isDefined(x, andNotNull) {\n return !isUndefined(x, andNotNull);\n }", "function isDefined(value) {\n return value !== null && typeof (value) !== \"undefined\";\n }", "function isDefined(v) {\n if(v !== '' && v !== null && v !== 'undefined') { return true; }\n else { return false; }\n }", "function Defined(type)\n{\n\treturn (type !== \"undefined\");\n}", "function isdefined(item) {\n return typeof item !== \"undefined\" && item !== null;\n }", "function defined (value) {\n return value !== undefined\n}", "function isDef(val) {\n return typeof val != \"undefined\";\n}", "function isDefined(value) {\n return value !== null && typeof value != 'undefined';\n}", "function isDefined(value) {\n\treturn typeof value !== 'undefined' && value !== null;\n}", "function hasVariable(expr, name) {\n let outcome;\n expr.traverse(function (node, path, parent) {\n if (node.type == 'SymbolNode' && node.name == name) {\n outcome = true;\n }\n });\n if (outcome) {\n return true;\n } else {\n return false;\n }\n}", "function isDefined(obj) {\n return obj !== null && obj !== undefined;\n}", "function isDefine(value) {\n\t\t\treturn !((undefined === value) || (null === value));\n\t }", "isWithVariables() {}", "function existy(x) {\n return x != null;\n}", "function existy(x) {\n return x != null;\n}", "function existy(x) {\n return x != null;\n}", "function isVar(t) {\n\t\tfor (var i = 0; i < varTable.length; i++) {\n\t\t\tif (varTable[i].name == t)\n\t\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "function isDefined(_target) {\r\n return (typeof _target != \"undefined\");\r\n }", "function existy(x){\n return x != null \n}", "function isDefined ( value ) {\n return angular.isDefined ( value );\n }", "function isDefined(v) {\n if (v === '' || v === null || v === undefined) {\n return false;\n }\n return true;\n }", "function isDef(obj) {\n return typeof obj !== 'undefined';\n}", "function exists(x) { return x !== null; }", "function isDef(obj) {\n\t\treturn typeof obj !== 'undefined';\n\t}", "function isDefined(value) {\n return value !== undefined && value !== null;\n}", "hasDeclarations() {\r\n\t\t\t\treturn !!this.declaredVariables().length;\r\n\t\t\t}", "function existy(x) {\n console.log(x != null);\n}", "function isDeclared(objName) {\n return ( window.hasOwnProperty(objName) ) ? true : false;\n }", "function isset(v) {\n return typeof(v) !== 'undefined' && v !== null;\n}", "function isDefined(value){return typeof value!=\"undefined\"&&value!==\"\"&&value!==null&&value!='null';}" ]
[ "0.83497834", "0.8342925", "0.7958818", "0.78828263", "0.7874305", "0.7874305", "0.7786021", "0.7782281", "0.7746712", "0.7704927", "0.74311316", "0.74018747", "0.7356111", "0.7339193", "0.7277225", "0.72046244", "0.7199952", "0.7199952", "0.7199952", "0.7199952", "0.7199952", "0.71722686", "0.7165719", "0.716161", "0.71488994", "0.7125107", "0.7118957", "0.70843863", "0.70183545", "0.70173264", "0.7004143", "0.69800305", "0.6973621", "0.6969226", "0.6969226", "0.6969226", "0.6969226", "0.6969226", "0.6969226", "0.6969226", "0.6969226", "0.6969226", "0.6969226", "0.6969226", "0.6969226", "0.6969226", "0.6966456", "0.69505614", "0.6917597", "0.69094753", "0.69061977", "0.6900192", "0.6900192", "0.6899584", "0.6875981", "0.68589723", "0.68472284", "0.6820015", "0.6817709", "0.6814218", "0.6809987", "0.6799866", "0.6799866", "0.6799866", "0.6799866", "0.67877066", "0.6774119", "0.67740387", "0.67586803", "0.67391604", "0.67307067", "0.6728699", "0.67216176", "0.6705598", "0.67028826", "0.66784424", "0.6675038", "0.66384155", "0.6636077", "0.6633049", "0.660118", "0.6599978", "0.6595227", "0.65717834", "0.65717834", "0.65717834", "0.6550878", "0.6535336", "0.65277874", "0.65149975", "0.64955175", "0.6491503", "0.6482289", "0.6461971", "0.6461583", "0.64507073", "0.6450384", "0.6440713", "0.6438122", "0.6405788" ]
0.66280466
80
return an element by id, or object reference
function getElement(obj){ if (typeof(obj) == "string"){ if (document.getElementById == undefined || !document.getElementById) return false; obj = document.getElementById(obj); } if (obj == undefined || !obj) return false; return obj; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get(id) {\r\n\tvar element = getEle(id);\r\n\treturn element;\r\n}", "function elem(id) {\n return document.getElementById(id);\n }", "function ElemId(id){\n\treturn document.getElementById(id);\n}", "function getObj(id) {\n\treturn $(id);\n}", "function ele(id) {\n\treturn document.getElementById(id);\n}", "function getEle(id) {\r\n\treturn document.getElementById(id);\r\n}", "function elt(id) {\n return document.getElementById(id)\n}", "function el(id)\n{\n\tif (document.getElementById)\n\t{\n\t\treturn document.getElementById(id);\n\t}\n\telse if (window[id])\n\t{\n\t\treturn window[id];\n\t}\n\treturn null;\n}", "function getEl(id){\n\treturn document.getElementById(id);\n}", "function elementById(id) {\n return document.getElementById(id);\n}", "function getElementById(id) {\n\n //Allow users to pass an element OR an element's ID\n if (isElement(id)) {\n return id;\n }\n\n var el = null;\n try {\n el = doc.getElementById(id);\n } catch (e) {}\n return el;\n }", "function byId( id ){ return document.getElementById( id ); }", "function find(id){\n var elem = document.getElementById(id);\n return elem;\n}", "function getEl(id) {\n return document.getElementById(id)\n}", "function el(id) {\n return document.getElementById(id);\n}", "function getElement(id){\n\tif(document.getElementById){\n\t\treturn document.getElementById(id); \n\t} else if(document.all){\n\t\treturn document.all(id); \n\t} else { \n\t\tthrow new Error(\"No way to retrieve element\"); \n\t}\n}", "function getElement(id) {\r\n return document.getElementById(id);\r\n}", "function getIdElement(id) {\n return document.getElementById(id);\n}", "function getObjById(id){\n\treturn document.getElementById(id);\n}", "function el(elementid) {\n if (document.getElementById) {\n return document.getElementById(elementid);\n } else if (window[elementid]) {\n return window[elementid];\n }\n}", "function byId(val){\n var object = document.getElementById(val);\n return(object);\n}", "function byId(id){return document.getElementById(id);}", "function getElement(id)\n{\n\t// This is a helper function\n\t// to get element by id\n\tvar element = document.getElementById(id);\n\treturn element;\n}", "function myGetElement ( id )\n {\n\tvar elt = document.getElementById(id);\n\t\n\tif ( elt == undefined )\n\t{\n\t console.log(\"ERROR: unknown element '\" + id + \"'\");\n\t return undefined;\n\t}\n\t\n\telse return elt;\n }", "function get(id){ return document.getElementById(id); }", "function get(id){ return document.getElementById(id); }", "function byId(id) {\n return document.getElementById(id);\n}", "function byId(id) {\n return document.getElementById(id);\n}", "function byId(id) {\n return document.getElementById(id);\n}", "function byId(id) {\r\n return document.getElementById(id);\r\n }", "function byId(id) {\n return document.getElementById(id);\n }", "function getElm(id) {\n return document.getElementById(id);\n}", "function getElmById(id)\n{\n\tif(document.getElementById)\n\t{\n\t\treturn document.getElementById(id);\n\t}\n\telse if(document.all)\n\t{\n\t\treturn document.all[id];\n\t}\n\treturn false;\n}", "function id(el){\n return document.getElementById(el);\n}", "function find(id) {\n return document.getElementById(id);\n}", "function getElement(id){\n const cachedEl = elCache.get(id);\n\n if(cachedEl){\n return cachedEl;\n };\n \n const newEl = document.getElementById(id);\n if(!newEl){\n throw new TypeError('element id ' + id + ' was not found in the DOM');\n };\n\n elCache.set(id, newEl);\n return newEl;\n}", "function my_getbyid(id)\n{\n\titm = null;\n\t\n\tif (document.getElementById)\n\t\titm = document.getElementById(id);\n\n\telse if (document.all)\n\t\titm = document.all[id];\n\n\telse if (document.layers)\n\t\titm = document.layers[id];\n\n\t\n\treturn itm;\n}", "static getEle(id) {\n return document.getElementById(id);\n }", "function id (id){\r\n\t\treturn document.getElementById(id);\r\n\t}", "function $el(id) {\n if (typeof id === 'string') {\n return document.getElementById(id);\n }\n return id;\n }", "function ref(instance_or_id) {\r\n\treturn (typeof (instance_or_id) == \"string\") ? document\r\n\t\t\t.getElementById(instance_or_id) : instance_or_id;\r\n}", "function returnObjById( id ) {\n\n if (document.getElementById) \n var returnVar = document.getElementById(id); \n else if (document.all) \n var returnVar = document.all[id]; \n else if (document.layers) \n var returnVar = document.layers[id]; \n return returnVar; \n }", "function id_of(id) {\n return document.getElementById(id);\n}", "function find(doc, element, id) {\n if (!element) {\n element = doc.getElementById(id);\n if (!element) {\n throw new Error('Missing element, id=' + id);\n }\n }\n return element;\n}", "function id(id) {\n return document.getElementById(id);\n}", "function id(id) {\n return document.getElementById(id);\n}", "function id(id) {\n return document.getElementById(id);\n}", "function getEleById(ele) {\n return document.getElementById(ele);\n}", "function ElementById(name)\n{\n return document.getElementById(name);\n}", "function getElement(elementId){\n return document.getElementById(elementId);\n }", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t}\n\t\tcatch (e) {}\n\t\treturn el;\n\t}", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t}\n\t\tcatch (e) {}\n\t\treturn el;\n\t}", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t}\n\t\tcatch (e) {}\n\t\treturn el;\n\t}", "function selectId(id) {\n var object = document.getElementById(id);\n return object;\n}", "function getElementById(id) {\n\t\tvar el = null;\n\t\ttry {\n\t\t\tel = doc.getElementById(id);\n\t\t} catch (e) {}\n\t\treturn el;\n\t}", "function id(id) {\n return document.getElementById(id);\n}", "function id(id) {\n return document.getElementById(id);\n}", "function id(id) {\n return document.getElementById(id);\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function get(id) {\n return document.getElementById(id);\n }", "function getElById(el) {\n return document.getElementById(el);\n}", "function get(id)\n{\n return document.getElementById(id);\n}", "function getElementById(id) {\n var el = null;\n try {\n el = doc.getElementById(id);\n }\n catch (e) { }\n return el;\n }", "function id(element) {\n return document.getElementById(element);\n}", "function getObj(idObj) {\n if (document.getElementsByName(idObj)[0] != null)\n document.getElementsByName(idObj)[0].id = idObj;\n\n return document.getElementById(idObj);\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function getId(id) {\n return document.getElementById(id);\n}", "function getElementById(id) {\n\n var element = document.getElementById(id);\n if(!element) fail(\"document.getElementById(\" + id + \") failed\");\n return element;\n}", "function getById(id) {\n return document.getElementById(id);\n }", "function getElementById(id) {\n var el = null;\n try {\n el = doc.getElementById(id);\n }\n catch (e) {}\n return el;\n }", "function getElementById(id) {\n var el = null;\n try {\n el = doc.getElementById(id);\n }\n catch (e) {}\n return el;\n }", "function el(x){\n return document.getElementById(x);\n }", "function get_ref( id )\n{\n return document.getElementById( id );\n}", "function id(element) {\n\n return document.getElementById(element);\n}", "get(_id) {\n return this._elements[_id];\n }", "get(_id) {\n return this._elements[_id];\n }", "function ID(id){\n return document.getElementById(id);\n}", "function domById(id)\n{\n return document.getElementById(id);\n}", "function E(id) { return document.getElementById(id); }", "function E(id) { return document.getElementById(id); }", "function elementId(id){\n const inputId = document.getElementById(id);\n return inputId;\n}", "function elem(elemName){var getElem=document.getElementById(elemName); return getElem;}", "function _ge(id) {\r\n return document.getElementById(id);\r\n}", "function $id(id) {\n\treturn document.getElementById(id);\n}", "function $id(id) {\n return document.getElementById(id);\n}", "function get(elementID) { \n\tvar d = document; \n\tvar r = d.getElementById(elementID); \n\treturn r; \n}", "function ID(id) {\n\t\treturn document.getElementById(id);\n\t}", "function ID(id) {\n\t\treturn document.getElementById(id);\n\t}", "function ID(id) {\n\t\treturn document.getElementById(id);\n\t}", "function xGetElementById(e)\n{\n if (typeof(e) == 'string') {\n if (document.getElementById) e = document.getElementById(e);\n else if (document.all) e = document.all[e];\n else e = null;\n }\n return e;\n}", "function ele(id,obj,debug) {\r\n var functionName = \"ele(id,obj)\";\r\n \r\n if(!debug){debug = false;}\r\n if(!obj)obj=window;\r\n \r\n var result = null;\r\n \r\n try{\r\n result = obj.document.getElementById(id);\r\n }catch(err){\r\n if(debug){\r\n alert(functionName + \":failure \\nCan't find id \" + id);\r\n result = false;\r\n }\r\n }\r\n \r\n return result;\r\n}", "function prendiElementoDaId(id_elemento) \r\n{\r\n\tvar elemento;\r\n\tif(document.getElementById)\r\n\t{\r\n\t\telemento = document.getElementById(id_elemento);\r\n\t}\r\n\telse\r\n\t{\r\n\t\telemento = document.all[id_elemento];\r\n\t}\r\n\treturn elemento;\r\n}", "function ge(id){\n\treturn document.getElementById(id);\n}", "function $id(id) {\n return document.getElementById(id);\n}", "function $id(id) {\n return document.getElementById(id);\n}", "function geto(id){\r\n\t//alert(id);\r\n\tvar obj = document.getElementById(id);\r\n\treturn obj;\r\n\t}", "function id(id){return d.getElementById(id)}" ]
[ "0.8033818", "0.77471775", "0.7696049", "0.7679374", "0.767635", "0.7629426", "0.75938314", "0.7581182", "0.75788766", "0.75246036", "0.74996924", "0.74773407", "0.7472821", "0.74595946", "0.7456551", "0.7442757", "0.74243855", "0.7423062", "0.7413727", "0.73944885", "0.73718613", "0.73640025", "0.732551", "0.7320073", "0.7308219", "0.7308219", "0.7307598", "0.730325", "0.730325", "0.7280664", "0.7265087", "0.7242205", "0.7236572", "0.7229417", "0.7225597", "0.72179806", "0.71937394", "0.7191027", "0.7190903", "0.7190432", "0.7186273", "0.7172419", "0.7171278", "0.7166057", "0.71605927", "0.71605927", "0.71605927", "0.7159449", "0.71470094", "0.71338105", "0.7132378", "0.7132378", "0.7132378", "0.712927", "0.71273434", "0.712363", "0.712363", "0.712363", "0.7123551", "0.7123551", "0.7123551", "0.7115185", "0.71124274", "0.7102203", "0.7095753", "0.70942986", "0.7091778", "0.70892435", "0.70892435", "0.70892435", "0.7082528", "0.7076737", "0.707002", "0.707002", "0.706935", "0.7064231", "0.7040151", "0.6999512", "0.6999512", "0.6975342", "0.69714624", "0.69704825", "0.69704825", "0.6939525", "0.6931265", "0.6929639", "0.6928435", "0.6886405", "0.6875368", "0.68725246", "0.68725246", "0.68725246", "0.687236", "0.6872034", "0.68708247", "0.68687505", "0.68658173", "0.68658173", "0.68619597", "0.6851029" ]
0.6995231
79
curGalReg is the element where scanRegion takes it's region from while moving around in the map, this element will take the currently selected galaxy/region TODO: get off the halfsecond timer for an update
function updateGalaxyRegion () { var curGalReg = document.getElementById('curGalReg'); if (curGalReg == null) { console.log('curGalReg is null!'); return; } var region = unsafeWindow.mapCurrentRegion; var galaxy = unsafeWindow.starsGalaxy; if (region == null) { if (document.URL.match(/([A-Za-z][0-9]{2}):([0-9]{2})/)) { var gr = document.URL.match(/([A-Za-z][0-9]{2}):([0-9]{2})/); galaxy = gr[1]; region = gr[2]; } else { return; } } curGalReg.innerHTML = galaxy; if (region != null) { curGalReg.innerHTML += ":" + region; } var getLoc = document.getElementById('getLocation'); var changeRegion = function(){ updateGalaxyRegion(); }; if (getLoc != null && getLoc.value.match(/[A-Za-z][0-9]{2}:[0-9]{2}$/)) { curGalReg.innerHTML = getLoc.value.match(/[A-Za-z][0-9]{2}:[0-9]{2}$/)[0]; registerEvent(getLoc, "change", changeRegion); } var t = window.setTimeout(updateGalaxyRegion, 500); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setGranRegion(){\n\tfor(var reg of fe_regiones)\n\t\treg.fCollapse();\n\tchoroInfo.update(choropleth_objects[currSource].r_max_val, \"región\");\n}", "function setReg(d) {\n d.region = region.get(d.id) || 0;\n return d.region;\n}", "setNextRegionCoord(number, maxIndex, coordsArray) {\n let index = this.state.currCoordIndex;\n if (index + number < 0) {\n this.setState({\n currCoordIndex: maxIndex\n });\n } else if (index + number > maxIndex) {\n this.setState({\n currCoordIndex: 0\n });\n } else {\n index += number;\n this.setState({\n currCoordIndex: index\n });\n }\n let nextIndex = this.state.currCoordIndex;\n let nextLocation = coordsArray[nextIndex];\n console.log(\"next index is:\", nextIndex);\n console.log(\"next location is:\", nextLocation);\n\n let newRegion = {\n latitude: nextLocation.latitude,\n longitude: nextLocation.longitude,\n latitudeDelta: nextLocation.latitudeDelta,\n longitudeDelta: nextLocation.longitudeDelta\n };\n\n this.map.animateToRegion(newRegion, 750);\n this.setState({ text: nextLocation.locationName });\n }", "function regionUpdate(){\n setPlot(regionSel.value);\n}", "function setUpCurrentVar() {\r\n g_current_var['section'] = g_search_info_level2['currentsection'];\r\n g_current_var['rangekmstart'] = g_all_result['mindis'];\r\n g_current_var['rangekmend'] = g_all_result['maxdis'];\r\n //For Flag Positioning\r\n var lastindex = g_all_result['usedlength'];\r\n g_current_var['flagfirstlat'] = g_all_result[0]['lat'];\r\n g_current_var['flagfirstlong'] = g_all_result[0]['long'];\r\n g_current_var['flaglastlat'] = g_all_result[lastindex]['lat'];\r\n g_current_var['flaglastlong'] = g_all_result[lastindex]['long'];\r\n\r\n }", "nextRegion() {\n const regions = this.regions;\n if (\n !regions ||\n !regions.length ||\n this.modalIsOpen ||\n this.popupIsOpen\n ) {\n return;\n }\n let newRegion;\n if (\n !this.activeRegion ||\n this.activeRegionIndex === regions.length - 1 ||\n this.resetNavigation\n ) {\n newRegion = regions[0];\n } else {\n newRegion = regions[this.activeRegionIndex + 1];\n }\n this.setActiveRegion(newRegion);\n this.setCurrentFocus();\n this.resetNavigation = false;\n }", "addRegion(newRegion, player) {\n\t\tnewRegion.area.setColor(this.color);\n\t\trenderScene(this.canvas, this.allRegions, this.img);\n\t\tnewRegion.area.reColor(this.color);\n\t\tnewRegion.owner = player;\n\t\tthis.regions.push(newRegion);\n\t}", "function setCurrentStation(map,currentStationTitle,baseColor,currentColor) {\n for (var i = 0; i < self.stationLocation().length; i++) {\n if (self.stationLocation()[i].title() == currentStationTitle) {\n self.stationLocation()[i].marker().setIcon(currentColor);\n var stationInfo = '<p><b>'+self.currentStation().title()+'</b></p>'+'<p>'+self.currentStation().address()+'</p>';\n self.stationLocation()[i].infowindow().setContent(stationInfo); \n getNextTrains('north',self.currentStation().northStop(),self.stationLocation()[i]); \n getNextTrains('south',self.currentStation().southStop(),self.stationLocation()[i]);\n } else {\n self.stationLocation()[i].marker().setIcon(baseColor);\n self.stationLocation()[i].infowindow().close(map,self.stationLocation()[i].marker());\n }\n self.stationLocation()[i].marker().setMap(map);\n }\n }", "function UpdateGraphicsZoomMap() {\n\tswitch(gridZoom) {\n\t\tcase 3:\n\t\t\tzoomPosition = [OPC.currentPos -11, OPC.currentPos -10, OPC.currentPos -9, OPC.currentPos -1, OPC.currentPos, OPC.currentPos +1, OPC.currentPos +9, OPC.currentPos +10, OPC.currentPos +11];\n\t\t\tfor(i = 0; i < zoomPosition.length; i ++) {\n\t\t\t\tdocument.getElementById(\"gz\" + i.toString()).style.backgroundImage = \"none\";\n\t\t\t\tdocument.getElementById(\"gz\" + i.toString()).style.backgroundColor = 'RGBA(255,255,255,1)';\n\t\t\t}\n\t\t\tfor(i = 0; i < gridArr.length; i ++) { // do for the whole map array\n\t\t\t\tif(zoomPosition.includes(i)) {\n\t\t\t\t\tif (gridArr[i].open > 0) { // only work on open areas of the map\n\t\t\t\t\t\texits = GetExits(i);\n\t\t\t\t\t\tswitch(exits) { // determine which graphic to display to reflect the available exits\n\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\timg = \"D\";\n\t\t\t\t\t\t\t\trotation = \"270\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 10:\n\t\t\t\t\t\t\t\timg = \"D\";\n\t\t\t\t\t\t\t\trotation = \"180\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 11:\n\t\t\t\t\t\t\t\timg = \"L\";\n\t\t\t\t\t\t\t\trotation = \"180\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 100:\n\t\t\t\t\t\t\t\timg = \"D\";\n\t\t\t\t\t\t\t\trotation = \"90\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 101:\n\t\t\t\t\t\t\t\timg = \"I\";\n\t\t\t\t\t\t\t\trotation = \"90\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 110:\n\t\t\t\t\t\t\t\timg = \"L\";\n\t\t\t\t\t\t\t\trotation = \"90\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 111:\n\t\t\t\t\t\t\t\timg = \"T\";\n\t\t\t\t\t\t\t\trotation = \"90\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1000:\n\t\t\t\t\t\t\t\timg = \"D\";\n\t\t\t\t\t\t\t\trotation = \"0\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1001:\n\t\t\t\t\t\t\t\timg = \"L\";\n\t\t\t\t\t\t\t\trotation = \"270\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1010:\n\t\t\t\t\t\t\t\timg = \"I\";\n\t\t\t\t\t\t\t\trotation = \"0\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1011:\n\t\t\t\t\t\t\t\timg = \"T\";\n\t\t\t\t\t\t\t\trotation = \"180\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1100:\n\t\t\t\t\t\t\t\timg = \"L\";\n\t\t\t\t\t\t\t\trotation = \"0\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1101:\n\t\t\t\t\t\t\t\timg = \"T\";\n\t\t\t\t\t\t\t\trotation = \"270\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1110:\n\t\t\t\t\t\t\t\timg = \"T\";\n\t\t\t\t\t\t\t\trotation = \"0\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 1111:\n\t\t\t\t\t\t\t\timg = \"X\";\n\t\t\t\t\t\t\t\trotation = \"\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(gridArr[i].room == \"T\" ||\n\t\t\t\t\t\tgridArr[i].room == \"R\") {\n\t\t\t\t\t\t\tgraphic = \"url(img/png/tunnel\" + img + rotation + \".png)\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tgraphic = \"url(img/png/room\" + img + rotation + \".png)\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdocument.getElementById(\"gz\" + zoomPosition.indexOf(i).toString()).style.backgroundImage = graphic;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 10:\n\t\t\tfor(i=0; i < 9; i ++) {\n\t\t\t\tdocument.getElementById(\"gz\" + i.toString()).style.backgroundImage = 'none';\n\t\t\t\tdocument.getElementById(\"gz\" + i.toString()).style.backgroundColor = 'rgba(255,255,255,0)';\n\t\t\t}\n\t\t\tbreak;\n\t}\n}", "function harvestGrain() {\n if(gameData.grain < gameData.grainCapacity) {\n gameData.grain += gameData.grainPerMin;\n showGameData();\n }\n}", "grav(satellite) {\n // This needs to be lighting fast\n return (GAMMA_GRAV_CONST * this.mass) *\n Math.pow(this.x - satellite.x, 2) + Math.pow(this.y - satellite.y, 2)\n }", "function btnNorth() {\n var temp = location[currentLoc].north;\n if (temp != -1) {\n currentLoc = temp;\n console.log(temp);\n startup();\n scoring();\n scoreCheck();\n }\n }", "_changeToMinuteSelection() {\n const that = this,\n svgCanvas = that._centralCircle.parentElement || that._centralCircle.parentNode;\n\n that._inInnerCircle = false;\n\n cancelAnimationFrame(that._animationFrameId);\n that.interval = that.minuteInterval;\n\n that.$hourContainer.removeClass('jqx-selected');\n that.$minuteContainer.addClass('jqx-selected');\n\n svgCanvas.removeChild(that._centralCircle);\n svgCanvas.removeChild(that._arrow);\n svgCanvas.removeChild(that._head);\n\n that._getMeasurements();\n that._numericProcessor.getAngleRangeCoefficient();\n that._draw.clear();\n\n svgCanvas.appendChild(that._centralCircle);\n svgCanvas.appendChild(that._arrow);\n svgCanvas.appendChild(that._head);\n\n that._renderMinutes();\n\n that._drawArrow(true, undefined, true);\n }", "function activate(gear){\r\n gear.fillStyle = active;\r\n }", "function regionspeeds() {\n \n if(currentbeat > (part1 + part2 +part3 +part4 + part5 + part6)){\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n } else if(currentbeat > (part1 + part2 +part3 +part4 + part5 +part6 - 4)){\n huegreen = true;\n }else if(currentbeat > (part1 + part2 +part3 +part4 + part5)){\n huered = false;\n huegreen = false;\n bpm = obpm * 1.25;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > (part1 + part2 +part3 +part4 + part5 -4)){\n huered = true;\n }else if(currentbeat > (part1 + part2 +part3 +part4 )){\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > (part1 + part2 +part3 +part4 - 4)){\n huegreen = true;\n }else if(currentbeat > (part1 + part2 +part3)){\n huered = false;\n huegreen = false;\n bpm = obpm * 1.25;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > (part1 + part2 +part3 - 4)){\n huered = true;\n }else if(currentbeat > (part1 + part2)){\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n //#b00035\n }else if(currentbeat > (part1 + part2 - 4)){\n huegreen = true;\n }else if(currentbeat > part1){\n huered = false;\n huegreen = false;\n bpm = obpm * 1.25;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }else if(currentbeat > part1 - 4){\n huered = true\n }else {\n huered = false;\n huegreen = false;\n bpm = obpm;\n gamecalulation();\n clearInterval(gameplay);\n gameplay = setInterval(function () {\n game();\n }, 1000 / fps);\n }\n}", "function addSirkel( lat, lng ){\n // Add a Circle overlay to the map.\n var radius = new google.maps.Circle({\n center: new google.maps.LatLng(lat, lng),\n radius: 1609 * 3,\n fillColor: \"#257bfa\",\n fillOpacity: 0.2,\n strokeColor: \"#257bfa\",\n strokeWeight: 0,\n zIndex: 0,\n });\n \n $.sirkel.radius = radius;\n radius.setMap( $.sirkel.map );\n \n }", "function locationSelected() {\n\ttempActive = false;\n\tlocationActive = true;\n\tradActive = false;\n\tco2Active = false;\n\tif (graphicActive) {\n\t\tdrawGraphic();\n\t} else if (tableActive) {\n\t\tdrawTable();\n\t}\n}", "function setCurrentMap(element) {\n\tcurrentMap = element;\n\tmapSize = {width:element.style.width.slice(0, -2), \n\t\t\theight:element.style.height.slice(0, -2)};\n\trefreshServicesLayer();\n}", "function Update()\n{\n\t\t// show the correct image\n\tmapScreen.renderer.material = mapList[DataTransfer.activeLevel-1];\n\t\n\t\t// show the correct name\n\t//mapName.text = LanguageHandler.mapNames[DataTransfer.activeLevel-1];\n\t\t// trigger localize refresh\n\t//NGUI_Handler.locUpdate = true;\n\t//Debug.Log (\"mapNext\");\n\t\t// if the current map is locked, show our lock symbol and switch for the buy button...\n\tif (!DataTransfer.trackUnlocks[(DataTransfer.activeLevel-1)])\n\t{\n\t\tbtn_select.localPosition = Vector3(0,200,0);\n\t\tbtn_buy.localPosition = Vector3(0,0,0);\n\t\ticon_lock.localPosition = Vector3(0,0,0);\n\t}\n\telse\n\t{\n\t\tbtn_select.localPosition = Vector3(0,0,0);\n\t\tbtn_buy.localPosition = Vector3(0,200,0);\n\t\ticon_lock.localPosition = Vector3(0,-2000,0);\n\t}\n}", "function imageInfoRegionsSelectorChange(event) {\n gImageRegionListViewer.setTextureID(gTextureIDList[imageInfoRegionsSelector.selectedIndex]);\n}", "function goImperial() {\n //Enable/disable buttons\n $(\"#imperial\")\n .addClass(\"active\")\n .prop(\"disabled\", true);\n $(\"#metric\")\n .removeClass(\"active\")\n .prop(\"disabled\", false);\n //Animate the changes\n $(\"#bottom-details\").addClass(\"animated zoomIn\");\n $(\"#top-details\").addClass(\"animated zoomIn\");\n //Update units\n $(\"#temp\").html(tempF);\n $(\"#degree-scale\").attr(\"class\", \"wi wi-fahrenheit degree\");\n $(\"#wind-speed\").html(windSpeedMiles + \" mph\");\n $(\"#visibility\").html(visMiles);\n //Remove animation class\n setTimeout(function() {\n $(\"#bottom-details\").removeClass(\"animated zoomIn\");\n $(\"#top-details\").removeClass(\"animated zoomIn\");\n }, 1000);\n}", "function watchCurrentPosition() {\n let options = {\n frequency: 30000\n };\n var positionTimer = navigator.geolocation.watchPosition(\n function(position) {\n\n\n\n locations.push({\n lat: position.coords.latitude,\n lng: position.coords.longitude\n });\n\n $(\"#bucket\").html(locations);\n console.log(\"ticking and bucket is \", locations);\n\n var routePath = new google.maps.Polyline({\n path: locations,\n geodesic: true,\n strokeColor: '#000000',\n strokeOpacity: 1.0,\n strokeWeight: 2\n });\n\n routePath.setMap(map);\n\n\n setMarkerPosition(\n currentPositionMarker,\n position\n );\n }, null, options);\n }", "function paintCurrentMove() {\n\t\t\tvar m;\n\n\t\t\tstoneContext.fillStyle = \"red\";\n\t\t\tstoneContext.beginPath();\n\t\t\tm = goMap.getCurrentMove();\n\t\t\tstoneContext.arc(SPACE * (m.x + 1), SPACE * (m.y + 1), SPACE_DIVIDE_FOUR, 0, PI_MUL_TWO, true);\n\t\t\tstoneContext.fill();\n\t\t\tstoneContext.closePath();\n\t\t}", "function fleetComplete(fleetRegistration,newLoc){\r\n let planes_1 = planesDummy();\r\n for (let i = 0; i < planes_1.planes.length; i++){\r\n if (planes_1.planes[i].registration == fleetRegistration){\r\n planes_1.planes[i].status = \"available\";\r\n planes_1.planes[i].location = newLoc;\r\n break;\r\n }\r\n }\r\n updateLocalStorage(LOCAL_PLANE_DATA_KEY,planes_1);\r\n}", "function goMetric() {\n //Enable/disable buttons\n $(\"#metric\")\n .addClass(\"active\")\n .prop(\"disabled\", true);\n $(\"#imperial\")\n .removeClass(\"active\")\n .prop(\"disabled\", false);\n //Animate changes\n $(\"#top-details\").addClass(\"animated zoomIn\");\n $(\"#bottom-details\").addClass(\"animated zoomIn\");\n //Update units\n $(\"#temp\").html(tempC);\n $(\"#degree-scale\").attr(\"class\", \"wi wi-celsius degree\");\n $(\"#wind-speed\").html(windSpeedMeters + \" m/s\");\n $(\"#visibility\").html(visKilometers);\n //Remove animation class\n setTimeout(function() {\n $(\"#bottom-details\").removeClass(\"animated zoomIn\");\n $(\"#top-details\").removeClass(\"animated zoomIn\");\n }, 1000);\n}", "function refit_reg( a_reg )\n{\n for (let ix = 0; ix < g_itemInfo.length; ix++)\n {\n let propID = g_itemInfo[ix].name;\n // GetSafeRegProperty will throw an error if any of\n // 'singleTone', 'splitLowerTone', 'dualTone2'\n // use a Tone that isn't valid on this piano\n try {\n let value = GetSafeRegProperty( a_reg, propID );\n if (g_itemInfo[ix].hasItem(g_pianoInfo.typeName)) {\n // Regs on this piano have this property\n if (value == null) {\n // No value in local storage: use the default value\n SetSafeRegProperty( a_reg, propID, g_itemInfo[ix].default_value );\n console.log('Adding value for \"' + propID + '\": \"' +\n g_itemInfo[ix].default_value + '\"');\n }\n }\n else {\n // Piano does not have this property\n if (value != null) {\n // Delete the incompatible value\n delete a_reg[propID];\n console.log('Deleting value for \"' + propID + '\"');\n }\n }\n }\n catch(e) {\n alert( '\"' + propID + '\" uses a Tone that this type of piano does not have.\\n'\n + e.toString() );\n }\n }\n \n return a_reg;\n}", "function radSelected() {\n\ttempActive = false;\n\tlocationActive = false;\n\tradActive = true;\n\tco2Active = false;\n\tif (graphicActive) {\n\t\tdrawGraphic();\n\t} else if (tableActive) {\n\t\tdrawTable();\n\t}\n}", "function setClimateSelected(){\n el.climate_selected = $('.climate-variables-map :selected:first').val();\n console.log(\"setClimateSelected - mapui is:\", el.climate_selected);\n $(\"select\").material_select();\n }", "function updateWebcamLocationInformation() {\n\tlistOfWebcams = new Array();\n\tif (!(selectedLocation.lat() == 0 || selectedLocation.lng() == 0)) {\n\t\t$(\"#webcam_stream\").html(\"<img class='spinner' src='images/spinner.gif' alt='...' title='Loading webcam information'/>\");\n\t\tgetWebcams(selectedLocation, $(\"#webcam_range\").val());\n\t}\n}", "function currentExperiment(scope){\n\t/** Setting the slider value to the label variable */\n\tscope.current_num = current;\n\t/** Equation is used to rotate the needle */\n\tgetChild(\"needle\").rotation = current * 10;\n\t/** Equation is used to rotate the white arc based on the current */\n\trotation = current*30;\n\tgetChild(\"white_rotate\").rotation = rotation;\n\tcalculation(scope);\n\thall_effect_stage.update();\n}", "UpdateRegion() {\n\n }", "function arealv() {\r\n\tconfigAddButton();\r\n\t/******** Set Default Vaue ***********/\r\n\t//if(getC(\"minStar\r\n\r\n var picNum = [ \r\n \"http://upic.me/i/vx/80j01.png\",\r\n \"http://upic.me/i/tv/deg02.png\",\r\n \"http://upic.me/i/b3/8uz03.png\",\r\n \"http://upic.me/i/q6/cch04.png\",\r\n \"http://upic.me/i/tm/19605.png\",\r\n \"http://upic.me/i/tm/hlu06.png\",\r\n \"http://upic.me/i/vi/gsq07.png\",\r\n \"http://upic.me/i/xe/re608.png\",\r\n \"http://upic.me/i/qc/wlq09.png\",\r\n ];\r\n var areas = document.getElementsByTagName('area');\r\n var maxArea = areas.length;\r\n var areaMinStar = getC(\"minStar\");if(!areaMinStar){setC(\"minStar\",3);areaMinStar=3;};\r\n var areaHoldStat = getC(\"areaHoldStat\");if(!areaMinStar){setC(\"areaHoldStat\",3);areaMinStar=3;}; //1Free 2Hold 3All\r\n var areaTaken = 0; // 0=all 1=free 2=taken\r\n var arealv;\r\n var areatmp ='';\r\n\tvar star2num = '';\r\n for(var i =0; i<maxArea; i++){\r\n\t\t\r\n\t\tif(areas[i].title.split(' ').length!=2 &&areaHoldStat==1)continue;\r\n\t\tif(areas[i].title.split(' ').length==2 &&areaHoldStat==2)continue;\r\n\t\t\r\n //if(areas[i].title.split(' ').length==2)\t\t//free area\r\n {\r\n\t\t\tstar2num=areas[i].getAttribute('onmouseover').split(\"/img/common/star_warpower_b.gif\");\r\n arealv = star2num.length -1;\r\n\t\t//\tareas[i].setAttribute('onmouseover',star2num[0].split(\"img src\")+\"img src=\\'/\"+picNum[arealv-1]+star2num[star2num.length-1]);\r\n\t\t\tif(arealv>=areaMinStar)\r\n if(i<9)areatmp += '<img src=\"'+picNum[arealv-1]+'\" class=\"mapAll0'+(i+1)+'\" alt=\"\">';else areatmp += '<img src=\"'+picNum[arealv-1]+'\" class=\"mapAll'+(i+1)+'\" alt=\"\">';\r\n }\r\n }\r\n document.getElementById(\"mapsAll\").innerHTML = document.getElementById(\"mapsAll\").innerHTML + areatmp;\r\n}", "function earthSurfaceChange() {\n var new_surface = this.value;\n if (new_surface === 'terrain') {\n SceneJS.withNode(\"earthTextureSelector\").set(\"selection\", [1]);\n color_map.style.display='none';\n } else {\n SceneJS.withNode(\"earthTextureSelector\").set(\"selection\", [0]);\n setTemperatureTexture(time_of_year.value);\n color_map.style.display='inline'; \n }\n}", "calcRegionSizeGlobal() {\n // this should only get done once\n // scanCol is the column that has the data we care about putting in the color fill\n // this returns a summary object that knows things about the size of the brain json dimensions and also the min and max of hte scan data\n //!! should only do this part once\n let globals = [1000, 1000, -1000, -1000]\n for (let sliceName in this.paneOb.regionBoundaryData) {\n let slice = this.paneOb.regionBoundaryData[sliceName]\n // skip if there's a single point feature\n for (let feature of slice.features) {\n // likely nota loop because coordinates is a single element array\n for (let line of feature.geometry.coordinates) {\n for (let pt of line) {\n if (pt[0] < globals[0]) {\n globals[0] = pt[0]\n }\n if (pt[1] < globals[1]) {\n globals[1] = pt[1]\n }\n if (pt[0] > globals[2]) {\n globals[2] = pt[0]\n }\n if (pt[1] > globals[3]) {\n globals[3] = pt[1]\n }\n }\n }\n }\n\n\n\n }\n /** This is a list of smallest and largest values found in the x,y dimensions within the geojson data provided. This is used to scale the region coordinates to the space of the canvas */\n this.regionSizes = globals\n /** This is a ratio of the heightvs the width of the brain data. Helpful for determining what the maximum value of our y interpolator should be. */\n this.canvasRatio = globals[3] / globals[2]\n }", "function updateRegionZoom() {\n var innerSelect = gees.dom.get('inner_zoom');\n var worldZoom = innerSelect.options[innerSelect.selectedIndex].value;\n var outerSelect = gees.dom.get('outer_zoom');\n var oldRegionZoom = outerSelect.options[outerSelect.selectedIndex].value;\n // If current region zoom is larger than selected world zoom, leave it\n // alone and just update the label. If world zoom is larger, reset\n // the region zoom, forcing user to select a new value.\n if (parseInt(oldRegionZoom) > parseInt(worldZoom)) {\n populateZoomDropdowns(regionZoom, 'outer_zoom', oldRegionZoom);\n } else {\n populateZoomDropdowns(regionZoom, 'outer_zoom', '--');\n }\n}", "_onMoveEnd() {\n this._map.locate({\n 'watch': true,\n 'setView': false,\n 'enableHighAccuracy': true,\n });\n }", "function addMarkerRegionToMI() {\n\t\t\tconsole.log(\"addMarkerRegionToMI()\");\n\n\t\t\tif (\n vm.markerRegionSearch == null\n || vm.markerRegionSearch.refsKey == null\n || vm.markerRegionSearch.refsKey == \"\"\n ) {\n alert(\"Add To Mutation Involves Required Fields:\\n\\nAllele\\nChr\\nStart Coordinate\\nEnd Coordinate\\nRelationship Type\\nJ#\");\n\t\t\t\tdocument.getElementById(\"startCoordinate\").focus();\n\t\t\t\treturn;\n\t\t\t}\n\n if (vm.markerRegion.length == 0) {\n alert(\"Add To Mutation Involves: 0 Markers found\");\n\t\t\t\tdocument.getElementById(\"startCoordinate\").focus();\n\t\t\t\treturn;\n }\n\n var newMI = vm.apiDomain.mutationInvolves.length;\n\n for(var i=0;i<vm.apiDomain.mutationInvolves.length; i++) { \n if (vm.apiDomain.mutationInvolves[i].processStatus == \"c\") {\n newMI = i;\n break;\n }\n }\n\n for(var i=0;i<vm.markerRegion.length; i++) { \n\t\t\t vm.apiDomain.mutationInvolves[newMI] = {\n\t\t\t\t \"processStatus\": \"c\",\n\t\t\t\t \"relationshipKey\": \"\",\n\t\t\t \t \"alleleKey\": vm.apiDomain.alleleKey,\n \"alleleSymbol\": \"\",\n\t\t\t \t \"markerKey\": vm.markerRegion[i].markerKey,\n \"markerSymbol\": vm.markerRegion[i].symbol,\n \"markerAccID\": vm.markerRegion[i].accID,\n \"organismKey\": \"1\",\n \"organism\": \"mouse, laboratory\",\n\t\t\t \t \"categoryKey\": \"1003\",\n\t\t\t \t \"categoryTerm\": \"\",\n\t\t\t \t \"relationshipTermKey\": vm.markerRegionSearch.relationshipTermKey,\n\t\t\t \t \"relationshipTerm\": \"\",\n\t\t\t \t \"qualifierKey\": \"11391898\",\n\t\t\t \t \"qualifierTerm\": \"\",\n\t\t\t \t \"evidenceKey\": \"11391900\",\n\t\t\t \t \"evidenceTerm\": \"IGC\",\n\t\t\t\t \"refsKey\": vm.markerRegionSearch.refsKey,\n\t\t\t \t \"jnumid\": vm.markerRegionSearch.jnumid,\n\t\t\t\t \"short_citation\": vm.markerRegionSearch.short_citation,\n\t\t\t\t \"createdBy\": \"\",\n\t\t\t\t \"creation_date\": \"\",\n\t\t\t\t \"modifiedBy\": \"\",\n\t\t\t\t \"modification_date\": \"\"\n\t\t\t }\n\n addMINoteRow(i);\n newMI = newMI + 1;\n }\n }", "updateMapForPollutant(pollutant) {\n \n this.activePollutant = pollutant;\n\n this.colorMap();\n\n }", "setCurrentRegion(region) {\n this.setState({\n currentRegion: region,\n filteredWines: _.filter(this.props.wines, (wine) => (\n wine.appelation === region\n )),\n currentWine: null\n });\n }", "function earthSurfaceChange() {\n var new_surface = this.value;\n if (new_surface === 'terrain') {\n SceneJS.withNode(\"earthTextureSelector3\").set(\"selection\", [1]);\n SceneJS.withNode(\"earthTextureSelector4\").set(\"selection\", [1]);\n color_map.style.display='none';\n } else {\n SceneJS.withNode(\"earthTextureSelector3\").set(\"selection\", [0]);\n SceneJS.withNode(\"earthTextureSelector4\").set(\"selection\", [0]);\n setTemperatureTexture(month);\n color_map.style.display='inline'; \n }\n}", "function changeStation() {\n if (current_center > base_limit) {\n current_center = 0;\n }\n if (current_center < 0) {\n current_center = base_limit;\n }\n highlight.translation = vec3.fromValues(station_centers[current_center][0], station_centers[current_center][1],\n station_centers[current_center][2]);\n\n document.getElementById(\"selected\").innerHTML = \"Selected Station: \" + station_centers[current_center][3];\n\n}", "function NewSelection(newmainphotonbr, movecarousel){\n if (newmainphotonbr != undefined) {\n //set slider to all days\n var SliderValue = 0;\n document.getElementById('slider-start').value = SliderValue;\n //filterBy(SliderValue);\n\n //copie varibles from previously selected phototo new var\n previouslyselectedphoto = selectedphoto\n\n //load varibales from new selected photo to\n selectedphoto = {nbr:newmainphotonbr, imgurls:\"\", imgurlb:\"\"};\n selectedphoto.htmlid = \"img\" + selectedphoto.nbr;\n selectedphoto.imgid = \"imgID\" + selectedphoto.nbr;\n selectedphoto.DOM = document.getElementById(selectedphoto.htmlid);\n selectedphoto.imgDOM = document.getElementById(selectedphoto.imgid);\n selectedphoto.imgurls = photoDB[selectedphoto.nbr].s_url;\n selectedphoto.Imgurlb = photoDB[selectedphoto.nbr].original_url;\n selectedphoto.latitude = photoDB[selectedphoto.nbr].GPSLatitude;\n selectedphoto.longitude = photoDB[selectedphoto.nbr].GPSLongitude;\n\n //set variables from new selection to UI \n document.getElementById('infobox_img').setAttribute('src', selectedphoto.imgurls);\n document.getElementById('Photo-Big').setAttribute('src', selectedphoto.Imgurlb);\n document.getElementById('map-overlay-infobox').style.visibility = 'visible';\n\n writephotovars(); //call function to write in consol the variable from new selection\n\n //remove previously applyed CSS fo select photo\n if (previouslyselectedphoto != undefined) {\n previouslyselectedphoto.imgDOM.style.visibility = 'visible';\n if (document.getElementById('imginfo') != undefined) {\n document.getElementById('imginfo').remove();\n }\n var oldactivedivclassimgcontainer = [].slice.apply(document.getElementsByClassName(\"active\"));\n for (var i = 0; i < oldactivedivclassimgcontainer.length; i++) {\n oldactivedivclassimgcontainer[i].className = oldactivedivclassimgcontainer[i].className.replace(/ *\\b active\\b/g, \"\");\n } \n }\n\n //make selected photo pop out of the carousel ussing CSS\n selectedphoto.DOM.className += \" active\";\n selectedphoto.imgDOM.style.visibility = 'hidden';\n\n //Scroll to correct posittion (new version, works well in Chrome less wel in Safary)\n selectedphoto.DOM.scrollIntoView({behavior: \"smooth\"});\n\n //Scroll to correct posittion (Old version)\n // if (movecarousel == 1) {\n // console.log(movecarousel); \n // document.getElementById('main-carousel').scrollLeft = selectedphoto.DOM.offsetLeft - 400;\n // }\n\n //load img info\n var datephotos = [\"\", \"20180406\", \"20180407\", \"20180408\", \"20180409\", \"20180410\", \"20180411\", \"20180412\", \"20180413\", \"20180414\", \"20180415\", \"\" ];\n var currentday = [\"Hele reis\", \"Aankomst Dag\", \"Zaterdag\", \"Zondag\", \"Maandag\", \"Dinsdag\", \"Woensdag\", \"Donderdag\", \"Vrijdag\", \"Zaterdag\", \"Laaste dag\", \"Hele reis\"];\n var newdiv = document.createElement('div');\n var position = i;\n var date = photoDB[newmainphotonbr].Date;\n var time = photoDB[newmainphotonbr].Time;\n for (var i = 0; i < datephotos.length; i++) {\n if (date == datephotos[i]) {\n date = currentday[i]\n }\n }\n\n newdiv.className = 'imginfo';\n newdiv.innerHTML = '<p>' + date + '</p><p>' + time + '</p>';\n newdiv.setAttribute(\"id\", \"imginfo\");\n selectedphoto.DOM.appendChild(newdiv);\n\n\n NewSelectedMapLocation(selectedphoto.longitude, selectedphoto.latitude);\n\n //this code was temporarly used to expiriment with other valuse than photos in carousel. This might be usefull in the future\n // var newdiv = document.createElement('div');\n // var position = i - newmainphotonbr;\n // newdiv.className = 'carousel-containter img' + position + ' carousel-info';\n // newdiv.Name = i;\n // newdiv.innerHTML = '<div class=\"carousel-info-text\"><p>Woensdag</p></div>';\n // newdiv.idName = 'img' + position;\n // document.getElementById('main-carousel').appendChild(newdiv);\n \n } else {\n //remove previously applyed CSS fo select photo\n if (selectedphoto != undefined) {\n selectedphoto.imgDOM.style.visibility = 'visible';\n if (document.getElementById('imginfo') != undefined) {\n document.getElementById('imginfo').remove();\n }\n var oldactivedivclassimgcontainer = [].slice.apply(document.getElementsByClassName(\"active\"));\n for (var i = 0; i < oldactivedivclassimgcontainer.length; i++) {\n oldactivedivclassimgcontainer[i].className = oldactivedivclassimgcontainer[i].className.replace(/ *\\b active\\b/g, \"\");\n } \n }\n } \n}", "onRegionSelected(region: Region) {\n this.viewing_region = region;\n }", "function nextTurn(allowedRegion) {\n\tif(!gameBoard.bigGrid[allowedRegion]) {\n\t\t$('.cell').css('background-color', 'rgb(128, 128, 128)');\n\t\t$(`.${allowedRegion}`).css('background-color', 'rgb(255, 255, 255)');\n\t} else {\n\t\t$(`.cell`).css('background-color', 'rgb(255, 255, 255)');\n\t}\n}", "set MainColorG(value) {\n this._g = value;\n }", "function loadPat_1() {\n pat = localStorage.getObj(0);\n guiControls.timeSig = pat.length;\n gridRedifine();\n\n for (var i = 0; i < cols; i++) {\n for (var j = 0; j < rows; j++) {\n grid[i][j].highlighted = pat[i][j];\n }\n }\n\n}", "function wpsc_region_change() {\n\twpsc_copy_meta_value_to_similiar( jQuery( this ) );\n}", "makeRegDataMap() {\n /** This is the region name to value map that is referenced when fill colors are being selected for a region during draw(). The region names are the keys and the numeric data of the fill column becomes the values */\n this.regNameToValueMap = {}\n // drawregions without fill if nothing selected yet\n // check if there's a regionname column in the csv data, use that instead, this is typically specific to the data from the hcp atlas \n let regionKey\n if (this.paneOb.csvData[\"regionname\"]) {\n regionKey = \"regionname\"\n } else {\n regionKey = \"region\"\n }\n if (this.fillData == undefined) {\n this.paneOb.csvData[regionKey].map((e, i) => {\n this.regNameToValueMap[e.replace(/\\s/, \"\")] = NaN\n })\n } else {\n this.paneOb.csvData[regionKey].map((e, i) => {\n let name = e.replace(/\\s/, \"\")\n // help determine if there's multiple rows with this region's data\n if (this.regNameToValueMap[name]) {\n // reset the region rois for the multiples\n if (this.paneOb.rois[name]) {\n if (/[\\s\\S]Multiple/.exec(this.paneOb.rois[name])) {\n delete this.paneOb.rois[name]\n }\n }\n // prev value mult by the prev count + new div count +1 == rolling ave\n let prev = this.regNameToValueMap[name]\n if (!isNaN(prev.value) && !isNaN(this.fillData[i])) {\n this.regNameToValueMap[name] = { value: (prev.value * prev.count + this.fillData[i]) / (prev.count + 1), count: prev.count + 1 }\n // make a note that there is a row with multiple entries in the current slice\n this.paneOb.rois[name] = `\n <h3>Selected Region\n <p class=\"tooltip-child\" id=\"regionname\">\n ${ name}\n </p>\n <p class=\"tooltip-child\">\n <p>Multiple CSV row entries for region</p>\n <p>Utilize Filters to view separately</p>\n <p>average value: ${this.regNameToValueMap[name].value.toFixed(3)}\n </h3>\n `\n }\n } else {\n if (!isNaN(this.fillData[i])) {\n this.regNameToValueMap[name] = { value: this.fillData[i], count: 1 }\n }\n }\n })\n }\n /**This attribute enables simple tools to access the filtered data being used for coloring the region so that it may be plotted\n * @alias dataForPlot\n * @memberof Pane\n * @instance\n */\n this.paneOb.dataForPlot = Object.entries(this.regNameToValueMap).reduce((prev, [k, v]) => {\n prev[k] = v.value\n return prev\n }, {})\n }", "setCurrentMap(currentMap) {\n\t\tthis.currentMap = currentMap;\n\n\t\tif (this.currentMap == this.houseMap) {\n\t\t\tthis.currentLayer = this.houseLayer;\n\t\t}\n\t\tif (this.currentMap == this.townMap) {\n\t\t\tthis.currentLayer = this.townLayer;\n\t\t}\n\t\tif (this.currentMap == this.forestMap) {\n\t\t\tthis.currentLayer = this.forestLayer;\n\t\t}\n\t\tif (this.currentMap == this.roomMap) {\n\t\t\tthis.currentLayer = this.roomLayer;\n\t\t}\n\t\tif (this.currentMap == this.havenMap) {\n\t\t\tthis.currentLayer = this.havenLayer;\n\t\t}\n\t}", "update_current(){\n while(this.current < this.means.length){\n if((this.means[this.current].key >= this.parent.year0 - this.parent.window) && (this.means[this.current].key <= this.parent.year0)){ \n //if before end of window\n //if after start of window\n this.buffer.push(this.means[this.current])\n this.current = this.current + 1 //add point to buffer\n }else{\n break\n }\n }\n }", "updateActiveRegion() {\n if (!this.activeRegion) {\n return;\n }\n this.activeRegion.classList.add(A11yClassNames.ACTIVE);\n\n // ensure active region element is focusable\n if (!this.activeRegion.getAttribute('tabindex')) {\n this.activeRegion.setAttribute('tabindex', -1);\n }\n }", "function calculateGear() {\n\tlet transmission = getElementByID(\"modelsGears\").value,\n\t\tspur = getElementByID(\"spur\").value,\n\t\tpinion = getElementByID(\"pinion\").value,\n\t\ttire = getElementByID(\"tire\").value;\n\tsetTextByID(\"final\",\"---\");\n\tsetTextByID(\"rollout\",\"---\");\n\tif (validateNumber([spur, pinion])) {\n\t\tlet finalGear = (spur / pinion) * transmission;\n\t\tsetTextByID(\"final\",round(finalGear, 3));\n\t\tif (validateNumber([tire])) setTextByID(\"rollout\",round((tire * 3.1415) / finalGear, 3));\n\t}\n}", "function applyGreenscreenWithGreenAdvantage(){\n for(var pixel of fgImage.values()){\n // if the current pixel is green-like\n if (calcGreenAdvantege(pixel) > sliderValue){\n // get the x,y cordinates of the current pixel\n var fgx = pixel.getX();\n var fgy = pixel.getY();\n // get the bgimage pixel at the same cordinates\n var bgpix = bgImage.getPixel(fgx, fgy);\n // set all the values of the foreground pixel to the corresponding values of the corresponding background pixel\n pixel.setAllFrom(bgpix);\n }\n }\n}", "currentLocationSelected() {\n if (isPlatformBrowser(this.platformId)) {\n this.gettingCurrentLocationFlag = true;\n this.dropdownOpen = false;\n this._googlePlacesService.getGeoCurrentLocation().then((result) => {\n if (!result) {\n this.gettingCurrentLocationFlag = false;\n }\n else {\n this.getCurrentLocationInfo(result);\n }\n });\n }\n }", "function SelectionRegion() {}", "function SelectionRegion() {}", "function updateVal()\r\n{\r\n\t\r\n\t//temp,humid,press,wind values change according to the current val of slider/radial\r\n\tif(currentTemperature <= 16){ tempVal = 1; }\r\n\telse if(currentTemperature > 16 && currentTemperature <= 32) { tempVal = 2; }\r\n\telse { tempVal = 3; }\r\n\ttempArr.push(tempVal);\r\n\t\r\n\t\r\n\tif(currentPressure == 0){ pressureVal = 1; }\r\n\telse if(currentPressure == 1) { pressureVal = 3; }\r\n\tpressureArr.push(pressureVal);\r\n}", "function settingImage()\r\n\t{\r\n\t\t\r\n\t\t\t$('.control-section').html(g_search_info_level2.currentsection);\r\n\t\t\t$('.code-section').html(g_search_info_level2.currentcode);\r\n\t\t\t$('.kmstart').html(g_search_info.kmstart);\r\n\t\t\t$('.kmend').html(g_search_info.kmend);\r\n\t\t\t$('#video-detail .selectedkm').html('');\r\n\t\t\t$('.latitute').html('');\r\n\t\t\t$('.longtitute').html('');\r\n\t\t\t$('#video-player').html('');\r\n\r\n\t\t\t//getImageSet();\r\n\t}", "function updateCurrentLocation(roomLat,roomLng) {\n if (!userHasGPSCoordinates ){\n userHasGPSCoordinates = true;\n currentPosition = new google.maps.LatLng(roomLat, roomLng);\n }\n}", "_updateOverviewSelection() {\n if (this.overview) {\n var ovChart = this.overview.getBackgroundChart();\n ovChart.getOptions()['selection'] = DvtChartDataUtils.getCurrentSelection(this);\n ovChart.render(); // rerender because unselected markers were not rendered\n }\n }", "_changeToHourSelection() {\n const that = this,\n svgCanvas = that._centralCircle.parentElement || that._centralCircle.parentNode;\n\n cancelAnimationFrame(that._animationFrameId);\n that.interval = 1;\n\n that.$hourContainer.addClass('jqx-selected');\n that.$minuteContainer.removeClass('jqx-selected');\n\n svgCanvas.removeChild(that._centralCircle);\n svgCanvas.removeChild(that._arrow);\n svgCanvas.removeChild(that._head);\n\n that._getMeasurements();\n that._numericProcessor.getAngleRangeCoefficient();\n that._draw.clear();\n\n svgCanvas.appendChild(that._centralCircle);\n svgCanvas.appendChild(that._arrow);\n svgCanvas.appendChild(that._head);\n\n that._renderHours();\n\n if (that.format === '24-hour' && (that.value.getHours() === 0 || that.value.getHours() > 12)) {\n that._inInnerCircle = true;\n }\n\n that._drawArrow(true, undefined, true);\n that._inInnerCircle = false;\n }", "function fireIntervalFinal(param) {\n //console.log('[fireIntervalFinal] hit! param=' + param);\n var n = $('#' + param.id);\n var t = \"rotate(0 \" + (param.x + param.width/2) + \" \" + (param.y + param.height/2) + \")\";\n //console.log('[fireIntervalFinal] transform=' + t);\n n.attr(\"transform\", t);\n if (param.id == 'ninot_balena') {\n $(document).trigger('app/setMovement', APP.balena);\n } else if (param.id == 'ninot_girafa') {\n $(document).trigger('app/setMovement', APP.girafa);\n } else if (param.id == 'ninot_ocell') {\n $(document).trigger('app/setMovement', APP.ocell);\n } else if (param.id == 'ninot_pitet') {\n $(document).trigger('app/setMovement', APP.pitet);\n } else if (param.id == 'ninot_gossalsitxa') {\n $(document).trigger('app/setMovement', APP.gos);\n }\n}", "function startCar1IntersectionEast () {\n\t// carRunning();\n\tintervalId = setInterval(car1MoveIntersectionEast, intersectionSpeed)\n}", "function get_selected_region(){\n r = $('#region').selectpicker('val');\n if (r == \"\") return \"UMG Global\";\n return r;\n}", "function zoomToCurrent() {\n var loc = managerData[currentManager].locations[currentLocation];\n map.panTo(loc.point);\n map.setZoom(8);\n infowindow.open(map, loc.marker);\n }", "function gaugeUpdate(gauge, opts){\n\t$('.val-min .metric-small', $('#'+gauge)).html(opts.minVal);\n\t$('.val-max .metric-small', $('#'+gauge)).html(opts.maxVal);\n\tcf_rGs[gauge].maxValue = opts.maxVal;\n\tcf_rGs[gauge].minValue = opts.minVal;\n\tcf_rGs[gauge].set(opts.newVal);\n}", "setSelectedLocationMap (location) {\n this.currentSelection = location.uri\n this.updateCurrentLayersStyle()\n }", "function tempSelected() {\n\ttempActive = true;\n\tlocationActive = false;\n\tradActive = false;\n\tco2Active = false;\n\tif (graphicActive) {\n\t\tdrawGraphic();\n\t} else if (tableActive) {\n\t\tdrawTable();\n\t}\n}", "function buf_switch(buf_button) {\n console.log(buf_button)\n if (buf_button == '1km') {\n init_extent = 1000;\n buf = hopeful_circle (co, 1000, 360);\n map.getSource('dr_buffer').setData(buf);\n tempSelection = turf.within(mapdata,buf);\n map.getSource('tempSelection').setData(tempSelection);\n document.getElementById('bdb05').style.opacity = '0.6';\n document.getElementById('bdb1').style.opacity = '1';\n document.getElementById('bdb15').style.opacity = '0.6';\n document.getElementById('bdb2').style.opacity = '0.6';\n }\n else if (buf_button == '2km') {\n init_extent = 2000;\n buf = hopeful_circle (co, 2000, 360);\n map.getSource('dr_buffer').setData(buf);\n tempSelection = turf.within(mapdata,buf);\n map.getSource('tempSelection').setData(tempSelection);\n document.getElementById('bdb05').style.opacity = '0.6';\n document.getElementById('bdb1').style.opacity = '0.6';\n document.getElementById('bdb15').style.opacity = '0.6';\n document.getElementById('bdb2').style.opacity = '1';\n } else if (buf_button == '1.5km') {\n init_extent = 1500;\n buf = hopeful_circle (co, 1500, 360);\n map.getSource('dr_buffer').setData(buf);\n tempSelection = turf.within(mapdata,buf);\n map.getSource('tempSelection').setData(tempSelection);\n document.getElementById('bdb05').style.opacity = '0.6';\n document.getElementById('bdb1').style.opacity = '0.6';\n document.getElementById('bdb15').style.opacity = '1';\n document.getElementById('bdb2').style.opacity = '0.6';\n } else {\n init_extent = 500;\n buf = hopeful_circle (co, 500, 360);\n map.getSource('dr_buffer').setData(buf);\n tempSelection = turf.within(mapdata,buf);\n map.getSource('tempSelection').setData(tempSelection);\n document.getElementById('bdb05').style.opacity = '1';\n document.getElementById('bdb1').style.opacity = '0.6';\n document.getElementById('bdb15').style.opacity = '0.6';\n document.getElementById('bdb2').style.opacity = '0.6';\n }\n}", "function selectGem(gem) {\n\n if (allowInput)\n {\n selectedGem = gem;\n selectedGemStartPos.x = gem.posX;\n selectedGemStartPos.y = gem.posY;\n }\n\n}", "function moveZoomControl() {\n\t\t\t\t$('#zoom ul li').removeClass('selected');\n\t\t\t\tvar actual_zoom = map.getZoom();\n\t\t\t\tif (actual_zoom<3) {\n\t\t\t\t\t$('#zoom ul li:eq(13)').addClass('selected');\n\t\t\t\t} else if (actual_zoom>14) {\n\t\t\t\t\t$('#zoom ul li:eq(0)').addClass('selected');\n\t\t\t\t} else {\n\t\t\t\t\t$('#zoom ul li:eq('+(15-actual_zoom)+')').addClass('selected');\n\t\t\t\t}\n\t\t\t}", "function ControllerMagMode(e) {\n if (this.enabled == true) {\n var img = this.parentNode.canvas.image;\n img.style.cursor = 'crosshair';\n this.parentNode.canvas.mode = 'mag';\n\n this.parentNode.buttonPan.className = 'controllerPan';\n this.className = 'controllerMagSelected';\n this.parentNode.msg.innerHTML = magnifyreg_msg;\n\n clearImageMap();\n }\n}", "function letThereBeLight(currElement,Calvin){\n\tvar tourElement = document.getElementById(elementIdArray[currElement]);\n\t// console.log(\"Moving to with light: \"+tourElement.id);\n\tremoveDarkness();\n\tdarknessFalls(tourElement);\n\teasingScrollAction(tourElement,2000);\n\t//Calvin.eraseTourGuide();\n}", "function selectRoom(row) {\n //var opts = new DwgOpts(); \n var selectedRecord = row.row.getRecord();\n var assetRow = row;\n var restriction = new Ab.view.Restriction();\n var regcomp = selectedRecord.getValue('regcompliance.regcomp_id'); \n \n // make the room selected in the floor plan\n if(selectedRow.length !=0){\n View.getControl('', 'abEgressPlans_DrawingPanel').unselectAssets(selectedRow);\n }\n selectedRow=[];\n if(regcomp){\n \tselectedRow.push([selectedRecord.getValue('regcompliance.regcomp_id')]);\n } else {\n \tselectedRow.push([selectedRecord.getValue('rm.bl_id'), selectedRecord.getValue('rm.fl_id'), selectedRecord.getValue('rm.rm_id')]);\n } \n View.getControl('', 'abEgressPlans_DrawingPanel').selectAssets(selectedRow);\n}", "focusOn (lat, long, arcSecPerPixel) {\n\n }", "function setPlayerGarrisonValues(gen_id) {\n var garrison, un, inp, idx, group, node;\n garrison = garrisonData.player[gen_id].garrison;\n \n // clear old values on page\n for (un in tsosim.units) {\n if (tsosim.units.hasOwnProperty(un)) {\n inp = document.getElementById(\"inp_\" + tsosim.units[un].id);\n inp.value = 0;\n }\n }\n \n // iterate though all groups in the garrison and set the values on the page\n for (idx in garrison.groups) {\n if (garrison.groups.hasOwnProperty(idx)) {\n group = garrison.groups[idx];\n \n if (group.type.hasSkill(Skills.GENERAL)) {\n if (group.type.id === tsosim.generals.mma.id) {\n node = document.getElementById(\"genSelMMA\");\n node.onclick();\n } else if (group.type.id === tsosim.generals.leg.id) {\n node = document.getElementById(\"genSelLEG\");\n node.onclick();\n } else if (group.type.id === tsosim.generals.dracula.id) {\n node = document.getElementById(\"genSelDRA\");\n node.onclick();\n } else {\n node = document.getElementById(\"genSel\" + garrison.capacity);\n node.onclick();\n }\n } else {\n inp = document.getElementById(\"inp_\" + group.type.id);\n if (inp) {\n inp.value = group.number;\n } else {\n console.log(\"could not find input field for unit : \" + group.type.id);\n }\n }\n }\n }\n}", "function applyGreenscreenWithGreenDistance(){\n for(var pixel of fgImage.values()){\n // if the current pixel is considered green-like\n if (calcGreenDistance(pixel) < sliderValue){\n // get the x,y cordinates of the current pixel\n var fgx = pixel.getX();\n var fgy = pixel.getY();\n // get the bgimage pixel at the same cordinates\n var bgpix = bgImage.getPixel(fgx, fgy);\n // set all the values of the foreground pixel to the corresponding values of the corresponding background pixel\n pixel.setAllFrom(bgpix);\n }\n }\n}", "onSelectedRes(resName, latitude, longitude) {\n // Set marker as center\n this.setState({\n currentLocation: {\n lat: latitude,\n lng: longitude\n }\n });\n // Mark restaurant as active\n const new_storemarkers = this.state.storemarkers.map((item) => {\n item.isChoosed = false;\n if (item.name === resName) {\n item.isChoosed = true;\n return item;\n } else {\n return item;\n }\n });\n this.props.setRestaurant(new_storemarkers);\n }", "function updateSelectionState(piece) {\r\n // Coordinates of the piece and the rubberband in piece space:\r\n var rubbrX1P = rubberband.xP, rubbrY1P = rubberband.yP;\r\n var rubbrX2P = rubberband.xP + rubberband.widthP - 1;\r\n var rubbrY2P = rubberband.yP + rubberband.heightP - 1;\r\n var pieceX1P = piece.xP, pieceY1P = piece.yP;\r\n var pieceX2P = piece.xP + piece.widthP - 1;\r\n var pieceY2P = piece.yP + piece.heightP - 1;\r\n piece.selected =\r\n ((rubbrX1P <= pieceX1P && rubbrX2P >= pieceX1P) ||\r\n (rubbrX1P > pieceX1P && rubbrX1P <= pieceX2P)) &&\r\n ((rubbrY1P <= pieceY1P && rubbrY2P >= pieceY1P) ||\r\n (rubbrY1P > pieceY1P && rubbrY1P <= pieceY2P));\r\n }", "onRegionUpdate(updated_region) {\n this.viewing_region = updated_region;\n this.fetch_regions();\n }", "function UpdateGraphicsMap() {\n\tfor(i=0; i<gridArr.length; i++) { // do for the whole map array\n\t\tif (gridArr[i].open > 0) { // only work on open areas of the map\n\t\t\texits = GetExits(i);\n\t\t\tswitch(exits) { // determine which graphic to display to reflect the available exits\n\t\t\t\tcase 1:\n\t\t\t\t\timg = \"D\";\n\t\t\t\t\trotation = \"270\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 10:\n\t\t\t\t\timg = \"D\";\n\t\t\t\t\trotation = \"180\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 11:\n\t\t\t\t\timg = \"L\";\n\t\t\t\t\trotation = \"180\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 100:\n\t\t\t\t\timg = \"D\";\n\t\t\t\t\trotation = \"90\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 101:\n\t\t\t\t\timg = \"I\";\n\t\t\t\t\trotation = \"90\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 110:\n\t\t\t\t\timg = \"L\";\n\t\t\t\t\trotation = \"90\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 111:\n\t\t\t\t\timg = \"T\";\n\t\t\t\t\trotation = \"90\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1000:\n\t\t\t\t\timg = \"D\";\n\t\t\t\t\trotation = \"0\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1001:\n\t\t\t\t\timg = \"L\";\n\t\t\t\t\trotation = \"270\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1010:\n\t\t\t\t\timg = \"I\";\n\t\t\t\t\trotation = \"0\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1011:\n\t\t\t\t\timg = \"T\";\n\t\t\t\t\trotation = \"180\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1100:\n\t\t\t\t\timg = \"L\";\n\t\t\t\t\trotation = \"0\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1101:\n\t\t\t\t\timg = \"T\";\n\t\t\t\t\trotation = \"270\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1110:\n\t\t\t\t\timg = \"T\";\n\t\t\t\t\trotation = \"0\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1111:\n\t\t\t\t\timg = \"X\";\n\t\t\t\t\trotation = \"\";\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif(gridArr[i].room == \"T\" ||\n\t\t\tgridArr[i].room == \"R\") {\n\t\t\t\tgraphic = \"url(img/png/tunnel\" + img + rotation + \".png)\";\n\t\t\t}\n\t\t\telse {\n\t\t\t\tgraphic = \"url(img/png/room\" + img + rotation + \".png)\";\n\t\t\t}\n\t\tdocument.getElementById(\"g\" + i.toString()).style.backgroundImage = graphic;\n\t\t}\n\t\telse {\n\t\t\tdocument.getElementById(\"g\" + i.toString()).style.backgroundImage = 'none';\n\t\t}\n\t}\n}", "function UpdateRubberbandOnMove(loc) {\r\n // Stores changing height, width, x & y position of most \r\n // top left point being either the click or mouse location\r\n UpdateRubberbandSizeData(loc)\r\n\r\n // Redraw the shape\r\n drawRubberbandShape(loc)\r\n}", "set_current(){\n let i = 0\n if(this.means.length > 0){\n while(this.means[i].key >= this.parent.year0 & i < this.means.length){\n i++\n }\n }\n this.current = i\n }", "function locate() {\nmap.locate({setView: true, maxZoom: 16});\n}", "function setCurrentLocation(id) {\n currentLocation = id;\n\n var currentManagerObj = managerData[currentManager];\n var location = currentManagerObj.locations[id];\n map.panTo(location.point);\n map.setZoom(8);\n $('#zoom-controls .zoomout').removeClass('active');\n $('#zoom-controls .zoomin').addClass('active');\n\n\n var nextIndex = getNextLocationIndex();\n var prevIndex = getPreviousLocationIndex();\n var infowindownav = '<div id=\"infobox-content\" class=\"clfx\">'\n + '<div class=\"info\">'\n + '<span class=\"imageWrap\"><img src=\"' + currentManagerObj.imageSmall + '\"/></span>'\n + '<a class=\"email\" href=\"mailto:' + currentManagerObj.email + '\">Email ' + currentManagerObj.firstName + '</a>'\n + '<div class=\"phone\"><a href=\"callto://' + formatPhoneForSkype(currentManagerObj.phone) + '\">' + currentManagerObj.phone + '</a></div>'\n + '</div>'\n + '<div class=\"infobox-content\">'\n + '<div class=\"header\">'\n + '<h2>' + location.suburb + '</h2>'\n + '<div class=\"controls\">'\n + (prevIndex != null ? '<a href=\"#\" class=\"prev\" onclick=\"javascript:goToPrevious(); return false;\">&lt;</a>' : '<a class=\"prev inactive\">&nbsp;</a>')\n + (nextIndex != null ? '<a href=\"#\" class=\"next\" onclick=\"javascript:goToNext(); return false;\">&gt;</a>' : '<a class=\"next inactive\">&nbsp;</a>')\n + '<span class=\"closeBtn\" onclick=\"infowindow.close(); return false;\">Close</span></div>'\n + '</div>'\n + '<span class=\"message\">\"' + location.message + '\"</span>'\n + '<span class=\"date\">Posted ' + location.date + '</span>'\n + '</div>'\n + '</div>';\n infowindow.setContent(infowindownav);\n infowindow.open(map, location.marker);\n infowindow.locationid = id;\n\n // highlight the current circle\n /*var locations = managerData[currentManager].locations;\n for (j = 0; j < locations.length; j++) {\n if (j != currentLocation) {\n locations[j].circle.setOptions(circleOptions);\n } else {\n locations[j].circle.setOptions(currentCircleOptions);\n }\n }*/\n\n // update the next and previous controls\n /*$prevLocation = $('#previousLocationButton');\n $nextLocation = $('#nextLocationButton');\n $prevLocation.text(getNameOrEmpty(getPreviousLocationIndex()));\n $nextLocation.text(getNameOrEmpty(getNextLocationIndex()));*/\n\n $prevLocation = $('#previousLocationButton');\n $nextLocation = $('#nextLocationButton');\n\n if (getPreviousLocationIndex() == null) {\n $prevLocation.addClass('disabled');\n } else {\n $prevLocation.removeClass('disabled');\n }\n\n if (getNextLocationIndex() == null) {\n $nextLocation.addClass('disabled');\n } else {\n $nextLocation.removeClass('disabled');\n }\n \n //Refresh for next and previous buttons\n //Cufon.refresh('#infobox-content h2');\n }", "function selectPlace(_place) {\n\n\n\n var _icon = {\n url: _place.icon,\n size: new google.maps.Size(71, 71),\n origin: new google.maps.Point(0, 0),\n anchor: new google.maps.Point(17, 34),\n scaledSize: new google.maps.Size(25, 25)\n };\n\n _this.travel.toPlace = {\n zoom:function(){\n _zoom_me(this.marker); \n },\n place: _place,\n marker: new google.maps.Marker({\n map: getMap(),\n icon: _icon,\n draggable: true,\n title: _place.name,\n position: _place.geometry.location\n })\n };\n\n _this.travel.fromPlace = {\n zoom:function(){\n _zoom_me(this.marker); \n },\n marker: new google.maps.Marker({\n map: getMap(),\n draggable: true,\n //icon: UserMarker.symbol, \n position: get_last_position()\n })\n }\n\n function _zoom_me(_marker){\n getMap().panTo(_marker.position);\n getMap().setZoom(18);\n }\n _this.travel.fromPlace.marker.addListener('dragend', _this.travel.onUpdate);\n _this.travel.toPlace.marker.addListener('dragend', _this.travel.onUpdate);\n\n _this.places_board.hide();\n _this.travel.set();\n _this.travel.onUpdate();\n //AHORA DEBE SELECCIONAR EL PUNTO DE PARTIDA\n\n\n }", "function storePlayerGarrisonValues(gen_id, units) {\n var garrison, idx, node, value, genIds, g, setStart;\n \n if (tsosim.version === tso.versions.Exp.id) {\n garrison = expData.getExpData(gen_id).garrison;\n garrison.clear();\n } else {\n garrison = garrisonData.player[gen_id].garrison;\n garrison.clear();\n }\n \n // read units from input fields\n setStart = false;\n for (idx in units) {\n if (units.hasOwnProperty(idx)) {\n node = document.getElementById(\"inp_\" + idx);\n if (node !== null) {\n value = parseInt(node.value, 10);\n if (value > 0) {\n garrison.addUnits(units[idx], value, !setStart);\n setStart = true;\n }\n } else {\n console.log(\"reading units from input fields, but node is null!\");\n }\n }\n }\n \n // store general\n if (tsosim.version !== tso.versions.Exp.id) {\n genIds = [\"genSel200\", \"genSel220\", \"genSel250\", \"genSel270\", \"genSelMMA\", \"genSelLEG\", \"genSelDRA\"];\n for (g = 0; g < genIds.length; g += 1) {\n node = document.getElementById(genIds[g]);\n if (node.getAttribute(\"class\") === \"genSel selOptActive\") {\n if (genIds[g] === \"genSelMMA\") {\n garrison.addUnits(tsosim.generals.mma, 1);\n } else if (genIds[g] === \"genSelLEG\") {\n garrison.addUnits(tsosim.generals.leg, 1);\n } else if (genIds[g] === \"genSelDRA\") {\n garrison.addUnits(tsosim.generals.dracula, 1);\n } else {\n garrison.addUnits(tsosim.generals.general, 1);\n }\n garrison.setCapacity(parseInt(node.getAttribute(\"value\"), 10));\n }\n }\n } else {\n genIds = [\"genSel100\"];\n }\n}", "onMouseUp(event) {\n //Enables rotation again\n this.controls.enabled = true;\n //Sets the selected slot to null (the slot stops being selected)\n this.selected_slot = null;\n //Sets the selected face to null (the face stops being selected)\n this.selected_face = null;\n //Sets the selected closet component to null (the component stops being selected)\n this.selected_component = null;\n }", "function highlightRegion2(d, i) { // Bepaalt wat er moet gebeuren zodra een element wordt gehighlight\n var teamColor = d3.rgb(\"pink\") // zet kleur om in RGB formaat\n d3.select(this).select(\"text\").classed(\"highlight\", true).attr(\"y\", 10) // Verander class en geef positie mee\n d3.selectAll(\"g.overallG\").select(\"circle\")\n .style(\"fill\", function(p) {\n return p.region == d.region ?\n teamColor.darker(.75) : teamColor.brighter(.5) // Set color voor elke region die met elkaar overeen komen (lichter of donkerder)\n })\n this.parentElement.appendChild(this); // Append bovenstaande aan het huidige element\n }", "function searchLoc(){\n selectedPlace = document.getElementById('place');\n deleteAllMarkers();\n searchNearLocs(map, curPos);\n }", "function updateGlobalTime(){\r\n gl.useProgram(program2);\r\n globalTimeLoc = gl.getUniformLocation(program2,\"globalTime\");\r\n globalTime += 1/60;\r\n gl.uniform1f(globalTimeLoc, globalTime);\r\n}", "function setEDdata(data) {\n\n if (data.ed == \"ED1\") {\n $(\"#edMap select\").val(\"ED1\");\n $('#Calque_1 > path:nth-child(1)').css(\"fill\",\"yellow\");\n $('#Calque_1 > path:nth-child(1)').click();\n }else if (data.ed == \"ED2\") {\n $(\"#edMap select\").val(\"ED2\");\n $('#Calque_1 > path:nth-child(4)').css(\"fill\",\"yellow\");\n $('#Calque_1 > path:nth-child(4)').click();\n }else if (data.ed == \"ED3\") {\n $(\"#edMap select\").val(\"ED3\");\n $('#Calque_1 > path:nth-child(2)').css(\"fill\",\"yellow\");\n $('#Calque_1 > path:nth-child(2)').click();\n }else if (data.ed == \"ED4\") {\n $(\"#edMap select\").val(\"ED4\");\n $('#Calque_1 > path:nth-child(3)').css(\"fill\",\"yellow\");\n $('#Calque_1 > path:nth-child(3)').click();\n }\n $('#couleur').val(data.region);\n edNumber = $('#couleur option:selected').data(\"ed\");\n getLieuFromRegionFirst($('#couleur option:selected').text(),edNumber);\n\n}", "_useCurrent() {\n var gl = this.renderer.gl;\n gl.colorMask(true, true, true, true);\n gl.stencilFunc(gl.EQUAL, this.stencilMaskStack.length, this._getBitwiseMask());\n gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n }", "function zControlBattleMapFollowGamer(position)\n{\n zObjectBattleMapLatLng[\"gamrLat\"] = position.coords.latitude;\n zObjectBattleMapLatLng[\"gamrLng\"] = position.coords.longitude;\n \n document.getElementById(\"map-info-crnt\").innerHTML = \"CRNT_LAT :{\" + zObjectBattleMapLatLng[\"crntLat\"] + \"}:CRNT_LNG :{\" + zObjectBattleMapLatLng[\"crntLng\"] + \"}:\";\n document.getElementById(\"map-info-gamr\").innerHTML = \"GAMR_LAT:{\" + zObjectBattleMapLatLng[\"gamrLat\"] + \"}:GAMR_LNG:{\" + zObjectBattleMapLatLng[\"gamrLng\"] + \"}:\";\n var date = new Date();\n document.getElementById(\"map-info-date\").innerHTML = \"DATE_TIME:{\" + date.getTime() + \"}:\";\n \n if(zObjectBattleMapLatLng[\"crntLat\"] != zObjectBattleMapLatLng[\"gamrLat\"]\n || zObjectBattleMapLatLng[\"crntLng\"] != zObjectBattleMapLatLng[\"gamrLng\"])\n {\n zObjectBattleMapGamer.setMap(null);\n \n var zObjectBattleMapCenterLatLng = new google.maps.LatLng(zObjectBattleMapLatLng[\"gamrLat\"], zObjectBattleMapLatLng[\"gamrLng\"]);\n zObjectBattleMap.setCenter(zObjectBattleMapCenterLatLng);\n \n zObjectBattleMapGamer = new google.maps.Marker(\n {\n position: zObjectBattleMapCenterLatLng,\n map: zObjectBattleMap,\n title: 'Hello World!'\n });\n \n zObjectBattleMapLatLng[\"crntLat\"] = zObjectBattleMapLatLng[\"gamrLat\"];\n zObjectBattleMapLatLng[\"crntLng\"] = zObjectBattleMapLatLng[\"gamrLng\"];\n }\n \n zControlHazardDistancetoGamer();\n \n zControlGamerMapStatus({\n\t code: 0, \n\t message: \"Good Map Status\",\n \ttimeofcoords: position.timestamp,\n \tmethod: \"zControlBattleMapFollowGamer\"\n\t});\n}", "function updateCurrent() {\n // console.dir(document.querySelector('#temp'));\n $('#current-city').html(\"\" + activeCity + \": \" + \"<span>\" + date.format('MMM. Do') + \"<span><img src='\"+ weathData.icon + \"'>\" );\n // console.log(weathData.uv);\n $('#temp').text(weathData.temp + \" °F\");\n $('#hum').text(weathData.hum + \"%\");\n $('#wind').text(weathData.wind + \" MPH\");\n $('#uv').removeClass('yellow red green')\n if (weathData.uv < 3) {\n $('#uv').text(weathData.uv).addClass('green');\n } else if (weathData.uv >= 3 && weathData.uv < 8) {\n $('#uv').text(weathData.uv).addClass('yellow');\n } else if (weathData.uv > 8) {\n $('#uv').text(weathData.uv).addClass('red');\n }\n \n }", "function redrawSelectedRotated() {\r\n if (rot.frame == 0) {\r\n groupSelected();\r\n } else {\r\n var angle = 90 * rot.frame / rot.framesPer90 *\r\n (that.selection.rotateCW ? 1 : -1);\r\n rot.group.\r\n setTransform(dojox.gfx.matrix.rotategAt(\r\n angle, \r\n that.selection.center.x, \r\n that.selection.center.y));\r\n }\r\n }", "function grabRacer() \n{\n // Function level variables\n opponetPony = currentIndex;\n\n // If user selects a pegesus pick an non pegesus\n if (isPegasus[currentIndex]) \n {\n while (isPegasus[opponetPony]) \n {\n opponetPony = Math.floor(Math.random() * 7);\n }\n\n // Set pegasus to sky\n racer0.src = ponysRacing[currentIndex];\n racer1.src = ponysRacing[opponetPony];\n } \n else \n {\n while (!isPegasus[opponetPony]) \n {\n opponetPony = Math.floor(Math.random() * 7);\n }\n\n // Set pegasus to sky\n racer0.src = ponysRacing[opponetPony];\n racer1.src = ponysRacing[currentIndex];\n }\n}", "function OnConfig() {\n gl.ScrRefresh();\n}", "function initCurrentPosition(thishash){\n current_position_marker = mapnav.flagHash(thishash);\n current_position_marker.setOptions({\n draggable: true,\n animation: google.maps.Animation.DROP,\n icon: curPos.startImage\n });\n \n google.maps.event.addListener(current_position_marker, 'mouseover', function(event){\n current_position_marker.setIcon(curPos.hoverImage);\n });\n \n google.maps.event.addListener(current_position_marker, 'mouseout', function(event){\n current_position_marker.setIcon(curPos.startImage);\n });\n \n google.maps.event.addListener(current_position_marker, 'mousedown', function(event){\n current_position_marker.setIcon(curPos.heldImage);\n });\n \n google.maps.event.addListener(current_position_marker, 'mouseup', function(event){\n current_position_marker.setIcon(curPos.startImage);\n });\n\n google.maps.event.addListener(current_position_marker, 'dragend', function(event){\n var newlocation = current_position_marker.getPosition();\n var thishash = geohash(newlocation.lat(), newlocation.lng());\n updateConsole(newlocation.lat(), newlocation.lng(), '', thishash); \n //getPosts(thishash);\n current_position_marker.setIcon(curPos.startImage);\n\n });\n}", "addNextVisitor(minPosition) {\n // console.log(this.visitorsInMin);\n if (this.visitorsInMin.length > 0 && minPosition % this.framesPerVisitor === 0) {\n let nextVisitorData = this.visitorsInMin.splice(0,1)[0];\n let nextVisitorX = nextVisitorData.dir == \"up\" ? 1 : this.myWidth;\n // console.log(\"new x value: \" + nextVisitorX);\n let nextVisitorY = 50 + Math.floor(Math.random()*175);\n let nextVisitor = {\n \"x\": nextVisitorX,\n \"y\": nextVisitorY,\n \"data\": nextVisitorData\n };\n this.activeVisitors.push(nextVisitor);\n }\n }" ]
[ "0.5154362", "0.5144067", "0.49987295", "0.49775556", "0.4908449", "0.4902646", "0.49025935", "0.4856827", "0.4855172", "0.48125374", "0.4805899", "0.4790259", "0.47886318", "0.4782783", "0.47629595", "0.47497466", "0.47337413", "0.473354", "0.47050133", "0.4699439", "0.46969026", "0.46787402", "0.4678088", "0.46755326", "0.4674435", "0.4665557", "0.4657616", "0.465004", "0.46458903", "0.46448404", "0.46396837", "0.46355063", "0.46339443", "0.46295995", "0.46245754", "0.46222347", "0.46198606", "0.4611678", "0.4598318", "0.45895058", "0.45804143", "0.45793578", "0.45727503", "0.4570512", "0.45580146", "0.45575273", "0.4554038", "0.45463625", "0.45384148", "0.4516136", "0.45089635", "0.4506947", "0.44985083", "0.4498239", "0.4492916", "0.4492916", "0.44878167", "0.44820425", "0.44759437", "0.44735837", "0.44704175", "0.44596258", "0.4458854", "0.44432697", "0.4438831", "0.44382408", "0.44360146", "0.44320327", "0.4431141", "0.44245395", "0.4423222", "0.44086716", "0.44076583", "0.44074208", "0.4405986", "0.44052848", "0.43968412", "0.4392841", "0.4392299", "0.43911648", "0.43843645", "0.43751508", "0.4373358", "0.43732637", "0.43690732", "0.43611553", "0.43587494", "0.43551415", "0.4355049", "0.43422955", "0.43422765", "0.43421283", "0.4339031", "0.43341917", "0.4333791", "0.4328953", "0.43268993", "0.4324558", "0.4318001", "0.43149656" ]
0.6779426
0
display a countdown until server time becomes elThen.title time
function displayTimeCountdown(elThen) { var thenTime = elThen.getAttribute("title"); var mThen = new moment( thenTime ); elThen.innerHTML = mThen.format("YYYY/MM/DD HH:mm:ss"); mCST = CurrentServerTime(); var diff = moment.duration(mThen.diff( CurrentServerTime() )); var msgClass = "debugMsg"; if (diff.asSeconds() < 10) { msgClass = "panicMsg"; } else if (diff.asSeconds() < 60) { msgClass = "errMsg"; } else if (diff.asSeconds() < 120) { msgClass = "infoMsg"; } elThen.innerHTML += '<br><span class="'+msgClass+'"><b>'+ diff.format("h [hrs] m [min] s [sec]") + "</b></span>"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function countdown(t) {\r\n display_element.querySelector('#rpm-feedback').innerHTML = '<p>'+t+'</p>';\r\n }", "function countItDown(){\n startTime -= 1\n $el.text(startTime);\n App.doTextFit('#hostWord');\n\n if( startTime <= 0 ){\n // console.log('Countdown Finished.');\n\n // Stop the timer and do the callback.\n clearInterval(timer);\n callback();\n return;\n }\n }", "function showCountdown(){\n seconds--;\n \n if(seconds < 10) {\n $(\"#timeLeft\").html(\"00:0\" + seconds);\t\n } else {\n $(\"#timeLeft\").html(\"00:\" + seconds);\t\n }\n \n if(seconds < 1){\n clearInterval(time);\n answered = false;\n answerPage();\n }\n }", "function UpdateCountDown (time : float) {\n\tvar displayTime = Mathf.CeilToInt(time);\n\tvar displayText = displayTime==0 ? \"\" : displayTime.ToString();\n\tcountdown.text = displayText;\n}", "function updateCountdown() {\n //comment obtenir les minutes et les secondes :\n const minutes = Math.floor(time / 60);\n let seconds = time % 60;\n\n //si le time inferieur a 10 tu concataine 0 et le time entre 0 et 9\n seconds = seconds < 10 ? '0' + seconds : seconds;\n\n countDownEl.innerHTML = `${minutes}:${seconds}`;\n //arrivé a zero lui dire de pas faire negatif et afficher game over\n if (time > 0) {\n time--;\n } else {\n countDownEl.innerHTML = `Game Over`;\n }\n }", "function countdown() {\n now = luxon.DateTime.local();\n d = event_date.diff(now, ['weeks', 'days', 'hours', 'minutes']);\n eventHTML = `<strong><span>${d.weeks}</span> ${d.weeks == 1 ? \"week\" : \"weeks\"}, `;\n eventHTML += `<span>${d.days}</span> ${d.days == 1 ? \"day\" : \"days\"}, `;\n eventHTML += `<span>${d.hours}</span> ${d.hours == 1 ? \"hour\" : \"hours\"}, `;\n eventHTML += `<span>${Math.floor(d.minutes)}</span> ${Math.floor(d.minutes) == 1 ? \"minute\" : \"minutes\"}</strong><br>`;\n eventHTML += `at ${record.title}`;\n $(\"#event-countdown-time\").html(eventHTML);\n }", "function countdown() {\n // timeRemaining is incremented down\n timeRemaining --;\n\n // If time runs out, runs gameOver()\n if (timeRemaining <= 0) {\n gameOver();\n }\n\n // Updates the timer element\n timer.text(timeRemaining);\n }", "function showRemaning(){\n\tvar now = new Date();\n\tvar distance = end - now;\n\tif(distance<0){\n\t\tclearInterval(timer);\n\t\tcountdownElement.innerHtml = 'Time Up !!!'\n\t\treturn;\n\t}\n\tvar days = Math.floor(distance/_day);\n\tvar hours = Math.floor((distance%_day) / _hour);\n\tvar minutes = Math.floor((distance %_hour) / _minute);\n\tvar second = Math.floor((distance % _minute) / _second);\n\tcountdownElement.innerHtml = days + 'days';\n\tcountdownElement.innerHtml += hours + 'hrs';\n\tcountdownElement.innerHtml += minutes + 'mins';\n\tcountdownElement.innerHtml += second + 'secs';\n}", "function countdown () {\n timeLeft--\n if (timeLeft >= 0) {\n time.innerText = timeLeft + ' secs'\n }\n }", "function countdown(){\n\t\tif(timeLeft == 0){\n\t\t\tend()\n\t\t}else{\n\t\t\t$(\"#Time-Remaining\").text(\"Time Left: \"+ timeLeft);\n\t\t\ttimeLeft--;\n\t\t}\n\t}", "function displayTime() {\n time--;\n $(\"#timer-holder\").html(\"Time remaining: \" + time);\n \n if (time <= 0) {\n hideGameContainers();\n stopTime();\n $(\"#answer-holder\").show();\n $(\"#answer-holder\").html(\"Time is up! The answer is: \" + answer[count]);\n unanswered++;\n count++;\n endGame();\n }\n \n }", "function domCountDown() {\n $(`.timer`).text(`Game Begins in: ${countDown} Seconds`);\n }", "function countDown() {\n counter--;\n var converted = timeConverter(counter);\n $(\"#time-display\").text(converted);\n\n //tell player time is up and delay long enough for them to see it\n if (counter === 0) {\n $(\"#time-display\").text(\"Time's Up!!\");\n setTimeout(gameResults(), 1500)\n }\n }", "function countdown () {\n\ttimer--;\n\t$(\"#timeRemaining\").text(timer);\n\n\t// User ran out of time to answer the question\n\tif (timer === 0) {\n\t\tcheckAnswer(\"timeUp\");\n\t}\n}", "function timer() {\n difference = Math.round(milliseconds - (Date.now() - now) / 1000);\n if (difference < 0) {\n return;\n }\n // eslint-disable-next-line no-use-before-define\n const { minutes, seconds } = displayTimer(difference);\n\n // eslint-disable-next-line\n displayElement.textContent = `${minutes}:${seconds}`;\n document.title = `${minutes}:${seconds}`;\n }", "function timer(){\n clock = setInterval(countDown,1000);\n function countDown() {\n if( time < 1) {\n clearInterval(clock);\n userTimeout();\n \n }\n if (time > 0) {\n time --;\n }\n \n\n $(\"#timer\").html(\"<stong>\" + time + \"</stong>\");\n }\n\t\t\t\n\t}", "function countDownTimer() {\n\n // Figure out the time to launch\n timeToLaunch();\n\n // Write to countdown component\n $(\"#days .number\").text(days);\n $(\"#hours .number\").text(hrs);\n $(\"#minutes .number\").text(min);\n $(\"#seconds .number\").text(sec);\n\n // Repeat the check every second\n setTimeout(countDownTimer, 1000);\n }", "function updateTimeRemaining() {\n timeDisplay.innerHTML = `${Math.floor(time / 60000).toString().padStart(2, '0')}:${(Math.floor((time % 60000) / 1000).toFixed(0)).padStart(2, '0')}`;\n}", "function displayRemainingTime() {\n minutesEl.textContent =\n Math.floor(time / 60) < 10\n ? \"0\" + Math.floor(time / 60)\n : Math.floor(time / 60);\n secondsEl.textContent = time % 60 < 10 ? \"0\" + (time % 60) : time % 60;\n}", "function countdown(){\n\tif (variables.time > 0) {\n\t\tvariables.time--;\n\t\t$('#time').width(variables.time + '%');\n\t} else {\n\t\tif (variables.gamestate > 0) {\n\t\t\tclearInterval(timeInterval);\n\t\t\tvariables.gamestate = 0;\n\t\t\t$(\".container\").children().fadeOut(gameOver);\t\t\n\t\t}\n\t}\n}", "function countdown() {\n \n \n if (timeLeft == -1) {\n clearTimeout(timerId);\n \n } else {\n $(\"#timer\").text(timeLeft + ' seconds remaining');\n timeLeft--;\n }\n }", "function decrement(){\n\t\ttimer--;\n\t\t$(\"#timeRemaining\").html(\"<h2>\"Time Remaining: + timer + \"</h2>\");\n\t\t\ttimeUp();\n\t\t\talert (\"Sorry...Time is up!\");\n\t\t}", "function timeCount () {\n timer--;\n $(\".timerArea\").html(\"remaining time : \" + timer);\n }", "function showCountdown(){\n console.log(\"in showcountdown\");\n seconds--;\n $('#timeLeft').html('<h3>Time Remaining: ' + seconds + '</h3>');\n if(seconds < 1){\n clearInterval(time);\n answered = false; \n PopulateAllAnswers(); \n }\n }", "function countDown() {\r\n tick();\r\n var countDownString = numToString(min) + \" : \" +\r\n numToString(sec);\r\n const printTimer = document.getElementById(\"timer\");\r\n timer.innerText = countDownString;\r\n}", "function tick() {\n timeLeft -= 1;\n cb(renderTimeString());\n }", "function displayTimer(){\n\t\tif(!timerOn){\n\t\t\treturn;\n\t\t}\n\t\tdocument.getElementById(\"numeric\").innerHTML=\"<h1>\"+count+\"</h1>\";\n\t\tdocument.bgColor = window.location.hash.substring(1) === 'fullbg' ? 'darkred' : '';\n\t\tif(count==0){\n\t\t\tstartT=(new Date()).getTime();\n\t\t}\n\t\tcount +=100;\n\t\tif(count>maxResponseTime){\n\t\t\tresetDisplayTimer();\n\t\t\treturn;\n\t\t}\n\t\tt=setTimeout(\"displayTimer()\", 100);\n\t}", "function showTime() {\n var elTimer = document.querySelector('.timer');\n gGame.secsPassed = parseInt((Date.now() - gStartTime) / 1000);\n elTimer.innerHTML = `${gGame.secsPassed}s`\n}", "function countDown() {\n counter--;\n\n $('#time').html(`\n <h5>:${counter}</h5><p>\n `)\n if (counter === 0) {\n timeUp();\n }\n}", "function fiveSeconds() {\n $(\"#time-remaining\").html(\"<p style='color:red;'><i class='fa fa-clock-o' style='padding: 20px;color:red;' aria-hidden='true'></i> Time Remaining : \" + timer + \"</p>\");\n }", "function countDownTimer() {\n\n // Figure out the time to launch\n timeToLaunch();\n\n // Write to countdown component\n $(\"#days .timer-number\").text(days);\n $(\"#hours .timer-number\").text(hrs);\n $(\"#minutes .timer-number\").text(min);\n $(\"#seconds .timer-number\").text(sec);\n\n // Repeat the check every second\n setTimeout(countDownTimer, 1000);\n }", "function t_updateTime() {\n var display = document.getElementById(\"t_time\");\n t_seconds--;\n if (t_seconds==-1) {\n t_seconds = 59;\n t_mins--; \n }\n if (t_mins<0) {\n display.innerHTML = \"Time is up!\";\n } else {\n if (t_mins<10&&t_seconds<10) {\n display.innerHTML = \"0\"+t_mins+\":0\"+t_seconds; \n } else if (t_mins<10) {\n display.innerHTML = \"0\"+t_mins+\":\"+t_seconds; \n } else if (t_seconds<10) {\n display.innerHTML = t_mins+\":0\"+t_seconds; \n } else {\n display.innerHTML = t_mins+\":\"+t_seconds; \n }\n t_timer = setTimeout(\"t_updateTime()\",1000);\n }\n \n}", "function countDown() {\n // decrement time remaining\n timeRemaining--;\n // updates html with the time remaining\n $(\"#timer\").text(\"Time Remaining: \" + timeRemaining);\n // stops and removes the timer at zero \n if(timeRemaining < 1){\n \n // calls the stop timer function\n stopTimer();\n\n }\n }", "function displayTime(){ \n let timeDisplayBoard=$QS('.time-display-board');\n \n if(count <= 0){\n stopTimer(); \n timeDisplayBoard.innerText=`${count} S`;\n } else {\n if(stopGame){\n let btn=$CESC('button', 'play-again-btn');\n btn.innerText=\"Play Again\";\n btn.onclick=resetGame;\n timeDisplayBoard.innerHTML=\"\";\n $ACP(timeDisplayBoard, btn);\n } else{\n timeDisplayBoard.innerText=`${count} S`;\n count--;\n setCountdownTimer(); \n } \n } \n}", "function countdown() {\n let timing = document.querySelector(\"#timer\");\n if (timing.textContent === \"0:00\") {\n timerEnd();\n return;\n }\n timing.textContent = secondToStringConversion(stringToSecondConversion(timing.textContent) - 1);\n const totalTiming = document.getElementsByClassName(\"time active\")[0].textContent * 60;\n visualUpdate(stringToSecondConversion(timing.textContent) - 1, totalTiming);\n}", "updateTimerText(){\n if(this.startTime && this.button){\n let timeLeft = 10 - (Math.floor((new Date().getTime() - this.startTime)/1000));\n if (timeLeft < 0)\n timeLeft = 0;\n this.button.textBlock.text = `Boost Remaining:\\n${timeLeft.toString()}s`;\n\n }\n }", "function displayTime() {\n var timerInterval = setInterval(function() {\n var currentTime = moment().format('MMMM Do YYYY, h:mm:ss a');\n $(\"#current\").text(currentTime);\n secondsLeft--;\n \n if (secondsLeft === 0) {\n clearInterval(timerInterval);\n displayTime();\n }\n }, 1000); \n }", "display(){\n $('#timer').text(timer.hours + \":\" + timer.minutes + \":\"+ timer.secondes);\n }", "function timeCycle() {\r\n var time2 = Date.now();\r\n var msTimeDiff = time2 - gTime1;\r\n var timeDiffStr = new Date(msTimeDiff).toISOString().slice(17, -1);\r\n document.querySelector('.timer').innerHTML = timeDiffStr;\r\n}", "function countdown(){\r\n time--;\r\n // replace the html with the new time\r\n $(\"#time-counter\").text(time)\r\n if(time <= 0) {\r\n // cease timer\r\n clearInterval(counterId);\r\n // show finished screen\r\n $(\"#finished\").removeAttr(\"style\")\r\n // update final score with current time\r\n $(\"#final-score\").text(time)\r\n }\r\n}", "function countDown() {\n counter--;\n $(\"#timer\").html(\"<h2> Timer: 00:\" + counter + \"</h2>\");\n timeOut();\n }", "function countDown() {\n seconds -= 1;\n\n if (seconds < 0 && minutes > 0) {\n seconds += 60;\n minutes -= 1;\n }\n else if (seconds === -1 && minutes === 0) {\n // Timer is done. Call relevant functions\n stopTimer();\n PEvents.timerDone(currentTimerType);\n loadTimer();\n }\n \n render();\n }", "function timer() {\n clock = setInterval(countDown, 1000);\n function countDown() {\n if (time < 1) {\n clearInterval(clock);\n userTimeout();\n }\n if (time > 0) {\n time--;\n }\n $(\"#timer\").html(\"<strong>\" + time + \"</strong>\");\n }\n }", "function countDown(){\n\t\ttime --;\n\t\tupdate($timer, time);\n\n\t\tif (time <= 0){\n\t\t\thide($timer);\n\t\t\tgameOver();\n\t\t}\n\t}", "function timer() {\n\t\t//get elapsed time, comes as milliseconds\n\t\tlet timeElapsed = Date.now() - timerStart;\n\n\t\tif (timeElapsed >= QUIZDURATION) {\n\t\t\tendQuiz();\n\t\t\treturn;\n\t\t}\n\t\t//convert to seconds\n\t\tlet remaining = (QUIZDURATION - timeElapsed) / 1000;\n\t\tlet h = parseInt(remaining / 3600); //divide to get hours\n\t\tlet m = parseInt( (remaining % 3600) / 60); //divide remainder to get minutes\n\t\tlet s = parseInt( (remaining % 3600) % 60); //divide that remainder to get seconds\n\n\t\t//put on page\n\t\tlet textString = padTimer(h) + \":\" + padTimer(m) + \":\" + padTimer(s);\n\t\ttimeDisplay.innerText = textString;\n\t}", "function countdown(){\n seconds = 20;\n $(\"#timeLeft\").html(\"00:\" + seconds);\n answered = true;\n //Sets a delay of one second before the timer starts\n time = setInterval(showCountdown, 1000);\n }", "_countDown() {\n // Setzen des Eventdatums: 24.12.2019, 00:00:00Uhr\n var christmas = new Date(\"Dec 24, 2019 00:00:00\").getTime();\n\n // Setzen eines Intervalls -> alle 1000ms Funktion aufgerufen\n var x = setInterval(function() {\n // aktuelle Daten holen\n var today = new Date().getTime();\n var timeLeft = christmas - today;\n // aus Differenz Tage, Stunden, Minuten und Sekunden berechnen\n var days = Math.floor(timeLeft / (1000 * 60 * 60 * 24));\n var hours = Math.floor((timeLeft % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));\n var minutes = Math.floor((timeLeft % (1000 * 60 * 60)) / (1000 * 60));\n var seconds = Math.floor((timeLeft % (1000 * 60)) / 1000);\n // HTML-Elemente mit berechneten Daten füllen\n // try-catch-Block um Funktion über return stoppen zu können\n try{\n document.getElementById(\"countDown\").innerHTML = days + \"d \" + hours + \"h \"\n + minutes + \"m \" + seconds + \"s \";\n\n if (timeLeft < 0) {\n clearInterval(x);\n document.getElementById(\"countDown\").innerHTML = \"EXPIRED\";\n }\n }catch(error){\n return;\n }\n\n }, 1000);\n\n }", "function countDown(){\n if (gameStart=true){\n remainingTime--;\n $(\"#timeRemain\").html(remainingTime + \" seconds\");\n if (remainingTime<=0){\n gameStart=false;\n }\n }\n }", "function clock() {\n // If time reaches 0\n if (triviagame.time === 0) {\n // Clear the interval of that time\n clearInterval(timer);\n // Run the function notime\n triviagame.notime();\n }\n // If there's time left\n if (triviagame.time > 0) {\n // Decrement time\n triviagame.time--;\n }\n // HTML\n $(\"#time-slot\").text(\"Time remaining: \" + triviagame.time);\n }", "function countdownTimer() {\n // reduce countdown timer by 1 second\n timer--;\n if (timer === 0) {\n // timer expired\n endTest();\n } else if (timer < 10) {\n // prefix times less than ten seconds with 0\n // update timer on web page\n $('#timer').text('0' + timer);\n } else {\n // update timer on web page\n $('#timer').text(timer);\n }\n }", "updateTimer() {\n var currentTime = new Date();\n var timeDifference = this.startTime.getTime() - currentTime.getTime();\n\n this.timeElapsed = Math.abs(timeDifference / 1000);\n\n var timeRemaining = this.totalTime - this.timeElapsed;\n\n var seconds = Math.floor(timeRemaining);\n\n var result = (seconds < 10) ? \"\" + seconds : \"\" + seconds;\n\n if (result >= 0){\n this.timeLabel.text = result;\n }\n }", "function countDown() {\n // decrease time by 1\n time--;\n // update the time displayed\n update($timer, time);\n // the game is over if the timer has reached 0\n if (time <= 0) {\n gameOver();\n }\n }", "function onUpdateTiempoRestante(e) {\n let comodin = (e.detail.total >= 3600 && e.detail.duration < 3600) ? \"00<span style='color: yellow'>:</span>\" : \"\";\n lastTimeIndicator.innerHTML = comodin + getReadableTime(e.detail.duration);\n}", "function displayTime() {\n let hours = Math.floor(secondCount/3600);\n let minutes = Math.floor((secondCount % 3600)/60);\n let seconds = Math.floor(secondCount % 60)\n\n // Display a leading zero if the values are less than ten\n let displayHours = (hours < 10) ? '0' + hours : hours;\n let displayMinutes = (minutes < 10) ? '0' + minutes : minutes;\n let displaySeconds = (seconds < 10) ? '0' + seconds : seconds;\n\n setTotalTime(secondCount)\n setTimeLapse(displayHours + ':' + displayMinutes + ':' + displaySeconds)\n\n secondCount++;\n }", "function countdownTimer() {\n if (countdown > 0) \t{\n countdown = countdown-1;\n $(\"#time\").html(\"<p>Time remaining: \" + countdown + \" seconds.</p>\"); \n }\n else {loadQuestion() \n };\n }", "function timer() {\n\t\tclock = setInterval(countDown, 1000);\n\t\tfunction countDown() {\n\t\t\tif (time < 1) {\n\t\t\t\tclearInterval(clock);\n\t\t\t\tuserTimeout();\n\t\t\t}\n\t\t\tif (time > 0) {\n\t\t\t\ttime--;\n\t\t\t}\n\t\t\t$(\"#timer\").html(\"<strong>\" + time + \"</strong>\");\n\t\t}\n\t}", "function timer() {\n\t\tclock = setInterval(countDown, 1000);\n\t\tfunction countDown() {\n\t\t\tif (time < 1) {\n\t\t\t\tclearInterval(clock);\n\t\t\t\tuserTimeout();\n\t\t\t}\n\t\t\tif (time > 0) {\n\t\t\t\ttime--;\n\t\t\t}\n\t\t\t$(\"#timer\").html(\"<strong>\" + time + \"</strong>\");\n\t\t}\n\t}", "function timer() {\n\t\tclock = setInterval(countDown, 1000);\n\t\tfunction countDown() {\n\t\t\tif (time < 1) {\n\t\t\t\tclearInterval(clock);\n\t\t\t\tuserTimeout();\n\t\t\t}\n\t\t\tif (time > 0) {\n\t\t\t\ttime--;\n\t\t\t}\n\t\t\t$(\"#timer\").html(\"<strong>\" + time + \"</strong>\");\n\t\t}\n\t}", "function decrement() {\n $(\"#time-remaining\").html(\"<h3>Time remaining: \" + timer + \"</h3>\");\n timer--;\n\n //if timer reaches 0, stop timer and display time is up\n if (timer === 0) {\n unansweredCounter++;\n stop();\n $(\"#answer-display\").html(\"<p>Time is up! The correct answer is: \" + questionSelected.choice[questionSelected.answer] + \"</p>\");\n outcome();\n }\n }", "function startIdleTimer() { \n \n /* Increment the \n timer seconds */ \n valido = document.getElementById(\"secs\");\n\n if(currSeconds < 30 && currSeconds > 9){\n valido.innerText = \"00:\"+(currSeconds); \n }else{\n if(currSeconds <= 0){\n valido.innerText =\"00:00\"; \n \n }else{\n if(currSeconds == 30){\n valido.innerText =\"00:30\"; \n \n }else{\n valido.innerText =\"00:0\"+(currSeconds); \n }\n \n }\n\n } \n currSeconds--; \n \n \n /* Display the timer text */ \n\n }", "function countDown() {\n seconds--;\n if (seconds > 0) {\n setTimeout(countDown, 1000);\n } else {\n submitAnswers();\n }\n console.log(seconds);\n $(\"#time-remaining\").html(\"<h4>\" + \"Time Remaining: \" + seconds + \" seconds\" + \"</h4>\");\n\n }", "function displayTime(second) {\n const min = Math.floor(second / 60);\n const sec = Math.floor(second % 60);\n req.session.timer = `${min < 10 ? \"0\" : \"\"}${min}:${sec < 10 ? \"0\" : \"\"}${sec}`;\n }", "function countdown() {\n timeInterval = setInterval(function () {\n timeLeft--;\n timer.text(\"Time: \" + timeLeft);\n if (timeLeft === 0) {\n clearInterval(timeInterval);\n }\n }, 1000);\n}", "function countDown(){\n\tcount--;\n\t$(\".time\").html(\"<h1> Time remaining: \" +count + \" seconds </h1>\"); \n\tif (count ==0){\n\t\tgrade();\n\t\tvar theDisp = \"<h1>Time is Up!</h1> <br><br> Correct Answers: \" + cAns + \"<br> Wrong Answers: \" + wAns + \"<br>Unanswered: \" + uAns;\n\t\t$(\".time\").html(theDisp);\n\t\tclearInterval(down1);\n\t\t$(\".theQs\").hide();\n\t\tcount = 80;\n\t}\n}", "function countDown() {\n timerTime--;\n $(\".time-left\").html(timerTime);\n}", "function zähler (){\r\n\tnew countdown(1200, 'counter'); //alle Zeiten werden in Sekunden angegeben, rechnet selbst auf Minuten und Stunden um\r\n}", "function countDown(){\n if(clock){\n $('.clock').show();\n questionTime--;\n if(questionTime > 0){\n setTimeout(countDown,1000);\n }\n questionTime = questionTime.toString();\n if(questionTime < 10){\n $('.clock').text(\"00:0\"+questionTime);\n $('.clock').css(\"color\", \"rgb(88, 22, 22)\");\n } else {\n $('.clock').text(\"00:\"+questionTime); \n $('.clock').css(\"color\", \"black\");\n }\n } else {\n return;\n }\n }", "function show_count_down(obj, time, msg) {\r\n count_content = time + msg;\r\n $(obj).text(count_content)\r\n}", "function displayTime(time){\n if(prevTime != time && time > 0){\n msg_queue.push(['Time', time, 2]);\n updateMessages();\n }\n prevTime = Math.floor(time);\n}", "function displayTimeLeft(seconds) {\n\tconst minutes = Math.floor(seconds / 60);\n\tconst remainSeconds = seconds % 60;\n\tconst display = ((remainSeconds < 10) ? minutes + \":0\" + remainSeconds : minutes + \":\" + remainSeconds);\n\tupdateElementById(\"sessionTime\", display);\n}", "function timer(){\r\n const now = new Date();\r\n const hours = now.getHours();\r\n const minutes = now.getMinutes();\r\n const seconds = now.getSeconds();\r\n \r\n timerDisplay.textContent = `${hours}:${minutes < 10 ? '0': ''}${minutes}:${seconds < 10 ? '0': ''}${seconds}`;\r\n \r\n}", "function showTime() {\n\t\ttry {\n\t\t\tvar hours = time.getUTCHours();\n\t\t\tvar minutes = time.getUTCMinutes();\n\t\t\tvar seconds = time.getUTCSeconds();\n\t\n\t\t\t// build the human-readable format\n\t\t\tvar timeValue = \"\" + ((hours > 12) ? hours - 12 : hours);\n\t\t\ttimeValue += ((minutes < 10) ? \":0\" : \":\") + minutes;\n\t\t\ttimeValue += ((seconds < 10) ? \":0\" : \":\") + seconds;\n\t\t\ttimeValue += (hours >= 12) ? \" pm\" : \" am\";\n\t\n\t\t\tvar clockElement;\n\t\t\tif ((piratequesting.sidebar) && (clockElement = sidebar.contentDocument.getElementById('servertime'))) {\n\t\t\t\tclockElement.setAttribute(\"value\", timeValue);\n\t\t\t}\n\t\t} \n\t\tcatch (e) {\n\t\t\tdumpError(e);\n\t\t}\t\n\t}", "function startCountdown () {\n\tremaining_minutes = dom_totalminutes.value;\n\tremaining_seconds = Math.floor(dom_totalseconds.value/10)*10;\n\tdocument.title=\"▶ Activo\";\n\tdom_totaltime.style.display=\"none\";\n\tcountdown.style.display=\"inline-block\";\n\tbtn_startcount.style.display=\"none\";\n\tbtn_stopcount.style.display=\"block\";\n\tdom_countdown_m.innerHTML=dom_totalminutes.value;\n\tdom_countdown_s.innerHTML=formato(remaining_seconds);\n\tdom_frases.innerHTML=eligefrase();\n\tmyCountdown();\n}", "function countdown() {\n var timeInterval= setInterval(function(){\n timer.innerText = timeLeft\n timeLeft--;\n },1000);\n}", "function updateTimerText() {\n $(\".timer\").html(`<h3>Time Remaining ${time} Seconds</h3>`);\n}", "function countDownTimer(){\n \n let currentTime = gameState.timeLeft - 1;\n gameState.timeLeft = currentTime;;\n\n timer.text(currentTime);\n\n \n if (gameState.timeLeft === 0){\n alert(`Times up! ${gameState.player} You scored ${gameState.score} points!`);\n gameOver();\n }\n \n }", "function countdown() {\n\t\t\tif (secondsLeft == 0) {\n\t\t\t\tclearInterval(timerId); // Should stop the timer\n\t\t\t\tclearInterval(moveTimer); // Should stop the timer\n\t\t\t\tthis.gotoAndStop(\"GameOver\");\n\t\t\t} else {\n\t\t\t\tsecondsLeft--; // reduce seconds by 1\n\t\t\t\t// Next line is optional - same as above\n\t\t\t\tthis.countdownDisplay.text = secondsLeft; // update the text field\n\t\t\t}\n\t\t}", "function timeLower(){\n timeRemaining-=1;\n timer.innerText = `Time: ${timeRemaining}`;\n}", "function reset(){\n time = 10;\n\t\t $(\"#display\").html('<h3>Time Remaining: ' + time + ' seconds</h3>');\n \t}", "function updateTime() {\n seconds += 1;\n document.querySelector(\"#timer\").innerText = \"Time elapsed: \" + seconds;\n}", "function timeStarter() {\n var countdown = setInterval(function() {\n secondsLeft--;\n timerEl.textContent = \"Time remaining: \" + secondsLeft;\n if (secondsLeft === 0) {\n clearInterval(countdown)\n titleEl.textContent = \"Time is up! Enter your initials below.\"\n\n }\n }, 1000);\n}", "function printTimer() {\n var timeDisplay = $(\"<h3>\").text(\n \"Time Remaining: \" + timeRemaining + \" Seconds\"\n );\n timeDisplay.attr({ id: \"time-display\", class: \"animated flipInX\" });\n $(\"#timer-section\").append(timeDisplay);\n intervalId = setInterval(count, 1000);\n }", "_updateTime() {\r\n // Determine what to append to time text content, and update time if required\r\n let append = \"\";\r\n if (this.levelNum <= MAX_LEVEL && !this.paused) {\r\n this.accumulatedTime += Date.now() - this.lastDate;\r\n }\r\n this.lastDate = Date.now();\r\n\r\n // Update the time value in the div\r\n let nowDate = new Date(this.accumulatedTime);\r\n let twoDigitFormat = new Intl.NumberFormat('en-US', {minimumIntegerDigits: 2});\r\n if (nowDate.getHours() - this.startHours > 0) {\r\n this.timerDisplay.textContent = `Time: ${nowDate.getHours() - this.startHours}:`+\r\n `${twoDigitFormat.format(nowDate.getMinutes())}:` +\r\n `${twoDigitFormat.format(nowDate.getSeconds())}${append}`;\r\n }\r\n else {\r\n this.timerDisplay.textContent = `Time: ${twoDigitFormat.format(nowDate.getMinutes())}:` +\r\n `${twoDigitFormat.format(nowDate.getSeconds())}${append}`;\r\n }\r\n }", "function fn() {\r\n let hours = Number.parseInt(counter / 3600);//\"Number.parseInt\" string ko no. mai convert kardega\r\n let RemSeconds = counter % 3600;\r\n let mins = Number.parseInt(RemSeconds / 60);\r\n let seconds = RemSeconds % 60;\r\n hours = hours < 10 ? `0${hours}` : hours;\r\n mins = mins < 10 ? `0${mins}` : mins;\r\n seconds = seconds < 10 ? `0${seconds}` : seconds;\r\n\r\n timings.innerText = `${hours}:${mins}:${seconds}`;\r\n counter++;\r\n }", "function timerTick() {\r\n\t\ttime++;\r\n\t\ttimerDiv.html(time);\r\n\t}", "function countdown(){\n \n \n $(\"#timer\").html(timer);\n //Sets a delay of one second before the timer starts\n // time = setInterval(showCountdown, 1000);\n // Shows the countdown function. IT WORKS.\n showCountdown();\n \n }", "function countdown() {\n timer.textContent = timeLeft;\n if (timeLeft > 0) {\n timeLeft--;\n }\n if (timeLeft === 0) {\n clearInterval(intervalId);\n }\n}", "function timer() {\n time--;\n if(time !== 0){\t\n document.getElementById(\"timer\").innerHTML = time + \" secondes restantes\";\n }\t\n}", "function changeTime ( time, logout ) {\r\n __TIMER = time;\r\n __EXITM = logout;\r\n document.getElementsByClassName('toptime')[0].innerHTML = '</a> <div class=\"toptime\">Time remaining: <span>' + __TIMER + '</span> <a href=\"/logout\">[' + __EXITM + ']</a></div>';\r\n}", "function timeDemerit() {\n if (secondsLeft > 10) {\n secondsLeft -= 10;\n } else {\n secondsLeft = 1;\n }\n}", "function userInterfaceCountdown() {\n // time--;\n $(\"#countitdown\").html(time + \" \" + \"Seconds\");\n if(time > 0) {\n time--;\n } else {\n // clearInterval(userInterfaceCountdown);\n $(\"#duringgame\").hide();\n $(\"#gameover\").show();\n gameFinished();\n }\n}", "function timeGo(){\n\t\t\tvar dateNow=new Date();\n\t\t\tvar arr=adddate(dateNow,dateEnd);\n\t\t\tfor (var i=0;i<arr.length;i++) {\n\t\t\t\tarr[i] = arr[i] < 10 ? '0'+arr[i]:arr[i];\n\t\t\t}\n\t\t\t\n\t\t\tvar txt=arr[0]+\"天\"+arr[1]+\"小时\"+arr[2]+\"分\"+arr[3]+\"秒\";\n\t\t\t$('.timeRest b').text(txt);\n\t\t\t\n\t\t\tif(dateNow.getTime() >= dateEnd.getTime()){\n\t\t\t\tclearInterval(iCount);\n\t\t\t\tarr = [00,00,00,00];\n\t\t\t\t$('.timeRest').html(\"<p>众筹已结束</p><p>十月遵义不见不散</p>\").css(\"color\",\"red\").css(\"font-weight\",\"bolder\");\n\t\t\t}\n\t\t}", "function count(){\n \ttime--;\n \t$('#display').html('<h3>Time Remaining: ' + time + ' seconds</h3>');\n \tif (time === 0) {\n \t\tstop();\n \t\treset();\n \t\tdisplayscore();\n \t}\n }", "function displayTimeLeft(seconds) {\n\t// Calculate hours, minutes and seconds\n\n\tlet hours = Math.floor(seconds / 3600);\n\tlet leftoverSeconds = seconds % 3600;\n\tlet minutes = Math.floor(leftoverSeconds / 60);\n\tleftoverSeconds = seconds % 60;\n\n\t// Make adjustments to display 2 digits \n\tif (leftoverSeconds < 10) {\n\t\tleftoverSeconds = `0${leftoverSeconds}`;\n\t}\n\n\tconst adjustedMinutes = minutes < 10 ? `0${minutes}` : `${minutes}`;\n\n\tif (hours >= 0 && hours < 10) {\n\t\thours = `0${hours}`\n\t}\n\n\t// Set doc title and countdown to display values \n\n\tconst display = `${hours}:${adjustedMinutes}:${leftoverSeconds}`;\n\tdocument.title = display;\n\ttimerDisplay.textContent = display;\n}", "function displayTimer() {\n let clock = $('.timer').text(time);\n\tlet mins = Math.floor(time / 60);\n\tlet secs = time % 60;\n\tif(secs < 10) {\n\t\tclock.text(`${mins}:0${secs}`);\n\t\t} else {\n\t\t\tclock.text(`${mins}:${secs}`);\n\t\t}\n}", "function countdownTimer() {\r\n setInterval(() => {\r\n roundComplete.play();\r\n swal(\"TIME IS UP\");\r\n }, 60000);\r\n}", "timing() {\n const newTimeDisplayed = this.switchSession();\n\n if (newTimeDisplayed.sec === 0) {\n newTimeDisplayed.sec = 60;\n newTimeDisplayed.min -= 1;\n }\n\n newTimeDisplayed.sec -= 1;\n this.setState({ timeDisplayed: newTimeDisplayed, countdown: true });\n }", "function getTime() {\n\tOutput('<span>It\\'s the 21st century man! Get a SmartWatch</span></br>');\n}", "function decrementQuestionTime() {\n\tquestionTime--;\n\tif (questionTime === 0) {\n\t\tisQuestionTimeout = true;\n\t}\n\telse {\n\t\tstrH4 = \"\";\n\t\tstrH4 = \"<h4 id=\\\"time-remaining\\\">Time Remaining: \" + questionTime + \" Seconds</h4>\";\n\t\t$(\"#time-remaining\").html(strH4);\n\t}\n}", "function countdown() {\n\ttime--;\n $(\".timer\").html(\"Time Left: \" + time);\n if (time === 0) {\n clearInterval(intervalId);\n noAnswer();\n }\n }" ]
[ "0.7420303", "0.71929115", "0.70546097", "0.69996226", "0.6976374", "0.6950918", "0.6945093", "0.6835363", "0.6823945", "0.6818996", "0.6782317", "0.67627025", "0.6715363", "0.6680051", "0.667312", "0.66572106", "0.6640387", "0.6617218", "0.6613649", "0.6613233", "0.66110957", "0.658974", "0.65849274", "0.65789056", "0.65545124", "0.65365374", "0.6534696", "0.65293676", "0.6527667", "0.6519818", "0.6509659", "0.65080535", "0.65033793", "0.6501059", "0.64983547", "0.64953715", "0.6491996", "0.6490876", "0.64782536", "0.64747906", "0.6472332", "0.64696044", "0.64654875", "0.6462066", "0.64605427", "0.6458784", "0.64549345", "0.6452914", "0.64505535", "0.6446191", "0.64446133", "0.6436454", "0.6433979", "0.6421499", "0.64183766", "0.641429", "0.641429", "0.641429", "0.6409934", "0.64090705", "0.6405082", "0.6396276", "0.6393082", "0.6383566", "0.63809717", "0.6380565", "0.6378623", "0.63765913", "0.637626", "0.63750607", "0.637352", "0.6364093", "0.6363917", "0.636236", "0.6362319", "0.63591415", "0.63566285", "0.6355768", "0.63552487", "0.6353895", "0.635027", "0.63479584", "0.63346416", "0.63266575", "0.63212764", "0.6320956", "0.63204336", "0.6315809", "0.63143945", "0.63141954", "0.6310793", "0.6310445", "0.6309252", "0.6304189", "0.63021785", "0.62928677", "0.6290906", "0.62872666", "0.62838626", "0.62804174" ]
0.78963125
0
restore visiblity style settings if cached and class
function restoreToggle(id) { var value; value = GM_getValue("setting:hidden:"+id, 0); // logTrace(id + ":" +value); if (value) { $("#"+id).hide(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function restoreAppearance()\n {\n this.style.color = \"black\";\n this.style.border = \"2px solid black\";\n \n }", "restoreDefaultVisibility(){\n\t\t\tthis.properties.forEach(function(entry){\n\t\t\t\tvar isVisible = ( isNone(entry['hidden']) || !entry['hidden'] ) ? true : false;\n\t\t\t\tset(entry, 'isVisible', isVisible);\n\t\t\t});\n\t\t}", "resetStyles () {\n\t\tthis.selection\n\t\t\t.attr('data-rel', '')\n\t\t\t.attr('data-hidden', '')\n\t}", "function resetStyles() {\r\n $scope.showForm = true\r\n $scope.showLogo = false\r\n $scope.logo.class = ''\r\n $scope.status = ''\r\n }", "function configureStyles(){\n var _ = nvd3Utils.deepExtend(defaultStyles(), scope.options['styles'] || {});\n\n if (scope._config.extended) scope.options['styles'] = _;\n\n angular.forEach(_.classes, function(value, key){\n value ? element.addClass(key) : element.removeClass(key);\n });\n\n element.removeAttr('style').css(_.css);\n }", "function configureStyles(){\n var _ = nvd3Utils.deepExtend(defaultStyles(), scope.options['styles'] || {});\n\n if (scope._config.extended) scope.options['styles'] = _;\n\n angular.forEach(_.classes, function(value, key){\n value ? element.addClass(key) : element.removeClass(key);\n });\n\n element.removeAttr('style').css(_.css);\n }", "function configureStyles(){\n\t var _ = nvd3Utils.deepExtend(defaultStyles(), scope.options['styles'] || {});\n\n\t if (scope._config.extended) scope.options['styles'] = _;\n\n\t angular.forEach(_.classes, function(value, key){\n\t value ? element.addClass(key) : element.removeClass(key);\n\t });\n\n\t element.removeAttr('style').css(_.css);\n\t }", "function restore() {\n\tthis.className = 'regular';\n}", "function StylingState() { }", "function StylingState() {}", "setInactiveStyles() {\n if (this._active) {\n this._active = false;\n this._changeDetectorRef.markForCheck();\n }\n }", "setInactiveStyles() {\n if (this._active) {\n this._active = false;\n this._changeDetectorRef.markForCheck();\n }\n }", "setInactiveStyles() {\n if (this._active) {\n this._active = false;\n this._changeDetectorRef.markForCheck();\n }\n }", "setInactiveStyles() {\n if (this._active) {\n this._active = false;\n this._changeDetectorRef.markForCheck();\n }\n }", "function changeStylesTuT() {\n document.querySelector(\".classNames\").classList.remove(\"hidden\");\n\n // document.querySelector(\".classname\").style.color = \"black\";\n // document.querySelector(\".classname\").style.backgroundColor = \"yellow\";\n // change multipöe in one line:\n // document.querySelector(\".classname\").style.cssText = \"background-color: orange; color: dark blue;\";\n document.querySelector(\".classname\").setAttribute(\"style\",\"background-color: black; color: white;\");\n \n }", "function StylingState(){}", "function resetOldStyles() {\n if (lastElem) {\n setStyleList(lastElem, lastElemStyle);\n lastElem = null;\n lastElemStyle = null;\n }\n}", "function switchcss(cls) {\n $('.Switcher').css({ 'background-color': cls });\n localStorage.setItem(\"CSS\", cls);\n }", "reset() {\n Utils.deepCopyProperties(this, defaultStyle, defaultStyle);\n }", "function styleUpdate(){\n hide('.intro');\n show('.mode');\n\n $('body').removeClass('initial');\n $('body').addClass('light-body');\n\n $('.container').addClass('light');\n}", "function resetCss() {\n\t\tif (element) {\n\t\t\telement.className = Command.css.base + \" \" + definition.css;\n\t\t}\n\t}", "reset() {\n UtilsSettings_1.UtilsSettings.deepCopyProperties(this, TextSettings_1.TextSettings.defaultStyle, TextSettings_1.TextSettings.defaultStyle);\n }", "changeVisibility() {\n super.changeVisibility();\n this.overlay.classList.toggle(\"hidden\");\n this.appWrapper.classList.toggle(\"blur\");\n this.appHeader.classList.toggle(\"blur\");\n this.menuView.classList.toggle(\"blur\");\n this.menuView.classList.toggle(\"disable\");\n }", "function clearStyleAttribute() {\r\n closeAllMenus();\r\n $(\".common-mobile-menu\").removeAttr(\"style\");\r\n $(\".footer-list-menu\").removeAttr(\"style\");\r\n}", "function reapplyStyle()\n\t{\n//\t\tvar script = \"select all;\" +\n//\t\t _styleScripts[style];\n\t\t// regenerate visual style script\n\t\tvar script = _scriptGen.generateVisualStyleScript(_selection, _chain, _options);\n\n\t\t// regenerate highlight script\n\t\tscript = script.concat(generateHighlightScript(_highlighted));\n\n\t\t// convert array to a single string\n\t\tscript = script.join(\" \");\n\t\t_3dApp.script(script);\n\t}", "_resetOverlayElementStyles() {\n extendStyles(this._pane.style, {\n top: '',\n left: '',\n bottom: '',\n right: '',\n position: '',\n transform: '',\n });\n }", "initializeStyles() {\n if (!!sessionStorage.getItem('saved_style') && sessionStorage.getItem('saved_style') == 1) {\n for (let i=0; i<sessionStorage.length; i++) {\n const key = sessionStorage.key(i);\n if (key.startsWith('styles.')) {\n $('#'+key.substr(7)).val(sessionStorage.getItem(key));\n }\n }\n }\n\n /* Set Default Value and Placeholder of Chart Title and Axis Label */\n const chartType = sessionStorage.getItem('chart-type');\n\n const chartTitle = sessionStorage.getItem('chart-title');\n $('.chart-style-wrapper #chart-title').val(chartTitle);\n $('.chart-style-wrapper #chart-title').attr('placeholder', chartTitle);\n\n const chartAxisLabel = sessionStorage.getItem('chart-axis-label');\n const selectorValidAxis = '.chart-style-wrapper #'+(chartType=='bar' ? 'x' : 'y')+'-axis-label';\n $(selectorValidAxis).val(chartAxisLabel);\n $(selectorValidAxis).attr('placeholder', chartAxisLabel);\n $('.chart-style-wrapper #'+(chartType=='bar' ? 'y' : 'x')+'-axis-label').val('');\n\n /* Set the switch of black and white */\n $('#dataset_black_and_white').prop('checked', sessionStorage.getItem('switch.bw')===\"true\");\n\n if (chartType==\"pie\") {\n $('.no-pie').hide();\n } else {\n $('.no-pie').show();\n }\n }", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n add_rmp_links: true,\n highlight_easy_classes: true,\n hide_full_classes: false\n }, function(items) {\n document.getElementById('add_rmp_links').checked = items.add_rmp_links;\n document.getElementById('highlight_easy_classes').checked = items.highlight_easy_classes;\n document.getElementById('hide_full_classes').checked = items.hide_full_classes;\n });\n }", "_getVisibleStyle() {\n var invisible = this.props.invisible;\n if(invisible) {\n return 'hide';\n }\n return '';\n }", "function swapStyle() {\n changeStyle = localStorage.getItem('nightmode');\n if (changeStyle === 'true'){\n changeStyle = localStorage.setItem('nightmode', 'false');\n } else {\n changeStyle = localStorage.setItem('nightmode', 'true');\n }\n loadStyle();\n \n}", "function updateSettings(){\n document.documentElement.style.setProperty(`--accent`, settings.accentColor);\n document.documentElement.style.setProperty(`--bg-color`, settings.bgColor );\n if(settings.bgHidden == 'false'){\n document.documentElement.style.setProperty(`--bg-image`, `url(${settings.bgImage})` );\n }else{\n document.documentElement.style.setProperty(`--bg-image`, `url('')` );\n\n }\n\n}", "_restoreFromMinimization() {\n const that = this;\n\n that.minimized = false;\n that.style.width = that.style.height = that.style.top = that.style.left = '';\n\n //Re-arrange the rest of the minimized windows\n that._refreshMinimizedWindowsPosition();\n }", "function removeClonesStyle() {\n $('[class*=\"clone-\"]').removeAttr(\"style\");\n $('[class*=\"area-\"]').removeAttr(\"style\");\n $('.cl-middle, .cl-bottom').removeAttr(\"style\");\n }", "getStyleSnapshot() {\n const _styles = this.cy.data('_styles') || {};\n return _.cloneDeep(_styles);\n }", "_restoreNodeVisibility(domNode, oldVisibility) {\n if (domNode.style) {\n domNode.style.display = oldVisibility.visibility;\n }\n let j = 0;\n for (let i = 0; i < domNode.childNodes.length; i++) {\n if (j < oldVisibility.children.length) {\n let node = domNode.children.item(i);\n if (node instanceof HTMLElement) {\n this._restoreNodeVisibility(node, oldVisibility.children[j++]);\n }\n }\n }\n }", "function vizToggleCleanup(){\n setRangeSliderThumbOpacity();\n layerObj[id].visible = layer.visible;\n layerObj[id].opacity = layer.opacity;\n }", "resetSettings() {\n\t\tthis.setState( { loading: true } );\n\n\t\tthis.state.api.post( 'minify_reset_settings' ).then( () => {\n\t\t\tWPHB_Admin.notices.show( __( 'Settings restored to defaults' ) );\n\t\t\tthis.setState( {\n\t\t\t\tassets: {\n\t\t\t\t\tstyles: {},\n\t\t\t\t\tscripts: {},\n\t\t\t\t},\n\t\t\t\tenabled: {\n\t\t\t\t\tstyles: true,\n\t\t\t\t\tscripts: true,\n\t\t\t\t},\n\t\t\t\texclusions: {\n\t\t\t\t\tstyles: {},\n\t\t\t\t\tscripts: {},\n\t\t\t\t},\n\t\t\t\tloading: false,\n\t\t\t} );\n\t\t} );\n\t}", "resetCSSValues() {\n this.getCSSValues();\n $('.pcm-collectButton').html(this.collectText); $('.pcm-hamButton').html(this.goHamText);\n $('.pcm-detailsButton').html(this.detailsText); $('.pcm-deleteButton').html(this.deleteText);\n $('.pcm-hitAccepted').html(this.acceptedStatusText); $('.pcm-hitFetched').html(this.fetchedStatusTextDef);\n $('.pcm-hitSearchFound').html(this.foundStatusTextDef);\n }", "function clearDarkenenedState() {\n var selected = svgDoc.getElementsByClassName('bordered');\n if (selected.length > 0) {\n var className = selected[0].getAttribute('class').replace('bordered','').trim();\n selected[0].setAttribute('class', className);\n }\n }", "applyTheme() {\n if (this.disabled) return this.clearCss();\n this.css = this.generatedStyles;\n }", "applyTheme() {\n if (this.disabled) return this.clearCss();\n this.css = this.generatedStyles;\n }", "applyTheme() {\n if (this.disabled) return this.clearCss();\n this.css = this.generatedStyles;\n }", "applyTheme() {\n if (this.disabled) return this.clearCss();\n this.css = this.generatedStyles;\n }", "applyTheme() {\n if (this.disabled) return this.clearCss();\n this.css = this.generatedStyles;\n }", "function changeSiteStyle() {\n $('.then_button').click(function() {\n $('#pagestyle').attr('href', 'css/css/style_then.css').attr('class', 'test-then');\n $('form').show();\n $('.swap-style').children().removeClass();\n // $(this).prop('disabled', true);\n // $('.now_button').prop('disabled', false);\n\n buttonStyle();\n })\n $('.now_button').click(function() {\n $('#pagestyle').attr('href', 'css/css/style_now.css').removeClass().attr('class', 'test-now');\n $('.footer-now').css('display', 'flex');\n $('.swap-click-800').css('display', 'none'); \n // $(this).prop('disabled', true);\n // $('.then_button').prop('disabled', false);\n\n buttonStyle();\n checkWidth();\n\n });\n }", "if (window.scCGSHMRCache[this.state.styledComponentId] === 0) {\n this.state.globalStyle.removeStyles(this.styleSheet);\n }", "function defaultStyles(){\n return {\n classes: {\n 'with-3d-shadow': true,\n 'with-transitions': true,\n 'gallery': false\n },\n css: {}\n };\n }", "function defaultStyles(){\n return {\n classes: {\n 'with-3d-shadow': true,\n 'with-transitions': true,\n 'gallery': false\n },\n css: {}\n };\n }", "_onVisibilityChange () {\n if (document[this._visibilityHidden]) { this._savePlayingTweens() }\n else { this._restorePlayingTweens(); }\n }", "static resetStyle(layer){\n layer.feature.properties.selected = false\n layer.unbindPopup();\n layer.setStyle({\n \"weight\": 1,\n \"color\": \"#000\",\n \"opacity\": 0.7,\n \"fillColor\": \"#fff\",\n \"fillOpacity\": 0.3\n });\n }", "function changePageStyle() {\r\n newWordButton.style.visibility = 'visible';\r\n actionText.style.visibility = 'visible';\r\n mainContainer.style.opacity = '0.2';\r\n allInputs.prop('disabled', true);\r\n }", "function holderThemeChanger() {\n setAppearanceDisplay(!appearanceDisplay)\n setProfileDisplay(!profileDisplay)\n }", "function visualshowStyle(){\n showStyle = true;\n showTransition = false; \n chooseMusic = false; \n chooseStyle = false; \n button9.hide();\n button4.hide();\n}", "function setStyles() {\n\t\t_.each(_.keys(site.styles), function(classKey) {\n\t\t\tvar cssClass = site.styles[classKey];\n\t\t\t_.each(_.keys(cssClass), function(styleKey) {\n\t\t\t\tsetStyle(classKey, styleKey, cssClass[styleKey]);\n\t\t\t});\n\t\t});\n\t}", "useStyle() {\n let index = Math.max(0, this.sums_.index - 1);\n index = Math.min(this.styles_.length - 1, index);\n const style = this.styles_[index];\n this.url_ = style['url'];\n this.height_ = style['height'];\n this.width_ = style['width'];\n this.textColor_ = style['textColor'];\n this.anchor_ = style['anchor'];\n this.textSize_ = style['textSize'];\n this.backgroundPosition_ = style['backgroundPosition'];\n }", "function toggleStyle(classe,style){\n //Si le style cliquer est celui qui est deplie\n //alert(classe+\" \"+style+\" \"+mapFile.currentStyle);\n if(style==currentStyle){\n //On verifie qu'il est pas modifie\n oLayer=mapFile.getLayer(currentLayer);\n oStyle=oLayer.getClass(classe).getStyle(currentStyle);\n hideStyle(oStyle);\n }else{\n var oLayer=mapFile.getLayer(currentLayer);\n if(currentStyle!=null){\n oStyle=oLayer.getClass(classe).getStyle(currentStyle);\n hideStyle(oStyle);\n }\n expandStyle(oLayer,classe,style);\n }\n}", "function changeElementCss () {\n\t\t\t// console.log(element);style.display\n\t\t\telement.style.color = color;\n\t\t\telement.style.visibility = 'visible';\n\t\t\tconsole.dir(element);\n\t\t}", "reset(){\n this.cySyncher.resetStyle();\n }", "function changePreviewStyle(style) {\n\t\t$(\"#StylePreview #UIToolbarContainer\").attr('class',\n\t\t\t\t\"UIContainer UIToolbarContainer UIToolbarContainer\" + style);\n\t}", "function registerRestorableStyles(backup, node, properties) {\n\t forEach(properties, function (prop) {\n\t backup[prop] = isDefined(backup[prop]) ? backup[prop] : node.style.getPropertyValue(prop);\n\t });\n\t }", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n scrollTime: 3500,\n animationTime: 800\n }, function(items) {\n document.getElementById('scroll-time').value = items.scrollTime;\n document.getElementById('animation-time').value = items.animationTime;\n });\n}", "function showSettings() {\n settingsContainer.classList.remove('hidden');\n}", "static switchStyle (styleSheet, styleButton) {\n\t\tstyleSheet.href = styleButton.options[styleButton.selectedIndex].value;\n\t\tlet stylez = JSON.stringify({ buttonValue: styleButton.value, stylePath: styleSheet.href });\n\t\tlocalStorage.setItem(\"stylez\", stylez);\n\t}", "useCurrentStyle() {\n return me.currentStyle;\n }", "restoreElement(element) {\n if (!element) return;\n // FIX: it has to remember the previous values\n element.style.zIndex = 0;\n element.style.position = 'static';\n }", "resetCSSValues() {\n let elements = (MyPandaUI !== null) ? '.pcm-pandaTop .pcm-btn-menu, .pcm-quickMenu .pcm-btn-menu' : '.pcm-searchTop .pcm-btn-menu';\n $(elements).each( (_s, ele) => {\n let theId = $(ele).attr('id'), label = $(ele).data('label');\n if (theId) { let cssVar = getCSSVar(theId.replace('pcm-', ''), label); $(ele).html(cssVar); }\n });\n }", "function applyStandardVersion() {\n\t\t//hide avoid areas\n\t\t$('#avoidAreas').hide();\n\t\t\n\t\t//hide import/export features\n\t\t$('#exportImport').hide();\n\t\t\n\t\t//hide accessibility analysis\n\t\t$('#accessibilityAnalysis').hide();\n\t}", "_setPrevTheme() {\n GM_setValue('style_theme', this._theme);\n }", "function changeAppearance()\n {\n this.style.color = \"blue\";\n this.style.border = \"2px solid blue\";\n }", "get style(){ return this.__baseStyle; }", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n panel: true,\n remove: true,\n notify: true,\n restyle: true,\n console: false,\n console_deep: false,\n }, (items) => {\n for (let item in items) {\n document.getElementById(item).checked = items[item];\n }\n });\n}", "function restore_options() {\n // Use default value color = 'red' and likesColor = true.\n chrome.storage.sync.get({\n darkGithub: false,\n darkSemaphore: false,\n darkLogentries: false,\n darkThundertix: false,\n darkThunderstage: false,\n darkThunderlocal: false\n }, function(items) {\n document.getElementById('dark_github').checked = items.darkGithub;\n document.getElementById('dark_semaphore').checked = items.darkSemaphore;\n document.getElementById('dark_logentries').checked = items.darkLogentries;\n document.getElementById('dark_thundertix').checked = items.darkThundertix;\n document.getElementById('dark_thunderstage').checked = items.darkThunderstage;\n document.getElementById('dark_localthundertix').checked = items.darkThunderlocal;\n });\n}", "function setClasses (style) {\n d3.select('body')\n .classed('fixed ', style.fixed)\n .classed('invert-colors', style.invert_colors)\n .classed('transparent-text', style.transparent_text)\n\n d3.select('nav')\n .classed('lights-out', style.lights_out)\n}", "_onStyleChange() {\n this.dirty = true;\n }", "function turnOnInverseStyle(){\n if(currentColorSetting != \"Inverse\")\n {\n removeCurrentColorSetting();\n toggleInvertColor();\n currentColorSetting = \"Inverse\";\n toggleAriaButtonPress('#color-scheme-inverse');\n }\n}", "function resetStyleAttributes(vm) {\n const {\n context,\n elm\n } = vm; // Remove the style attribute currently applied to the host element.\n\n const oldHostAttribute = context.hostAttribute;\n\n if (!isUndefined(oldHostAttribute)) {\n removeAttribute.call(elm, oldHostAttribute);\n } // Reset the scoping attributes associated to the context.\n\n\n context.hostAttribute = context.shadowAttribute = undefined;\n }", "_resetStyleDomains() {}", "function darkReferenceStyles() {\r\n if (!GM_config.get('dark_reference_view') || !onReferencePage) {\r\n return;\r\n }\r\n // www.w3schools.com/colors/colors_picker.asp\r\n // background color\r\n addGlobalStyles('#nav-search-form {background: #d9d9d9}');\r\n addGlobalStyles('#wrapper, #pagecontent, .recently-viewed {background-color: #000000}');\r\n addGlobalStyles('.aux-content-widget-2 {background: #191919}');\r\n addGlobalStyles('#imdbscout_header, #imdbscoutsecondbar_header, #imdbscoutthirdbar_header, .article, .cast_list tr, .titlereference-list tr {background-color: #191919 !important}');\r\n addGlobalStyles('.add-image-container {background-color: #262626}');\r\n // border color\r\n addGlobalStyles('.article, .aux-content-widget-2, .cast_list tr, .titlereference-list tr, .recently-viewed .item {border-color: #323232 !important}');\r\n addGlobalStyles('hr, .answers-widget__question, .answers-widget__see-more {border-color: #666666}');\r\n addGlobalStyles('.recently-viewed {border-color: #000000}');\r\n // font color\r\n addGlobalStyles('h3[itemprop=\"name\"], .titlereference-title-year a {color: #f5c20a}');\r\n addGlobalStyles('.titlereference-original-title-label {color: #cc0000}');\r\n addGlobalStyles('.ipl-rating-star__rating {font-weight: bold; color: #00b300;}');\r\n addGlobalStyles('.article, .aux-content-widget-2, .cast_list tr td {color: #cccccc !important}');\r\n addGlobalStyles('.ipl-list-title, #sidebar h4, .ipl-list-title::after {color: #c49b08}');\r\n addGlobalStyles('.ipl-list-title::after {border-color: #7a6105}');\r\n}", "function defaultStyles(){\n\t return {\n\t classes: {\n\t 'with-3d-shadow': true,\n\t 'with-transitions': true,\n\t 'gallery': false\n\t },\n\t css: {}\n\t };\n\t }", "function registerRestorableStyles(backup, node, properties) {\n forEach(properties, function (prop) {\n backup[prop] = isDefined(backup[prop]) ? backup[prop] : node.style.getPropertyValue(prop);\n });\n }", "refreshStyles() {\n\t\tthis.styleElement.replaceChildren( document.createTextNode( this.getStyles() ) );\n\t}", "function hideSettings() {\n settingsContainer.classList.add('hidden');\n}", "_setLayerVisibility() {\n let layerVisibility = this.get('layerVisibility');\n if (this.get('visibility')) {\n this._visibilityOfLayerByZoom();\n } else if (!Ember.isNone(layerVisibility)) {\n layerVisibility.set('visibility', false);\n this.set('layerVisibility', null);\n }\n }", "function setStyle(){\r\n\tif(clickNumber % 2 == 0){\r\n\t\tconsole.log('This is an even click -> black!')\t\t\r\n\t\t// Layer colors\r\n\t\tcurrentLayer.styleMap = b_style;\r\n\t\toldLayer.styleMap = w_style;\r\n\t\t// Chart colors\r\n\t\tcol1 = '#DBD8D8';\t\t\t// white\r\n\t\tcol2 = '#363434';\t\t\t// black - also tried this #808080\r\n\t\tcol1_borderColor = '#7B7B7B';\r\n\t\tcol2_borderColor = '#BDBDBD';\r\n\t}\r\n\telse{\r\n\t\tconsole.log('This is an odd click -> white!')\t\t\t\t\r\n\t\t// Layer colors\r\n\t\tcurrentLayer.styleMap = w_style;\r\n\t\toldLayer.styleMap = b_style;\t\t\r\n\t\t// Chart colors\r\n\t\tcol1 = '#363434';\t\t\t// black\t\r\n\t\tcol2 = '#DBD8D8';\t\t\t// white\r\n\t\tcol1_borderColor = '#BDBDBD';\r\n\t\tcol2_borderColor = '#7B7B7B';\r\n\t}\r\n}", "function refuseStyle(refStyle) {\n var selectedTag = getSelectedNode(); // the selected node\n\n // if the selected node have attribute of \"style\" and it have unwanted style\n if (selectedTag && selectedTag.is(\"[style]\") && selectedTag.css(refStyle) != \"\") {\n var refValue = selectedTag.css(refStyle); // first get key of unwanted style\n\n selectedTag.css(refStyle, \"\"); // clear unwanted style\n\n var cleanStyle = selectedTag.attr(\"style\"); // cleaned style\n\n selectedTag.css(refStyle, refValue); // add unwanted style to the selected node again\n\n return cleanStyle; // print cleaned style\n }\n else\n return \"\";\n }", "_updateStyles() {\n if (this.$element) {\n const cssText = createCssText(createDOMStyles(this.state, this.attributes));\n if (cssText !== this._lastCssText) {\n this.$element.style.cssText = cssText;\n this._lastCssText = cssText;\n }\n }\n }", "static getStyles(){return this.styles;}", "function removePreSerializedStylesWhenSelectingControls() {\n\t\t\tdom.bind(editor.getBody(), 'mouseup', function() {\n\t\t\t\tvar value, node = selection.getNode();\n\n\t\t\t\t// Moved styles to attributes on IMG eements\n\t\t\t\tif (node.nodeName == 'IMG') {\n\t\t\t\t\t// Convert style width to width attribute\n\t\t\t\t\tif ((value = dom.getStyle(node, 'width'))) {\n\t\t\t\t\t\tdom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, ''));\n\t\t\t\t\t\tdom.setStyle(node, 'width', '');\n\t\t\t\t\t}\n\n\t\t\t\t\t// Convert style height to height attribute\n\t\t\t\t\tif ((value = dom.getStyle(node, 'height'))) {\n\t\t\t\t\t\tdom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, ''));\n\t\t\t\t\t\tdom.setStyle(node, 'height', '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function removePreSerializedStylesWhenSelectingControls() {\n\t\t\tdom.bind(editor.getBody(), 'mouseup', function() {\n\t\t\t\tvar value, node = selection.getNode();\n\n\t\t\t\t// Moved styles to attributes on IMG eements\n\t\t\t\tif (node.nodeName == 'IMG') {\n\t\t\t\t\t// Convert style width to width attribute\n\t\t\t\t\tif ((value = dom.getStyle(node, 'width'))) {\n\t\t\t\t\t\tdom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, ''));\n\t\t\t\t\t\tdom.setStyle(node, 'width', '');\n\t\t\t\t\t}\n\n\t\t\t\t\t// Convert style height to height attribute\n\t\t\t\t\tif ((value = dom.getStyle(node, 'height'))) {\n\t\t\t\t\t\tdom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, ''));\n\t\t\t\t\t\tdom.setStyle(node, 'height', '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function removePreSerializedStylesWhenSelectingControls() {\n\t\t\tdom.bind(editor.getBody(), 'mouseup', function() {\n\t\t\t\tvar value, node = selection.getNode();\n\n\t\t\t\t// Moved styles to attributes on IMG eements\n\t\t\t\tif (node.nodeName == 'IMG') {\n\t\t\t\t\t// Convert style width to width attribute\n\t\t\t\t\tif ((value = dom.getStyle(node, 'width'))) {\n\t\t\t\t\t\tdom.setAttrib(node, 'width', value.replace(/[^0-9%]+/g, ''));\n\t\t\t\t\t\tdom.setStyle(node, 'width', '');\n\t\t\t\t\t}\n\n\t\t\t\t\t// Convert style height to height attribute\n\t\t\t\t\tif ((value = dom.getStyle(node, 'height'))) {\n\t\t\t\t\t\tdom.setAttrib(node, 'height', value.replace(/[^0-9%]+/g, ''));\n\t\t\t\t\t\tdom.setStyle(node, 'height', '');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function menu_standard() {\n\t$('#menu').removeClass('menu_reverse');\n\t$('.ico_home').removeClass('ico_home_reverse');\n\t$('.menu_child:not(.ico_home)').css('visibility', 'visible');\n}", "function setLayout(currentLocalStorageLayout) {\n var navLinkStyle = $('.nav-link-style'),\n currentLayout = getCurrentLayout(),\n mainMenu = $('.main-menu'),\n navbar = $('.header-navbar'),\n // Witch to local storage layout if we have else current layout\n switchToLayout = currentLocalStorageLayout ? currentLocalStorageLayout : currentLayout;\n $html.removeClass('semi-dark-layout dark-layout bordered-layout');\n\n if (switchToLayout === 'dark-layout') {\n $html.addClass('dark-layout');\n mainMenu.removeClass('menu-light').addClass('menu-dark');\n navbar.removeClass('navbar-light').addClass('navbar-dark');\n navLinkStyle.find('.ficon').replaceWith(feather.icons['sun'].toSvg({\n \"class\": 'ficon'\n }));\n } else if (switchToLayout === 'bordered-layout') {\n $html.addClass('bordered-layout');\n mainMenu.removeClass('menu-dark').addClass('menu-light');\n navbar.removeClass('navbar-dark').addClass('navbar-light');\n navLinkStyle.find('.ficon').replaceWith(feather.icons['moon'].toSvg({\n \"class\": 'ficon'\n }));\n } else if (switchToLayout === 'semi-dark-layout') {\n $html.addClass('semi-dark-layout');\n mainMenu.removeClass('menu-dark').addClass('menu-light');\n navbar.removeClass('navbar-dark').addClass('navbar-light');\n navLinkStyle.find('.ficon').replaceWith(feather.icons['moon'].toSvg({\n \"class\": 'ficon'\n }));\n } else {\n $html.addClass('light-layout');\n mainMenu.removeClass('menu-dark').addClass('menu-light');\n navbar.removeClass('navbar-dark').addClass('navbar-light');\n navLinkStyle.find('.ficon').replaceWith(feather.icons['moon'].toSvg({\n \"class\": 'ficon'\n }));\n } // Set radio in customizer if we have\n\n\n if ($('input:radio[data-layout=' + switchToLayout + ']').length > 0) {\n setTimeout(function () {\n $('input:radio[data-layout=' + switchToLayout + ']').prop('checked', true);\n });\n }\n }", "function remColor() {\n var span = document.getElementsByClassName(\"color-span\");\n span[IndexRunner].removeAttribute(\"style\");\n}", "function changeVisibility() {\n magic.style.visibility = 'hidden';\n magic.style.display = 'block;';\n}", "function saveStyles() {\n var styleAttr = $html.attr('style'),\n styleStrs = [],\n styleHash = {};\n\n if (!styleAttr) {\n return;\n }\n\n styleStrs = styleAttr.split(/;\\s/);\n $.each(styleStrs, function serializeStyleProp(styleString) {\n if (!styleString) {\n return;\n }\n\n var keyValue = styleString.split(/\\s:\\s/);\n\n if (keyValue.length < 2) {\n return;\n }\n\n styleHash[keyValue[0]] = keyValue[1];\n });\n $.extend(prevStyles, styleHash);\n }", "setDescendentCssGridStyles_() {\n const elementsToUpgradeStyles = scopedQuerySelectorAll(\n this.element,\n SUPPORTED_CSS_GRID_ATTRIBUTES_SELECTOR\n );\n\n Array.prototype.forEach.call(elementsToUpgradeStyles, (element) => {\n this.setCssGridStyles_(element);\n });\n }", "applyLayoutVisibility() {\n const { visible } = this;\n const { mbMap } = this.mapboxLayer;\n\n if (!mbMap) {\n return;\n }\n\n const style = mbMap.getStyle();\n\n if (!style) {\n return;\n }\n\n if (this.styleLayersFilter) {\n const visibilityValue = visible ? 'visible' : 'none';\n for (let i = 0; i < style.layers.length; i += 1) {\n const styleLayer = style.layers[i];\n if (this.styleLayersFilter(styleLayer)) {\n if (mbMap.getLayer(styleLayer.id)) {\n mbMap.setLayoutProperty(\n styleLayer.id,\n 'visibility',\n visibilityValue,\n );\n }\n }\n }\n }\n }", "get styleRadio() { return Object.assign({}, this.style.common); }", "function saveStyles() {\n\t\t\tvar styleAttr = $html.attr( 'style' ),\n\t\t\t\tstyleStrs = [],\n\t\t\t\tstyleHash = {};\n\t\n\t\t\tif( !styleAttr ){\n\t\t\t\treturn;\n\t\t\t}\n\t\n\t\t\tstyleStrs = styleAttr.split( /;\\s/ );\n\t\n\t\t\t$.each( styleStrs, function serializeStyleProp( styleString ){\n\t\t\t\tif( !styleString ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\tvar keyValue = styleString.split( /\\s:\\s/ );\n\t\n\t\t\t\tif( keyValue.length < 2 ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\n\t\t\t\tstyleHash[ keyValue[ 0 ] ] = keyValue[ 1 ];\n\t\t\t} );\n\t\n\t\t\t$.extend( prevStyles, styleHash );\n\t\t}", "setNormalLabelStyle(style) {\n this._.normalLabelStyle = clone(style);\n if (this._.labelSet.size > 0) {\n for (const label of this._.labelSet) {\n if (label === this._.selectedLabel || label.minimized) continue;\n this.unhighlightLabel(label);\n }\n this.animateForAWhile();\n }\n }", "function alternaReinicia(tipoDisplay) {\n $reiniciaDom.css({\n display: tipoDisplay\n });\n\n }" ]
[ "0.6772449", "0.64971673", "0.63446516", "0.63246584", "0.63173926", "0.63173926", "0.6295325", "0.62056214", "0.6165277", "0.61460143", "0.60404474", "0.60404474", "0.60404474", "0.60404474", "0.603744", "0.6021813", "0.5941101", "0.59381515", "0.5912644", "0.5905503", "0.5851672", "0.5814457", "0.579702", "0.5796979", "0.5778973", "0.57779825", "0.57485896", "0.5735308", "0.5727664", "0.56996566", "0.56987995", "0.5686226", "0.56852484", "0.5668607", "0.5644635", "0.56250024", "0.5612845", "0.5600764", "0.55983794", "0.5586948", "0.5586948", "0.5586948", "0.5586948", "0.5586948", "0.55733883", "0.5562484", "0.55431587", "0.55431587", "0.5524009", "0.5522819", "0.5522571", "0.551651", "0.5510787", "0.54965055", "0.5492554", "0.54821175", "0.54776114", "0.5474853", "0.54669815", "0.54526234", "0.5449768", "0.5445739", "0.54393214", "0.543306", "0.54286563", "0.5423993", "0.5422364", "0.5421898", "0.54126793", "0.5404947", "0.54035467", "0.5403493", "0.5400791", "0.53956586", "0.53878325", "0.5383712", "0.53805065", "0.53783166", "0.5374691", "0.5374576", "0.5358647", "0.53566474", "0.5353498", "0.535347", "0.533889", "0.5336165", "0.53259057", "0.53206384", "0.53206384", "0.53206384", "0.53194946", "0.5316918", "0.53127", "0.5312047", "0.53117377", "0.5311109", "0.5308585", "0.5306975", "0.53069246", "0.53022826", "0.529854" ]
0.0
-1
ae data parsing functions
function matchFirstPos(string, re) { if (string == null || re == null) { return null; } var m = string.match(re); if (m != null && m.length > 0) { return m[1]; } else { return null; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "_parseAPIData(data) {\n\t throw new Error('_parseAPIData should not be called on base view');\n\t }", "function parseData( linkStr ) {\n\t\t\tthis.dataid = linkStr.substring(0, 5);\n\t\t\tif( this.dataid == \"/issu\" ) {\n\t\t\t\tthis.is_issued = false;\n\t\t\t\tthis.dataid = \"00000\";\n\t\t\t\tthis.issueid = \"00000000\";\n\t\t\t\tthis.year = \"0000\";\n\t\t\t\tthis.month = \"00\";\n\t\t\t\tthis.day = \"00\";\n\t\t\t\tthis.weekday = \"0\";\n\t\t\t} else {\n\t\t\t\tthis.is_issued = true;\n\t\t\t\tthis.issueid = linkStr.substring(14, 22);\n\t\t\t\tthis.year = linkStr.substring(14, 18);\n\t\t\t\tthis.month = linkStr.substring(18, 20);\n\t\t\t\tthis.day = linkStr.substring(20, 22);\n\t\t\t\tthis.weekday = linkStr.substring(25, 26);\n\t\t\t}\n\t\t}", "function parseData(line) {\n\n console.log(Date.now() + \": \" + line);\n var a = line.split(\":\");\n\n if (a[0].indexOf(\"<data>\")!==-1) {\n obj = {};\n } \n else if (a[0].indexOf(\"</data>\")!==-1 && obj) {\n saveToRawTable(_.clone(obj));\n obj = undefined;\n }\n else if (obj && a[0] !== undefined && a[1] !== undefined) {\n obj[a[0].trim().toLowerCase()] = a[1].trim();\n }\n else{\n console.log(\"Received a line but the <data> separator was missing. Discarding.\")\n }\n}", "dataParser(data) {\n // Parser si on a des resultat uniquement\n if (data.results > 0) {\n this.ligueName = data.response[0].league.name;\n for (var i = 0; i < data.response[0].league.standings[0].length; i++) {\n this.standings[i] = data.response[0].league.standings[0][i];\n this.tabInt[i] = i;\n }\n }\n }", "parse( objdata )\r\n\t{\r\n\t\tvar lines = objdata.split('\\n');\r\n\t\tfor ( var i=0; i<lines.length; ++i ) \r\n\t\t{\r\n\t\t\tvar line = lines[i].trim();\r\n\t\t\tvar elem = line.split(/\\s+/);\r\n\t\t\tswitch ( elem[0][0] ) \r\n\t\t\t{\r\n\t\t\t\t// Vértices...\r\n\t\t\t\tcase 'v':\r\n\t\t\t\t\tswitch ( elem[0].length ) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t// Coordenadas de los vértices\r\n\t\t\t\t\t\tcase 1:\r\n\t\t\t\t\t\t\tthis.vpos.push( [ parseFloat(elem[1]), parseFloat(elem[2]), parseFloat(elem[3]) ] );\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 2:\r\n\t\t\t\t\t\t\tswitch ( elem[0][1] ) \r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// Coordenada de textura\r\n\t\t\t\t\t\t\t\tcase 't':\r\n\t\t\t\t\t\t\t\t\tthis.tpos.push( [ parseFloat(elem[1]), parseFloat(elem[2]) ] );\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\r\n\t\t\t\t\t\t\t\t// Normal\r\n\t\t\t\t\t\t\t\tcase 'n':\r\n\t\t\t\t\t\t\t\t\tthis.norm.push( [ parseFloat(elem[1]), parseFloat(elem[2]), parseFloat(elem[3]) ] );\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t// Caras...\r\n\t\t\t\tcase 'f':\r\n\t\t\t\t\tvar f=[], tf=[], nf=[];\r\n\t\t\t\t\tfor ( var j=1; j<elem.length; ++j ) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tvar ids = elem[j].split('/');\r\n\t\t\t\t\t\tvar vid = parseInt(ids[0]);\r\n\r\n\t\t\t\t\t\tif ( vid < 0 ) vid = this.vpos.length + vid + 1;\r\n\t\t\t\t\t\tf.push( vid - 1 );\r\n\r\n\t\t\t\t\t\tif ( ids.length > 1 && ids[1] !== \"\" ) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvar tid = parseInt(ids[1]);\r\n\t\t\t\t\t\t\tif ( tid < 0 ) tid = this.tpos.length + tid + 1;\r\n\t\t\t\t\t\t\ttf.push( tid - 1 );\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif ( ids.length > 2 && ids[2] !== \"\" ) \r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tvar nid = parseInt(ids[2]);\r\n\t\t\t\t\t\t\tif ( nid < 0 ) nid = this.norm.length + nid + 1;\r\n\t\t\t\t\t\t\tnf.push( nid - 1 );\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tthis.face.push(f);\r\n\t\t\t\t\tif ( tf.length ) this.tfac.push(tf);\r\n\t\t\t\t\tif ( nf.length ) this.nfac.push(nf);\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "function parseEmplData (str) {\n // let pattern = /^([A-Z][a-z]+) - ([\\d]+) - ([\\s\\w\\d_-]+?)$/gm;\n // let match = pattern.exec(str);\n // while (match){\n // console.log(`Name: ${match[1]}\\nPosition: ${match[2]}\\nSalary: ${match[3]}\\n`);\n // match = pattern.exec(str)\n // }\n\n // let pattern = /^([A-Z][a-z]+) - ([\\d]+) - ([\\s\\w\\d_-]+?)$/gm;\n //\n // for (let token of str) {\n // let match = pattern.exec(token);\n // if (match === null) {\n // continue;\n // }\n // console.log(`Name: ${match[1]}\\nPosition: ${match[3]}\\nSalary: ${match[2]}\\n`);\n // }\n\n //var 3:\n\n let regex =\n /^([A-Z][a-zA-Z]*) - ([1-9][0-9]*) - ([a-zA-Z0-9 -]+)$/;\n for (let element of str) {\n let match = regex.exec(element);\n if (match)\n console.log(`Name: ${match[1]}\\n` +\n `Position: ${match[3]}\\n` +\n `Salary: ${match[2]} `);\n }\n}", "function parseInput(data_string) {\n var split_array = data_string.split('|');\n var processed_data = {};\n processed_data.timestamp = split_array[0];\n processed_data.instrument_id = split_array[4].split('=')[1];\n processed_data.trade_volume = split_array[7].split('=')[1];\n processed_data.trade_type = split_array[15].split('=')[1];\n console.log(processed_data);\n return processed_data;\n}", "parseFile(file) {\n\n var content = this.lire(file);\n\n var lines = content.split(/\\r?\\n/);\n\n //string that contains keys\n var header = lines[0];\n\n //array containing data separate with \";\"\n var dataLines = lines.slice(1);\n\n // data = dataLines.map(this.parser);\n\n var data = this.jsonifydata(header,dataLines);\n\n console.log(data);\n\n }", "function dataParser() {\n let response = JSON.parse(this.responseText);\n window.fields = response.fields;\n window.rules = response.rules;\n\n generateForm();\n generateRules();\n}", "parseData(data) {\n // Taken from https://gist.github.com/Jezternz/c8e9fafc2c114e079829974e3764db75\n const re = /(,|\\r?\\n|\\r|^)(?:\"([^\"]*(?:\"\"[^\"]*)*)\"|([^,\\r\\n]*))/gi;\n const result = [[]];\n let matches;\n\n while ((matches = re.exec(data))) {\n if (matches[1].length && matches[1] !== ',') result.push([])\n result[result.length - 1].push(\n matches[2] !== undefined ? matches[2].replace(/\"\"/g, '\"') : matches[3]\n )\n }\n\n result.pop(); // Delete last element, which is an empty row\n this.transformToObject(result);\n }", "parse(parseType) {}", "_parseDataLine(line){\n line = line.replace(/#/g,1).replace(/\\+/g,2).replace(/\\s/g,0).split('');\n return line;\n }", "function _parseData(model) {\n var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;\n\n var head = parseRoot(model, model.component.data.sources);\n var _model$component$data = model.component.data,\n outputNodes = _model$component$data.outputNodes,\n outputNodeRefCounts = _model$component$data.outputNodeRefCounts;\n var ancestorParse = model.parent ? model.parent.component.data.ancestorParse.clone() : new AncestorParse();\n var data = model.data;\n\n if (isGenerator(data)) {\n // insert generator transform\n if (isSequenceGenerator(data)) {\n head = new SequenceNode(head, data.sequence);\n } else if (isGraticuleGenerator(data)) {\n head = new GraticuleNode(head, data.graticule);\n } // no parsing necessary for generator\n\n\n ancestorParse.parseNothing = true;\n } else if (((_a = data === null || data === void 0 ? void 0 : data.format) === null || _a === void 0 ? void 0 : _a.parse) === null) {\n // format.parse: null means disable parsing\n ancestorParse.parseNothing = true;\n }\n\n head = (_b = ParseNode.makeExplicit(head, model, ancestorParse)) !== null && _b !== void 0 ? _b : head; // Default discrete selections require an identifer transform to\n // uniquely identify data points. Add this transform at the head of\n // the pipeline such that the identifier field is available for all\n // subsequent datasets. During optimization, we will remove this\n // transform if it proves to be unnecessary. Additional identifier\n // transforms will be necessary when new tuples are constructed\n // (e.g., post-aggregation).\n\n head = new IdentifierNode(head); // HACK: This is equivalent for merging bin extent for union scale.\n // FIXME(https://github.com/vega/vega-lite/issues/2270): Correctly merge extent / bin node for shared bin scale\n\n var parentIsLayer = model.parent && isLayerModel(model.parent);\n\n if (isUnitModel(model) || isFacetModel(model)) {\n if (parentIsLayer) {\n head = (_c = BinNode.makeFromEncoding(head, model)) !== null && _c !== void 0 ? _c : head;\n }\n }\n\n if (model.transforms.length > 0) {\n head = parseTransformArray(head, model, ancestorParse);\n } // create parse nodes for fields that need to be parsed (or flattened) implicitly\n\n\n var implicitSelection = getImplicitFromSelection(model);\n var implicitEncoding = getImplicitFromEncoding(model);\n head = (_d = ParseNode.makeWithAncestors(head, {}, Object.assign(Object.assign({}, implicitSelection), implicitEncoding), ancestorParse)) !== null && _d !== void 0 ? _d : head;\n\n if (isUnitModel(model)) {\n head = GeoJSONNode.parseAll(head, model);\n head = GeoPointNode.parseAll(head, model);\n }\n\n if (isUnitModel(model) || isFacetModel(model)) {\n if (!parentIsLayer) {\n head = (_e = BinNode.makeFromEncoding(head, model)) !== null && _e !== void 0 ? _e : head;\n }\n\n head = (_f = TimeUnitNode.makeFromEncoding(head, model)) !== null && _f !== void 0 ? _f : head;\n head = CalculateNode.parseAllForSortIndex(head, model);\n } // add an output node pre aggregation\n\n\n var rawName = model.getDataName(DataSourceType.Raw);\n var raw = new OutputNode(head, rawName, DataSourceType.Raw, outputNodeRefCounts);\n outputNodes[rawName] = raw;\n head = raw;\n\n if (isUnitModel(model)) {\n var agg = AggregateNode.makeFromEncoding(head, model);\n\n if (agg) {\n head = agg;\n\n if (requiresSelectionId(model)) {\n head = new IdentifierNode(head);\n }\n }\n\n head = (_g = ImputeNode.makeFromEncoding(head, model)) !== null && _g !== void 0 ? _g : head;\n head = (_h = StackNode.makeFromEncoding(head, model)) !== null && _h !== void 0 ? _h : head;\n }\n\n if (isUnitModel(model)) {\n head = (_j = FilterInvalidNode.make(head, model)) !== null && _j !== void 0 ? _j : head;\n } // output node for marks\n\n\n var mainName = model.getDataName(DataSourceType.Main);\n var main = new OutputNode(head, mainName, DataSourceType.Main, outputNodeRefCounts);\n outputNodes[mainName] = main;\n head = main;\n\n if (isUnitModel(model)) {\n materializeSelections(model, main);\n } // add facet marker\n\n\n var facetRoot = null;\n\n if (isFacetModel(model)) {\n var facetName = model.getName('facet'); // Derive new aggregate for facet's sort field\n // augment data source with new fields for crossed facet\n\n head = (_k = makeJoinAggregateFromFacet(head, model.facet)) !== null && _k !== void 0 ? _k : head;\n facetRoot = new FacetNode(head, model, facetName, main.getSource());\n outputNodes[facetName] = facetRoot;\n }\n\n return Object.assign(Object.assign({}, model.component.data), {\n outputNodes: outputNodes,\n outputNodeRefCounts: outputNodeRefCounts,\n raw: raw,\n main: main,\n facetRoot: facetRoot,\n ancestorParse: ancestorParse\n });\n }", "function processDataFromDocusky() {\n\tparseDocInfo();\n\ttoolSetting();\n}", "parseAbi(source, data) {\n switch (source) {\n case 'etherscan':\n return abiParsers[source](data);\n default:\n return { err: `No ${source} parser available.` };\n\n }\n }", "static _parseFunctionData (index, data) {\n var func, name;\n\n if (typeof (data) == 'function') {\n func = data;\n name = index;\n } else {\n func = data.functionCall;\n name = data.name;\n }\n\n return { func, name }\n }", "function parseData(data) {\n \n const dataArray = data.toString().split('\\n');\n const method = dataArray[0].split(' ')[0];\n const path = dataArray[0].split(' ')[1];\n\n const dataObj = {\n method,\n path,\n };\n\n return dataObj;\n}", "function ParseMsg(msg) {\n var data = new Object();\n msg = \".\" + msg; // Adding one character to make it easier to match the spec in EJU handbook.\n data.ProtoVer = msg.substr(2, 3);\n data.IDEvent = msg.substr(5, 20);\n data.Gender = msg.substr(25, 1);\n data.Category = msg.substr(26, 4);\n data.AgeGroup = msg.substr(30, 1);\n data.Round = msg.substr(21, 1);\n data.ContestID = msg.substr(32, 3);\n data.TimerFlag = msg.substr(35, 1);\n data.TimerMinute = msg.substr(36, 1);\n data.TimerSecond = msg.substr(37, 2);\n data.NationWhite = msg.substr(39, 3);\n data.IDWhite = msg.substr(42, 15);\n data.NameWhiteShort = msg.substr(57, 4);\n data.WRLWhite = msg.substr(61, 3);\n data.NameWhiteLong = msg.substr(64, 30);\n data.IpponWhite = msg.substr(94, 1);\n data.WazaWhite = msg.substr(95, 1);\n data.YukoWhite = msg.substr(96, 1);\n data.PenaltyWhite = msg.substr(97, 1);\n data.TimerOasaeWhite = msg.substr(98, 1);\n data.TeamScoreWhite = msg.substr(100, 1);\n data.NationBlue = msg.substr(101, 3);\n data.IDBlue = msg.substr(104, 15);\n data.NameBlueShort = msg.substr(119, 4);\n data.WRLBlue = msg.substr(123, 3);\n data.NameBlueLong = msg.substr(126, 30);\n data.IpponBlue = msg.substr(156, 1);\n data.WazaBlue = msg.substr(157, 1);\n data.YukoBlue = msg.substr(158, 1);\n data.PenaltyBlue = msg.substr(159, 1);\n data.TimerOsaeBlue = msg.substr(160, 2);\n data.TeamScoreBlue = msg.substr(162, 1);\n data.GoldenScore = msg.substr(163, 1);\n data.Winner = msg.substr(164, 1);\n data.IDReferee = msg.substr(165, 15);\n data.IDJudge1 = msg.substr(180, 15);\n data.IDJudge2 = msg.substr(195, 15);\n data.MatSending = msg.substr(210, 1);\n data.DisplayMode = msg.substr(211, 1); // 1 Logo, 6 Timer\n return (data);\n}", "function parseData(xmldoc) {\r\n\tvar root = xmldoc.getElementsByTagName('root').item(0);\r\n\tif (!root) { errorAlert(\"parseData\",'Could not get root node'); return; }\r\n\t//updateStatus('Processing anime data...');\r\n\tglobalStatus.loadingbar_color = 'green';\r\n\tglobalStatus.updateBarWithText('Parsing Custom node',15,'Total progress: ');\r\n\tt1 = new Date();\r\n\tparseAnimes(root.getElementsByTagName('animes'));\r\n\tvar parseAnimeNode = (new Date()) - t1;\r\n\tvar filedataNodes = root.getElementsByTagName('filedata');\r\n\tfor (var k = 0; k < filedataNodes.length; k++) parseFiledata(filedataNodes[k], aid);\r\n\t//updateStatus('Processing user data...');\r\n\tvar t1 = new Date();\r\n\tparseCustom(root.getElementsByTagName('custom').item(0));\r\n\tvar parseCustomNode = (new Date()) - t1;\r\n\tglobalStatus.updateBarWithText('Processing animes...',45,'Total progress: ');\r\n\t// do some triming of the definition cols if possible\r\n\tif (!uid)\r\n\t\tremoveColAttribute('expand',groupCols);\r\n\t// Okay now that i have the preferences i can rebuild fileCols\r\n\tvar newFileCols = new Array();\r\n\tfor (var i = 0; i < animePage_curLayout.length; i++) {\r\n\t\tvar name = animePage_curLayout[i];\r\n\t\tnewFileCols = addColAttribute(name,fileCols,newFileCols);\r\n\t}\r\n\tfileCols = newFileCols;\r\n\tfileSkips = buildSkipCols(fileCols);\r\n\t//updateStatus('');\r\n\tvar aid = root.getElementsByTagName('anime')[0];\r\n\tif (!aid) { errorAlert('parseData','no anime node'); return; }\r\n\taid = Number(aid.getAttribute('id'));\r\n\tt1 = new Date();\r\n\tglobalStatus.updateBarWithText('Rendering...',65,'Total progress: ');\r\n\tvar t2 = new Date();\r\n\tupdateGroupTable();\r\n\tvar uGT = new Date() - t2;\r\n\tt2 = new Date();\r\n\tupdateEpisodeTable();\r\n\tvar uET = new Date() - t2;\r\n\tt2 = new Date();\r\n\t// fetch group data if needed\r\n\tfor (var g = 0; g < updateGroupTable.length; g++) {\r\n\t\t// i hope this is just one group, but you never know\r\n\t\tvar gid = groupsNeedingExpand[g];\r\n\t\tvar a = document.getElementById('href_gid_'+gid);\r\n\t\texpandedGroups--;\r\n\t\tif (a) {\r\n\t\t\ta.onclick = expandFilesByGroup;\r\n\t\t\ta.onclick();\r\n\t\t\ta.onclick = foldFilesByGroup;\r\n\t\t}\r\n\t}\r\n\tvar gEGD = new Date() - t2;\r\n\tt2 = new Date();\r\n\tupdateAddToMylistBox();\r\n\tvar uAB = new Date() - t2;\r\n\tvar preparingPage = (new Date() - t1);\r\n\tglobalStatus.updateBarWithText('Done.',100,'Total progress: ');\r\n\tglobalStatus.clearAfterTimeout('globalStatus',1000);\r\n\tif (seeTimes) alert('Processing...\\n'+\r\n\t\t\t\t\t\t'\\n\\tanimes: '+parseAnimeNode+'ms'+\r\n\t\t\t\t\t\t'\\n\\tcustom: '+parseCustomNode+' ms'+\r\n\t\t\t\t\t\t'\\n\\tpreping: '+preparingPage+' ms'+\r\n\t\t\t\t\t\t'\\n\\t\\tupdateGroupTable: '+uGT+' ms'+\r\n\t\t\t\t\t\t'\\n\\t\\tupdateEpisodeTable: '+uET+' ms'+\r\n\t\t\t\t\t\t'\\n\\t\\tupdateAddToMylistBox: '+uAB+' ms'+\r\n\t\t\t\t\t\t'\\n\\t\\tgetExtraGroupData: '+gEGD+' ms'+\r\n\t\t\t\t\t\t'\\n\\tTotal: '+(parseAnimeNode+parseCustomNode+preparingPage)+' ms');\r\n}", "function data_parse(data) {\n\tvar msg, device_name;\n\n\t// The channel is the event name\n\tvar channel = data.name;\n\n\t// The command is what follows after the slash\n\tvar command = channel.split(\"/\")[1].toUpperCase();\n\n\t// Grab the \"payload\"\n\tvar payload = data.data;\n\n\t// Figure out the key\n\tif(payload.indexOf(\",\")>=0)\n\t\tvar key = payload.substr(0, payload.indexOf(\",\"));\n\telse\n\t\tvar key = payload;\n\n\t// Parse out anything following the key\n\tif(payload.indexOf(\",\")>0) {\n\t\tvar val = payload.substr(payload.indexOf(\",\")+1);\n\t}\n\n\n\t_log('<<<', data);\n\n\tswitch(command) {\n\t\tcase 'SET':\n\t\t\tR.set(key, val);\n\t\t\tbreak;\n\t\tcase 'GET':\n\t\t\tvar response = R.get(key, function(err, resp) {\n\t\t\t\tspark.publishEvent(\"redis/response\", JSON.stringify(resp));\n\t\t\t\t_log('>>>', \"redis/response\", JSON.stringify(resp));\n\t\t\t});\n\t\t\tbreak;\n\t}\n}", "dataParser(data) {\n console.log(\"Je commence fini\");\n for (var i = 0; i < data.results; i++) {\n this.responses[i] = data.response[i];\n this.tabInt[i] = i;\n }\n }", "parsing(data) {\r\n let jsonStructure = new jsonParser(data);\r\n }", "function parseData(xmldoc) {\r\n updateStatus('parsing Custom node');\r\n var root = xmldoc.getElementsByTagName('root').item(0);\r\n base_url = root.getAttribute('anidb');\r\n var t1 = new Date();\r\n parseCustom(root.getElementsByTagName('custom').item(0));\r\n var parseCustomNode = (new Date()) - t1;\r\n replaceGlobals(document.body);\r\n updateStatus('Processing anime...');\r\n t1 = new Date();\r\n parseAnimes(root.getElementsByTagName('animes'));\r\n var parseAnimeNode = (new Date()) - t1;\r\n updateStatus('Processing user information...');\r\n if (seeTimes) { alert('Processing...'+\r\n '\\n\\tanime: '+parseAnimeNode+'ms'+\r\n '\\n\\tcustom: '+parseCustomNode+' ms'+\r\n '\\nTotal: '+(parseAnimeNode+parseCustomNode)+' ms'); }\r\n updateStatus('');\r\n renderPage();\r\n}", "function parse(data) {\n\n let value = 0\n let parsedData = []\n\n data.split('').forEach(char => {\n switch(char) {\n case 'i': value++\n break\n case 'd': value--\n break\n case 's': value = value * value\n break\n case 'o': parsedData.push(value)\n }\n \n })\n\n return parsedData\n \n}", "parseValue (idx) {\n const len = this.size;\n const uson = this.input;\n idx = this.skipWspace (idx);\n\n if (idx === len) {\n return;\n }\n\n const chr = uson[idx];\n\n switch (chr) {\n case '\"': return this.parseString (idx + 1);\n case '{': return this.parseObject (idx + 1);\n case '[': return this.parseArray (idx + 1);\n case '<': return this.parseData (idx + 1);\n case ']':\n /* Catch the closing array bracket */\n this.end = true;\n return;\n default:\n /* USON identifier is a number which failed\n // to parse due to *syntactic* difference\n // from an actual valid number */\n return this.parseNumber (idx);\n }\n}", "function TextParser() {}", "function TextParser() {}", "function TextParser() { }", "parse (text) {\r\n var result = {}\r\n var find = null\r\n\r\n try {\r\n // CUIT\r\n find = text.match(/(?:C\\.U\\.I\\.T\\. )(\\d{2}-\\d{8}-\\d)/)\r\n result.CUIT = find[1]\r\n\r\n // Periodo (Mes/Año)\r\n find = text.match(/(\\d{2}\\/\\d{4})(?:\\sServicios\\sEventuales)/)\r\n result.Periodo = find[1]\r\n\r\n // Revisión - Orig. (0) - Rect. (1/9)\r\n find = text.match(/(?:Orig\\.\\s\\(0\\)\\s-\\sRect\\.\\s\\(1\\/9\\):\\s)(\\d+)/)\r\n result.Revision = parseInt(find[1], 10)\r\n\r\n // Empleados en Nomina\r\n find = text.match(/(?:Empleados\\sen\\snómina:\\s)(\\d+)/)\r\n result.EmpleadosEnNomina = parseInt(find[1], 10)\r\n\r\n // Suma de REM\r\n find = text.match(/(?:Suma\\sde\\sRem\\.\\s)(\\d):\\s([\\d\\.]+,[\\d]{2})/g)\r\n result.SumaDeREM = find.map(function (s) {\r\n var f = s.match(/(?:Suma\\sde\\sRem\\.\\s)(\\d):\\s([\\d\\.]+,[\\d]{2})/)\r\n return {\r\n REM: parseInt(f[1], 10),\r\n value: parseFloatB(f[2])\r\n }\r\n })\r\n\r\n // Montos que se Ingresan\r\n find = text.match(/(\\d{3})\\s-\\s([A-Za-z\\s\\.]+)([\\d\\.]+,[\\d]{2})/g)\r\n result.MontosQueSeIngresan = find.map(function (s) {\r\n var f = s.match(/(\\d{3})\\s-\\s([A-Za-z\\s\\.]+)([\\d\\.]+,[\\d]{2})/)\r\n return {\r\n code: parseInt(f[1], 10),\r\n name: f[2].trim(),\r\n value: parseFloatB(f[3])\r\n }\r\n })\r\n\r\n } catch (e) {\r\n console.log('Error', e)\r\n return null\r\n }\r\n\r\n return result\r\n }", "parse( attributes ) {\n return attributes;\n }", "function parseData(dato){\n\n var retorno = null;\n\n if(typeof(dato) == \"string\"){\n\n retorno = JSON.parse(dato);\n\n }else{\n retorno= dato;\n }\n\n return retorno\n\n}", "function parsePostTable(data, start) {\n const post = {};\n const p = new _parse__WEBPACK_IMPORTED_MODULE_1__.default.Parser(data, start);\n post.version = p.parseVersion();\n post.italicAngle = p.parseFixed();\n post.underlinePosition = p.parseShort();\n post.underlineThickness = p.parseShort();\n post.isFixedPitch = p.parseULong();\n post.minMemType42 = p.parseULong();\n post.maxMemType42 = p.parseULong();\n post.minMemType1 = p.parseULong();\n post.maxMemType1 = p.parseULong();\n switch (post.version) {\n case 1:\n post.names = _encoding__WEBPACK_IMPORTED_MODULE_0__.standardNames.slice();\n break;\n case 2:\n post.numberOfGlyphs = p.parseUShort();\n post.glyphNameIndex = new Array(post.numberOfGlyphs);\n for (let i = 0; i < post.numberOfGlyphs; i++) {\n post.glyphNameIndex[i] = p.parseUShort();\n }\n\n post.names = [];\n for (let i = 0; i < post.numberOfGlyphs; i++) {\n if (post.glyphNameIndex[i] >= _encoding__WEBPACK_IMPORTED_MODULE_0__.standardNames.length) {\n const nameLength = p.parseChar();\n post.names.push(p.parseString(nameLength));\n }\n }\n\n break;\n case 2.5:\n post.numberOfGlyphs = p.parseUShort();\n post.offset = new Array(post.numberOfGlyphs);\n for (let i = 0; i < post.numberOfGlyphs; i++) {\n post.offset[i] = p.parseChar();\n }\n\n break;\n }\n return post;\n}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function BinaryParser() {}", "function parse( data )\n{\n var val = 0;\n var arr = [];\n\n for( var i = 0; i < data.length; i++ ) {\n if( data[i] == 'i' ) {\n val++;\n }\n else if( data[i] == 's' ) {\n val*= val;\n }\n else if( data[i] == 'd' ) {\n val--;\n }\n else if( data[i] == 'o' ) {\n arr.push(val);\n }\n\n }\n\n return arr;\n}", "function parseData(obj, $, fieldsLength, code) {\n var idx,\n first = \"\",\n trs = $('table .data');\n for (idx = 0; idx < trs.length; idx++) {\n first = parseTrData(obj.data, first, fieldsLength, $, trs[idx], code);\n }\n}", "function parseData(model) {\n var head = parseRoot(model, model.component.data.sources);\n var _a = model.component.data, outputNodes = _a.outputNodes, outputNodeRefCounts = _a.outputNodeRefCounts;\n var ancestorParse = model.parent ? model.parent.component.data.ancestorParse.clone() : new AncestorParse();\n // format.parse: null means disable parsing\n if (model.data && model.data.format && model.data.format.parse === null) {\n ancestorParse.parseNothing = true;\n }\n head = ParseNode.makeExplicit(head, model, ancestorParse) || head;\n // Default discrete selections require an identifier transform to\n // uniquely identify data points as the _id field is volatile. Add\n // this transform at the head of our pipeline such that the identifier\n // field is available for all subsequent datasets. Additional identifier\n // transforms will be necessary when new tuples are constructed\n // (e.g., post-aggregation).\n if (requiresSelectionId(model) && (isUnitModel(model) || isLayerModel(model))) {\n head = new IdentifierNode(head);\n }\n // HACK: This is equivalent for merging bin extent for union scale.\n // FIXME(https://github.com/vega/vega-lite/issues/2270): Correctly merge extent / bin node for shared bin scale\n var parentIsLayer = model.parent && isLayerModel(model.parent);\n if (isUnitModel(model) || isFacetModel(model)) {\n if (parentIsLayer) {\n head = BinNode.makeFromEncoding(head, model) || head;\n }\n }\n if (model.transforms.length > 0) {\n head = parseTransformArray(head, model, ancestorParse);\n }\n head = ParseNode.makeImplicitFromEncoding(head, model, ancestorParse) || head;\n if (isUnitModel(model)) {\n head = GeoJSONNode.parseAll(head, model);\n head = GeoPointNode.parseAll(head, model);\n }\n if (isUnitModel(model) || isFacetModel(model)) {\n if (!parentIsLayer) {\n head = BinNode.makeFromEncoding(head, model) || head;\n }\n head = TimeUnitNode.makeFromEncoding(head, model) || head;\n head = CalculateNode.parseAllForSortIndex(head, model);\n }\n // add an output node pre aggregation\n var rawName = model.getName(RAW);\n var raw = new OutputNode(head, rawName, RAW, outputNodeRefCounts);\n outputNodes[rawName] = raw;\n head = raw;\n if (isUnitModel(model)) {\n var agg = AggregateNode.makeFromEncoding(head, model);\n if (agg) {\n head = agg;\n if (requiresSelectionId(model)) {\n head = new IdentifierNode(head);\n }\n }\n head = StackNode.makeFromEncoding(head, model) || head;\n }\n if (isUnitModel(model)) {\n head = FilterInvalidNode.make(head, model) || head;\n }\n // output node for marks\n var mainName = model.getName(MAIN);\n var main = new OutputNode(head, mainName, MAIN, outputNodeRefCounts);\n outputNodes[mainName] = main;\n head = main;\n // add facet marker\n var facetRoot = null;\n if (isFacetModel(model)) {\n var facetName = model.getName('facet');\n // Derive new sort index field for facet's sort array\n head = CalculateNode.parseAllForSortIndex(head, model);\n // Derive new aggregate (via window) for facet's sort field\n // TODO: use JoinAggregate once we have it\n // augment data source with new fields for crossed facet\n head = WindowTransformNode.makeFromFacet(head, model.facet) || head;\n facetRoot = new FacetNode(head, model, facetName, main.getSource());\n outputNodes[facetName] = facetRoot;\n head = facetRoot;\n }\n return __assign({}, model.component.data, { outputNodes: outputNodes,\n outputNodeRefCounts: outputNodeRefCounts,\n raw: raw,\n main: main,\n facetRoot: facetRoot,\n ancestorParse: ancestorParse });\n }", "function loadData(e) {\n\t\ttype_id = e.attr('id').split('-');\n\t\ttype = type_id[0];\n\t\tid = type_id[1];\n\t\tswitch (type) {\n\t\t\tcase \"org\":\n\t\t\t\tloadBranch(type,id,e);\n\t\t\t\tbreak;\n\t\t\tcase \"branch\":\n\t\t\t\tloadDepartment(type,id,e);\n\t\t\t\tbreak;\n\t\t\tcase \"depart\":\n\t\t\t\tloadCabinet(type,id,e);\n\t\t\t\tbreak;\n\t\t\tcase \"cabinet\":\n\t\t\t\tloadEmployee(type,id,e);\n\t\t\t\tbreak;\t\n\t\t\tcase \"employee\":\n\t\t\t\tloadDeviceType(type,id,e);\n\t\t\t\tbreak;\t\t\n\t\t\tdefault:\n\t\t\t\talert(\"none\"); \t\t\n\t\t}\n\t}", "function parsePostTable(data, start) {\n var post = {};\n var p = new parse.Parser(data, start);\n post.version = p.parseVersion();\n post.italicAngle = p.parseFixed();\n post.underlinePosition = p.parseShort();\n post.underlineThickness = p.parseShort();\n post.isFixedPitch = p.parseULong();\n post.minMemType42 = p.parseULong();\n post.maxMemType42 = p.parseULong();\n post.minMemType1 = p.parseULong();\n post.maxMemType1 = p.parseULong();\n switch (post.version) {\n case 1:\n post.names = standardNames.slice();\n break;\n case 2:\n post.numberOfGlyphs = p.parseUShort();\n post.glyphNameIndex = new Array(post.numberOfGlyphs);\n for (var i = 0; i < post.numberOfGlyphs; i++) {\n post.glyphNameIndex[i] = p.parseUShort();\n }\n\n post.names = [];\n for (var i$1 = 0; i$1 < post.numberOfGlyphs; i$1++) {\n if (post.glyphNameIndex[i$1] >= standardNames.length) {\n var nameLength = p.parseChar();\n post.names.push(p.parseString(nameLength));\n }\n }\n\n break;\n case 2.5:\n post.numberOfGlyphs = p.parseUShort();\n post.offset = new Array(post.numberOfGlyphs);\n for (var i$2 = 0; i$2 < post.numberOfGlyphs; i$2++) {\n post.offset[i$2] = p.parseChar();\n }\n\n break;\n }\n return post;\n }", "function parseUserEventInput(data){\n \n var split = /^(.+)\\n\\-{3,6}\\n(.+)$/s.exec(data);\n if(!split) throw Error(\"完全看不懂!\");\n\n try{\n var yamldoc = yaml.parse(split[1].trim());\n } catch(e){\n throw Error(\"格式写错了!\");\n }\n var description = split[2].trim();\n\n if(!(\n yamldoc.name &&\n _.isString(yamldoc.name) &&\n yamldoc.name.length <= 100 &&\n yamldoc.name.length >= 3\n )){\n throw Error(\"活动名字要在3到100个字之间!\");\n }\n\n const isPublicTranslation = {\n \"y\": true, \"yes\": true, \"是\": true, \"公开\": true, \"true\": true,\n \"1\": true,\n\n \"n\": false, \"no\": false, \"否\": false, \"不公开\": false,\n \"false\": false, \"私有\": false, \"私密\": false, \"0\": false,\n };\n\n if(isPublicTranslation[yamldoc.public] === undefined){\n throw Error(\"要决定是不是公开分享!\");\n }\n yamldoc.public = isPublicTranslation[yamldoc.public];\n\n \n return {\n name: yamldoc.name,\n public: yamldoc.public,\n description: description,\n }\n}", "function parseAnalysisInfo(item) {\n switch (item.typ) {\n case 'numeric':\n item.average = item.data.reduce(function (prev, current) {\n return prev + parseInt(current, 10);\n }, 0) / item.data.length;\n item.template = 'numeric';\n break;\n\n case 'info':\n item.data = item.data.map(function(dataItem) {\n dataItem = $mmText.parseJSON(dataItem);\n return typeof dataItem.show != \"undefined\" ? dataItem.show : false;\n }).filter(function(dataItem) {\n // Filter false entries.\n return dataItem;\n });\n case 'textfield':\n case 'textarea':\n item.template = 'list';\n break;\n\n case 'multichoicerated':\n case 'multichoice':\n item.data = item.data.map(function(dataItem) {\n dataItem = $mmText.parseJSON(dataItem);\n return typeof dataItem.answertext != \"undefined\" ? dataItem : false;\n }).filter(function(dataItem) {\n // Filter false entries.\n return dataItem;\n });\n\n // Format labels.\n item.labels = item.data.map(function(dataItem) {\n dataItem.quotient = parseFloat(dataItem.quotient * 100).toFixed(2);\n var label = \"\";\n\n if (typeof dataItem.value != \"undefined\") {\n label = '(' + dataItem.value + ') ';\n }\n label += dataItem.answertext;\n label += dataItem.quotient > 0 ? ' (' + dataItem.quotient + '%)' : \"\";\n return label;\n });\n item.chartData = item.data.map(function(dataItem) {\n return dataItem.answercount;\n });\n\n if (item.typ == 'multichoicerated') {\n item.average = item.data.reduce(function (prev, current) {\n return prev + parseFloat(current.avg);\n }, 0.0);\n }\n\n var subtype = item.presentation.charAt(0);\n item.single = subtype != 'c';\n\n item.template = 'chart';\n break;\n }\n\n return item;\n }", "function parseData(e) {\r\n const file = e.target.files[0];\r\n\r\n Papa.parse(file, {\r\n dynamicTyping: true,\r\n complete: function(results) {\r\n $('header').hide();\r\n $('main').prepend(`<h1 class=\"tableTitle\">Christopher Duerkes</h1>`);\r\n createTable(results.data);\r\n addEventListeners();\r\n }\r\n });\r\n}", "function wearMLParser(e, element) {\n\n var attributes = \"\";\n\n /**\n * If we cant find a value and we have a root value use this....\n */\n var get_root = e != undefined ? e.getPropertyValue(root).trim() : \"\";\n var get_text_field = e != undefined ? e.getPropertyValue(text_field).trim() : root_text_field;\n var get_overlay_show_number = e != undefined ? e.getPropertyValue(overlay_show_number).trim() : root_overlay_show_number;\n var get_overlay_show_text = e != undefined ? e.getPropertyValue(overlay_show_text).trim() : root_overlay_show_text;\n var get_overlay_persists = e != undefined ? e.getPropertyValue(overlay_persists).trim() : root_overlay_persists;\n var get_overlay_orientation = e != undefined ? e.getPropertyValue(overlay_orientation).trim() : root_overlay_orientation;\n var get_overlay_background_color = e != undefined ? e.getPropertyValue(overlay_background_color).trim() : root_overlay_background_color;\n var get_overlay_text_color = e != undefined ? e.getPropertyValue(overlay_text_color).trim() : root_overlay_text_color;\n var get_overlay_border_color = e != undefined ? e.getPropertyValue(overlay_border_color).trim() : root_overlay_border_color;\n var get_overlay_anchor_hv = e != undefined ? e.getPropertyValue(overlay_anchor_hv).trim() : root_overlay_anchor_hv;\n var get_overlay_show_dot = e != undefined ? e.getPropertyValue(overlay_show_dot).trim() : root_overlay_show_dot;\n var get_overlay_show_icon = e != undefined ? e.getPropertyValue(overlay_show_icon).trim() : root_overlay_show_icon;\n var get_overlay_offset = e != undefined ? e.getPropertyValue(overlay_offset).trim() : root_overlay_offset;\n var get_hf_scroll = e != undefined ? e.getPropertyValue(hf_scroll).trim() : root_hf_scroll;\n var get_barcode = e != undefined ? e.getPropertyValue(barcode).trim() : \"\";\n var get_global = e != undefined ? e.getPropertyValue(global).trim() : \"\";\n var get_hide_help = e != undefined ? e.getPropertyValue(hide_help).trim() : \"\";\n var get_broadcast_results = e != undefined ? e.getPropertyValue(broadcast_results).trim() : \"\";\n\n /**\n Input type\n ***/\n if(get_root != \"\"){\n if(get_root == \"true\"){\n root_text_field = get_text_field;\n root_overlay_show_number = get_overlay_show_number;\n root_overlay_show_text = get_overlay_show_text;\n root_overlay_persists = get_overlay_persists;\n root_overlay_orientation = get_overlay_orientation;\n root_overlay_background_color = get_overlay_background_color;\n root_overlay_text_color = get_overlay_text_color;\n root_overlay_border_color = get_overlay_border_color;\n root_overlay_anchor_hv = get_overlay_anchor_hv;\n root_overlay_show_dot = get_overlay_show_dot;\n root_overlay_show_icon = get_overlay_show_icon;\n root_overlay_offset = get_overlay_offset;\n root_hf_scroll = get_hf_scroll;\n root_hide_help = get_hide_help;\n }\n }\n\n /**\n Input type\n ***/\n if(get_text_field != \"\"){\n attributes += \"text_field=\"+ get_text_field + \" \";\n }\n\n /**\n Show Number\n ***/\n if(get_overlay_show_number != \"\"){\n if(get_overlay_show_number == \"true\"){\n attributes += \"overlay_show_number=\\\"yes\\\" \";\n }\n else{\n attributes += \"overlay_show_number=\\\"no\\\" \";\n }\n }\n\n\n /**\n Show Text\n **/\n if(get_overlay_show_text != \"\"){\n if(get_overlay_show_text == \"true\")\n attributes += \"overlay_show_text=\\\"yes\\\" \";\n else{\n attributes += \"overlay_show_text=\\\"no\\\" \";\n }\n }\n\n\n /**\n Show Overlay\n **/\n if(get_overlay_persists != \"\"){\n if(get_overlay_persists == \"true\")\n attributes += \"overlay_persists=\\\"yes\\\" \";\n else{\n attributes += \"overlay_persists=\\\"no\\\" \";\n }\n }\n\n /**\n Overlay Orientation\n **/\n if(get_overlay_orientation != \"\"){\n attributes += \"overlay_orientation=\"+ get_overlay_orientation + \" \";\n }\n\n /**\n Overlay background color\n **/\n if(get_overlay_background_color != \"\"){\n attributes += \"overlay_background_color=\"+ get_overlay_background_color + \" \";\n }\n\n\n /**\n Overlay text color\n */\n if(get_overlay_text_color != \"\"){\n attributes += \"overlay_text_color=\"+ get_overlay_text_color + \" \";\n }\n\n\n /**\n Overlay border color\n */\n if(get_overlay_border_color != \"\"){\n attributes += \"overlay_border_color=\"+ get_overlay_border_color + \" \";\n }\n\n /**\n Overlay anchor percent\n */\n if(get_overlay_anchor_hv != \"\"){\n attributes += \"overlay_anchor=\"+ get_overlay_anchor_hv + \" \";\n }\n\n /**\n Overlay show dot\n **/\n if(get_overlay_show_dot != \"\"){\n if(get_overlay_show_dot == \"true\")\n attributes += \"overlay_show_dot=\\\"yes\\\" \";\n else{\n attributes += \"overlay_show_dot=\\\"no\\\" \";\n }\n }\n\n /**\n Overlay show icon\n **/\n if(get_overlay_show_icon != \"\"){\n if(get_overlay_show_icon == \"true\")\n attributes += \"overlay_show_icon=\\\"yes\\\" \";\n else{\n attributes += \"overlay_show_icon=\\\"no\\\" \";\n }\n }\n\n /**\n Overlay offset\n **/\n if(get_overlay_offset != \"\"){\n attributes += \"overlay_offset=\"+ get_overlay_offset + \" \";\n }\n\n /**\n HF Scroll\n **/\n if(get_hf_scroll != \"\"){\n attributes += \"scroll=\"+ get_hf_scroll + \" \";\n }\n\n /**\n Barcode Reader\n **/\n if(get_barcode != \"\"){\n attributes += \"barcode=\"+ get_barcode + \" \";\n\n }\n\n /**\n Hide Help\n */\n if(get_hide_help != \"\"){\n attributes += \"barcode=\"+ get_barcode + \" \";\n\n }\n\n /**\n Global Commands\n **/\n if(get_global != \"\"){\n if(get_global == \"true\")\n attributes += \"global_commands=\\\"yes\\\" \";\n else{\n attributes += \"global_commands=\\\"no\\\" \";\n }\n }\n\n /**\n BroadCast Commands\n **/\n if(get_broadcast_results != \"\"){\n if(get_broadcast_results == \"true\")\n attributes += \"broadcast_results=\\\"yes\\\" \";\n else{\n attributes += \"broadcast_results=\\\"no\\\" \";\n }\n }\n return attributes;\n}", "function get_data() {}", "function TextData() {}", "function TextData() {}", "function TextData() {}", "function BinaryParser() { }", "function TextData(){}", "function data2Attribs(data)\t{\n\t\t\t\t\t\t\tvar attribs = \" \";\n\t\t\t\t\t\t\tfor(index in data)\t{\n\t\t\t\t\t\t\t\tattribs += index+\"='\"+data[index]+\"' \";\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn attribs;\n\t\t\t\t\t\t\t}", "function parseRawData(data) {\n var out = []\n // Interate though the rows of the sheet\n for(var i = 0; i < data.length; i++) {\n var type = getTypeID(data[i][0])\n if(type == -1) { break; }\n \n // Difrent gen for dif types\n if(type == 3) {\n var options = data[i][3].split(\",\")\n out.push([type, data[i][1], data[i][2], options])\n } else if (type == 2) {\n out.push([type, data[i][1], data[i][2], data[i][3]])\n } else {\n out.push([type, data[i][1], data[i][2]])\n }\n }\n \n return out\n}", "function processData(data)\n\t{\n\t\t// attributes is an array of an individual industry by year e.g. ['con2008', 'con2009', ....]\n\t\tvar attributes = [];\n\n\t\t// would list all properties associated with the first attribute \n\t\tvar properties = data.features[0].properties;\n\n\n\t\t//push each attribute name into attributes array\n\t\tfor (var attribute in properties)\n\t\t{\n\t\t\tif(attribute.indexOf(ABREVIATION) > -1)\n\t\t\t{\n\t\t\t\tattributes.push(attribute);\n\t\t\t\t//console.log(attribute);\n\t\t\t}\n\t\t}\n\t\treturn attributes;\n\t}", "function parse(data){\n let temp = 0\n let answer = []\n data.split('').forEach(i => {\n if(i === 'i') temp += 1\n if(i === 'd') temp -= 1\n if(i === 's') temp = temp * temp\n if(i === 'o'){\n answer.push(temp)\n }\n })\n return answer;\n }", "function parseDataFromFile(data) {\n var allData = [];\n var rows = data.split(\"\\n\");\n for (var x in rows) {\n var row = rows[x];\n var cols = row.split(\",\");\n if (cols.length !== ncols) {\n continue;\n }\n allData.push({\n amount: parseFloat(cols[3]),\n date: new Date(cols[1]),\n price: parseFloat(cols[2]),\n tid: parseInt(cols[0]), \n type: cols[4]\n });\n }\n allData.sort(function (a, b) {\n return a.tid - b.tid;\n });\n return allData;\n }", "function parsingRAWData(data,delimeter){\n\t\n\tresult = data.toString().replace(/(\\r\\n|\\n|\\r)/gm, \"\").split(delimeter);\n\n\treturn result;\n}", "function processData(data){\n //empty array to hold attributes\n var attributes = [];\n\n //properties of the first feature in the dataset\n var properties = data.features[0].properties;\n\n //push each attribute name into attributes array\n for (var attribute in properties){\n //only take attributes with spruce values\n if (attribute.indexOf(\"yr\") > -1){\n attributes.push(attribute);\n };\n };\n // return attributes as object\n return attributes;\n}", "function parsePostTable(data, start) {\n var post = {};\n var p = new parse.Parser(data, start);\n var i;\n post.version = p.parseVersion();\n post.italicAngle = p.parseFixed();\n post.underlinePosition = p.parseShort();\n post.underlineThickness = p.parseShort();\n post.isFixedPitch = p.parseULong();\n post.minMemType42 = p.parseULong();\n post.maxMemType42 = p.parseULong();\n post.minMemType1 = p.parseULong();\n post.maxMemType1 = p.parseULong();\n switch (post.version) {\n case 1:\n post.names = encoding.standardNames.slice();\n break;\n case 2:\n post.numberOfGlyphs = p.parseUShort();\n post.glyphNameIndex = new Array(post.numberOfGlyphs);\n for (i = 0; i < post.numberOfGlyphs; i++) {\n post.glyphNameIndex[i] = p.parseUShort();\n }\n\n post.names = [];\n for (i = 0; i < post.numberOfGlyphs; i++) {\n if (post.glyphNameIndex[i] >= encoding.standardNames.length) {\n var nameLength = p.parseChar();\n post.names.push(p.parseString(nameLength));\n }\n }\n\n break;\n case 2.5:\n post.numberOfGlyphs = p.parseUShort();\n post.offset = new Array(post.numberOfGlyphs);\n for (i = 0; i < post.numberOfGlyphs; i++) {\n post.offset[i] = p.parseChar();\n }\n\n break;\n }\n return post;\n}", "function ElementData() {}", "function ElementData() {}", "function ElementData() {}", "function parsingData (name, age, callback) {\n \n callback(name, age)\n \n return {\n\n name: name,\n age: age\n }\n}", "function parseFromFirstRemaining() {\n var cur = this.value[this.index];\n switch(cur) {\n case '{':\n return exports.ArrayParser.call(this);\n break;\n case '\"':\n return exports.StringParser.call(this);\n break;\n case 'a':\n if (this.value.substring(this.index, this.index+5) == 'alias') {\n return exports.AliasParser.call(this);\n }\n break;\n case '«':\n if (this.value.substring(this.index, this.index+5) == '«data') {\n return exports.DataParser.call(this);\n }\n break;\n }\n if (!isNaN(cur)) {\n return exports.NumberParser.call(this);\n }\n return exports.UndefinedParser.call(this);\n}", "function parseData() {\n let current;\n\n while (true) {\n current = input[i++];\n if (!current) {\n break;\n }\n\n parser.pos_++;\n\n switch (parser.state_) {\n case State.INIT:\n if (current === '{') {\n parser.state_ = State.OBJECT_OPEN;\n } else if (current === '[') {\n parser.state_ = State.ARRAY_OPEN;\n } else if (!utils.isJsonWhitespace(current)) {\n parser.error_(input, i);\n }\n continue;\n\n case State.KEY_START:\n case State.OBJECT_OPEN:\n if (utils.isJsonWhitespace(current)) {\n continue;\n }\n if (parser.state_ === State.KEY_START) {\n stack.push(State.KEY_END);\n } else {\n if (current === '}') {\n addMessage('{}');\n parser.state_ = nextState();\n continue;\n } else {\n stack.push(State.OBJECT_END);\n }\n }\n if (current === '\"') {\n parser.state_ = State.STRING;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n\n case State.KEY_END:\n case State.OBJECT_END:\n if (utils.isJsonWhitespace(current)) {\n continue;\n }\n if (current === ':') {\n if (parser.state_ === State.OBJECT_END) {\n stack.push(State.OBJECT_END);\n parser.depth_++;\n }\n parser.state_ = State.VALUE;\n } else if (current === '}') {\n parser.depth_--;\n addMessage();\n parser.state_ = nextState();\n } else if (current === ',') {\n if (parser.state_ === State.OBJECT_END) {\n stack.push(State.OBJECT_END);\n }\n parser.state_ = State.KEY_START;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.ARRAY_OPEN:\n case State.VALUE:\n if (utils.isJsonWhitespace(current)) {\n continue;\n }\n if (parser.state_ === State.ARRAY_OPEN) {\n parser.depth_++;\n parser.state_ = State.VALUE;\n if (current === ']') {\n parser.depth_--;\n if (parser.depth_ === 0) {\n parser.state_ = State.ARRAY_END;\n return;\n }\n\n addMessage('[]');\n\n parser.state_ = nextState();\n continue;\n } else {\n stack.push(State.ARRAY_END);\n }\n }\n if (current === '\"')\n parser.state_ = State.STRING;\n else if (current === '{')\n parser.state_ = State.OBJECT_OPEN;\n else if (current === '[')\n parser.state_ = State.ARRAY_OPEN;\n else if (current === 't')\n parser.state_ = State.TRUE1;\n else if (current === 'f')\n parser.state_ = State.FALSE1;\n else if (current === 'n')\n parser.state_ = State.NULL1;\n else if (current === '-') {\n // continue\n } else if ('0123456789'.indexOf(current) !== -1) {\n parser.state_ = State.NUM_DIGIT;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.ARRAY_END:\n if (current === ',') {\n stack.push(State.ARRAY_END);\n parser.state_ = State.VALUE;\n\n if (parser.depth_ === 1) {\n msgStart = i; // skip ',', including a leading one\n }\n } else if (current === ']') {\n parser.depth_--;\n if (parser.depth_ === 0) {\n return;\n }\n\n addMessage();\n parser.state_ = nextState();\n } else if (utils.isJsonWhitespace(current)) {\n continue;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.STRING:\n const old = i;\n\n STRING_LOOP: while (true) {\n while (parser.unicodeCount_ > 0) {\n current = input[i++];\n if (parser.unicodeCount_ === 4) {\n parser.unicodeCount_ = 0;\n } else {\n parser.unicodeCount_++;\n }\n if (!current) {\n break STRING_LOOP;\n }\n }\n\n if (current === '\"' && !parser.slashed_) {\n parser.state_ = nextState();\n break;\n }\n if (current === '\\\\' && !parser.slashed_) {\n parser.slashed_ = true;\n current = input[i++];\n if (!current) {\n break;\n }\n }\n if (parser.slashed_) {\n parser.slashed_ = false;\n if (current === 'u') {\n parser.unicodeCount_ = 1;\n }\n current = input[i++];\n if (!current) {\n break;\n } else {\n continue;\n }\n }\n\n pattern.lastIndex = i;\n const patternResult = pattern.exec(input);\n if (!patternResult) {\n i = input.length + 1;\n break;\n }\n i = patternResult.index + 1;\n current = input[patternResult.index];\n if (!current) {\n break;\n }\n }\n\n parser.pos_ += (i - old);\n\n continue;\n\n case State.TRUE1:\n if (!current) {\n continue;\n }\n if (current === 'r') {\n parser.state_ = State.TRUE2;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.TRUE2:\n if (!current) {\n continue;\n }\n if (current === 'u') {\n parser.state_ = State.TRUE3;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.TRUE3:\n if (!current) {\n continue;\n }\n if (current === 'e') {\n parser.state_ = nextState();\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.FALSE1:\n if (!current) {\n continue;\n }\n if (current === 'a') {\n parser.state_ = State.FALSE2;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.FALSE2:\n if (!current) {\n continue;\n }\n if (current === 'l') {\n parser.state_ = State.FALSE3;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.FALSE3:\n if (!current) {\n continue;\n }\n if (current === 's') {\n parser.state_ = State.FALSE4;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.FALSE4:\n if (!current) {\n continue;\n }\n if (current === 'e') {\n parser.state_ = nextState();\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.NULL1:\n if (!current) {\n continue;\n }\n if (current === 'u') {\n parser.state_ = State.NULL2;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.NULL2:\n if (!current) {\n continue;\n }\n if (current === 'l') {\n parser.state_ = State.NULL3;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.NULL3:\n if (!current) {\n continue;\n }\n if (current === 'l') {\n parser.state_ = nextState();\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.NUM_DECIMAL_POINT:\n if (current === '.') {\n parser.state_ = State.NUM_DIGIT;\n } else {\n parser.error_(input, i);\n }\n continue;\n\n case State.NUM_DIGIT: // no need for a full validation here\n if ('0123456789.eE+-'.indexOf(current) !== -1) {\n continue;\n } else {\n i--;\n parser.pos_--;\n parser.state_ = nextState();\n }\n continue;\n\n default:\n parser.error_(input, i);\n }\n }\n }", "parse() {\n while (this.shouldContinue()) {\n const c = this.buffer.charCodeAt(this.index - this.offset);\n switch (this.state) {\n case Tokenizer_State.Text: {\n this.stateText(c);\n break;\n }\n case Tokenizer_State.SpecialStartSequence: {\n this.stateSpecialStartSequence(c);\n break;\n }\n case Tokenizer_State.InSpecialTag: {\n this.stateInSpecialTag(c);\n break;\n }\n case Tokenizer_State.CDATASequence: {\n this.stateCDATASequence(c);\n break;\n }\n case Tokenizer_State.InAttributeValueDq: {\n this.stateInAttributeValueDoubleQuotes(c);\n break;\n }\n case Tokenizer_State.InAttributeName: {\n this.stateInAttributeName(c);\n break;\n }\n case Tokenizer_State.InCommentLike: {\n this.stateInCommentLike(c);\n break;\n }\n case Tokenizer_State.InSpecialComment: {\n this.stateInSpecialComment(c);\n break;\n }\n case Tokenizer_State.BeforeAttributeName: {\n this.stateBeforeAttributeName(c);\n break;\n }\n case Tokenizer_State.InTagName: {\n this.stateInTagName(c);\n break;\n }\n case Tokenizer_State.InClosingTagName: {\n this.stateInClosingTagName(c);\n break;\n }\n case Tokenizer_State.BeforeTagName: {\n this.stateBeforeTagName(c);\n break;\n }\n case Tokenizer_State.AfterAttributeName: {\n this.stateAfterAttributeName(c);\n break;\n }\n case Tokenizer_State.InAttributeValueSq: {\n this.stateInAttributeValueSingleQuotes(c);\n break;\n }\n case Tokenizer_State.BeforeAttributeValue: {\n this.stateBeforeAttributeValue(c);\n break;\n }\n case Tokenizer_State.BeforeClosingTagName: {\n this.stateBeforeClosingTagName(c);\n break;\n }\n case Tokenizer_State.AfterClosingTagName: {\n this.stateAfterClosingTagName(c);\n break;\n }\n case Tokenizer_State.BeforeSpecialS: {\n this.stateBeforeSpecialS(c);\n break;\n }\n case Tokenizer_State.InAttributeValueNq: {\n this.stateInAttributeValueNoQuotes(c);\n break;\n }\n case Tokenizer_State.InSelfClosingTag: {\n this.stateInSelfClosingTag(c);\n break;\n }\n case Tokenizer_State.InDeclaration: {\n this.stateInDeclaration(c);\n break;\n }\n case Tokenizer_State.BeforeDeclaration: {\n this.stateBeforeDeclaration(c);\n break;\n }\n case Tokenizer_State.BeforeComment: {\n this.stateBeforeComment(c);\n break;\n }\n case Tokenizer_State.InProcessingInstruction: {\n this.stateInProcessingInstruction(c);\n break;\n }\n case Tokenizer_State.InNamedEntity: {\n this.stateInNamedEntity(c);\n break;\n }\n case Tokenizer_State.BeforeEntity: {\n this.stateBeforeEntity(c);\n break;\n }\n case Tokenizer_State.InHexEntity: {\n this.stateInHexEntity(c);\n break;\n }\n case Tokenizer_State.InNumericEntity: {\n this.stateInNumericEntity(c);\n break;\n }\n default: {\n // `this._state === State.BeforeNumericEntity`\n this.stateBeforeNumericEntity(c);\n }\n }\n this.index++;\n }\n this.cleanup();\n }", "function read_info(data) {\n var _items = {};\n read_in();\n read_all();\n return data;\n\n function split2(str, delim) {\n var parts = str.split(delim);\n return [parts[0], parts.splice(1, parts.length).join(delim)];\n }\n\n function read_in() {\n var r = data.content.match(/#\\+[a-zA-Z]*:.*\\n/g);\n if (r) {\n for (var i = 0; i < r.length; i++) {\n var parts = split2(r[i], ':');\n var key = parts[0].substring(2).trim();\n if(!_items[key])\n _items[key] = parts[1].trim();\n }\n }\n }\n\n function read_title() {\n if (_items.TITLE) {\n data.title = _items.TITLE;\n }\n }\n\n // function convert_org_time(org_time) {\n // return moment(Date.parse(org_time.replace(/[^0-9:-]/g, ' ')));\n // }\n\n // function read_date() {\n // if (_items.DATE) {\n // data.date = convert_org_time(_items.DATE);\n // }\n // }\n\n function read_tags(){\n if(_items.TAGS){\n // data.setTags(_items.TAGS.split(',').filter((item) => item.trim() != ''));\n data.setTags(_items.TAGS);\n }\n }\n\n // function read_categories(){\n // if(_items.CATEGORIES){\n // data.setCategories(_items.CATEGORIES.split(',').map((item) => item.trim()));\n // }\n // }\n\n function read_layout(){\n if(_items.LAYOUT){\n data.layout = _items.LAYOUT;\n }\n }\n\n function read_comments(){\n if(_items.COMMENTS == \"no\"){\n data.comments = false;\n }\n }\n\n function read_all() {\n if (!/.*\\.org/.test(data.source)) {\n // skip if is not a org file\n return data;\n }\n read_in();\n read_title();\n // read_date();\n read_tags();\n // read_categories();\n read_layout();\n read_comments();\n return data;\n }\n}", "function ParseException() {\r\n}", "function MatchData() {}", "function parse(words){\n\n\n\n}", "function parsePostTable(data, start) {\n var post = {};\n var p = new parse.Parser(data, start);\n var i;\n post.version = p.parseVersion();\n post.italicAngle = p.parseFixed();\n post.underlinePosition = p.parseShort();\n post.underlineThickness = p.parseShort();\n post.isFixedPitch = p.parseULong();\n post.minMemType42 = p.parseULong();\n post.maxMemType42 = p.parseULong();\n post.minMemType1 = p.parseULong();\n post.maxMemType1 = p.parseULong();\n switch (post.version) {\n case 1:\n post.names = encoding.standardNames.slice();\n break;\n case 2:\n post.numberOfGlyphs = p.parseUShort();\n post.glyphNameIndex = new Array(post.numberOfGlyphs);\n for (i = 0; i < post.numberOfGlyphs; i++) {\n post.glyphNameIndex[i] = p.parseUShort();\n }\n\n post.names = [];\n for (i = 0; i < post.numberOfGlyphs; i++) {\n if (post.glyphNameIndex[i] >= encoding.standardNames.length) {\n var nameLength = p.parseChar();\n post.names.push(p.parseString(nameLength));\n }\n }\n\n break;\n case 2.5:\n post.numberOfGlyphs = p.parseUShort();\n post.offset = new Array(post.numberOfGlyphs);\n for (i = 0; i < post.numberOfGlyphs; i++) {\n post.offset[i] = p.parseChar();\n }\n\n break;\n }\n return post;\n}", "function TextRecognitionData() {\n }", "preprocessData(type) {\n if (type == \"Genomes\")\n this.preprocessGenomes();\n else if (type == \"Paired-end Reads\")\n this.preprocessPairedReads();\n else if (type == \"Single-end Reads\")\n this.preprocessSingleReads();\n else if (type == \"Interleaved Paired-end Reads\")\n this.preprocessSingleReads();\n }", "function processData(data){\n\t//empty array to hold attributes\n\tvar attributes = [];\n\t// console.log(data);\n\t//properties of the first feature in the dataset\n\tvar properties = data.features[0].properties;\n\tconsole.log(properties)\n\t//push each attribute name into attributes array\n\tfor (var attribute in properties){\n\t\t//only take attributes with values\n\t\t// decided to up alphabetical search and sort \n\t\tif(attribute.indexOf(\"April\"|\"September\") > -1){\n\t\t\tattributes.push(attribute);\n\t\t};\n\t};\n\t//check result\n\t// console.log(attributes);\n\treturn attributes;\n}", "doParse(content: string): any {\n let lines = this.getLines(content);\n return this.parseContent(lines);\n }", "function ElementData(){}", "function preProcessIGData(data, metric, period) {\n\n let stringified;\n\n if (metric.toString() === \"audience_gender_age\" && data) {// This metric has dots in keys, which are not allowed\n stringified = JSON.stringify(data);\n stringified = stringified.replace(/F./g, \"F\").replace(/M./g, \"M\").replace(/U./g, \"U\");\n data = JSON.parse(stringified);\n }\n\n if (metric.toString() === \"audience_city\" && data) {// This metric has dots in keys, which are not allowed\n stringified = JSON.stringify(data);\n stringified = stringified.replace( /\\./g , \" \" ); //replace all dots, remember\n data = JSON.parse(stringified);\n }\n\n\n if (period !== \"lifetime\")\n data = data.slice(0,-1);\n\n return data;\n}", "function GeometryParser() {}", "parse(data) {\n return {\n editURL: data.editURL,\n id: data.id,\n integrationID: data.integrationID,\n itemState: data.enabled ? 'enabled' : 'disabled',\n name: data.name,\n };\n }", "function parseReadData (sam_read) {\n var\n i,\n f = sam_read.buffer.split('\\t'),\n read = {\n name: sam_read.name,\n flag: sam_read.flag,\n length: sam_read.l_seq,\n pos: sam_read.pos - 1,\n cigar: sam_read.cigarString,\n cigarOps: sam_read.cigarOps,\n mapq: parseInt(f[4], 10),\n seq: sam_read._seq,\n qual: sam_read._qual.replace(/</g, '=').replace(/>/g, '='),\n ref: sam_read.ref,\n refID: sam_read.refID,\n samOrder: ['name', 'flag', 'ref', 'pos', 'mapq', 'cigar', 'length', 'seq', 'qual'],\n isReverse: sam_read.isReverse,\n getInterval: sam_read.getInterval,\n getReferenceLength: sam_read.getReferenceLength,\n };\n\n for (i = 11; i < f.length; i++) {\n var\n subtag = f[i].split(':'),\n data = subtag.pop(),\n type = null;\n\n data = data.replace(/^([fis]),/, function (match, c) {\n type = c;\n subtag.push(c);\n return '';\n });\n\n tag = subtag.join(':');\n read.samOrder.push(tag);\n if (type) {\n if (type === 'f') {\n read[tag] = data.split(',').map(function (v) { return parseFloat(v); });\n }\n else { // type === i or s\n read[tag] = data.split(',').map(function (v) { return parseInt(v, 10); });\n }\n }\n else {\n if (tag.match(/:i$/)) {\n read[tag] = parseInt(data, 10);\n }\n else {\n read[tag] = data;\n }\n }\n }\n\n if (read['YT:Z'] && (read['ZA:i'] - read.length - read['YT:Z'].length > 0)) {\n read.qt = true;\n }\n\n return read;\n }", "parse(superBlock, tokenizer) {\n throw new Error(\"parse function not implemented!\");\n }", "function processData(allText) {\n restJson = JSON.parse(allText);\n console.log(restJson);\n buildTable(restJson);\n }", "function parse_613(data) {\n\tlet parse = {\n\t\tvehicle : {\n\t\t\todometer : {\n\t\t\t\tkm : ((data.msg[1] << 8) + data.msg[0]) * 10,\n\t\t\t\tmi : null,\n\t\t\t},\n\n\t\t\trunning_clock : ((data.msg[4] << 8) + data.msg[3]),\n\t\t},\n\n\t\t// Looks bad, I should feel bad\n\t\tfuel : {\n\t\t\tlevel : null,\n\t\t\tliters : (data.msg[2] >= 0x80) && data.msg[2] - 0x80 || data.msg[2],\n\t\t},\n\t};\n\n\tparse.fuel.level = Math.floor((parse.fuel.liters / config.fuel.liters_max) * 100);\n\tif (parse.fuel.level < 0) parse.fuel.level = 0;\n\tif (parse.fuel.level > 100) parse.fuel.level = 100;\n\n\tupdate.status('fuel.level', parse.fuel.level, false);\n\tupdate.status('fuel.liters', parse.fuel.liters);\n\n\tparse.vehicle.odometer.mi = Math.floor(convert(parse.vehicle.odometer.km).from('kilometre').to('us mile'));\n\n\tupdate.status('vehicle.odometer.km', parse.vehicle.odometer.km);\n\tupdate.status('vehicle.odometer.mi', parse.vehicle.odometer.mi, false);\n\n\tupdate.status('vehicle.running_clock', parse.vehicle.running_clock, false);\n}", "function parseCSV(data) {\n\tvar allTextLines = [];\n\tvar fldHeading = [];\n\t// var fldData = [];\n\tvar i = null;\n\tvar x = 0;\n\n\tallTextLines = data.split(/\\r\\n|\\n/);\n\tfldHeading = allTextLines[0].split(',');\n\tconsole.log(fldHeading);\n\n\tfor (i = allTextLines.length - 1; i > 0; i--) {\n\t\tnflQBs[x] = allTextLines[i].split(',');\n\t\tx++;\n\t}\n\tconsole.log(nflQBs);\n\talertify.success(\"Data has been parsed.\");\n}", "function parseData(data) {\n\t\tvar newArr = [],\n\t\t\td = data.rows;\n\t\tfor (var i in d) {\n\t\t\tnewArr.push(d[i].doc);\n\t\t}\n\t\treturn newArr;\n\t}", "parseXmlToObject(data, callback) {\n parseString(data, { tim: true }, (err, res) => {\n if (err) callback(err);else callback(null, (0, _normalizeArrayAndObject.normalize)(res));\n });\n }", "function parsePostTable(data) {\n return {\n version: utility_1.formatFixed(data.readUInt16BE(0), data.readUInt16BE(2)),\n italicAngle: utility_1.formatFixed(data.readUInt16BE(4), data.readUInt16BE(6)),\n underlinePosition: data.readInt16BE(8),\n underlineThickness: data.readInt16BE(10),\n isFixedPitch: data.readUInt32BE(12),\n minMemType42: data.readUInt32BE(16),\n maxMemType42: data.readUInt32BE(20),\n minMemType1: data.readUInt32BE(24),\n maxMemType1: data.readUInt32BE(28)\n };\n}", "function parsePostTable(data, start) {\r\n\t const post = {};\r\n\t const p = new parse.Parser(data, start);\r\n\t post.version = p.parseVersion();\r\n\t post.italicAngle = p.parseFixed();\r\n\t post.underlinePosition = p.parseShort();\r\n\t post.underlineThickness = p.parseShort();\r\n\t post.isFixedPitch = p.parseULong();\r\n\t post.minMemType42 = p.parseULong();\r\n\t post.maxMemType42 = p.parseULong();\r\n\t post.minMemType1 = p.parseULong();\r\n\t post.maxMemType1 = p.parseULong();\r\n\t switch (post.version) {\r\n\t case 1:\r\n\t post.names = standardNames.slice();\r\n\t break;\r\n\t case 2:\r\n\t post.numberOfGlyphs = p.parseUShort();\r\n\t post.glyphNameIndex = new Array(post.numberOfGlyphs);\r\n\t for (let i = 0; i < post.numberOfGlyphs; i++) {\r\n\t post.glyphNameIndex[i] = p.parseUShort();\r\n\t }\r\n\r\n\t post.names = [];\r\n\t for (let i = 0; i < post.numberOfGlyphs; i++) {\r\n\t if (post.glyphNameIndex[i] >= standardNames.length) {\r\n\t const nameLength = p.parseChar();\r\n\t post.names.push(p.parseString(nameLength));\r\n\t }\r\n\t }\r\n\r\n\t break;\r\n\t case 2.5:\r\n\t post.numberOfGlyphs = p.parseUShort();\r\n\t post.offset = new Array(post.numberOfGlyphs);\r\n\t for (let i = 0; i < post.numberOfGlyphs; i++) {\r\n\t post.offset[i] = p.parseChar();\r\n\t }\r\n\r\n\t break;\r\n\t }\r\n\t return post;\r\n\t}", "parseExtraData(extraData, format) {\n let parseData = \"\";\n if (Array.isArray(extraData)) {\n for (var i = 0; i < extraData.length; i++) {\n parseData += format.replace(\"${data}\", extraData[i]);\n }\n } else {\n parseData += format.replace(\"${data}\", extraData);\n }\n return parseData;\n }", "ParseData(d) {\n return {Date : new Date(d.DATE),\n Year: parseInt(d.year),\n AT: parseInt(d.at),\n BE: parseInt(d.be),\n CH: parseInt(d.ch),\n DE: parseInt(d.de),\n DK: parseInt(d.dk),\n ES: parseInt(d.es),\n FR: parseInt(d.fr),\n GB: parseInt(d.gb),\n IE: parseInt(d.ie),\n IT: parseInt(d.it),\n LU: parseInt(d.lu),\n NL: parseInt(d.nl),\n NO: parseInt(d.no),\n PT: parseInt(d.pt),\n SE: parseInt(d.se)\n }\n }", "constructor(buf, off=0) { // Create a new RowParser from a DataRow message buffer.\n this.buf = buf; this.off = off; this.columns = []; this.columnNames = []; // Set up parsing state.\n const columnCount = r16(buf, off+5); off += 7; // Read in the array of column descriptions.\n for (let i = 0; i < columnCount; i++) { // Each column has a name, followed by table, type and format info.\n const nameEnd = buf.indexOf(0, off); // The name is a C string so we find the null byte terminator.\n const name = buf.toString('utf8', off, nameEnd); off = nameEnd + 1; // Then extract the string without the null byte.\n const tableOid = r32(buf, off); off += 4; // If the column is from a table, here's the table's OID. Otherwise zero. \n const tableColumnIndex = r16(buf, off); off += 2; // Along with the index of the column in the table. If the column is not from a table, this is zero.\n const typeOid = r32(buf, off); off += 4; // Next comes the PostgreSQL data type OID of the column. SELECT typname, oid, typarray FROM pg_type WHERE typarray != 0;\n const typeLen = r16(buf, off); off += 2; // The byteLength of a fixed size type. -1 means variable length type.\n const typeModifier = r32(buf, off); off += 4; // The type modifier, see pg_attribute.atttypmod.\n const binary = r16(buf, off); off += 2; // Whether the column is sent as binary (0 = string, 1 = binary.)\n const column = { name, tableOid, tableColumnIndex, typeOid, typeLen, typeModifier, binary }; // Wrap the column description into an object.\n this.columns.push(column); // And add it to our list of columns.\n }\n const parserPrototype = Object.create(RowParser.parserPrototype); // Create a new row parser prototype.\n parserPrototype.columnCount = columnCount; // Store the number of columns to aid in parsing.\n parserPrototype.rowColumns = this.columns; // Store the column information to find column names and types when parsing.\n for (let i = 0; i < this.columns.length; i++) { // Create column getters.\n const index = i; // Pull index into the local closure.\n const getter = {get: function() { // The getter at this index walks the row columns to find the column data.\n let off = 7, buf = this.rowBuffer; // Set up walk state.\n if (this.columnOffsets === undefined) { // If we haven't cached the column offsets yet, let's do it.\n this.columnOffsets = new Array(this.columnCount*2); // Lookup table for column offsets and lengths.\n for (let i = 0; i < this.columnCount; i++) { // Walk through columns.\n const columnLength = r32(buf, off); off += 4; // Read in the column length.\n this.columnOffsets[i*2] = off; // Cache column offset.\n this.columnOffsets[i*2+1] = columnLength; // Cache column length.\n if (columnLength >= 0) off += columnLength; // Skip over the column data.\n }\n }\n off = this.columnOffsets[index*2]; // Read the cached column offset\n const length = this.columnOffsets[index*2+1]; // Read the length of the wanted column.\n return length < 0 ? null : this.parseColumn(index, off, off+length); // Parse the column data unless it's a null.\n }};\n Object.defineProperty(parserPrototype, this.columns[index].name, getter); // Bind the getter to the column name so that you can do `col = row.my_col`\n Object.defineProperty(parserPrototype, index, getter); // Bind the getter to the column index so that you can do `col = row[3]`\n }\n this[1] = function(buf) { this.rowBuffer = buf; }; // Binary row constructor just stores the DataRow buffer, it's parsed on access.\n this[1].prototype = Object.create(parserPrototype); // The prototype of the row stores the row description and methods to access columns. Note that all properties are camelCased to avoid name clashes with column names which are all lowercase.\n this[1].prototype.dataFormat = 1; // The binary rows have a binary data format.\n this[1].prototype.parseColumn = function(i, start, end) { // Parse a binary column, casts the column to a JS object.\n const parser = TypeParser[this.rowColumns[i].typeOid]; // Find a parser for the column type.\n return parser ? parser(this.rowBuffer, start, end) : this.rowBuffer.slice(start, end); // If there's a parser, use it, otherwise slice the buffer.\n };\n this[0] = function(buf) { this.rowBuffer = buf; }; // A String row parser is a binary row parser with a different parseColumn method.\n this[0].prototype = Object.create(parserPrototype); // Copy over the binary row prototype.\n this[0].prototype.dataFormat = 0; // The string row parser's data format is string.\n this[0].prototype.parseColumn = function(i, start, end) { return this.rowBuffer.toString('utf8', start, end); } // To parse a string column, convert a slice of the buffer into a string.\n }", "function parse_data(data) {\n console.log('data n é data: ', data)\n var dia = data.split(\"/\")[0]\n var mes = data.split(\"/\")[1]\n var ano = data.split(\"/\")[2]\n\n return new Date(parseInt(ano), parseInt(mes) - 1, parseInt(dia))\n}", "parseBadgeData(data) {\n\t\tif(data != null){\n\t\t\tlet badgeId = \"\";\n\t\t\t// Validar QR Code\t\t\t\n\t\t\tif(data.substring(0,4) == \"VQC:\") {\n\t\t\t\tlet scannedData = data.substring(4);\n\t\t\t\tlet scannedFields = scannedData.split(\";\");\n\t\t\t\tif(scannedFields != null) {\n\t\t\t\t\tfor(let i = 0, j = scannedFields.length ; i < j ; i++) {\n\t\t\t\t\t\tlet field = scannedFields[i].split(\":\");\n\t\t\t\t\t\tif(field != null && field.length > 0) {\n\t\t\t\t\t\t\tif(field[0] == \"ID\") {\n\t\t\t\t\t\t\t\tbadgeId = field[1];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} \n\t\t\t// try to just load any data as BadgeId\n\t\t\telse {\n\t\t\t\tbadgeId = data;\n\t\t\t}\n\n\t\t\tthis.props.onScanData(badgeId);\n\t\t}\n\t\t\n\t}", "function parseArticleFields(article) {\n\t// Can't assume that any of the values will be present in the, returned\n\t// article data set. Initialise all of the fields as their empty placeholders,\n\t// and fill them if they're defined in the 'article' object \n\tvar title = \"No Title Provided\";\n\tvar snippet = \"No Snippet Provided\";\n\tvar year = \"\";\n\tvar relevance = \"\";\n\tvar url = \"http://trove.nla.gov.au/\";\n\n\n\tif (article.title != undefined) title = article.title;\n\tif (article.snippet != undefined) snippet = article.snippet;\n\tif (article.issued != undefined) year = article.issued;\n\tif (article.relevance != undefined) relevance = article.relevance;\n\tif (article.troveUrl != undefined) url = article.troveUrl;\n\n\n\tvar articleData = {\n\t\ttitle: title,\n\t\tsnippet: snippet,\n\t\tyear: year,\n\t\trelevance: relevance,\n\t\turl: url\n\t}\n\n\treturn articleData;\n}", "function parseOS2Table(data, start) {\n const os2 = {};\n const p = new _parse__WEBPACK_IMPORTED_MODULE_0__.default.Parser(data, start);\n os2.version = p.parseUShort();\n os2.xAvgCharWidth = p.parseShort();\n os2.usWeightClass = p.parseUShort();\n os2.usWidthClass = p.parseUShort();\n os2.fsType = p.parseUShort();\n os2.ySubscriptXSize = p.parseShort();\n os2.ySubscriptYSize = p.parseShort();\n os2.ySubscriptXOffset = p.parseShort();\n os2.ySubscriptYOffset = p.parseShort();\n os2.ySuperscriptXSize = p.parseShort();\n os2.ySuperscriptYSize = p.parseShort();\n os2.ySuperscriptXOffset = p.parseShort();\n os2.ySuperscriptYOffset = p.parseShort();\n os2.yStrikeoutSize = p.parseShort();\n os2.yStrikeoutPosition = p.parseShort();\n os2.sFamilyClass = p.parseShort();\n os2.panose = [];\n for (let i = 0; i < 10; i++) {\n os2.panose[i] = p.parseByte();\n }\n\n os2.ulUnicodeRange1 = p.parseULong();\n os2.ulUnicodeRange2 = p.parseULong();\n os2.ulUnicodeRange3 = p.parseULong();\n os2.ulUnicodeRange4 = p.parseULong();\n os2.achVendID = String.fromCharCode(p.parseByte(), p.parseByte(), p.parseByte(), p.parseByte());\n os2.fsSelection = p.parseUShort();\n os2.usFirstCharIndex = p.parseUShort();\n os2.usLastCharIndex = p.parseUShort();\n os2.sTypoAscender = p.parseShort();\n os2.sTypoDescender = p.parseShort();\n os2.sTypoLineGap = p.parseShort();\n os2.usWinAscent = p.parseUShort();\n os2.usWinDescent = p.parseUShort();\n if (os2.version >= 1) {\n os2.ulCodePageRange1 = p.parseULong();\n os2.ulCodePageRange2 = p.parseULong();\n }\n\n if (os2.version >= 2) {\n os2.sxHeight = p.parseShort();\n os2.sCapHeight = p.parseShort();\n os2.usDefaultChar = p.parseUShort();\n os2.usBreakChar = p.parseUShort();\n os2.usMaxContent = p.parseUShort();\n }\n\n return os2;\n}", "parseData(data) {\n let wodz = [];\n for (let dbWod of data.wodz) {\n wodz.push(this.parseWod(dbWod));\n }\n return wodz;\n }", "function parseTextData(context, length, mode) {\n\t const rawText = context.source.slice(0, length);\n\t advanceBy(context, length);\n\t if (mode === 2 /* RAWTEXT */ ||\n\t mode === 3 /* CDATA */ ||\n\t rawText.indexOf('&') === -1) {\n\t return rawText;\n\t }\n\t else {\n\t // DATA or RCDATA containing \"&\"\". Entity decoding required.\n\t return context.options.decodeEntities(rawText, mode === 4 /* ATTRIBUTE_VALUE */);\n\t }\n\t}", "function eb(a){var b,c,d,e,f,g,h=a._i,i=De.exec(h)||Ee.exec(h);if(i){for(m(a).iso=!0,b=0,c=Ge.length;b<c;b++)if(Ge[b][1].exec(i[1])){e=Ge[b][0],d=Ge[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=He.length;b<c;b++)if(He[b][1].exec(i[3])){\n// match[2] should be 'T' or space\nf=(i[2]||\" \")+He[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Fe.exec(i[4]))return void(a._isValid=!1);g=\"Z\"}a._f=e+(f||\"\")+(g||\"\"),kb(a)}else a._isValid=!1}", "function eb(a){var b,c,d,e,f,g,h=a._i,i=De.exec(h)||Ee.exec(h);if(i){for(m(a).iso=!0,b=0,c=Ge.length;b<c;b++)if(Ge[b][1].exec(i[1])){e=Ge[b][0],d=Ge[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=He.length;b<c;b++)if(He[b][1].exec(i[3])){\n// match[2] should be 'T' or space\nf=(i[2]||\" \")+He[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Fe.exec(i[4]))return void(a._isValid=!1);g=\"Z\"}a._f=e+(f||\"\")+(g||\"\"),kb(a)}else a._isValid=!1}", "function eb(a){var b,c,d,e,f,g,h=a._i,i=De.exec(h)||Ee.exec(h);if(i){for(m(a).iso=!0,b=0,c=Ge.length;b<c;b++)if(Ge[b][1].exec(i[1])){e=Ge[b][0],d=Ge[b][2]!==!1;break}if(null==e)return void(a._isValid=!1);if(i[3]){for(b=0,c=He.length;b<c;b++)if(He[b][1].exec(i[3])){\n// match[2] should be 'T' or space\nf=(i[2]||\" \")+He[b][0];break}if(null==f)return void(a._isValid=!1)}if(!d&&null!=f)return void(a._isValid=!1);if(i[4]){if(!Fe.exec(i[4]))return void(a._isValid=!1);g=\"Z\"}a._f=e+(f||\"\")+(g||\"\"),kb(a)}else a._isValid=!1}" ]
[ "0.635364", "0.62993324", "0.6051874", "0.60458535", "0.6011031", "0.6003248", "0.5898246", "0.585114", "0.58487767", "0.580468", "0.57391065", "0.57249844", "0.57207775", "0.56698793", "0.56681895", "0.5656121", "0.5645805", "0.5634945", "0.5634591", "0.563181", "0.55931866", "0.5588443", "0.55788034", "0.55631113", "0.5557041", "0.55474424", "0.55474424", "0.5526111", "0.5507101", "0.5498374", "0.5496768", "0.54810476", "0.54761803", "0.54761803", "0.54761803", "0.54761803", "0.54761803", "0.5473403", "0.54540515", "0.5452521", "0.5444612", "0.5437375", "0.5437209", "0.54366416", "0.5424398", "0.5421787", "0.5414578", "0.54041535", "0.54041535", "0.54041535", "0.5391688", "0.5391588", "0.5389929", "0.5388976", "0.536805", "0.5349064", "0.53247774", "0.5323392", "0.5316605", "0.5313291", "0.5309075", "0.5309075", "0.5309075", "0.53051984", "0.5304223", "0.5291812", "0.52852154", "0.5284679", "0.5277989", "0.52771616", "0.52688575", "0.52671874", "0.5259735", "0.5249234", "0.52328944", "0.5230686", "0.522625", "0.5222744", "0.5217788", "0.5213562", "0.5209606", "0.52092975", "0.5201763", "0.52011967", "0.5197357", "0.5197079", "0.51937157", "0.5187959", "0.51850903", "0.5184654", "0.5180564", "0.51782775", "0.5174446", "0.51727384", "0.5171193", "0.51689774", "0.5163662", "0.5163262", "0.516103", "0.516103", "0.516103" ]
0.0
-1
have to actually load the resources specified in header
function doResources() { var css = ['aegis.css', 'jquery-ui.css']; css.forEach(function(el, i, a) { var res = GM_getResourceText(el); GM_addStyle(res); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function loadResources(res) {\n var monitor,\n tag;\n monitor = createMonitor(res);\n for (var i = 0, i_len = res.res.length; i < i_len; i++) {\n tag = createTag(res.res[i], monitor);\n if (tag) head.appendChild(tag);\n }\n }", "function loadResources(callback) {\n // No resources need loaded\n callback();\n }", "function loadedResources(response){\n //console.log('Language Resources loaded for: ar',response);\n }", "function initResources(done) {\n\n try {\n\n // load styles\n loadCss(host + 'components/fontawesome/css/font-awesome.min.css');\n loadCss(host + 'components/owl-carousel/owl.carousel.css');\n loadCss(host + 'components/owl-carousel/owl.theme.css');\n loadCss(host + 'ibhs/styles/ibhs.css');\n\n // load scripts\n loadScript(host + 'components/modernizr/modernizr.min.js');\n loadScript(host + 'components/owl-carousel/owl.carousel.min.js');\n loadScript(host + 'components/jquery.media/jquery.media.js');\n loadScript(host + 'components/handlebars/handlebars-v3.0.0.js', function () {\n loadScript(host + 'ibhs/js/templates/compiled/file-browser-widget.html.js');\n loadScript(host + 'ibhs/js/templates/compiled/link-widget.html.js');\n loadScript(host + 'components/rivets/rivets.bundled.min.js', function () {\n loadScript(host + 'ibhs/js/ibhs.common.js', function () {\n loadScript(host + 'ibhs/js/ibhs.data.js', function () {\n loadScript(host + 'ibhs/js/ibhs.widget.link.js', function () {\n loadScript(host + 'ibhs/js/ibhs.widget.filebrowser.js', done);\n });\n });\n });\n\n });\n });\n } catch (e) {\n console.error('Exception initializing widget resources - ' + e.message);\n }// try-catch\n }", "function loadResources() {\n var images = [];\n images = images.concat(Player.getSprites());\n images = images.concat(Block.getSprites());\n images = images.concat(Gem.getSprites());\n\n images.push(Enemy.sprite);\n images.push(Heart.sprite);\n images.push(Star.sprite);\n images.push(Key.sprite);\n\n Resources.load(images);\n Resources.onReady(init);\n }", "loadResources() {\n lbs.loader.scripts = lbs.loader.scripts.filter(this.uniqueFilter)\n lbs.loader.styles = lbs.loader.styles.filter(this.uniqueFilter)\n lbs.loader.libs = lbs.loader.libs.filter(this.uniqueFilter)\n\n lbs.log.debug(`Scripts to load:${lbs.loader.scripts}`)\n lbs.log.debug(`Styles to load: ${lbs.loader.styles}`)\n lbs.log.debug(`Libs to load: ${lbs.loader.libs}`)\n\n $.each(lbs.loader.libs, (i) => {\n lbs.loader.loadScript(lbs.loader.libs[i])\n })\n\n $.each(lbs.loader.scripts, (i) => {\n lbs.loader.loadScript(lbs.loader.scripts[i])\n })\n\n $.each(lbs.loader.styles, (i) => {\n lbs.loader.loadStyle(lbs.loader.styles[i])\n })\n }", "loadResources(){\n\n const directory = \"./assets/images/\";\n\n //Load Character-related textures\n this.gameContent.skins.forEach(({skin,texture}) => {\n this.loader.add(`skin_${skin}`,`${directory}/skins/${texture}`);\n });\n\n //Load Map textures\n this.gameContent.maps.forEach(({map,source,obstacle}) => {\n\n this.loader\n .add(`map_${map}`,`${directory}/${source}`)\n .add(`obstacle_${map}`,`${directory}/${obstacle.texture}`);\n\n });\n\n //Load UI-related textures\n this.loader\n .add(\"ui_background\", `${directory}/${this.gameContent.ui.background}`)\n .add(\"ui_button\", `${directory}/${this.gameContent.ui.button}`)\n .add(\"ui_button2\", `${directory}/${this.gameContent.ui.button2}`)\n .add(\"ui_button3\", `${directory}/${this.gameContent.ui.button3}`)\n .add(\"ui_arrow\", `${directory}/${this.gameContent.ui.arrow}`)\n .add(\"ui_loader\", `${directory}/${this.gameContent.ui.loader}`)\n .add(\"ui_sound\", `${directory}/${this.gameContent.ui.sound}`)\n .add(\"ui_muted\", `${directory}/${this.gameContent.ui.muted}`);\n\n //Load Sounds *****\n\n }", "function loadCSS() {\n\n // CSS file not loaded yet? => load CSS file\n if ( !resource ) jQuery( 'head' ).append( '<link rel=\"stylesheet\" type=\"text/css\" href=\"' + url + '\">' );\n\n // immediate perform success callback\n success();\n\n }", "load() {}", "load() {}", "function init(){\n // loadHeaders(); //load platform headers\n}", "LoadAsset() {}", "function loadResource($, rscURL, rscType, callback, doc, win, tag, done, readystate){\n if (!window.__DICT__.appendTag) {\n alert('Need dict.util.sharebml.js');\n return;\n }\n doc = doc || document;\n win = win || window;\n console.log(D.LC, '[_cmn/dict.util.js] Loading:',rscURL);\n if (rscType==\"js\") {\n // Create a script element.\n tag = doc.createElement( 'script' );\n tag.type = 'text/javascript';\n tag.src = rscURL;\n } else if (rscType==\"css\") {\n // Create a css link element.\n tag = doc.createElement( 'link' );\n tag.type = 'text/css';\n tag.type = 'text/css';\n tag.rel = 'stylesheet';\n tag.href = rscURL;\n } else {\n return;\n }\n\n tag.onload = tag.onreadystatechange = function() {\n if ( !done && ( !( readystate = this.readyState )\n || readystate == 'loaded' || readystate == 'complete' ) ) {\n\n if (typeof callback == \"function\"){\n callback($);\n }\n //$( tag ).remove();\n }\n };\n\n window.__DICT__.appendTag(tag);\n}", "function ResourceLoader() {\n this.loadedScenesByUid = {};\n this.loadedCommonEventsById = [];\n }", "function loadExternalData() {\n var loadFileParam = $location.search().loadfile;\n if (loadFileParam) {\n // block gui for long calls\n blockGui(true);\n Rest.callOther(\"loadableServerDataFiles\", \"loadFromFile\" + \"/\" + loadFileParam, initFromResponse);\n }\n }", "[loadAllSource]() {\n let ret = [];\n let test = {};\n // dump static html files\n let sopt = this[config].format({\n flag: false,\n dir: 'DIR_SOURCE',\n sub: 'DIR_SOURCE_SUB'\n });\n ret.push(...this[loadSource](sopt,test));\n // dump server template files\n let topt = this[config].format({\n flag: true,\n dir: 'DIR_SOURCE_TP',\n sub: 'DIR_SOURCE_TP_SUB'\n });\n ret.push(...this[loadSource](topt,test));\n // ensure all resource loaded\n Promise.all(ret).then(() => {\n this.emit('done');\n });\n }", "loadResources(callback) {\n\t\tthis.manager = new RC.LoadingManager();\n\t\tthis.objLoader = new RC.ObjLoader(this.manager);\n\t\tthis.imageLoader = new RC.ImageLoader(this.manager);\n\n\t\tlet urls = [];\n\t\t/*for(var x = 1; x <= 14; x++) {\n\t\t\turls.push(\"data/models/mitos/mito_\"+x+\"_out.obj\");\n\t\t}*/\n\t\t// Mitochondrias\n\t\tfor(var x = 1; x <= 15; x++) {\n\t\t\turls.push(\"data/models/mito_new/structure_id_\"+x+\".obj\");\n\t\t}\n\t\t// Endolysosomes\n\t\tvar end = 'structure_id_405.obj,structure_id_334.obj,structure_id_336.obj,structure_id_333.obj,structure_id_535.obj,structure_id_395.obj,structure_id_502.obj,structure_id_375.obj,structure_id_390.obj,structure_id_660.obj,structure_id_703.obj,structure_id_623.obj,structure_id_359.obj,structure_id_608.obj,structure_id_618.obj,structure_id_595.obj,structure_id_552.obj'\n\t\tfor (var s of end.split(\",\")) {\n\t\t\turls.push(\"data/models/endolysosomes_new/\"+s)\n\t\t}\n\t\t// Fusiform Vesicles\n\t\tvar fv = 'structure_id_816.obj,structure_id_815.obj,structure_id_818.obj,structure_id_822.obj,structure_id_820.obj,structure_id_821.obj'\n\t\tfor (var s of fv.split(\",\")) {\n\t\t\turls.push(\"data/models/fusiform_vesicles_new/\"+s)\n\t\t}\n\n\t\tconst makeRepeated = (arr, repeats) =>\n\t\t\t[].concat(...Array.from({ length: repeats }, () => arr));\n\n\t\tlet augmented_dataset = makeRepeated(urls, 5)\n\n\t\tfunction shuffleArray(array) {\n\t\t\tfor (var i = array.length - 1; i > 0; i--) {\n\t\t\t\tvar j = Math.floor(Math.random() * (i + 1));\n\t\t\t\tvar temp = array[i];\n\t\t\t\tarray[i] = array[j];\n\t\t\t\tarray[j] = temp;\n\t\t\t}\n\t\t}\n\t\tshuffleArray(urls)\n\t\tshuffleArray(augmented_dataset)\n\n\t\tthis.augmented_three_d_model_count = augmented_dataset.length;\n\t\tthis.three_d_model_count = urls.length;\n\t\tthis.resources = [];\n\n\t\t/*for (let i = 0; i < urls.length; ++i) {\n\t\t\tthis.resources[i] = false;\n\t\t\tthis.objLoader.load(urls[i], (obj) => {\n\t\t\t\tthis.resources[i] = obj;\n\n\t\t\t});\n\t\t}*/\n\n\t\tfor (let i = 0; i < augmented_dataset.length; ++i) {\n\t\t\tthis.resources[i] = false;\n\t\t\tthis.objLoader.load(augmented_dataset[i], (obj) => {\n\t\t\t\tthis.resources[i] = obj;\n\n\t\t\t});\n\t\t}\n\n\t\tlet wait = (function() {\n\t\t\tif (this.resources.every((el) => { return el !== false; })) {\n\t\t\t\tthis.setupObjectsInHemiSphere();\n\t\t\t\tcallback();\n\t\t\t} else {\n\t\t\t\tsetTimeout(wait, 500);\n\t\t\t}\n\t\t}).bind(this);\n\t\twait();\n\t}", "function loadResource (source, isTemplate) {\n\t\tvar s = document.createElement('script');\n\t\ts.src = chrome.extension.getURL(source);\n\n\t\tif (isTemplate) {\n\t\t\t// Knockout templates need to be handled differently than normal scripts\n\t\t\t// This is step one of two. Step two gets carried out by getTemplates() in bootstrapper.js\n\n\t\t\tvar startpoint = source.lastIndexOf(\"/\") + 1;\n\t\t\tvar name = source.substring(startpoint, source.length-5);\n\n\t\t\ts.id = name;\n\t\t\ts.type = \"text/html\";\n\t\t\t(document.head||document.documentElement).appendChild(s);\n\t\t} else {\n\t\t\t// creates, runs and removes script\n\t\t\ts.type = \"text/javascript\";\n\t\t\ts.onload = function() {\n\t\t\t\tthis.parentNode.removeChild(this);\n\t\t\t};\t\t\t\n\t\t\t(document.head||document.documentElement).appendChild(s);\t\t\t\n\t\t}\n\t}", "load(cb){\r\n\r\n\t\tconsole.log('Loading assets (difficulty: 1)');\r\n\r\n\t\t// Chiama il metodo load della classe parent\r\n\t\tsuper.load(cb, 1);\r\n\t}", "function resourceLoaded()\n{\n\tif(++curLoadResNum >= totalLoadResources){\n\t\tredraw();\n\t}\n}", "function loadImage() {\n\n // image file not loaded yet? => load image file\n if ( !resource ) jQuery( '<img src=\"' + url + '\">' );\n\n // immediate perform success callback\n success();\n\n }", "loadResource(name) {\n if (!(name in this.resources)) {\n return Promise.reject(name);\n }\n\n const resource = this.resources[name];\n if (resource.promise) {\n return resource.promise;\n }\n\n if (!(resource.type in this.loaders)) {\n return Promise.resolve(name);\n }\n\n const loader = this.loaders[resource.type];\n resource.promise = loader(resource.url);\n return resource.promise;\n}", "function requires(src){\r\n\treturn (new AjaxJSLoader(src)).retrieve();\r\n}", "async load () {}", "function loaded(res, fail, failedResource) {\n var old = queuePos;\n if (res.done) {\n queuePos = 0;\n db('#loaded - calling done on: ', res)\n res.done(ctx.$loader);\n }\n // Restore queue position in case a resource was injected.\n queuePos = old;\n db('#loaded - wait = false')\n wait = false;\n if (queue.length === 0) fireReady();\n }", "function enqueueResources(resources, cb){\n var numElementsLoaded = 0;\n var lastError = null;\n\n function onCompleteHandler(err){\n lastError = err;\n numElementsLoaded++;\n\n // all callbacks returned ?\n if (numElementsLoaded == resources.length){\n // set flag\n isEnqueued = true;\n\n // run final callback to trigger initialization\n cb(lastError);\n }\n }\n\n // load all resources\n resources.forEach(function(src){\n // extract extension\n var match = src.match(/\\.([a-z]+)(?:[#?].*)?$/);\n\n switch (match[1]){\n // dynamically load script\n case 'js':\n var script = document.createElement('script');\n script.onload = function(){onCompleteHandler(null)};\n script.onerror = onCompleteHandler;\n script.src = src;\n script.async = true;\n head.appendChild(script);\n break;\n\n // dynamically load style\n case 'css':\n var link = document.createElement('link');\n link.onload = function(){onCompleteHandler(null)};\n link.onerror = onCompleteHandler;\n link.rel = 'stylesheet';\n link.type = 'text/css';\n link.href = src;\n link.media = 'all';\n head.appendChild(link);\n break;\n default:\n log('Error: invalid file extension', src);\n };\n });\n }", "load() {\r\n\r\n }", "load( resolver ) {\n const nextToLoad = this.layers.find( ( { isready } ) => !isready );\n if( nextToLoad ) {\n const loader = Promise.all( nextToLoad.prop.use.map( ({ type = \"url\", ...use }) =>\n type === \"url\" ? Loader.default.obtain( use ) : this.get( use.path )\n ));\n loader.then(( packs ) => {\n packs.map( (pkj, index) => {\n const { type = \"url\" } = nextToLoad.prop.use[index];\n if(type === \"url\") {\n this.appendData( pkj, nextToLoad.src );\n }\n else {\n this.merge( pkj, true );\n }\n } );\n nextToLoad.isready = true;\n this.load( resolver );\n });\n }\n else {\n resolver( this );\n }\n }", "function loadInternalResource(uri) {\n \tlog.info(\"Loading internal resource from \" + extensionAddress + '/' + uri + '.');\n\n \tvar xhr = new XMLHttpRequest();\n \txhr.open(\"get\", extensionAddress + '/' + uri, false);\n \txhr.send();\n\n \treturn xhr.responseText;\n }", "function Loader( resources, callback, thisArg ) { \n\t\t// Sets the current instance in a variable\n\t\tconst al = this;\n\t\t\n\t\t// If there are less than three arguments, set the context to the current instance\n\t\tif ( arguments.length < 3 ) thisArg = this;\n\n\t\t// An array of loaded scripts\n\t\tal.loadedScripts = [ ];\n\n\t\t// An array of MediaWiki modules\n\t\tal.modules = resources.MODULES || [ ];\n\n\t\t// An object of scripts to load\n\t\tal.scripts = resources.SCRIPTS || { };\n\n\t\t// An array of stylesheets to load\n\t\tal.stylesheets = resources.STYLESHEETS || [ ];\n\n\t\t// Initializes the loader\n\t\tal.init = function( ) { \n\t\t\tif ( Array.isArray( al.modules ) && al.modules.length ) { \n\t\t\t\treturn mw.loader\n\t\t\t\t\t.using( al.modules )\n\t\t\t\t\t.then( al.loadScripts.bind( al ) );\n\t\t\t}\n\n\t\t\tal.loadScripts( );\n\t\t};\n\n\t\t// Loads all scripts and stylesheets if they are not loaded\n\t\tal.loadScripts = function( ) { \n\t\t\tif ( Array.isArray( al.stylesheets ) && al.stylesheets.length ) { \n\t\t\t\timportArticles( { type: \"style\", articles: al.stylesheets } );\n\t\t\t}\n\n\t\t\tconst promises = Promise.all( \n\t\t\t\tObject\n\t\t\t\t\t.getOwnPropertyNames( al.scripts )\n\t\t\t\t\t.map( function( name ) { \n\t\t\t\t\t\tconst script = al.scripts[ name ];\n\n\t\t\t\t\t\tif ( window.dev && window.dev[ name ] ) { \n\t\t\t\t\t\t\tal.loadedScripts.push( script );\n\t\t\t\t\t\t\treturn Promise.resolve( );\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn new Promise( function( resolve, reject ) { \n\t\t\t\t\t\t\timportArticle( { \n\t\t\t\t\t\t\t\ttype: \"script\",\n\t\t\t\t\t\t\t\tarticle: script\n\t\t\t\t\t\t\t} ).then( function( ) { \n\t\t\t\t\t\t\t\tal.loadedScripts.push( script );\n\t\t\t\t\t\t\t} ).then( resolve )[ \"catch\" ]( reject );\n\t\t\t\t\t\t} );\n\t\t\t\t\t} )\n\t\t\t);\n\n\t\t\treturn promises.then( function( ) { \n\t\t\t\tal.loaded = true;\n\t\t\t\treturn callback.apply( thisArg, al );\n\t\t\t} );\n\t\t};\n\n\t\treturn al;\n\t}", "asyncLoadRequested(resourceName) {\n this.resourceMap[resourceName] = new MapEntry(resourceName); // place holder for the resource to be loaded\n this.numOutstandingLoads += 1;\n }", "function ResourceManager() {\n var fileUID = 0;\n this.eventDispatcher = new Odyssey.Events.EventDispatcher();\n\n this.spritesheets = [];\n\n // Sources to UID map.\n this.srcs = {};\n\n this.resources = [];\n\n // Source file prefix.\n this.prefix = \"\";\n\n // Getter for private fileUID.\n this.getUniqueFileID = function () {\n var id = fileUID;\n fileUID += 1;\n return id;\n };\n\n // File IDs awaiting load.\n this.resourcesAwaitingLoad = [];\n this.resourcesAwaitingLoadMap = {};\n // Needed for progress %.\n this.loaded = [];\n\n // Event listeners.\n //this.addEventListener(\"OdysseyBinaryFileLoaded\", proxy(this.stopLoader, this, null));\n //this.addEventListener(\"OdysseyBinaryFileLoaded\", proxy(this.startLoader, this, null));\n this.addEventListener(\"OdysseyBinaryFileLoaded\", proxy(this.filterAwaiting, this, null));\n this.addEventListener(\"OdysseyBinaryFileLoaded\", proxy(this.loadNextResource, this, null));\n\n // The number of active loaders.\n this.activeLoaders = 0;\n }", "function onResourceRequested(requestData, request){\n resources[requestData.id] = requestData.stage;\n var domain = get_domain(requestData['url']);\n if ((/http:\\/\\/.+?\\.(css|ssi)$/gi).test(requestData['url'])) {\n // abort all css request\n request.abort();\n return;\n }else if((/^http.*\\.js.*/).test(requestData['url'])){\n //This a js request would not be aborted\n return;\n } else if (root_domain != null && domain.indexOf(root_domain) == -1 && !_valid_request(domain, root_domain)){\n // abort request for other sites\n request.abort();\n return;\n }\n}", "function inner_onResource(filename, resource)\r\n\t\t{\r\n\t\t\tresource.filename = filename;\r\n\t\t\tif(options.filename) //used to overwrite\r\n\t\t\t\tresource.filename = options.filename;\r\n\r\n\t\t\tif(!resource.fullpath)\r\n\t\t\t\tresource.fullpath = url;\r\n\r\n\t\t\tif(LS.ResourcesManager.resources_being_processes[filename])\r\n\t\t\t\tdelete LS.ResourcesManager.resources_being_processes[filename];\r\n\r\n\t\t\t//keep original file inside the resource\r\n\t\t\tif(LS.ResourcesManager.keep_files && (data.constructor == ArrayBuffer || data.constructor == String) )\r\n\t\t\t\tresource._original_data = data;\r\n\r\n\t\t\t//load associated resources\r\n\t\t\tif(resource.getResources)\r\n\t\t\t\tResourcesManager.loadResources( resource.getResources({}) );\r\n\r\n\t\t\t//register in the containers\r\n\t\t\tLS.ResourcesManager.registerResource(url, resource);\r\n\r\n\t\t\t//callback \r\n\t\t\tif(on_complete)\r\n\t\t\t\ton_complete(url, resource, options);\r\n\t\t}", "load() {\n\n }", "function preLoad() {\n // load something and continue on only when finished\n}", "function loadStories() {\n req.keys().forEach((filename) => req(filename));\n}", "function loadData() {\n\t// Detect if HTTP object exists and is not busy\n\tif (http && !isWorking) {\n\t\t//http.open('get','http://people.rit.edu/~met8481/536/project_1/ajax/data/content.js');\n\t\thttp.open('get','DATA/content.js');\n\t\thttp.onreadystatechange=handleHttpResponse;\n\t\thttp.send();\n\t\tisWorking = true;\n\t}\n}", "function loadActivist (prefix, options, rsrc) {\n var config = {};\n var defaultConfig = require('./src/config');\n for (var i in defaultConfig) {\n if (defaultConfig.hasOwnProperty(i) && !options[i]) {\n config[i] = defaultConfig[i];\n } else if (options[i]) {\n config[i] = options[i];\n }\n }\n config.url = prefix + '.js';\n config.frame = prefix + '.html';\n config.offline = prefix + '-offline.html';\n\n rsrc.type = 'text/javascript';\n packager(config, function (data) {\n rsrc.body = data;\n rsrc.headers = {\n 'Cache-Control': 'public, max-age=' + Math.floor(rsrc.maxAge / 1000),\n 'ETag': etag(data)\n };\n });\n}", "function requestContent(filename) {\n $('main').load(filename);\n}", "function startResourceLoading(jobid){\r\n\t\t// test if component panel was already added to the\r\n\t\t// center stage at the\r\n\t\t// presentation layer\r\n\t\tfor(let i = 0; i < _containersToLoad.length; ++i) {\r\n\t\t\tlet container = _containersToLoad[i];\r\n\t\t\tLOG.debug(TAG, \"****************************************************************\");\r\n\t\t\tLOG.debug(TAG, \"... start loading runtime container of component {\" + container.getComponentID() + \"}\");\r\n\t\t\t// add loading state observable to ui layer, where\r\n\t\t\t// it is used to observe and\r\n\t\t\t// represent the component's state.\r\n\t\t\tDocuma.RuntimeManager.getUIManager().getComponentsLoadView().addLoadingStateObject(container.getLoadingState());\r\n\t\t\t// start loading component resources\r\n\t\t\tcontainer.loadResources(container.getComponentInstanceID(), jobid, onContainerLoaded);\r\n\t\t\t// add container to trigger the loading of resources\r\n\t\t\t// --> the onload function will\r\n\t\t\t// be called after the iframe is added to the\r\n\t\t\t// DOM-tree\r\n\t\t\tDocuma.RuntimeManager.getUIManager().getLayoutManager().add(container);\r\n\t\t\tLOG.debug(TAG, \"****************************************************************\");\r\n\t\t}\r\n\t}", "loadPages() {\n this._pages = utility.getJSONFromFile(this._absoluteFile);\n }", "function loadResources(assets, whenLoaded) {\n document.fonts.load('30px AtariST').then(() => {\n let imgCounter = 0;\n let sfxCounter = 0;\n assets.IMGS.forEach(function(path){\n let img = document.createElement('img');\n img.src = path;\n let fileName = path.split(/[\\./]/).slice(-2, -1)[0];\n img.onload = function(){\n ctx.clearRect(15, 50, gameWindow.width, 30);\n ctx.fillText(\"Img \" + imgCounter + \"/\" + assets.IMGS.length, 15, 80);\n imgs[fileName] = img;\n imgCounter++;\n (assets.IMGS.length == imgCounter) && (assets.SFX.length == sfxCounter) ? whenLoaded() : console.log('suspenseful loading time...');\t\n };\n });\n assets.SFX.forEach(function(path){\n let sfx = document.createElement('audio');\n sfx.src = path;\n let fileName = path.split(/[\\./]/).slice(-2, -1)[0];\n sfx.onloadeddata = function() {\n ctx.clearRect(15, 100, gameWindow.width, gameWindow.height);\n ctx.fillText(\"Sfx \" + sfxCounter + \"/\" + assets.SFX.length, 15, 130);\n sfxs[fileName] = sfx;\n\t\t\t sfxCounter++;\n (assets.IMGS.length == imgCounter) && (assets.SFX.length == sfxCounter) ? whenLoaded() : console.log('suspenseful loading time...');\n };\n });\n });\n}", "_read() {\n\n if (!this.headerSent) {\n perf(`bundling: BUNDLE_HEADER::${this.entryScriptIdentity}`);\n let proceed = this.push(BUNDLE_HEADER(this.entryScriptIdentity));\n this.headerSent = true;\n if (!proceed) {\n return;\n }\n }\n\n while (this.includeList.length) {\n\n let fileToProcess = this.includeList.shift();\n\n perf(`bundling: ${fileToProcess}`);\n\n //remove it to ensure we don't repeat files\n let fileContent = this.readFile(fileToProcess);\n let proceed = this.push(fileContent);\n if (!proceed) {\n return;\n }\n }\n\n perf(`bundling: BUNDLE_FOOTER::${this.entryScriptIdentity}`);\n this.push(BUNDLE_FOOTER(this.entryScriptIdentity));\n\n this.push(null);\n }", "function loadStories() {\n req.keys().forEach(filename => req(filename));\n}", "preload() {\n\n // loading assets\n this.load.image(\"wheel\", Utils.UrlRoot + \"minigame/wheel/wheel.png\");\n this.load.image(\"pin\", Utils.UrlRoot + \"minigame/wheel/pin.png\");\n }", "function load() {\n m_data.load(APP_ASSETS_PATH + \"ded_moroz_06.json\", load_cb, preloader_cb);\n}", "getRessources(app) {\n var localization = navigator.language;\n if (localization == \"fr\" || localization == \"fr-FR\") {\n Utilitary.getXHR(\"ressources/ressources_fr-FR.json\", (ressource) => { this.loadMessages(ressource, app); }, Utilitary.errorCallBack);\n }\n else {\n Utilitary.getXHR(\"ressources/ressources_en-EN.json\", (ressource) => { this.loadMessages(ressource, app); }, Utilitary.errorCallBack);\n }\n }", "function load() {\n var p_cb = PRELOADING ? preloader_callback : null;\n m_data.load(\"dalena_web.json\", load_cb, p_cb, !true);\n}", "loadStylesAndResources() {\n if (stylesLoaded) return;\n stylesLoaded = true;\n \n let style = document.createElement('style');\n style.type = 'text/css';\n style.innerHTML = styles;\n document.body.appendChild(style);\n\n for (let url of [fontAwesome + '/css/all.css', heebo + '/css.css']) {\n let link = document.createElement('link');\n link.rel = 'stylesheet';\n link.type = 'text/css';\n link.href = url;\n document.head.appendChild(link);\n }\n }", "function preload_menuhdr() {\n\tfor ( x=0; x<totalButtons_menuhdr; x++ ) {\n\t\tbuttonUp_menuhdr = new Image();\n\t\tbuttonUp_menuhdr.src = buttonFolder_menuhdr + upSources_menuhdr[x];\n\t\tbuttonOver_menuhdr = new Image();\n\t\tbuttonOver_menuhdr.src = buttonFolder_menuhdr + overSources_menuhdr[x];\n\t}\n}", "function loadResourceScripts(scripts) {\n // Load all of the new scripts in parallel\n var scriptPromises = [];\n _.each(scripts, function(script) { scriptPromises.push(loadScript(script)); });\n\n return $q.all(scriptPromises);\n }", "pushResources(data, appPath) {\n let path\n\n if (typeof data === 'undefined') {\n return\n }\n $.each(data.scripts, (i) => {\n path = appPath === '/' ? `${lbs.loader.systemLibPath}js/` : appPath\n lbs.loader.scripts.push(path + data.scripts[i])\n })\n\n $.each(data.libs, (i) => {\n path = `${lbs.loader.systemLibPath}js/`\n lbs.loader.libs.push(path + data.libs[i])\n })\n\n $.each(data.styles, (i) => {\n path = appPath === '/' ? `${lbs.loader.systemLibPath}css/` : appPath\n lbs.loader.styles.push(path + data.styles[i])\n })\n }", "function _fetchResourceSource(source, currentView) {\n var resources = source.resources;\n \n if (resources) {\n if ($.isFunction(resources)) {\n return resources();\n }\n } else {\n var url = source.url;\n if (url) {\n var data={};\n if (typeof currentView == 'object') {\n var startParam = options.startParam;\n var endParam = options.endParam;\n if (startParam) {\n data[startParam] = Math.round(+currentView.visStart / 1000);\n }\n if (endParam) {\n data[endParam] = Math.round(+currentView.visEnd / 1000);\n }\n }\n\n $.ajax($.extend({}, source, {\n data: data,\n dataType: 'json',\n cache: false,\n success: function(res) {\n res = res || [];\n resources = res;\n },\n error: function() {\n alert(\"ajax error getting json from \"+url);\n },\n async: false // too much work coordinating callbacks so dumb it down\n }));\n }\n }\n return resources;\n }", "function load(paths) {\n\tfunction loadImage(path, callback) {\n\t\tvar img = document.createElement('img');\n\t\timg.addEventListener('load', callback, false);\n\t\timg.src = path;\n\t}\n\tfunction loadResource(path, callback) {\n\t\tvar req = new XMLHttpRequest();\n\t\treq.open('GET', path, true);\n\t\treq.onreadystatechange = function () {\n\t\t\tif (req.readyState === 4)\n\t\t\t\tcallback({\n\t\t\t\t\ttext: req.responseText,\n\t\t\t\t\tstatus: req.status\n\t\t\t\t});\n\t\t};\n\t\treq.send(null);\n\t}\n\treturn ({ then: function (callback) {\n\t\treturn new Async(callback.accumulate(paths.length), function (callback) {\n\t\t\tpaths.forEach(function (path, i) {\n\t\t\t\t(/\\.(png|jpg|gif)$/.test(path) ? loadImage : loadResource)\n\t\t\t\t\t(path, callback.curry(i));\n\t\t\t});\n\t\t})\n\t}})\n}", "function loaded() {\n ut.assert(true);\n ut.async(false);\n }", "function readResource(filenameArray) {\n let filename = filenameArray.pop();\n return new Promise((res, rej) => {\n fs.readFile(__dirname + \"/resources/\" + filename, (err, data) => {\n let promisedArray = [filename, data, filenameArray];\n return err ? rej(err) : res(promisedArray);\n });\n });\n }", "patched() {\n this._handleImageLoad();\n }", "function basicLoad(location) {\n var possible = ['koalas', 'koalas1', 'koalas2', 'koalas3'];\n // ** you can change this variable to whatever image you want. This becomes the default **\n var file = 'img/' + possible[Math.floor(Math.random() * possible.length)] + '.jpg'\n return {\n file: file,\n shownFile: location.protocol + '//' + location.host + location.pathname + file\n };\n }", "function load() {\n chrome.runtime.sendMessage({action: 'load'}, function(response) {\n initialize();\n\n var observer = new MutationObserver(function (mutations) {\n\n mutations.forEach(function (mutation) {\n var fileActionDiv = mutation.target.querySelector(\".file-actions\");\n var footer = mutation.target.querySelector(\".footer\");\n if (fileActionDiv != null && footer == null) {\n initialize();\n }\n });\n });\n var config = {\n childList: true,\n characterData: true,\n subtree: true\n };\n\n // pass in the target node, as well as the observer options\n var files = document.querySelector('#files');\n if (files != null) {\n observer.observe(files, config);\n }\n });\n }", "getResource(){\n\n }", "loadExternal() {\n // let texture = Bitmap.fromImage(this.$url, true);\n let texture = new Bitmap();\n this.$loadingTexture = texture;\n //TODO: Texture does not have error event... monitor error event on baseTexture will casue cross-error-event problem.\n // texture.once(\"update\", () => {\n // if (!texture.width || !texture.height)\n // this.$loadResCompleted(null);\n // else\n // this.$loadResCompleted(texture);\n // });\n }", "constructor () {\n this.hdrCubeLoader = new HDRCubeTextureLoader();\n this.gltfLoader = new GLTFLoader();\n this.fbxLoader = new FBXLoader();\n this.jsonLoader = new JSONLoader();\n this.textureLoader = new TextureLoader();\n this.fontLoader = new FontLoader();\n this.isLoaded = false;\n }", "function _init() {\n\t\tgetHeadlines();\n\t}", "function loadResource( url, type, callback ) {\n\t\tvar head = document.querySelector( 'head' );\n\t\tvar resource;\n\n\t\tif ( type === 'script' ) {\n\t\t\tresource = document.createElement( 'script' );\n\t\t\tresource.type = 'text/javascript';\n\t\t\tresource.src = url;\n\t\t}\n\t\telse if ( type === 'stylesheet' ) {\n\t\t\tresource = document.createElement( 'link' );\n\t\t\tresource.rel = 'stylesheet';\n\t\t\tresource.href = url;\n\t\t}\n\n\t\t// Wrapper for callback to make sure it only fires once\n\t\tvar finish = function() {\n\t\t\tif( typeof callback === 'function' ) {\n\t\t\t\tcallback.call();\n\t\t\t\tcallback = null;\n\t\t\t}\n\t\t}\n\n\t\tresource.onload = finish;\n\n\t\t// IE\n\t\tresource.onreadystatechange = function() {\n\t\t\tif ( this.readyState === 'loaded' ) {\n\t\t\t\tfinish();\n\t\t\t}\n\t\t}\n\n\t\t// Normal browsers\n\t\thead.appendChild( resource );\n\t}", "LoadAssetWithSubAssets() {}", "_initSources() {\n // finally load every sources already in our plane html element\n // load plane sources\n let loaderSize = 0;\n if(this.autoloadSources) {\n const images = this.htmlElement.getElementsByTagName(\"img\");\n const videos = this.htmlElement.getElementsByTagName(\"video\");\n const canvases = this.htmlElement.getElementsByTagName(\"canvas\");\n\n // load images\n if(images.length) {\n this.loadImages(images);\n }\n\n // load videos\n if(videos.length) {\n this.loadVideos(videos);\n }\n\n // load canvases\n if(canvases.length) {\n this.loadCanvases(canvases);\n }\n\n loaderSize = images.length + videos.length + canvases.length;\n }\n\n this.loader._setLoaderSize(loaderSize);\n\n this._canDraw = true;\n }", "preload() {\n\n\t\t// Get our type based on the key in the manifest\n\t\tlet _type = Object.keys(this.manifest)[this.preloader.package_loaded];\n\n\t\t// Check to see if our total loaded is < our manifest\n\t\tif(this.preloader.package_loaded < Object.keys(this.manifest).length){\n\t\t\tthis.preloader.load(_type, this.manifest[_type]);\n\t\t} else {\n\t\t\tthis.trigger('assets_loaded');\n\t\t}\n\t}", "load(key) {\n this.assets[key].load();\n return this.assets[key];\n }", "function getImageResources(){\n\t//Load default resources\n\tvar imageResources =\n\t\t[\n\t\t\t['font', 'resources/CasualEncounter.png'],\n\t\t\t['logo', 'resources/logo.png'],\n\t\t\t['player_sprite', 'resources/walk.png'],\n\t\t\t['map_spritesheet', 'resources/map_pieces.png'],\n\t\t\t['enemy_sprite', 'resources/enemy_sprite.png'],\n\t\t\t['block_sprite', 'resources/block_sprite.png'],\n\t\t\t['background_tilesheet', 'resources/bg1.png'],\n\t\t\t['explosion_sprite', 'resources/Frk_Blast1.png']\n\t\t];\n\tif($config.use_plugins){\n//\t\timageResources = [];\n\t\tfor(var plugin in pluginHelper.loadedPlugins) {\n\t\t\tif (pluginHelper.loadedPlugins[plugin].sprites) {\n\t\t\t\tjQuery.merge(imageResources,pluginHelper.loadedPlugins[plugin].sprites);\n\t\t\t}\n\t\t}\n\t}\n\treturn imageResources;\n}", "async load_map_assets(opts,fname){\n let js_file =opts.jsfile;\n let file_path = js_file.split(\"/\")\n file_path.pop()\n file_path = file_path.join(\"/\");\n let file_full_path = `/plugins/${file_path}/${fname}`;\n if(fname.match(/\\.js$/)){\n await jQuery.ajax({\n url: file_full_path,\n dataType: 'script',\n async: true\n });\n }\n else{\n $('head').append(`<link rel=\"stylesheet\" type=\"text/css\" href=\"${file_full_path}\">`);\n }\n }", "static preload() {\n\n\t\tlet _onAssetsLoaded = function(e, ressources) {\n\t\t\tShooter.assets = ressources;\n\n\t\t\tShooter.setup();\n\t\t}\n\n\t\tShooter.loader\n\t\t\t.add(Shooter.assetsDir + \"background.jpg\") //TODO : use json objects with index\n\t\t\t.add(Shooter.assetsDir + \"space_ship.png\")\n\t\t\t.add(Shooter.assetsDir + \"space_ship_hit.png\")\n\t\t\t.add(Shooter.assetsDir + \"enemy.png\")\n\t\t\t.add(Shooter.assetsDir + \"bullet.png\")\n\t\t\t.add(Shooter.assetsDir + \"explode.json\");\n\t\t\t\n\t\tShooter.loader.load(_onAssetsLoaded);\n\t}", "loaded() {}", "function loadExternalFiles()\n\t{\n\t\tif (window.loadedCroppie) return false;\n\n\t\tvar head = document.getElementsByTagName('head')[0];\n\t\tvar cssEl = document.createElement('link');\n\t\tvar scriptEl = document.createElement('script');\n\n\t\tcssEl.rel = 'stylesheet';\n\t\tcssEl.href = '../vendor/croppie/croppie.css';\n\t\tscriptEl.src = '../vendor/croppie/croppie.min.js';\n\n\t\thead.appendChild(cssEl);\n\t\thead.appendChild(scriptEl);\n\n\t\twindow.loadedCroppie = true;\n\t}", "get(name) {\n if (!(name in this.resources)) {\n return Promise.reject(name);\n }\n\n // construct dependency chain\n let dependencies = [name];\n let queue = [name];\n while (queue.length > 0) {\n const next = queue.pop();\n const deps = this.resources[next].dependencies.filter(name => !dependencies.includes(name));\n dependencies = dependencies.concat(deps);\n queue = queue.concat(deps);\n }\n\n // ensure correct sequence\n dependencies = this.sorted.filter(name => dependencies.includes(name));\n\n // load resources\n const promises = dependencies.map(name => this.loadResource(name));\n\n return Promise.all(promises).then(data => {\n // execute scripts and styles\n dependencies.forEach(name => {\n const dependency = this.resources[name];\n if (dependency.type === 'script') {\n dependency.promise.then(script => document.head.appendChild(script));\n } else if (dependency.type === 'style') {\n dependency.promise.then(style => document.head.appendChild(style));\n }\n });\n\n // return last one (the requested one, \"name\")\n return data.pop();\n });\n}", "open_resource(resource_url) {\n\t\tvar _this = this;\n\n\t\tif(resource_url.toLowerCase().indexOf('.json') == resource_url.length - 5){\n\t\t\t//load json\n\t\t\twindow.fetch(resource_url).then(function(response) {\n\t\t\t\treturn response.json();\n\t\t\t}).then(function(json) {\n\t\t\t\t_this.load_json(json, false);\n\t\t\t}).catch(function(ex) {\n\t\t\t\talertify.error('Sorry, image could not be loaded.');\n\t\t\t});\n\t\t}\n\t\telse{\n\t\t\t//load image\n\t\t\tvar data = {\n\t\t\t\turl: resource_url,\n\t\t\t};\n\t\t\tthis.file_open_url_handler(data);\n\t\t}\n\t}", "preload() {\n this.load.image('author-logo', 'author/PlatypusDev.png');\n this.load.audio('author-song', 'author/Perry.mp3');\n }", "function loadJS(js) {\n if (typeof(js) != 'object'){\n\tjs = [js];\n }\n for (var i = 0; i < js.length; i++) {\n appendToHeader('js/'+js[i]+'.js');\n }\n}", "function preload() {\r\n statusGeral = loadJSON(\"erro.json\");\r\n}", "function loadStories() {\n require('../app/components/avatars/avatars.stories');\n require('../app/components/loading.stories');\n}", "LoadAllAssets() {}", "preload() {\n this.load.image('menu', 'assets/menu_v3.png');\n }", "function initHypoPage() {\n // this starts the preloader queue loading\n // when complete the assetsLoadingComplete callback is triggered\n loadAssets();\n}", "function loadScript(idx) {\r\n console.log(\"Loading \", requiredResources[idx]);\r\n jQuery.getScript(requiredResources[idx], function () {\r\n if ((idx + 1) < requiredResources.length) {\r\n loadScript(idx + 1);\r\n } else {\r\n initExp();\r\n }\r\n });\r\n }", "function success() {\n\n // mark resource as already loaded\n if ( !resources[ url ] ) resources[ url ] = url;\n\n // is resource on waitlist? => perform waiting actions\n while ( waiter[ url ] && waiter[ url ].length > 0 )\n ccm.helper.action( waiter[ url ].pop() );\n\n // check if all resources are loaded\n check();\n\n }", "function loadSprites() {\n Loader.add(\"assets/imgs/resize1.png\")\n .add(\"assets/imgs/resize2.png\")\n .add(\"assets/imgs/colorize.png\")\n .add(\"assets/imgs/rotate.png\")\n .add(\"assets/imgs/select.png\")\n .add(\"assets/imgs/win.png\")\n .add(\"assets/imgs/logo.png\")\n .add(\"assets/imgs/logo2.png\")\n .add(\"assets/imgs/introFinal.png\")\n .add(\"assets/imgs/btPlay.png\")\n .add(\"assets/imgs/btAgain.png\")\n .load(setup);\n}", "function load()\n{\n\tsetupParts();\n\t\n\tmain();\n}", "function resource(_id, _type, _paths) { // Queues a resource for download. Called it resource so it can be declared in the same way of a scene\n\tvar resi = {\n\t\tpaths: _paths, // Multiple paths, will try until one works\n\t\tpathToTry: 0, // Increments each time until a path works\n\t\ttype: _type, // image, audio, video\n\t\tdownloaded: false,\n\t\tfailed: false,\n\t\tdata: (_type == \"image\") ? new Image() :\n\t\t\t (_type == \"audio\") ? new Audio() :\n\t\t\t (console.log(_type + \" is not supported by the resource downloader.\")) ? false : false // To do: add video support\n\t};\n\tres[_id] = resi;\n\tresVars.totalResources++;\n\tresVars.resourcesLeftToDownload++;\n}", "preload(){\n this.load.image('player', 'assets/player.png'); //load player.png as 'player'\n this.load.image('pipe', 'assets/pipe.png'); //load pipe.png as 'pipe'\n this.serverURL = 'http://localhost:8080';\n\n }", "function preLoad() {\n\tconst promises = [];\n\tusr_res = {};\n\tworkspace.getBlocksByType('b3js_create_mesh_from_file').forEach((b) => {\n\t\tconst key = 'mesh_' + b.getFieldValue('NAME');\n\t\tconst file_name = b.getInputTargetBlock('VALUE').getFieldValue('TEXT');\n\n\t\tif (file_name.indexOf('.obj') >= 0) {\n\t\t\tconst mtl = file_name.replace('.obj', '.mtl');\n\t\t\tpromises.push(new Promise((resolve, reject) => {\n\t\t\t\tnew THREE.MTLLoader().setResourcePath('./resources/')\n\t\t\t\t\t.load('./resources/' + mtl, (m) => {\n\t\t\t\t\t\tnew THREE.OBJLoader().setMaterials(m)\n\t\t\t\t\t\t\t.load('./resources/' + file_name, (obj) => resolve([key, obj]), undefined, reject);\n\t\t\t\t\t});\n\t\t\t}));\n\t\t}\n\t\telse if (file_name.indexOf('.dae') >= 0) {\n\t\t\tpromises.push(new Promise((resolve, reject) => {\n\t\t\t\tnew THREE.ColladaLoader()\n\t\t\t\t\t.load('./resources/' + file_name, (dae) => resolve([key, dae]), undefined, reject);\n\t\t\t}));\n\t\t}\n\t\telse if (file_name.indexOf('.gltf') >= 0 || file_name.indexOf('.glb') >= 0) {\n\t\t\tpromises.push(new Promise((resolve, reject) => {\n\t\t\t\tnew THREE.GLTFLoader()\n\t\t\t\t\t.load('./resources/' + file_name, (gltf) => resolve([key, gltf]), undefined, reject);\n\t\t\t}));\n\t\t}\n\t});\n\n\treturn promises;\n}", "function loadData() {\n $http.get('data/content.json').then(function(result) {\n service.text = result.data;\n });\n $http.get('data/langs.json').then(function(result) {\n service.langs = result.data;\n });\n }", "loadImageAndLabels(source, labels) {\n if (source) {\n let sourcePromise = null;\n if (source.file) sourcePromise = this.loadLocalImage(source.file);\n else if (source.url) sourcePromise = this.loadRemoteImage(source.url);\n if (sourcePromise) {\n sourcePromise\n .then(() => {\n this._.sourceLoaded = true;\n this.loadLabels(labels);\n })\n .catch(err => this.props.errorDetectedCallback(err));\n } else this.props.errorDetectedCallback('No file or url found in source');\n }\n }", "preload() {\n const images = Object.keys(ASSET.IMAGE).map(\n (imgKey) => ASSET.IMAGE[imgKey]\n );\n for (let image of images) {\n this.load.image(image.KEY, image.ASSET);\n }\n }", "function finishedLoad() {\n console.log('finishedLoad()');\n if (externalIsLoaded()) {\n init();\n }\n }", "function createTranslateLoader(http) {\n}", "resourcesUrl (baseUrl,username){\n browser.get(baseUrl + username + \"/_resources\");\n }", "load(uri, callback)\n {\n this.showIndicator();\n\n conSense.write(\"[loading: \" + uri + \"...\");\n\n // Evaluate loaded content as JavaScript source\n if (callback === undefined)\n {\n callback = redSandGenericLoader.javaScriptEvaluatorCallback;\n }\n\n // Callbacks\n this.callbacks.push(callback);\n\n if (this.oldContainerPool.length)\n {\n // Recycle old loader div if possible\n this.containers.push(this.oldContainerPool.pop());\n }\n else\n {\n // Create loader div \"RedSandRegistryContainerNNN\" if necessary\n let newContainer = document.createElement('div');\n newContainer.setAttribute(\n \"id\", \"RedSandRegistryContainer\" + this.lastProcess);\n newContainer.style.display = \"none\";\n conSense.conSenseContainer.appendChild(newContainer);\n\n this.containers.push(newContainer);\n }\n\n let uriRandom = uri + simpleUtils.randomSuffix();\n\n // Create loader IFrame \"RedSandRegistryNNN\" if necessary\n this.frameNames.push(\"RedSandRegistry\" + this.lastProcess);\n\n this.containers[this.lastProcess].innerHTML\n = \"<iframe name='\"\n + this.frameNames[this.lastProcess]\n + \"' id='\"\n + this.frameNames[this.lastProcess]\n + \"' onLoad='parent.redSandGenericLoader.loadedCallback(\"\n + this.lastProcess\n + \")' src='\"\n + uriRandom\n + \"' style='width: 0px; height: 0px; border: 0px;'></iframe>\";\n\n conSense.writeLn(\" done]\");\n }", "function loadAsset(path, type, args) {\n var request = issueRequest(path, type, args, false);\n request.done(function (result) {\n return result\n });\n return request;\n }", "function resourceLoaded()\n{\n if(++curLoadResNum >= totalLoadResources){\n redraw();\n }\n}", "function load(){\r\n\r\n}" ]
[ "0.69140846", "0.66232824", "0.64752793", "0.63766056", "0.6335159", "0.6328017", "0.63004965", "0.6165346", "0.6106171", "0.6106171", "0.6099534", "0.6084527", "0.6032862", "0.5956885", "0.59459025", "0.5901989", "0.5895496", "0.58668923", "0.5849764", "0.58409894", "0.5838969", "0.5837205", "0.5814366", "0.58141994", "0.58104587", "0.5772611", "0.57003975", "0.56929696", "0.5635459", "0.5632961", "0.56161237", "0.56091386", "0.5602733", "0.5600825", "0.558988", "0.5586753", "0.5586507", "0.5584298", "0.5580742", "0.5579856", "0.5578751", "0.5557645", "0.5555531", "0.5550554", "0.55431515", "0.5542909", "0.5538062", "0.5524382", "0.5523813", "0.55214155", "0.55108416", "0.54918593", "0.54876995", "0.5485431", "0.5439354", "0.5433958", "0.54255706", "0.54227006", "0.5420062", "0.5419826", "0.54166025", "0.54100466", "0.54063153", "0.54014283", "0.5400297", "0.5393808", "0.53897196", "0.5389497", "0.53888303", "0.53852785", "0.53828156", "0.537911", "0.53769976", "0.5371639", "0.53688073", "0.5358243", "0.5356658", "0.53443605", "0.5330305", "0.532936", "0.53267294", "0.5324501", "0.53217345", "0.5315225", "0.53139514", "0.53042877", "0.5299217", "0.52969843", "0.5294468", "0.529098", "0.528859", "0.52853554", "0.52834225", "0.5283143", "0.52818125", "0.5280718", "0.5278982", "0.52770174", "0.52722734", "0.52695286" ]
0.60454416
12
Register a new user
async create(req, res) { try { validateUser(req.body); await userRepository.create(req.body); res.json('User registered successfully.'); } catch (err) { res.json({ err }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function registerUser() {\n addUser()\n }", "function register() {\n User.register(self.user, handleLogin);\n }", "function registerNewUser() {\n USER_NAME = buildNewName();\n USER_PWD = buildNewPassword();\n register(USER_NAME, USER_PWD);\n}", "function register(req, res, next) {\n User\n .create(req.body)\n .then(user => res.status(200).json({ message: `Hi ${user.username}! Let's change the way you do food..` })) // evaluate if welcome message set up correctly\n .catch(next)\n}", "function register (req, res, next) {\n users.exists(req.body.username)\n .then(exists => {\n if (exists) {\n return res.status(400).send({message: 'User exists'})\n }\n users.create(req.body.username, req.body.password)\n .then(() => next())\n })\n .catch(err => {\n res.status(400).send({message: err.message})\n })\n}", "function registerUser(req, res) {\n userService.create(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "function registerUser(req, res) {\n userService.create(req.body)\n .then(function () {\n res.sendStatus(200);\n })\n .catch(function (err) {\n res.status(400).send(err);\n });\n}", "async registerUser(userInfo) {}", "function register(req, res) {\n \n const credentials = req.body;\n\n const hash = bcrypt.hashSync(credentials.password, 10);\n credentials.password = hash;\n\n db('users')\n .insert(credentials)\n .then(ids => {\n const id = ids[0];\n res.status(201).json({ newUserId: id });\n })\n .catch(err => {\n res.status(500).json(err);\n });\n}", "function register(user) {\n return db('users').insert(user, ['id'])\n}", "function register(req, res) {\n const newUser = new User(req.body);\n newUser.hash_password = bcrypt.hashSync(req.body.password, 10);\n newUser.id = uuidv4();\n newUser.save((err, user) => {\n if (err) {\n return res.status(400).send({\n message: err,\n });\n }\n // eslint-disable-next-line no-param-reassign\n user.hash_password = undefined;\n return res.json(user);\n });\n}", "function registerUser(){\n Cloud.Users.create({\n username: \"push123x\",\n password: \"push123x\",\n password_confirmation: \"push123x\",\n first_name: \"Firstname\",\n last_name: \"Lastname\"\n }, function (e) {\n if (e.success) {\n \talert(\"User Created\");\n \tloginUser();\n } else {\n \talert(\"Error :\"+e.message);\n }\n });\n}", "function register(){\n newUser = {};\n newUser.email = profile.emails[0].value;\n newUser.name = profile.displayName;\n newUser.fbConnect = true;\n newUser.registerMe = true;\n \n return done(null, newUser);\n }", "async register (req, res) {\n try {\n // Create a user using the body that was passed in on the request\n const user = await User.create(req.body)\n // If successful, send back the info as JSON\n res.send(user.toJSON())\n } catch (err) {\n // If any errors get caught\n res.status(400).send({\n error: `🤬 This email address is already in use.`\n })\n }\n\n }", "async register(req, res) {\n User.create(req.body).then(user => {\n res.status(201).send({\n success: true,\n message: 'User successfully registered!',\n user\n })\n }).catch((err) => {\n res.status(500).send({\n success: false,\n message: 'Something went wrong!',\n error: err[0].message\n })\n })\n }", "async register(req, res) {\n const userData = await getData(req.body)\n try {\n const user = await User.create(userData);\n const token = jwt.sign(\n { id: user._id },\n process.env.SECRET,\n { expiresIn: 1000 * 60 * 60 * 24 * 365 }\n );\n res.status(200).json({ message: 'User Created', token });\n } catch (error) {\n res.status(403).json({ error });\n }\n }", "function signup(username, password) {\n // TODO: create new user\n}", "function registerUser(newUserObj, done) {\n logger.info(\"Inside service method - register user\");\n newUserObj.userId = uuidv4();\n usersDao.addUser(newUserObj, done);\n}", "function createUser() {}", "function register(user) {\n return request({\n url: '/users/register',\n method: 'POST',\n data: user\n })\n}", "newUser(req, res, next) {\n // EXTRACT FORM DATA\n const { username, email, password } = req.body;\n\n // INSERT USER DATA INTO AN OBJECT\n let newUser = { username, email, password };\n\n // USE MODEL TO REGISTER A NEW USER\n User.addUser(newUser)\n .then(user => {\n res.status(201).json({\n success: true,\n message: 'User registered',\n user: {\n id: user.id,\n username: user.username,\n email: user.email\n }\n });\n })\n .catch(err => console.error(err));\n }", "_registerUser(id){\n\t\tthis.idUser = id;\n\t}", "register({ username, email, firstName, lastName, password }) {\n return apiClientEmail.post('/user', {\n username,\n email,\n firstName,\n lastName,\n password,\n })\n }", "function createUser() {\n var newUser = {\n username: $usernameFld.val(),\n password: $passwordFld.val(),\n firstName: $firstNameFld.val(),\n lastName: $lastNameFld.val(),\n role: $roleFld.val()\n };\n try {\n userService\n .createUser(newUser)\n .then(function (userServerInfo) {\n users.push(userServerInfo);\n renderUsers(users);\n resetInputFields();\n clearSelected();\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "function register(req, res, next) {\n if (!req.body.firstName ) {\n res\n .status(400)\n .json({errors: ['Please enter all required fields']});\n } else {\n const newUser = new User(req.body);\n\n newUser\n .save()\n .then(() => res.json({message: 'Successfully registered new user'}))\n .catch(err => {\n if (err.code && err.code === 11000) {\n res\n .status(400)\n .send({'errors': ['Email already registered']});\n } else {\n next(err);\n }\n });\n }\n }", "function register(req, res) {\n const creds = req.body;\n if (\n creds.username &&\n creds.password &&\n creds.name &&\n creds.email &&\n creds.role_id &&\n creds.title\n ) {\n const hash = bcrypt.hashSync(creds.password, 16);\n creds.password = hash;\n users\n .newUser(creds)\n .then(users => {\n const user = users[0];\n const token = generateToken(user);\n res.status(201).json({\n username: user.username,\n name: user.name,\n location: user.loc_id,\n role: user.role_id,\n token: token\n });\n })\n .catch(err => {\n res.status(500).send(err);\n });\n } else {\n res.status(400).json({ message: \"all fields are required\" });\n }\n}", "function createUser(firstname, lastname, username, password) {\n let person = new UserSignUp(firstname, lastname, username, password);\n ajax(\"PUT\", \"/auth\", isCreateUserOk, person);\n}", "function signup({ username, password, email, dateOfBirth, city }) {\n // TODO: create new user\n}", "function register(email, password, username) {\n Firebase.goOnline();\n ref.createUser({\n email: email,\n password: password\n },\n function(error, userData) {\n if (error) {\n console.log(\"Error creating user:\", error);\n loginError = String(error);\n AppStore.emitChange();\n } else {\n // log new user in\n AsyncStorage.setItem(STORAGE_EMAIL, email);\n AsyncStorage.setItem(STORAGE_PASSWORD, password);\n AsyncStorage.setItem(STORAGE_USERNAME, username);\n login(email, password);\n }\n });\n}", "registerUser() {\n // \"persist\" user in dB and return id\n this.id = () => { return \"userId\" };\n // send message to user\n return new Message(this.id, \"You've registered\").sendMessage(\"[email protected]\");\n }", "function register(req, res, next) {\n const { actual_name, user_name, password, user_type } = req.body\n usernameExists(user_name)\n .then(exists => {\n if (exists) return res.status(400).json({ message: \"Username Taken\" })\n\n createUser(actual_name, user_name, password, user_type)\n .then(user_id => {\n if (user_type == \"teacher\") {\n // TODO: store campus info in a teachers table\n } else {\n return addNewStudent({\n user_id,\n cohort_id: 64, // TODO: Base this on user input\n })\n }\n })\n .then(() => next())\n })\n .catch(err => {\n console.err(err)\n res.status(500).json({err: \"Server Error\", message: err.message})\n })\n}", "createNewUser(userName, fullName, unhashedPassword, phone, countryCode, callback) {\n authy.register_user(userName, phone, countryCode, (err, res) => {\n if (err) {\n return callback(err);\n }\n let authyID = res.user.id;\n\n this.saveUser(unhashedPassword, userName, fullName, phone, countryCode, authyID, callback);\n });\n }", "function createRegistration(context) {\n if (!validator.isRegFormValid(context.params)) {\n $('input[name=\"password\"]').val('');\n $('input[name=\"repeatPass\"]').val('');\n return;\n }\n\n const userData ={\n username: context.params.username,\n password: context.params.password,\n email: context.params.email,\n avatarUrl: context.params.avatarUrl\n };\n\n userModel.register(userData)\n .then(function (response) {\n userModel.saveSession(response);\n handler.showInfo(`User registration successful.`);\n context.redirect('#/home');\n })\n .catch(handler.handleError);\n }", "function register(req, res, next) {\n const user = new User({\n email: req.body.email,\n firstName: req.body.firstName,\n lastName: req.body.lastName\n });\n\n\n //standard for express error firts then user.\n User.register(user, req.body.password, (error, user) => {\n if (error) {\n next(error);\n return;\n }\n //store user in the req object itself so that it is accessible by following\n // middleware\n req.user = user;\n next();\n })\n}", "function signup({ email, password, city, dateOfBirth, username }) {\n // create new user\n}", "function register (req, res, next) {\n const { username, password } = req.body\n createUser({username, password})\n .then(([id]) => {\n res.locals.userId = id\n next()\n })\n .catch(({message}) => {\n // todo research how this works in Postgres\n if(message.includes('UNIQUE constraint failed: users.username')){\n return res.status(400).json({\n ok: false,\n message: 'Username already exists.'\n })\n }\n res.status(500).json({\n ok: false,\n message: \"Something bad happend. We don't know why.\"\n })\n })\n}", "async register(req, res) {\n\t\ttry {\n\t\t\tconst { password, useremail } = req.body;\n\t\t\tconst pwdRegex = \"^(?=.*[0-9])(?=.*[!@#$%^&*])[a-zA-Z0-9!@#$%^&*]{6,16}$\";\n\t\t\tconst pattern = new RegExp(pwdRegex);\n\t\t\t// req.body.userId = uuid();\n\t\t\tif (pattern.test(password)) {\n\t\t\t\tconst newUser = new userModel({ ...req.body });\n\t\t\t\t// await userModel.generateToken(newUser.dataValues);\n\t\t\t\t// // console.log(\"new user token\",newUser.token);\n\t\t\t\tconst user = await newUser.save();\n\t\t\t\tconsole.log(user);\n\n\t\t\t\treturn res.status(200).send({ msg: \"User registered sucessfull\" });\n\t\t\t} else {\n\t\t\t\treturn res.send(\"Invalid Password\");\n\t\t\t}\n\t\t} catch (err) {\n\t\t\tconsole.log(err);\n\t\t\treturn res.send({ msg: err.msg });\n\t\t}\n\t}", "function registerUser(req, res) {\n\n // return console.log(errors)\n\n usermodel.User.create({\n fname: req.body.fname,\n lname: req.body.lname,\n email: req.body.email,\n password: req.hashvalue,\n img: req.body.image,\n role:\"user\",\n status: \"normal\"\n\n })\n .then(function(err, user) {\n\n res.status(200).send({ message: \"registered successfully\" })\n })\n .catch(function(err) {\n\n res.status(500).send({ message: err.message })\n })\n}", "function register(user, pass, callback) {\n\tsendRequest({ request: 'register', username: user, password: pass }, callback);\n}", "function registerUser(req, res, next) {\n db.collection(\"users\").insertOne(\n {\n naam: req.body.voornaam,\n email: req.body.emailadres,\n wachtwoord: req.body.wachtwoord,\n },\n done\n );\n\n // //hash met bcrypt\n // bcrypt.hash(myPlaintextPassword, saltRounds, function (err, hash) {\n // // Store hash in your password DB.\n // });\n\n function done(err, data) {\n if (err) {\n next(err);\n } else {\n res.redirect(\"/login\");\n }\n }\n}", "function signup(username, password, email, dateOfBirth, city) {\n // TODO: create new user\n}", "function signup(username, password, email, dateOfBirth, city) {\n // TODO: create new user\n}", "async function register(req, res) {\n const [user] = await User.create(req.body);\n\n const [accessToken, refreshToken] = createUserTokens(user);\n\n res.status(200).json({ accessToken, refreshToken });\n}", "function register(req, res, fallbackRoute){\r\n\t\tdatabase.getModels(function(models){\r\n\t\t\tvar username = req.body.username;\r\n\t\t\tvar password = crypto.createHash('sha512').update(req.body.password).digest(\"hex\");\r\n\r\n\t\t\tvar newUser = new models.User({username:username,password:password});\r\n\t\t\tnewUser.save();\r\n\r\n\t\t\tauthenticate(req, res, fallbackRoute);\r\n\t\t});\r\n\t}", "function authenticationsRegister(req, res){\n User.create(req.body.user, (err, user) => {\n if (err) return res.status(600).json({success: false, message: `Something went wrong: ${err.message}` });\n if (!user) return res.status(500).json({success: false, message: 'No user has been created' });\n const token = jwt.sign({id: user._id}, config.secret, {expiresIn: 60 * 60} );\n return res.status(201).json({success: true, message: `Welcome ${user.username}!`, user, token});\n });\n}", "function registerUser(user){\n\n\tlet req = new XMLHttpRequest();\n\n\t// On load, what was therequest status?\n\treq.addEventListener(\"load\", function(evt){\n\n\t\t// 200 = OK\n\t\t// Registered - redirect to login.html\n\t\t// Anything else = not OK\n\t\t// Was not registered\n\t\tif(req.status === 200){\n\t\t\talert(\"Registered.\");\n\t\t\twindow.location.href = \"login.html\";\n\t\t} else if (req.status === 409) {\n\t\t\talert(\"That username already exists.\");\n\t\t} else {\n\t\t\talert(\"We encountered an error.\");\n\t\t}\n\t});\n\n\t// Open the request to the register route, and then send the data in the body\n\treq.open(\"POST\", \"/api/v1/register\");\n\treq.send(user);\n\n\n}", "async function register(req, res) {\n const { username, password, isAdmin } = req.body;\n const db = req.app.get('db');\n const result = await db.get_user([username]);\n const existingUser = result[0];\n if (existingUser) {\n return res.status(409).send('Username taken');\n }\n const salt = bcrypt.genSaltSync(10);\n const hash = bcrypt.hashSync(password, salt);\n const registeredUser = await db.register_user([isAdmin, username, hash]);\n const user = registeredUser[0];\n req.session.user = { isAdmin: user.is_admin, username: user.username, id: user.id };\n return res.status(201).send(req.session.user);\n}", "registerUser(email, pass, name, cb) {\n this.provider.registerUser(email, pass, name, cb);\n }", "function registerUser(email, password) {\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function(value) {\n\t// log all changes //\n console.log(\"signed up\");\n }).catch(function(error) {\n\n });\n}", "async register() {\n console.log('Register:', this.state.email, this.state.password);\n try {\n await firebase.auth()\n .createUserWithEmailAndPassword(this.state.email, this.state.password);\n AlertIOS.alert(\n 'Account created',\n // null,\n // [\n // {\n // text: 'OK',\n // onPress: this.tabHandler(2)\n // }\n // ]\n )\n } catch (error) {\n AlertIOS.alert(error.toString());\n }\n console.log('current user:', firebase.auth().currentUser);\n Keyboard.dismiss();\n }", "async register({request, response}){\n const {first_name, last_name, email, password} = request.only(['first_name','last_name','email', 'password'])\n\n await User.create({\n first_name,\n last_name,\n email,\n password\n })\n return response.send({mensaje: 'Usuario creado Satisfactoriamente'})\n }", "async function register(req, res) {\n const {\n firstName,\n lastName,\n email,\n password,\n phone,\n countyId,\n zip,\n languageId,\n } = req.body;\n\n try {\n // * Bcrypt user password\n const saltRound = 10;\n const salt = await bcrypt.genSalt(saltRound);\n const bcryptPassword = await bcrypt.hash(password, salt);\n\n // * Creating the user\n const newUser = await prisma.user.create({\n data: {\n firstName,\n lastName,\n email,\n phone,\n password: bcryptPassword,\n countyId,\n zip,\n languageId,\n },\n });\n\n const token = tokenGenerator(newUser.id);\n\n if (newUser) {\n return res.json({\n msg: `The user '${firstName}' was succesfully registered.`,\n token,\n });\n }\n } catch (error) {\n console.log(error);\n return res.status(500).send({ error: `Something went wrong.` });\n }\n}", "function registerUser(ev) {\n ev.preventDefault();\n let registerUsername = $('#registerUsername');\n let registerName = $('#registerName');\n let registerPassword = $('#registerPasswd');\n\n let usernameVal = registerUsername.val();\n let nameVal = registerName.val();\n let passVal = registerPassword.val();\n\n auth.register(usernameVal, passVal, nameVal)\n .then((userInfo) => {\n saveSession(userInfo);\n registerUsername.val(\"\");\n registerName.val(\"\");\n registerPassword.val(\"\");\n showInfo('User registration successful.');\n }).catch(handleError);\n }", "function addUser() {\n var user = {\n primaryEmail: '[email protected]',\n name: {\n givenName: 'Elizabeth',\n familyName: 'Smith'\n },\n // Generate a random password string.\n password: Math.random().toString(36)\n };\n user = AdminDirectory.Users.insert(user);\n Logger.log('User %s created with ID %s.', user.primaryEmail, user.id);\n}", "function createRegistration(context) {\n if (!validator.isRegFormValid(context.params)) {\n $('input[name=\"password\"]').val('');\n $('input[name=\"repeatPass\"]').val('');\n return;\n }\n\n const username = this.params.username;\n const password = this.params.password;\n\n userModel.register(username, password)\n .then(function (response) {\n userModel.saveSession(response);\n handler.showInfo(`You was register successfully!`);\n\n viewController.renderHomePage(context);\n })\n .catch(userModel.handleError);\n }", "registerUser(email, password){\n Services.user.register(email, password).then((res) => {\n if (res.success){\n this.loginUser(email, password);\n }\n }).catch((err) => {\n alert(\"Error on register user: \" + err.error.err);\n });\n }", "registerUser({}, payload) {\n firebaseAuth.createUserWithEmailAndPassword(payload.email, payload.password)\n .then(response => {\n // Success\n // console.log(response)\n // Recover the id generated by firebase, we will use it in our\n // table.\n let userId = firebaseAuth.currentUser.uid\n // This part adds the user to our users table in the database\n // this is not on the auth system.\n firebaseDb.ref('users/' + userId).set({\n name: payload.name,\n email: payload.email,\n online: true\n })\n })\n .catch(error => {\n console.log(error.message)\n })\n }", "async addUser(name){\n return user.create(name)\n }", "register(data) {\n\t\taxios(`${this.base}/users`, {\n\t\t\tmethod: 'POST',\n\t\t\tdata\n\t\t})\n\t\t\t.then(response => {\n\t\t\t\tconsole.log('Registration successful. Response Data:', response.data);\n\t\t\t\tTokenService.save(response.data.token);\n\t\t\t\tthis.setState({\n\t\t\t\t\tuser: response.data.user,\n\t\t\t\t\ttoken: response.data.token,\n\t\t\t\t\tisAuthed: true\n\t\t\t\t});\n\t\t\t})\n\t\t\t.catch(error => console.log(`Error: ${error}`));\n\t}", "async function registerUser (req,res) {\n const {fName,lName, email, password, role} =req.body;\n \n try{\n const userObj = {fName, lName, email, password, role : role || 'User'};\n const user = await User.create(userObj);\n console.log(user);\n let result = {\n status : \"success\",\n data: {\n user : user\n }\n }\n res.status(200).json(result);\n }catch (err){\n const errors = handleErrors(err);\n await res.status(400).json({ errors });\n }\n}", "function registerUser(){\r\n let email=$(\"#txtEmail\").val();\r\n let pass=$(\"#txtPassword\").val();\r\n let firstName=$(\"#txtFirst\").val();\r\n let lastName=$(\"#txtLast\").val();\r\n let age=$(\"#txtAge\").val();\r\n let address=$(\"#txtAddress\").val();\r\n let phone=$(\"#txtPhone\").val();\r\n let payment=$(\"#selPayment\").val();\r\n let color=$(\"#txtColor\").val();\r\n let user = new User(email,pass,firstName,lastName,age,address,phone,payment,color);\r\n console.log(user);\r\n saveUser(user);// this function is on the storeManager\r\n clearForm();\r\n setNavInfo()\r\n\r\n}", "function register(userObj) {\n vm.emails.push(userObj.emails);\n userObj.emails = vm.emails;\n console.log(userObj);\n UserService\n .createUser(userObj)\n .then(function (response) {\n console.log(response);\n var currentUser = response.data;\n if(currentUser != null){\n UserService.setCurrentUser(currentUser);\n $location.url('/profile');\n }\n else{\n //promise fullfilled, inpsite of getting a null response.\n console.log(\"Username already exists\");\n vm.showAlert = true;\n }\n });\n }", "function register() {\n Auth.register(authCtrl.user).then(function(){\n $state.go('home');\n });\n }", "function register(user) {\n return true;\n }", "function createUser(req, res, next) {\r\n\treq.body.age = parseInt(req.body.age);\r\n\r\n\tvar auth = _hashPassword(req.params.password);\r\n\r\n\tdb.none(`insert into users(first_name, last_name, email, password)` +\r\n\t `values(${first_name}, ${last_name}, ${email}, ${password})`,\r\n\t req.body)\r\n\t.then(function () {\r\n\t\tres.status(200)\r\n\t\t.json({\r\n\t\t\tstatus: 'success',\r\n\t\t\tmessage: 'Inserted one user'\r\n\t\t});\r\n\t})\r\n\t.catch(function (err) {\r\n\t\treturn next(err);\r\n\t});\r\n}", "static async registerUser(newUser) {\n const { email } = newUser\n const oldUser = await database.User.findOne({\n where: { email: email }\n })\n if (oldUser) {\n return null\n }\n try {\n var salt = bcrypt.genSaltSync(10);\n var hashedPassword = bcrypt.hashSync(newUser.password, salt)\n const userWithHashedPassword = {\n ...newUser,\n password: hashedPassword\n }\n return await database.User.create(userWithHashedPassword)\n } catch(e) {\n throw e\n }\n }", "static async register({ username, password, profilePicture, bio, isAdmin }) {\n /** Check for a duplicate username before registering */\n\n const duplicateCheck = await db.query(\n `SELECT username\n FROM users\n WHERE username = $1`,\n [username]\n );\n\n if (duplicateCheck.rows[0]) {\n throw new BadRequestError(`Duplicate username: ${username}`);\n }\n\n const hashedPassword = await bcrypt.hash(password, BCRYPT_WORK_FACTOR);\n\n const result = await db.query(\n `INSERT INTO users\n (username,\n password,\n profile_picture,\n bio,\n is_admin)\n VALUES ($1, $2, $3, $4, $5)\n RETURNING username, is_admin AS \"isAdmin\"`,\n [username, hashedPassword, defaultImg, defaultBio, isAdmin]\n );\n\n const user = result.rows[0];\n\n return user;\n }", "function createNewUser(email, password, type, name) {\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function(user) {\n writeUserData(name, email, type); // Optional\n }, function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n console.log(errorCode + \": \" + errorMessage);\n errorToScreenAuth(errorCode + \": \" + errorMessage, \"error-signup-id\");\n });\n}", "function registerUser() {\n let email = $(\"#txtEmail\").val();\n let pass= $(\"#txtPassword\").val();\n let first= $('#txtFirst').val();\n let last = $('#txtLast').val();\n let age = $('#txtAge').val();\n let address = $('#txtAddress').val();\n let phone = $('#txtPhone').val();\n let payment = $('#txtPayment').val();\n let color = $('#txtColor').val();\n\n let user = new User(email, pass, first, last, age, address, phone, payment, color);\n console.log(user);\n\n saveUser(user); // This function is on the storeManager\n clearUser();\n\n}", "async createUser () {\n\t\t// first create the user, unregistered...\n\t\tconst { email, fullName, username, passwordHash, timeZone, preferences } = this.request.body.user;\n\t\tconst user = await new UserCreator({\n\t\t\trequest: this,\n\t\t\texistingUser: this.existingUser\n\t\t}).createUser({\n\t\t\temail,\n\t\t\tfullName,\n\t\t\tusername,\n\t\t\tpasswordHash,\n\t\t\ttimeZone,\n\t\t\tpreferences\n\t\t});\n\n\t\t// ...then confirm...\n\t\treturn this.confirmUser(user);\n\t}", "function userRegister(req, res) {\n User.find({ email: req.body.email })\n .exec()\n .then((users) => {\n if (users.length >= 0) {\n console.log(\"User with this email already exists\");\n } else {\n var today = new Date();\n\n const text = req.body.email + req.body.password + today;\n\n bcrypt.hash(text, 10, (err, hash) => {\n if (!hash) {\n res.status(500).json({ message: err.message });\n } else {\n const newUser = new User({\n //Storing a unique user ID\n user_id: new mongoose.Types.ObjectId(),\n //User's name\n name: req.body.name,\n //User's email.\n email: req.body.email,\n //User's address\n address: req.body.address,\n //password\n password: hash,\n // setting loggedin flag to 1\n loggedIn: true,\n });\n\n newUser\n .save()\n .then((user) => {\n res.status(201).json(\"Created\");\n })\n .catch((err) => {\n res.status(500).json({ message: err.message });\n });\n }\n });\n }\n });\n}", "function createUser(userData) {\n\t\tuserAuth.register(userData, function(err) {\n\t\t\tif(err){ \n\t\t\t\t$rootScope.flashMessage = {data: \"Something went wrong please try again\", type: \"error\"}\n\t\t\t}else{\n\t\t\t\tif($rootScope.currentUser.role == \"Author\"){\n\t\t\t\t\t$location.path('/info');\n\t\t\t\t\t$rootScope.flashMessage = {data: \"Kindly fill your profile details\", type: \"success\"}\n\t\t\t\t\tvm.showForm = true;\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t$location.path('/');\n\t\t\t\t$rootScope.flashMessage = {data: \"Successfully Logged In\", type: \"success\"}\n\t\t\t}\n\t\t});\n\t}", "function createUser(req, res, next) {\n const sql = sqlString.format(`INSERT INTO users SET ?`, req.body)\n\n db.execute(sql, (err, result) => {\n if (err) return next(err)\n res.send('New user added successfully')\n })\n}", "function registerUser(req, res) {\n\n console.log(`authRoutesMethods: registerUser: req.body is:`, req.body);\n\n //query db to see if the user exists already\n userDBHelper.doesUserExist(req.body.username, (sqlError, doesUserExist) => {\n\n //check if the user exists\n if (sqlError !== null || doesUserExist){\n\n //message to give summary to client\n const message = sqlError !== null ? \"Operation unsuccessful\" : \"User already exists\"\n\n //detailed error message from callback\n const error = sqlError !== null ? sqlError : \"User already exists\"\n\n sendResponse(res, message, sqlError)\n\n return\n }\n\n //register the user in the db\n userDBHelper.registerUserInDB(req.body.username, req.body.password, dataResponseObject => {\n\n //create message for the api response\n const message = dataResponseObject.error === null ? \"Registration was successful\" : \"Failed to register user\"\n\n sendResponse(res, message, dataResponseObject.error)\n })\n })\n }", "register (user) {\n return axios.post(API_URL + 'signup', {\n username: user.username,\n email: user.email,\n password: user.password\n })\n }", "async function registerNewUser(user, callback) {\n const newUserId = await addNewUser(user)\n callback(newUserId);\n}", "function register(){\n\tusername = document.getElementById('usernameRegister').value;\n\temail = document.getElementById('emailRegister').value;\n\tpassword = document.getElementById('passwordRegister').value;\n\n\tvar registrationData = {\n \t\tdisplayName: username,\n \t\temail : email,\n \t\tpassword: password\n\t};\n\n\tvar newUser = new Stamplay.User().Model;\n\tnewUser.signup(registrationData).then(function(){\n\t\tdocument.getElementById('usernameRegister').value = \"\";\n\t\tdocument.getElementById('emailRegister').value = \"\";\n\t\tdocument.getElementById('passwordRegister').value = \"\";\n\t\twindow.location = \"home.html\";\n\t});\n}", "static async addUser(req, res) {\n try {\n let { error } = await validateUser(req.body);\n if (error) return res.status(400).send(error.details[0].message);\n\n let user = await User.findOne({ email: req.body.email });\n if (user) return res.status(400).send(\"User already registered.\");\n user = new User({\n name: req.body.name,\n email: req.body.email,\n password: req.body.password,\n });\n const salt = await bcrypt.genSalt(10);\n user.password = await bcrypt.hash(user.password, salt);\n await user.save();\n\n const token = user.getToken();\n res.send(token);\n } catch (error) {\n res.send(error.message);\n }\n }", "register(email, password){\n firebaseApp.auth().createUserWithEmailAndPassword(email, password)\n .catch(function (err) {\n console.log(err)\n });\n }", "function createUser(req, res, next) {\n var user = new User();\n\n user.name = req.body.name;\n user.email = req.body.email;\n user.lastAccess = new Date();\n // Creates a random initial password\n var password = make_passwd(13, 'qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM1234567890');\n\n user.setPassword(password);\n\n user.save(function (err) {\n var token;\n token = user.generateJwt();\n updateUsers(1,token);\n return resource.setResponse(res,\n {\n status: 200,\n item: {\n \"error\": false,\n \"data\": {\n \"password\": password,\n \"url\": process.env.CURRENT_DOMAIN + \"/login\"\n }\n }\n }, next);\n });\n }", "async registerUser(newUser) {\n try {\n await axios.post(\"api/register\", newUser);\n } catch (error) {\n this.registerError = true;\n this.registerSuccess = false;\n this.registerErrorReason = `error ${error.response.status}: ${error.response.data[\"message\"]}`;\n return;\n }\n\n this.registerSuccess = true;\n this.registerError = false;\n\n window.setTimeout(this.resetRegister, 1000);\n }", "static registerUser(user) {\n return new Promise((resolve, reject) => {\n (new User(user)).save().then((newUser) => {\n console.log(\"saved\");\n resolve(newUser);\n }).catch((saveErr) => {\n console.log(\"can't save\");\n reject(new Error('Could not save a user ' + saveErr.message));\n });\n });\n }", "function _newUserCreated(req, res) {\n let {\n names,\n surnames,\n username,\n password,\n } = req.body;\n let u = new User();\n u.names = names;\n u.surnames = surnames;\n u.username = username;\n u.created_at = moment().unix();\n\n\n if (!password) {\n return res.status(403).send({\n message: 'La contraseña es necesaria!'\n })\n }\n\n\n /* now we need encrypt the new user password, we're going to use the library bcrypt */\n bcrypt.hash(password, 10).then(hashed => {\n u.password = hashed;\n /* save user */\n u.save().then(user => {\n\n res.status(200).send({\n user: user\n });\n }).catch(err => res.status(500).send({\n err,\n message: 'El campo email ha sido duplicado!'\n }));\n }).catch(err => res.status(401).send({\n message: err + ', la contraseña no pudo ser encriptada, porque no se ha colocado ninguna'\n }));\n}", "register(data, callback) {\n let user = new User({\n firstName: data.firstName,\n lastName: data.lastName,\n email: data.email,\n password: data.password\n });\n // to save the data in the database\n user.save((err, result) => {\n if(err){\n console.error(err);\n callback(err);\n }else{\n callback(null, result)\n }\n });\n }", "function registerUserInDB(username, password){\n let newUser = new User({username: username, password: password});\n return newUser.save();\n}", "function addUser({name, password}) {\n const a = findUser(name);\n const ic = generateInternalCode(name);\n if(a.i === ic) {\n return;\n } \n postUser(name, password);\n}", "function registerUser(ev) {\n\t\tev.preventDefault();\n\t\tlet registerForm = $('#registerForm');\n\t\tlet usernameInput = registerForm.find('input[name=\"username\"]');\n\t\tlet passInput = registerForm.find('input[name=\"password\"]');\n\t\tlet repeatPassInput = registerForm.find('input[name=\"repeatPass\"]');\n\t\tlet fullNameInput = registerForm.find('input[name=\"fullName\"]');\n\t\tlet addressInput = registerForm.find('input[name=\"address\"]');\n\t\tlet phoneInput = registerForm.find('input[name=\"phone\"]');\n\t\tlet emailInput = registerForm.find('input[name=\"email\"]');\n\t\tlet cityInput = registerForm.find('input[name=\"city\"]');\n\t\tlet profileImgInput = registerForm.find('input[name=\"profileImg\"]');\n\t\tlet websiteInput = registerForm.find('input[name=\"website\"]');\n\t\tlet infoInput = registerForm.find('input[name=\"info\"]');\n\n\n\t\tlet usernameVal = usernameInput.val();\n\t\tlet passVal = passInput.val();\n\t\tlet repeatPassVal = repeatPassInput.val();\n\t\tlet fullNameVal = fullNameInput.val();\n\t\tlet addressVal = addressInput.val();\n\t\tlet phoneVal = phoneInput.val();\n\t\tlet emailVal = emailInput.val();\n\t\tlet cityVal = cityInput.val();\n\t\tlet profileImgVal = profileImgInput.val();\n\t\tlet websiteVal = websiteInput.val();\n\t\tlet infoVal = infoInput.val();\n\n\t\tlet allIsValid = validateRegisterFields(usernameVal, passVal, repeatPassVal);\n\t\tif (allIsValid) {\n\t\t\tlet userData = {\n\t\t\t\tusername: usernameVal,\n\t\t\t\tpassword: passVal\n\t\t\t};\n\t\t\n\t\t\tauth.register(userData)\n\t\t\t\t.then((userInfo) => {\n\t\t\t\t\tconsole.log('after user register');\n\t\t\t\t\tconsole.log(userInfo);\n\t\t\t\t\tlet profileData = {\n\t\t\t\t\t\tuserId: userInfo._id,\n\t\t\t\t\t\tfullName: fullNameVal,\n\t\t\t\t\t\taddress: addressVal,\n\t\t\t\t\t\tphone: phoneVal,\n\t\t\t\t\t\temail: emailVal,\n\t\t\t\t\t\tcityId: cityVal,\n\t\t\t\t\t\tprofileImg: profileImgVal,\n\t\t\t\t\t\twebsite: websiteVal,\n\t\t\t\t\t\tinfo: infoVal\n\t\t\t\t\t};\n\t\t\t\t\tauthorService.createAuthor(profileData)\n\t\t\t\t\t\t.then(authorData => {\n\t\t\t\t\t\t\tconsole.log('after author register');\n\t\t\t\t\t\t\tconsole.log(authorData);\n\t\t\t\t\t\t\tusernameInput.val('');\n\t\t\t\t\t\t\tpassInput.val('');\n\t\t\t\t\t\t\trepeatPassInput.val('');\n\t\t\t\t\t\t\tfullNameInput.val('');\n\t\t\t\t\t\t\taddressInput.val('');\n\t\t\t\t\t\t\tphoneInput.val('');\n\t\t\t\t\t\t\temailInput.val('');\n\t\t\t\t\t\t\tcityInput.val('');\n\t\t\t\t\t\t\tprofileImgInput.val('');\n\t\t\t\t\t\t\twebsiteInput.val('');\n\t\t\t\t\t\t\tinfoInput.val('');\n\t\t\t\t\t\t\tuserInfo.authorId = authorData._id;\n\t\t\t\t\t\t\tsaveSession(userInfo);\n\t\t\t\t\t\t\tshowInfo('User registration successful.');\n\t\t\t\t\t\t});\n\n\t\t\t\t}).catch(handleError);\n\t\t}\n\t}", "function createUser() {\n return UserDataService.signup(props.onLogin, setValidation, values);\n }", "function addNewUser() {\n}", "registerUser(user) {\n return firebase.database().ref('users/' + this.authData.uid).set({\n username: user.username,\n name: user.name,\n lastname: user.lastname,\n address: user.address,\n phone: user.phone,\n country: user.country,\n state: user.state,\n city: user.city,\n email: user.email\n }).then(() => this.storeUserData(user));\n }", "async function addNewUser() {\n const randomTokenVerifying = genRandomToken(32);\n const encryptedToken = await bcrypt.hash(randomTokenVerifying, 8);\n\n // 2] generate url for verification\n const url = `${frontend_link}/verifyEmail/${randomTokenVerifying}`;\n\n await new Email({ firstName, email }, url).verifyEmail();\n const user = await User.create({\n firstName,\n lastName,\n email,\n password,\n passwordConfirm,\n phone,\n photo,\n });\n\n // 4-a] save random token to database after hashing it && change expiry date\n\n //====================\n\n user.randomTokenVerifying = encryptedToken;\n await user.save({ validateBeforeSave: false });\n res.status(200).json({\n status: 'success',\n data: user,\n });\n }", "function registerUser(user, response)\n{\n\tclient.get(\"global:user_id\", function(err, uid) {\n\t\tif (uid == null)\n\t\t{\n\t\t\tclient.set(\"global:user_id\", 1);\n\t\t\tconsole.log(\"No global user id? Already set to 1\");\n\t\t\tuid = \"1\";\n\t\t}\n\t\tif (err)\n\t\t{\n\t\t\tconsole.log(\"Error: \" + err);\n\t\t}\n\t\tclient.exists(\"username:\" + user.username, function(err, reply) { \n\t\t\tif (err == null)\n\t\t\t{\n\t\t\t\tconsole.log(err);\n\t\t\t}\n\t\t\tif (reply == 1)\n\t\t\t{\n\t\t\t\tconsole.log(\"Ooops, username \" + user.username + \" taken\");\n\t\t\t\thandleReply(buildResponse(401, null, \"Username taken\"), response);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tregisterUserCallback(user, uid, response);\n\t\t\t\treturn;\n\t\t\t}\n\t\t});\n\t});\t\n\n}", "static async register(data) {\n const duplicateCheck = await db.query(\n `SELECT *\n FROM users\n WHERE email = $1`,\n [data.email]\n );\n\n if (duplicateCheck.rows[0]) {\n const err = new ExpressError(\n `There already exists a user with this email ${data.email}`,\n 409\n );\n throw err;\n }\n\n const hashedPassword = await bcrypt.hash(data.password, BCRYPT_WORK_FACTOR);\n\n const result = await db.query(\n `INSERT INTO users\n (full_name, email, password)\n VALUES ($1, $2, $3)\n RETURNING id, full_name, email, cash_balance`,\n [\n data.full_name,\n data.email,\n hashedPassword,\n ]);\n\n const user = result.rows[0]\n\n return user;\n }", "function createUser() {\n var username = $('#usernameFld').val();\n var password = $('#passwordFld').val();\n var firstName = $('#firstNameFld').val();\n var lastName = $('#lastNameFld').val();\n var role = $('#roleFld').val();\n\n var user = new User(username,password,firstName,lastName,role,null,null,null);\n\n userService\n .createUser(user)\n .then(findAllUsers)\n .then(emptyUserForm);\n }", "static register(req, res, next){\n let newUser = {\n email: req.body.email,\n password: req.body.password,\n location: req.body.location\n }\n\n if(newUser.location === ''){\n newUser.location = \"Jakarta\"\n }\n\n User.create(newUser)\n .then(data => {\n let output = {\n id: data.id,\n email: data.email,\n location: data.location\n }\n res.status(201).json(output)\n })\n .catch(err => {\n next(err)\n })\n }", "async register(name, email, password) {\n await this.auth.createUserWithEmailAndPassword(email, password);\n return this.auth.currentUser.updateProfile({\n displayName: name\n });\n }", "function register(req, res) {\n var body = _.pick(req.body, ['email', 'name', 'password']);\n\n var user = new User(body);\n\n\n user.save().then(user => {\n return user.generateAuthToken();\n }).then(token => {\n res.header('x-auth', token).json({ user: user, token: token });\n }).catch(err => {\n console.log(err);\n if (err.name === 'ValidationError')\n res.status(500).send({ 'errorname': err.name, 'message': 'name must be filled' })\n else if (err.name == 'MongoError' && err.code == 11000)\n res.status(500).send({ 'errorname': err.name, 'message': err.errmsg, 'code': err.code })\n });\n\n}", "register(firstName, lastName, email, password){\n return $.post(\n this.REGISTRATION_URL,\n {\n user : {\n first_name: firstName,\n last_name: lastName,\n email: email,\n password: password\n }\n }\n );\n }", "function createUser(newUser){\n\n UserService\n .createUser(newUser)\n .then(\n function (doc) {\n vm.user = null;\n init();\n });\n }", "function register() {\r\n var username = $(\"#usernameFld\").val();\r\n var pass = $(\"#passwordFld\").val();\r\n var pass2 = $(\"#confirmPasswordFld\").val();\r\n if (pass == pass2 && username.length > 0) {\r\n console.log(\"Registering \" + username + \":\" + pass);\r\n userService.register(username, pass).then(goToProfile,\r\n function(resp) {\r\n console.log(\"no login\" + resp);\r\n }\r\n )\r\n } else {\r\n console.log(\"Error, something missing\");\r\n }\r\n }" ]
[ "0.83520013", "0.8306033", "0.8103047", "0.78591985", "0.78367496", "0.7781775", "0.7781775", "0.7746846", "0.773446", "0.76466674", "0.7638227", "0.7611044", "0.7586086", "0.7553099", "0.7551185", "0.7507968", "0.7505681", "0.74828196", "0.74784523", "0.7478244", "0.74609697", "0.7446199", "0.7435469", "0.7414422", "0.7409416", "0.7399614", "0.73865664", "0.73699707", "0.7367829", "0.7366063", "0.7364359", "0.7360531", "0.7355077", "0.7347561", "0.73208797", "0.73006684", "0.72950745", "0.7285252", "0.7284908", "0.7245899", "0.7244975", "0.7244975", "0.72442204", "0.7234424", "0.7225349", "0.7212809", "0.721076", "0.7208375", "0.7207954", "0.71892446", "0.71721977", "0.716083", "0.7150819", "0.71504945", "0.71466047", "0.7146039", "0.7143857", "0.7140118", "0.71286714", "0.71244824", "0.71216136", "0.7118306", "0.7106719", "0.71047807", "0.71028465", "0.7094282", "0.709416", "0.7085255", "0.70850706", "0.7080753", "0.7072226", "0.70657223", "0.7063539", "0.7061428", "0.7044942", "0.7044436", "0.7043283", "0.70332813", "0.70315695", "0.70247084", "0.70231986", "0.70198524", "0.70100856", "0.7006012", "0.7005817", "0.6967336", "0.69656706", "0.696311", "0.69503415", "0.6949706", "0.6944643", "0.6938607", "0.6936985", "0.69327176", "0.6932328", "0.69277775", "0.6926639", "0.69262314", "0.69261223", "0.6925217" ]
0.72955656
36
User adds topic to their list of tracked topics Delete user profile
async delete(req, res) { try { const id = await userRepository.delete(req.params.id); res.json('deleted user. redirect to website landing page'); } catch (err) { console.log('error', err); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function pushTopic() {\n $('#userInput').click(function() {\n topics.push($('#userAdded').val());\n renderButtons();\n });\n }", "function addTopicToSelected(topic) {\n // if the there are too many topics selected, tell the user\n if (topics.full()) {\n alert(\"You may only select up to 10 topics.\")\n return;\n }\n // update the selected topics\n updateSelected(topic);\n // add the topic\n topics.add(topic);\n}", "function addUserText() {\n topics.push(userText);\n}", "function addTopic(newTopic){\n // debugger\n console.log(newTopic)\n const ul = document.getElementById('topic-list')\n const div = document.getElementById('comment-list')\n const li = document.createElement('li')\n const p = document.createElement('p')\n const deleteBtn = document.createElement('button')\n \n \n li.textContent = newTopic.topic\n p.textContent = `${newTopic.name} - \"${newTopic.comments}\"`\n p.style.fontStyle = \"italic\"\n deleteBtn.textContent = \"X\"\n deleteBtn.classList = \"rounded border border-warning\"\n \n //debugger\n console.log(p)\n li.appendChild(deleteBtn)\n ul.append(li, p)\n // div.appendChild(p)\n \n \n \n deleteBtn.addEventListener('click', () => {\n li.remove()\n p.remove()\n \n fetch(`http://localhost:3000/topic/${newTopic.id}`, {\n method: 'DELETE',\n })\n .then(res => res.json())\n .then(topics =>console.log(topics))\n\n })\n}", "function addTopic(){\n\n\tconsole.reset();\n\n\tinq.prompt([\n\t\t{\n\t\t\tname:\"addedTopic\",\n\t\t\ttype:\"input\",\n\t\t\tmessage: \"What Topic would you like to Add?\",\n\t\t}\n\t\t])\n\t\t.then(function (answer) {\n\n\t\t\tlet newTopic = \"Topics/\"+answer.addedTopic;\n\n\t\t\tfs.mkdir(newTopic, function(error){\n\n\t\t\t\tif (error) throw error;\n\t\t\t\tconsole.reset();\n\t\t\t\tpickFC(answer.addedTopic);\n\t\t\t})\n\n\t\t});\t\n\n}", "function addNewTopic(topic) {\n\tif (topic != \"\") {\n\t\tconsole.log(\"Adding new task: \" + topic);\n\t\tvar topicId = Math.floor(100000 + Math.random() * 900000);\n\t\ttopicsDictionary[topicId] = {id: topicId, name: topic, time: 0};\n\n\t\tif (selectedTopicID == \"\" || selectedTopicID == null || isWorkingOnTask == false) {\n\t\t\tselectedTopicID = topicId;\n\t\t\tstoreSelectedTopicID();\n\t\t}\n\t\tstoreTopics();\n\t}\n}", "function clearTopicsFromLS() {\n localStorage.clear();\n}", "function topicChanged( topic, room, user ) {\n}", "function storeTopicLocally(topic) {\n let topics;\n if(localStorage.getItem('topics') === null) {\n topics = [];\n }\n else {\n topics = JSON.parse(localStorage.getItem('topics'));\n }\n\n topics.push(topic);\n\n localStorage.setItem('topics', JSON.stringify(topics));\n}", "function deleteTopic(item, prop) {\n console.log(\"deleteTopic\");\n let val = item.trim();\n let i = selectedServer[prop].indexOf(val);\n if (i > -1) {\n let el = $(\"#inpSelectedTopic\");\n let selectedTopic = \"subscriptionTopic\";\n if (prop==\"publishTopicHistory\"){\n el = $(\"#inpPublishTopic\");\n selectedTopic = \"publishTopic\";\n }\n if (val == el.val()) {\n el.val(null);\n selectedServer[selectedTopic] = \"\"; //remove \"History\"\n }\n selectedServer[prop].splice(i, 1); // remove the element\n updateServersAndGui(selectedServer, true);\n }\n}", "onTopicClick(topic) {\n if (topic.rowid === this.currentTopic) {\n return;\n }\n\n this.currentTopic = topic.rowid;\n localStorage.setItem('currentTopic', this.currentTopic);\n this.loadSelections();\n }", "function newTopic(topicArray, topicsList) {\n //console.log('received: ', topicArray);\n if(typeof topicArray !== \"undefined\"){\n topicArray.forEach(function (topic, topicIndex) {\n var addToTopicsList = true;\n if (topicsList.length > 0) {\n\n topicsList.forEach(function (topicObject, index) {\n if (topicObject.topic == topic.term) {\n var newCount = topicObject.count + 1;\n topicObject.count = newCount;\n addToTopicsList = false;\n }\n });\n\n }\n if (addToTopicsList == true) {\n\n //then add it to topicsList\n var newTopic = {topic: topic.term, count: 1};\n topicsList.push(newTopic);\n }\n });\n\n }\n return topicsList;\n}", "function updateUserTopic(userId, topic) {\n return new Promise((resolve, reject) => {\n if (!topic) {\n reject(new Error(\"topic must be set\"));\n return;\n }\n const data = JSON.stringify({\n api_key: process.env.EMAIL_OCTOPUS_API_KEY,\n fields: {\n Topic: topic,\n },\n status: \"SUBSCRIBED\",\n });\n\n updateContact(userId, data)\n .then((result) => resolve(result))\n .catch((err) => reject(err));\n });\n}", "function addNewTopicToUX(uxBus, topic){\n //Make sure topic with such pkfp does not exist\n let topicsList = domUtil.$(\"#topics-list\")\n let topics = Array.from(domUtil.$$(\".side-block-data-list-item\", topicsList)).filter(item=>item.getAttribute(\"pkfp\") === topic.pkfp)\n if(topics.length > 0) return\n\n //Creating messages area\n let messageBlocksContainer = domUtil.$(\"#topic-message-blocks-container\")\n //Creating side panel elements\n let topicListItem = UI.bakeTopicListItem(topic, uxBus);\n let topicAssets = UI.bakeTopicAssets(topic, uxBus);\n console.log(\"Baked\");\n\n //Adding new elements to view\n domUtil.appendChildren(topicsList, [topicListItem, topicAssets])\n let topicMessageBlock = UI.bakeTopicMessagesBlock(topic.pkfp, topic.name)\n domUtil.appendChildren(messageBlocksContainer, topicMessageBlock)\n\n addEventListenersForMessagesWindow(uxBus, topicMessageBlock)\n uxTopics[topic.pkfp] = new TopicUXData()\n}", "function handleDelete(event, topic) {\n const newTopicChipArray = topicChipsArray.filter((indexedTopic) => indexedTopic._id !== topic._id)\n setChipData(newTopicChipArray);\n }", "prune(topic, callback) {\n console.log(`ℹ️ [info] Pruning ACL topic ${topic}`);\n this.removeTopic(this.userFromTopic(topic), topic);\n if (typeof (callback) !== \"undefined\") callback();\n }", "function deleteFavorite (articleKey) {\n let uid= firebase.auth().currentUser.uid\n database.ref(`users/${uid}/favorites/${articleKey}`).remove()\n console.log(\"Favorite deleted\")\n}", "deleteTopic(name, id) {\n this.deleteBox.seen = true\n this.deleteBox.name = name\n this.deleteBox.id = id\n this.deleteBox.desc = `با تایید عملیات سرفصل با نام ${name} حذف خواهد شد`\n }", "function newTopic() {\n var activity = $(\"#input\").val().trim();\n topics.push(activity);\n topicBtn();\n $(\"#input\").val(\"\");\n}", "removeTopic(topic) {\n if(!(topic in this.listeners)) return;\n this.listeners[topic].unsubscribe();\n delete(this.listeners[topic]);\n }", "function overBound(topic) {\n if (topic.passed_count >= config.pass_count) {\n var date = new Date();\n var TopicData = {\n title: topic.title,\n content: topic.content,\n location: topic.location,\n lat: topic.lat,\n lng: topic.lng,\n category: topic.category,\n author_id: topic.author_id,\n create_date: date,\n like_count: parseInt(Math.random() * config.start_like + 1)\n };\n // Delete the food posting\n Topic.remove({_id: topic._id}, function (err, result) {\n });\n\n //put the fooding posting to a set of authorized food posting\n topic_passed.createTopic(TopicData, function (err, result) {\n });\n }\n}", "function wpabstracts_delete_topic(){\n jQuery('#topics_table').find(\"tr:last\").remove();\n}", "changeTopic(newTopic) {\n let url = defaultUrl + '&category=' + newTopic;\n this.apiCall(url);\n }", "function deleteFaq(faqId) {\n // Makes sure that currentUser is set before getting messages from the server\n AuthFactory.auth.$onAuthStateChanged(function(currentUser) {\n if(currentUser){\n return currentUser.getToken().then(function(idToken) {\n return $http({\n method: 'DELETE',\n url: '/profile-edit/delete-faq/' + faqId,\n headers: {\n id_token: idToken\n }\n })\n .then(function(response) {\n getProfiles();\n }),\n function(error) {\n console.log('Error with messages POST request: ', error);\n };\n });\n }\n });\n }", "updateTopic(root, args, { user }) {\n if (!user) {\n throw new AuthenticationError('You must be logged in to update a topic')\n }\n // todo before trying to update, check if it is found\n let _tempTopic = Object.assign({}, args)\n delete _tempTopic.id\n return Topic.updateOne({ _id: args.id }, { $set: _tempTopic })\n }", "function upload(topicData, callback) {\n\n Topic.create(topicData, function (err, result) {\n callback(err, result);\n })\n}", "function getTopic(){\n fetch('http://localhost:3000/topic')\n .then(r => r.json())\n .then(topics => //console.log(topics))\n {\n topics.forEach(topic => addTopic(topic))\n })\n}", "subscribe(topic) {\n this.topicQueues[topic] = []\n }", "function updateActiveTopic(topic) {\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.select(\"#g-topic\").text((topic.count > maxMentions ? \"A sampling of \" : topic.count || \"No\") + \" mentions of \" + topic.name + \".\");\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.select(\"#g-topic\").text(\"Lucastimmons tweets\");\n }\n}", "function handleFaveButtonClick(event, topic) {\n //console.log(topic)\n const newTopicChipsArray = [...topicChipsArray];\n\n\n let isAlreadyIncluded;\n // Check if topic to be added is already included\n newTopicChipsArray.forEach(topicIndexed => {\n if (topicIndexed._id === topic._id) {\n //console.log(\"Already included\")\n isAlreadyIncluded = true;\n }\n })\n\n // Add topic to chips array\n if (!isAlreadyIncluded) {\n newTopicChipsArray.push(topic);\n setChipData(newTopicChipsArray)\n\n }\n\n }", "onApply(post) {\n console.log(\"deleted\");\n if (this.appliedUsers.length !== 0) {\n this.postService.deletePost(post).subscribe(p => {\n console.log(\"deleted\");\n this.userService.getUserById(JSON.parse(localStorage.getItem('user')).id).subscribe(u => {\n localStorage.setItem('user', JSON.stringify(u));\n location.reload();\n });\n });\n }\n }", "function addTopics() {\n\t\tfor(i = 0 ; i < topics.length; i++) {\n\t\t\t$(\"#topics\").append(\"<button class='topic-button'>\"+topics[i]+\"</button>\");\n\t\t}\n\t}", "function addObserver(aTopic)\n{\n if (gActiveTopics.indexOf(aTopic) < 0)\n {\n gObsService.addObserver(gObserver, aTopic, false);\n gActiveTopics.push(aTopic);\n }\n}", "function userCreatesButton() {\n $submitBtn.click(function(e) {\n e.preventDefault();\n if (\n formatUserInput() !== \"\" &&\n !topics.includes(formatUserInput()) &&\n !favTopics.includes(formatUserInput())\n ) {\n var topic = formatUserInput();\n topics.push(topic);\n makeButtons();\n }\n });\n}", "function clearTopics(e) {\n //topicList.innerHTML = '';\n\n // Faster\n while(topicList.firstChild) {\n topicList.removeChild(topicList.firstChild);\n }\n\n // Clear from LS\n clearTopicsFromLS();\n}", "deleteProfile() {}", "onDelete(post) {\n this.userService.deleteApply(post.id, JSON.parse(localStorage.getItem('user'))).subscribe(u => {\n localStorage.setItem('user', JSON.stringify(u));\n location.reload();\n });\n }", "deleteProfile() {\n // console.log(\"deleteProfile()\");\n return store.delete('CURRENT_PROFILE');\n }", "function createNewSubscription() {\n\t// grab the topic from the page form\n\tvar topic = document.getElementById(\"topic\").value.trim();\n\n\t// perform some basic sanity checking.\n\tif (topic.length === 0) {\n\t\treturn;\n\t}\n\n\tif (topic in subscriptions) {\n\t\tconsole.log(\"already have a sub with this topic\");\n\t\treturn;\n\t}\n\n\t// beyond the above, we rely of the sub call to fail if\n\t// the topic string is invalid.\n\n\tconsole.log(\"create new subscription: \" + topic);\n\n\t// issue the subscribe request to the server. Only update\n\t// the page and our data structure if the subscribe is\n\t// successful (do work in success callback).\n\tclientObj.subscribe(topic, {\n\t\tonFailure : function(responseObject) {\n\t\t\tconsole.log(\"Failed to subscribe: \" + responseObject.errorCode);\n\t\t\t// don't update the page\n\t\t},\n\n\t\tonSuccess : function(responseObject) {\n\t\t\t// grab the div on the page that houses the subs display items\n\t\t\tvar subsDiv = document.getElementById(\"subscriptions\");\n\t\t\t// ensure that it's not hidden (will be when there are no subs)\n\t\t\tsubsDiv.hidden = false;\n\n\t\t\t// create a new div to house the messages\n\t\t\tvar div = document.createElement(\"DIV\");\n\t\t\tdiv.id = \"subsection_\" + topic;\n\n\t\t\t// create the delete button\n\t\t\tvar nameRef = \"button/\" + topic;\n\t\t\tvar button = document.createElement(\"BUTTON\");\n\t\t\tbutton.id = nameRef;\n\t\t\tbutton.innerHTML = \"delete subscription\";\n\n\t\t\tbutton.onclick = function() {\t\t\t\t\n\t\t\t\tconsole.log(\"delete subscription: \" + topic);\n\n\t\t\t\t// do unsub\n\t\t\t\tclientObj.unsubscribe(topic);\n\t\t\t\t// remove row...\n\t\t\t\tsubsDiv.removeChild(subscriptions[topic].div);\n\t\t\t\tsubsDiv.removeChild(subscriptions[topic].spacing);\n\t\t\t\t// remove from data structure\n\t\t\t\tdelete subscriptions[topic];\n\t\t\t\tsubCount--;\n\n\t\t\t\tif (subCount === 0) {\n\t\t\t\t\tsubsDiv.hidden = true;\n\t\t\t\t}\n\t\t\t}\t\n\n\t\t\t// create a new table for the div\n\t\t\tvar table = document.createElement(\"TABLE\");\n\n\t\t\t// create header\n\t\t\tvar header = table.createTHead();\n\t\t\tvar hRow = header.insertRow(0);\n\t\t\tvar tCell = hRow.insertCell(0);\n\t\t\tvar bCell = hRow.insertCell(1);\n\n\t\t\ttCell.innerHTML = \"Topic: \" + topic;\n\t\t\tbCell.appendChild(button);\n\t\t\t\n\t\t\tvar textArea = document.createElement(\"TEXTAREA\");\n\t\t\ttextArea.readOnly = true;\n\t\t\ttextArea.cols = 150;\n\t\t\ttextArea.rows = 6;\n\n\t\t\tvar spacing = document.createElement(\"BR\");\n\n\t\t\tdiv.appendChild(table);\n\t\t\tdiv.appendChild(textArea);\t\t\t\n\n\t\t\t// add the div to the page\n\t\t\tsubsDiv.appendChild(div);\n\t\t\tsubsDiv.appendChild(spacing);\n\n\t\t\t// the object we will store in our subs map\n\t\t\tvar subObj = {\n\t\t\t\tdiv : div, // ref to the div (for easy deleting later)\n\t\t\t\ttext : textArea, // ref to the text area (to add msgs to)\n\t\t\t\tspacing : spacing, // ref to the <br> tag (for easy deleting)\n\t\t\t\tmsgCount : 0 // count of the messages currently displayed.\n\t\t\t};\t\t\t\n\n\t\t\t// store the obj and update our sub count\n\t\t\tsubscriptions[topic] = subObj;\t\n\t\t\tsubCount++;\n\t\t}\n\t});\n}", "async function deleteUserStory(e){\n\n if(e.target.nodeName !== \"SPAN\") return;\n\n const storyId = $(e.target).parent().attr('id');\n\n await currentUser.deleteUserStory(storyId);\n storyList = await StoryList.getStories();\n\n $storiesMyList.empty();\n const storyUser = storyList.stories.filter(story => story.username === currentUser.username);\n\n for (let story of storyUser) {\n const $story = generateStoryMarkup(story);\n $storiesMyList.append($story);\n }\n\n if(storyUser.length <= 0){\n $storiesMyList.append('<p>No stories added by user yet!</p>')\n }\n\n}", "deleteUser() {\n this.deleteBox.seen = true\n }", "function processTopicSettingsUpdated(topic){\n console.log(\"Processing topic settings updated\");\n for(let participant of topic.participants){\n let nickname = participant.getNickname();\n let alias = participant.getAlias()\n Common.setParticipantAlias(topic, participant, alias)\n Common.setParticipantNickname(topic, participant, nickname)\n }\n\n for (let invite of topic.getInvites()){\n Common.setInviteAlias(invite)\n }\n\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "function updateActiveTopic(topic) {\n d3.selectAll(\".g-head\").attr(\"class\", topic ? \"g-head g-has-topic\" : \"g-head g-hasnt-topic\");\n if (activeTopic = topic) {\n node.classed(\"g-selected\", function(d) { return d === topic; });\n updateMentions(findMentions(topic));\n d3.selectAll(\".g-head a\").text(topic.name);\n d3.select(\".g-democrat .g-head span.g-count\").text(formatCount(topic.parties[0].count));\n d3.select(\".g-republican .g-head span.g-count\").text(formatCount(topic.parties[1].count));\n } else {\n node.classed(\"g-selected\", false);\n updateMentions(sampleMentions());\n d3.selectAll(\".g-head a\").text(\"various topics\");\n d3.selectAll(\".g-head span.g-count\").text(\"some number of\");\n }\n}", "addTopic(topic) {\n if(topic in this.listeners) return;\n var listener = new ROSLIB.Topic({\n ros : ros,\n name : topic,\n messageType : 'sensor_msgs/NavSatFix'\n });\n listener.color = this.COLORS[this.topicN++ % this.COLORS.length];\n this.listeners[topic] = listener;\n var that = this;\n listener.subscribe(function(message) {\n if(!message) return;\n if(!message.latitude || !message.longitude) return;\n var marker = L.circleMarker([message.latitude, message.longitude], { renderer: that.renderer, color: this.color, radius: 3 });\n marker.addTo(that.map);\n if(!(topic in that.markersByTopic)) {\n that.markersByTopic[topic] = [];\n }\n that.markersByTopic[topic].push(marker);\n while(that.markersByTopic[topic].length > 1024) {\n that.map.removeLayer(that.markersByTopic[topic][0]);\n that.markersByTopic[topic].shift();\n }\n that.lastMessage = message;\n });\n }", "function fetchTopicsAndListenForNewOnes()\r\n{\r\n \r\n $(\".topic-listings\").hide();\r\n $(\".post-listings\").hide();\r\n $(\".post-display\").hide();\r\n \r\n $(\"#table-of-topics\").empty();\r\n \r\n $(\".topic-listings\").show();\r\n \r\n let topicRef = firestore.collection('topics');\r\n\r\n topicRef.orderBy('timestamp').onSnapshot(function(topics){\r\n $(\"#table-of-topics\").empty();\r\n topics.forEach(function(topic){\r\n let topicData = topic.data();\r\n\r\n let date = new Date(topicData.timestamp);\r\n $(\"#table-of-topics\").append('<tr id = \"' + topic.id +'\" class = \"clickable\"><td>' + topicData.topicName + '</td><td>' + topicData.username + '</td><td>' + date + '</td><td>' + topicData.postCount + '</td>');\r\n // TODO: add badge with number of posts! (cool)\r\n console.log(topicData.topicName);\r\n });\r\n });\r\n}", "function forEachScopedTopic(topic, callback) {\n // this won't include individual dev topics, but\n // the vast majority of installations won't notice.\n const scopes = ['', 'staging', 'production'];\n const topics = scopes.map(scope => `${scope}${scope === '' ? '' : '-'}${topic}`);\n topics.forEach(callback);\n}", "function new_notes(){\r\n var lec = $('#Topic').val();\r\n var cor = $('#Course_Name').val();\r\n var des = $('#Description').val();\r\n\r\n var user = firebase.auth().currentUser;\r\n var name, email, photoUrl, uid;\r\n\r\n if (user != null) {\r\n // name = user.displayName;\r\n email = user.email;\r\n uid = user.uid; // The user's ID, unique to the Firebase project. Do NOT use\r\n // this value to authenticate with your backend server, if\r\n // you have one. Use User.getToken() instead.\r\n }\r\n\r\n var notesData = {\r\n Topic: lec,\r\n userid: uid,\r\n Description: des,\r\n Course_Name: cor\r\n };\r\n\r\n // Get a key for a new Post.\r\n var newNotesKey = firebase.database().ref().child('Notes').push().key;\r\n\r\n // Write the new post's data simultaneously in the posts list and the user's post list.\r\n var updates = {};\r\n updates['/Notes/' + newNotesKey] = notesData;\r\n // updates['/user-notes/' + uid + '/' + 'noteid'] = newNotesKey;\r\n\r\n firebase.database().ref().update(updates);\r\n}", "function deleteCurrentPersonSubscription( sub) {\n SubscriptionService.delete({\n id: sub.id\n },\n /* on success */\n function () {\n toaster.pop('success', \"\", \"Subscription is deleted.\");\n delete vm.subscriptions[ sub.id];\n\n PeopleService.query({\n id: AuthService.getUserId(),\n resource: 'subscriptions'\n }).$promise.then(function (subscriptions) {\n vm.subscriptions = subscriptions;\n });\n\n },\n /* on error */\n function (err) {\n toaster.pop('success', \"\", \"Failed deleting the Subscription.\");\n }\n );\n }", "function removeFromSubscribed(username) {\n\tvar subscribed = getSubscribedList();\n\tdelete subscribed[username];\n\tsetSubscribedList(subscribed);\n}", "function pushTopic(el){\n var foundTopic = false;\n for(var i = 0; i < topics.length; i++){\n if(el === topics[i]){\n foundTopic = true;\n break;\n }\n }\n\n if(!foundTopic){\n topics.push(el);\n var newTopic = $(\"<button>\");\n newTopic.attr(\"type\", \"button\");\n newTopic.text(el);\n $(\".topics\").append(newTopic);\n }\n }", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}", "function hashchange() {\n var name = decodeURIComponent(location.hash.substring(1)).trim();\n updateActiveTopic(name && name != \"!\" ? findOrAddTopic(name) : null);\n}" ]
[ "0.63320595", "0.610518", "0.6047354", "0.5901316", "0.5898591", "0.58916134", "0.57216436", "0.5681172", "0.56433547", "0.5642202", "0.5641545", "0.56403744", "0.5631555", "0.5629372", "0.5617408", "0.55946326", "0.55941594", "0.558389", "0.5568373", "0.55626214", "0.5561351", "0.5537986", "0.55057794", "0.54889256", "0.54769707", "0.5470013", "0.5440712", "0.5430794", "0.5369242", "0.53644687", "0.5357326", "0.53489053", "0.53317297", "0.532242", "0.5285294", "0.5261909", "0.5252382", "0.5244352", "0.5202915", "0.5197848", "0.517979", "0.5178432", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5177242", "0.5171778", "0.5167789", "0.51606965", "0.5152929", "0.514269", "0.5140191", "0.51393145", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322", "0.5093322" ]
0.0
-1
renderTable renders the ufoSIghtings dataSet to the tbody
function renderTable() { $tbody.innerHTML = ""; for (var i = 0; i < ufoSightings.length; i++) { // Get get the current sightings object and its fields var sightings = ufoSightings[i]; var fields = Object.keys(sightings); // Create a new row in the tbody, set the index to be i + startingIndex var $row = $tbody.insertRow(i); for (var j = 0; j < fields.length; j++) { // For every field in the sightings object, create a new cell at set its inner text to be the current value at the current sightings field var field = fields[j]; var $cell = $row.insertCell(j); $cell.innerText = sightings[field]; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function renderTable() {\n $tbody.innerHTML = \"\";\n console.log(\"rendering\")\n\n for (var i = 0; i < tableData.length; i++) {\n // Get get the current UFO info object and its fields\n var ufoinfo = tableData[i];\n var field = Object.keys(ufoinfo);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < field.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = ufo[field];\n }\n } \n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredDataSet.length; i++) {\n\n // Get the current object and its fields\n var data = filteredDataSet[i];\n var fields = Object.keys(data);\n\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n\n // For every field in the table object, create a new cell at set its inner text to be the current value at the current field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = data[field];\n }\n }\n}", "function renderTable() {\n $tbody.innerHTML = '';\n for (var i = 0; i < filteredData.length; i++) {\n // Get get the current UFOData object and its fields\n var UFOData = filteredData[i];\n var fields = Object.keys(UFOData);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the UFOData object, create a new cell at set its inner text to be the current value\n // at the current UFOData's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = UFOData[field];\n }\n }\n}", "function renderTable() {\n clearTable();\n showTable();\n}", "function appendTable(dataToRender){\n tabelBody.html(\"\")\n dataToRender.forEach(ufo => {\n var newRow = tabelBody.append(\"tr\");\n Object.entries(ufo).forEach(([key,value]) => {\n var cell = newRow.append(\"td\");\n cell.text(value)\n });\n });\n}", "function renderTable(data) {\n var table_data = data.data;\n var height = data.height;\n var width = data.width;\n var table = document.getElementById(\"results-\" + current_tab);\n $(\".no-table#tab-\" + current_tab).hide();\n table.innerHTML = \"\";\n $(\"h5\").hide();\n for (var i = 0; i < height; i++) {\n let row = document.createElement(\"tr\");\n for (var j = 0; j < width; j++) {\n let col;\n if (i == 0 || j == 0) col = document.createElement(\"th\");\n else col = document.createElement(\"td\");\n col.appendChild(document.createTextNode(table_data[i][j]));\n row.appendChild(col);\n }\n table.appendChild(row);\n }\n var current_date = new Date();\n $(\".date#tab-\" + current_tab).text(current_date.toLocaleTimeString());\n $(\"h5\").show();\n}", "function renderTable(data) {\r\n const header = buildTableHeader(data);\r\n const body = buildTableBody(data);\r\n const columns = data[0].length;\r\n\r\n const table = `\r\n <table id=\"main\" class=\"display\" style=\"width:100%\">\r\n <thead>${header}</thead>\r\n <tbody>${body}<tbody>\r\n </table>`;\r\n\r\n $('#table-wrapper').append(table);\r\n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < sightingData.length; i++) { // Loop through the data object items\n var sighting = sightingData[i]; // Get each data item object\n var fields = Object.keys(sighting); // Get the fields in each data item\n var $row = $tbody.insertRow(i); // Insert a row in the table object\n for (var j = 0; j < fields.length; j++) { // Add a cell for each field in the data item object and populate its content\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sighting[field];\n }\n }\n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredData.length; i++) {\n // Get the current object and its fields\n var data = filteredData[i];\n var fields = Object.keys(data);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = data[field];\n }\n }\n}", "function renderData() {\n tableBody.innerHTML = \"\";\n for (var i = 0; i < tableData.length; i++) {\n var data = tableData[i];\n var rows = Object.keys(data);\n var input = tableBody.insertRow(i);\n for (var j = 0; j < rows.length; j++) {\n var field = rows[j];\n var cell = input.insertCell(j);\n cell.innerText = data[field];\n }\n }\n}", "function renderTable() {\n tbody.innerHTML = \"\";\n for (var i = 0; i < filterData.length; i++) {\n // Get the current objects and its fields. Calling each dictionary object 'ovni'. This comes from the data.js database where\n //the object dataSet holds an array (list) of dictionaries. Each dictionary is an object and I'm calling it ovni. This will\n // loop through each dictionary/object from the variable dataSet and store their keys in the variable fields. \n\n var ovni = filterData[i];\n var fields = Object.keys(ovni);\n \n // Create a new row in the tbody, set the index to be i + startingIndex\n // fields are the columns\n var row = tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell and set its inner text to be the current value at the current address's field\n // the variable field will gather the columns names. It will loop through the fields(columns). Example, fields index 0 is datetime.\n var field = fields[j];\n var cell = row.insertCell(j);\n // now i will pass to the cell the ovni object, field values.\n cell.innerText = ovni[field];\n }\n }\n}", "function renderTable(data){\r\n\tlet table = createEmptyTable(\"tableContainer\");\r\n\tcreateHeaderRow(table, data[0]); // Pass any of the data objects to this function\r\n\tcreateResultRows(table, data); // Pass all of the data objects to this function\r\n}", "function renderTable() {\n $newDataTable.innerHTML = \"\";\n for (var i = 0; i < ufoData.length; i++) {\n // Get the current ufo sighting and its fields\n var sighting = ufoData[i];\n var fields = Object.keys(sighting);\n // Insert a row into the table at position i\n var $row = $newDataTable.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell \n // at set its inner text to be the current value at the \n // current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sighting[field];\n }\n }\n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredUFOData.length; i++) {\n\n // Get UFO Data object and its fields\n var UFOdata = filteredUFOData[i];\n var fields = Object.keys(UFOdata);\n\n // Create new row in tbody\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n\n // For every field in the UFOData object create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = UFOdata[field];\n }\n\n }\n\n}", "function table(data){\n tbody.html(\"\");\n\n\t//append the rows(tr) and cells(td) for returned values\n data.forEach((dataRow) => {\n let row = tbody.append(\"tr\");\n \n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n });\n })\n}", "function renderTable(data) {\n var tHead = \"\";\n var tBody = \"\";\n var header = true;\n\n // adds data to array\n if (!Array.isArray(data)) {\n var dataTmp = data;\n data = [dataTmp];\n }\n\n // iterate through json objects in array\n for (var index in data) {\n tBody += \"<tr>\";\n // iterate through values in json object\n for (var key in data[index]) {\n // adds table header from key values\n if (header) tHead += \"<th>\" + key + \"</th>\";\n tBody += \"<td id = '\" + index + \"'>\" + data[index][key] + \"</td>\";\n }\n // stops adding table headers\n header = false;\n tBody += \"</tr>\";\n }\n tableHead.innerHTML = tHead;\n tableBody.innerHTML = tBody;\n}", "function renderTable() {\n \n // Delete the list of cities prior to adding new city table data \n // (necessary to prevent repeat of table data)\n $(\"tbody\").empty();\n\n // Loop through the array of cities\n for (var i = 0; i < citiesArray.length; i++) {\n // Render new table row and table data elements for each city in the array.\n var tRow = $(\"<tr>\");\n var tData = $(\"<td>\");\n var tSpan = $(\"<span>\");\n\n tSpan.addClass(\"city\");\n tData.attr(\"data-name\", citiesArray[i]);\n tData.attr(\"data-index\", i);\n tSpan.text(citiesArray[i]);\n\n let button = $(\"<button>\");\n button.text(\"Remove\");\n button.attr(\"class\", \"btn-sm bg-danger rounded text-white\");\n \n tData.append(tSpan);\n tData.append(button);\n tRow.append(tData);\n $(\"tbody\").append(tRow);\n }\n }", "function renderSalesTable() {\n\n renderTableHead();\n renderTableBody();\n renderTableFoot();\n\n}", "function renderTable() {\n console.log(\"in Render\");\n tbody.innerHTML = \"\";\n for (var i = 0; i < filteredObs.length; i++) {\n // Get get the current address object and its fields\n var address = filteredObs[i];\n var fields = Object.keys(address);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var row = tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var cell = row.insertCell(j);\n cell.innerText = address[field];\n }\n }\n}", "function renderTable() {\n\n var table = $('<table>', { \"id\": \"group\", \"class\": \"mdl-data-table\"}).appendTo('#content');\n var thead = $('<thead>').appendTo(table);\n var tr = $('<tr>').appendTo(thead);\n var name = $('<th>').html(\"Имя\").appendTo(tr);\n var discipline = $('<th>').html(\"Предмет\").appendTo(tr);\n var grade = $('<th>').html(\"Оценка\").appendTo(tr);\n var edit = $('<th>').html(\"Изменить\").appendTo(tr);\n\n/*jquery plugin for work with tables*/\n $('#group').DataTable({\n \"ajax\": '../arrays.json',\n \"language\": {\n \"url\": 'tableLangRus.json'\n }\n });\n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredTable.length; i++) {\n var address = filteredTable[i];\n var fields = Object.keys(address);\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = address[field];\n }\n }\n}", "function renderTable() {\n\n var tbody = d3.select(\"tbody\");\n \n tbody.html(\"\"); \n\n // Iterate through each fileteredData and pend to table\n filteredData.forEach(sighting => {\n \n var tbl_col = Object.keys(sighting);\n\n // console.log(tbl_col);\n\n var row = tbody.append(\"tr\");\n\n tbl_col.forEach(s_info => {\n row.append(\"td\").text(sighting[s_info]); \n // console.log(sighting);\n // console.log(tbl_col);\n // console.log(s_info);\n }); \n });\n}", "function displayData(data){\n tbody.text(\"\")\n data.forEach(function(ufo_sighting){\n new_table_row = tbody.append(\"tr\")\n Object.entries(ufo_sighting).forEach(function([key, value]){\n new_table_cell = new_table_row.append(\"td\").text(value)\n }) \n })}", "function displayData(data){\n tbody.text(\"\")\n data.forEach(function(ufo_sighting){\n new_table_row = tbody.append(\"tr\")\n Object.entries(ufo_sighting).forEach(function([key, value]){\n new_table_cell = new_table_row.append(\"td\").text(value)\n }) \n })}", "function renderTable(search_data) { \n $tbody.innerHTML = \"\";\n for (var i = 0; i < search_data.length; i++) {\n \n var sighting = search_data[i];\n var fields = Object.keys(sighting);\n \n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sighting[field];\n }\n }\n}", "function renderTableData (data) {\n // JAX-RS serializes an empty list as null, and a 'collection of one' as an object (not an 'array of one')\n var list = data == null ? [] : (data.orders instanceof Array ? data.orders : [data.orders]);\n var table = $ ('#orderTbl').DataTable ();\n // var shippingTable = $('#shippingTbl').DataTable();\n var deliveredTable = $ ('#deliveredTbl').DataTable ();\n var orderDetailsTable = $ ('#orderDetailsTbl').DataTable ();\n\n table.clear ().draw ();\n deliveredTable.clear ().draw ();\n var extraButton = \"<span style='display:inline-flex !important;'><a href='' class='order-edit glyphicon glyphicon-pencil'></a> <a href='' class='order-delete glyphicon glyphicon-trash'></a> <a href='Javascript:void(0);' id='printOrder' class='glyphicon glyphicon-print'></a> </span>\";\n // var weight = order.weight;\n $.each (list, function (index, order) {\n var weight = order.weight;\n var amount = order.total;\n /* this will validate if value is not:\n null\n undefined\n NaN\n empty string (\"\")\n false\n 0\n */\n if (!weight)\n weight = 0;\n if (!amount)\n amount = 0;\n // divide data to 2 parts: ordered/delivered (0/1)\n if (order.status == 0)\n table.row.add ([order.id, order.date, order.s_name, order.s_phone, order.s_address, order.r_name, order.r_phone, order.r_address, weight, amount]).draw ();\n else if (order.status == 1)\n deliveredTable.row.add ([order.id, order.date, order.s_name, order.s_phone, order.s_address, order.r_name, order.r_phone, order.r_address, weight, amount]).draw ();\n //reserve first column for checkbox with order id as well\n console.log (\"fill data for order details table of shipping\");\n orderDetailsTable.row.add ([order.id, order.id, order.date, order.s_name, order.r_name, weight, amount]).draw ();\n });\n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredData.length; i++) {\n // Get get the current address object and its fields\n var data = filteredData[i];\n var fields = Object.keys(data);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = data[field];\n }\n }\n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n\n var endingIndex = startingIndex + resultsPerPage;\n // Get a section of the addressData array to render\n var sightingsSubset = sightingsData.slice(startingIndex, endingIndex);\n\n\n for (var i = 0; i < sightingsSubset.length; i++) {\n //console.log(sightingsData.length);\n // Get get the current sighting object and its fields\n var sighting = sightingsSubset[i];\n var fields = Object.keys(sighting);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the sighting object, create a new cell at set its inner text to be the current value at the current sighting's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sighting[field];\n }\n }\n}", "function render(data) {\r\n\t\t\t\t\t\t$('#slc_Marca').children().remove();\r\n\t\t\t\t\t\t$('#slc_TipoVeiculo').children().remove();\r\n\t\t\t\t\t\tvar tabela = $('#tableDiv').append(\r\n\t\t\t\t\t\t\t\t$('<table></table>').attr(\"id\", \"tabela\"));\r\n\t\t\t\t\t\tvar tHead = \"<thead id='tableHead'></thead>\";\r\n\t\t\t\t\t\t$('#tabela').append(tHead);\r\n\t\t\t\t\t\tvar rowH = \"<tr> \" + \"<th>ID</th>\" + \"<th>Marca</th>\"\r\n\t\t\t\t\t\t\t\t+ \"<th>Tipo Veiculo</th>\" + \"<th>Modelo</th>\"\r\n\t\t\t\t\t\t\t\t+ \"<th>Status</th>\" + \"<th>Actions</th>\"\r\n\t\t\t\t\t\t\t\t+ \"</tr>\";\r\n\t\t\t\t\t\t$('#tableHead').append(rowH);\r\n\r\n\t\t\t\t\t\t$('#tabela').append(\r\n\t\t\t\t\t\t\t\t$('<tbody></tbody>').attr(\"id\", \"tabelaBody\"));\r\n\r\n\t\t\t\t\t\t$.each(data, function(index, value) {\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar td = $(\"<tr id= 'row\" + index\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"'>\" + \"</tr>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row1 = $(\"<td>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ value.idModelo + \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row2 = $(\"<td>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ value.idMarca.descMarca\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row3 = $(\"<td>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ value.idTipoV.descTipoV\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row4 = $(\"<td>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ value.descModelo\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row5 = $(\"<td>\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ value.statusModelo\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t+ \"</td>\");\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t// Efetua A Funcao Ao Clicar No\r\n\t\t\t\t\t\t\t\t\t\t\t// Botao\r\n\t\t\t\t\t\t\t\t\t\t\t// btn-update\r\n\t\t\t\t\t\t\t\t\t\t\tvar buttonUpdate = $(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<button>Modificar</button>')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"id\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"btn-update-\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ index)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.click({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tp1 : this\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}, setInputData);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar buttonRemove = $(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t'<button>Remover</button>')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.attr(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"id\",\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\"btn-remove-\"\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t+ index)\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.click({\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tp1 : this\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t}, callRemoveServlet);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tvar row6 = $(\"<td></td>\");\r\n\t\t\t\t\t\t\t\t\t\t\trow6.append(buttonUpdate);\r\n\t\t\t\t\t\t\t\t\t\t\trow6.append(buttonRemove);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row1);\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row2);\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row3);\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row4);\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row5);\r\n\t\t\t\t\t\t\t\t\t\t\ttd.append(row6);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t$('#tabela tbody').append(td);\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t$('#set')\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.append('</tbody></table>');\r\n\r\n\t\t\t\t\t\t\t\t\t\t})\r\n\r\n\t\t\t\t\t\t// Preenche O Select Marca\r\n\t\t\t\t\t\tgetMarcas();\r\n\r\n\t\t\t\t\t\t// Preenche O Select TipoVeiculo\r\n\t\t\t\t\t\tgetTiposVeiculos();\r\n\r\n\t\t\t\t\t}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < AlienData.length; i++) {\n // Get get the current address object and its fields\n var Sighting = AlienData[i];\n var fields = Object.keys(Sighting);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = Sighting[field];\n }\n }\n}", "function renderStoreInTable() {\n\n var table = document.getElementById('store-table');\n var tableRow = document.createElement('tr');\n var tableCell = document.createElement('th');\n tableCell.textContent = this.location;\n tableRow.appendChild(tableCell);\n\n for (var i = 0; i < this.dailyHourSales.length; i++) {\n\n tableCell = document.createElement('td');\n tableCell.textContent = this.dailyHourSales[i];\n tableRow.appendChild(tableCell);\n }\n var tableCellTotal = document.createElement('th');\n tableCellTotal.textContent = this.dailyTotalSales;\n tableRow.appendChild(tableCellTotal);\n table.appendChild(tableRow);\n}", "function renderTable() { \r\n $tbody.innerHTML = \"\";\r\n var length = filteredData.length;\r\n for (var i = 0; i < length; i++) {\r\n // Get get the current address object and its fields\r\n var data = filteredData[i]; \r\n var fields = Object.keys(data); \r\n // Create a new row in the tbody, set the index to be i + startingIndex\r\n var $row = $tbody.insertRow(i);\r\n for (var j = 0; j < fields.length; j++) {\r\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\r\n var field = fields[j];\r\n var $cell = $row.insertCell(j);\r\n $cell.innerText = data[field];\r\n }\r\n }\r\n}", "function displayData(allData){ \n tbody.text(\"\")\n allData.forEach(function(ufoSighting){\n newTr = tbody.append(\"tr\")\n Object.entries(ufoSighting).forEach(function([key, value]){\n newTd = newTr.append(\"td\").text(value)\t\n })\n})}", "function renderTable() {\n $('.request-item').remove();\n\n requests.forEach(function writeToTable(request) {\n $('#request-table').append(request.rowHtml);\n })\n}", "renderObjectsTable_() {\n let tableName = this.objectsTable_.append('tr')\n .attr('class', 'memory-table-name');\n\n tableName.append('td')\n .text('Objects in memory');\n tableName.append('td')\n .text('');\n\n let tableHeader = this.objectsTable_.append('tr')\n .attr('class', 'memory-table-header');\n\n tableHeader.append('td')\n .text('Objects');\n tableHeader.append('td')\n .text('Count');\n\n let countRows = this.objectsTable_.selectAll('.memory-table-row')\n .data(this.data_.objectsCount)\n .enter()\n .append('tr')\n .attr('class', 'memory-table-row');\n\n countRows.append('td')\n .text((d) => d[0]);\n countRows.append('td')\n .text((d) => d[1]);\n }", "function displayData(tableData){\r\n tableData.forEach(function(record){\r\n // console.log(record);\r\n var row = tbody.append(\"tr\");\r\n \r\n Object.entries(record).forEach(function([key, value]){\r\n var cell = row.append(\"td\");\r\n cell.text(value);\r\n });\r\n })}", "function displayData(data){ \r\n tbody.text(\"\")\r\n data.forEach(function(sighting){\r\n new_tr = tbody.append(\"tr\")\r\n Object.entries(sighting).forEach(function([key, value]){\r\n new_td = new_tr.append(\"td\").text(value)\t\r\n })\r\n})}", "function buildTable(data) {\r\n tbody.html(\"\");\r\n//next loop through each object in data and append a row and cells for each value in the row\r\ndata.forEach((dataRow)) => {\r\n //append a row to table body\r\n let row=tbody.append(\"tr\");\r\n //Loop through each field in dataRow and add each value as a table cell (td)\r\n Object.values(dataRow).forEach((val)=> {\r\n let cell = row.append(\"td\");\r\n cell.text(val);\r\n }\r\n );\r\n}", "render() {\n return (\n <table>\n <thead>\n <tr>\n {\n this.props.headers.map((header, index) =>\n <th key={`header-${index}`}>\n {header}\n </th>\n )\n }\n </tr>\n </thead>\n <tbody>\n {\n this.props.data.map((datum, datumIndex) =>\n <tr key={`data-row-${datumIndex}`}>\n {\n datum.map((item, itemIndex) =>\n <td key={`data-col-${itemIndex}`}>\n {item}\n </td>\n )\n }\n </tr>\n )\n }\n </tbody>\n </table>\n );\n }", "function display (dataFiltered) {\n tbody.html(\"\");\n dataFiltered.forEach((report) => {\n var row = tbody.append(\"tr\");\n Object.entries(report).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n })\n })\n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n // Set the value of endingIndex to startingIndex + resultsPerPage\n var endingIndex = startingIndex + resultsPerPage;\n // Get a section of the addressData array to render\n var addressSubset = filteredAddresses.slice(startingIndex, endingIndex);\n\n for (var i = 0; i < addressSubset.length; i++) {\n // Get get the current address object and its fields\n var address = addressSubset[i];\n var fields = Object.keys(address);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = address[field];\n }\n }\n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredrows.length; i++) {\n // Get get the current address object and its fields\n var rows = filteredrows[i];\n var fields = Object.keys(rows);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the rows object, create a new cell at set its inner text to be the current value at the current row's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = rows[field];\n }\n }\n}", "function RenderTable(header, data, element, dataObj) \n{\n\t//the dataObj parameter is only required if classes on each row is req'd\n\t\n\t$(\"#\" + element).empty();\n\t\n\tvar table = d3.select(\"#\"+element)\n\t\t.append(\"table\")\n\t\t.attr(\"class\", \"table-bordered\");\n\t\n\t//append the header row\n\ttable.append(\"thead\")\n\t\t.selectAll(\"th\")\n\t\t.data(header)\n\t\t.enter().append(\"th\")\t\t\n\t\t.text(function(d){\n\t\t\treturn d;\n\t\t});\n\t\n\t//append rows\n\ttable.append(\"tbody\")\n\t\t.selectAll(\"tr\")\n\t\t.data(data)\n\t\t.enter().append(\"tr\")\n\t\t.attr(\"class\", function(d){\n\t\t\t//add the class for each metricId as part of its corresponding row\n\t\t\tif(!(dataObj == undefined))\n\t\t\t{\n\t\t\t\tfor(var j = 0; j < dataObj.design.length; j++)\n\t\t\t\t{\n\t\t\t\t\tif(dataObj.design[j] == d[0])\n\t\t\t\t\t{\n\t\t\t\t\t\treturn dataObj.cid[j];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\t.selectAll(\"td\") \n\t\t.data(function(d){\n\t\t\t\treturn d;\n\t\t}) \n\t\t.enter().append(\"td\")\n\t\t.text(function(d){\n\t\t\t\treturn d;\n\t\t});\n}", "function displayTable(){\n var stringData = \"\";\n for (var i=0; i<data.length; i++ ){\n \n \n stringData = stringData + \"<tr><td>\"+(i+1)+\"</td><td>\" + data[i].FullName + \"</td><td>\" + data[i].Email + \"</td><td>\" + data[i].Phone + \"</td><td>\" + data[i].Description + \"</td></tr>\";\n \n }\n \n var tableData = document.getElementById('tableData');\n tableData.innerHTML = stingData;\n \n}", "function RenderTableRows(data) {\t\t \n\t\t var id = settings.id;\n\t\t $('#' + id).find('tbody').empty();\n\n\t\t var totalRows = 0;\n if (data != null && data.length > 0) {\n\n //ShowBlank - insert a blank option at beginning of list\n if (data[0].Value != 0 && settings.showBlank === true) {\n\t\t data.unshift({Value: 0, Text: \"\"});\n\t\t }\n\n\t\t $(data).each(function () {\n\t\t var row = tbody.insertRow();\n\t\t $(row).empty();\n\n\t\t var cell = row.insertCell();\n\t\t $(cell).css({'text-align':'center', 'width':'40px'});\n\n\t\t var btn = document.createElement('button');\n\t\t btn.setAttribute('data-name', this.Text);\n\t\t btn.setAttribute('data-id', this.Value);\n\n\t\t var preSelect = false;\n\t\t for (var r = 0; r < btnList.length; r++) {\n\t\t if (btnList[r].id == this.Value)\n\t\t preSelect = true;\n\t\t }\n\n\t\t if (preSelect)\n\t\t $(btn).addClass('btn btn-xs btn-success');\n\t\t else\n\t\t $(btn).addClass('btn btn-xs btn-primary');\n\n\t\t if (settings.data[0].Group != null)\n\t\t $(btn).addClass(this.Group.Name);\n\n\n\t\t if (settings.buttonTemplate == null) {\n\t\t if (preSelect)\n\t\t btn.innerHTML = '<i class=\"glyphicon glyphicon-check\"></i>';\n\t\t else\n\t\t btn.innerHTML = '<i class=\"glyphicon glyphicon-unchecked\"></i>';\n\t\t } else {\n\t\t btn.innerHTML = settings.buttonTemplate;\n\t\t }\n\n\t\t $(btn).click(function () {\n\t\t switch (TargetType.toLowerCase()) {\n\t\t case \"input\":\n\t\t $('#' + TargetId).val($(this).data('name'));\n\t\t $('#' + TargetId).attr('data-name', $(this).data('name'));\n\t\t $('#' + TargetId).attr('data-id', $(this).data('id'));\n\t\t break;\n\n\t\t case \"div\":\n\t\t $('#' + TargetId).append('<button type=\"button\" class=\"btn btn-xs btn-danger RemoveListItem\" style=\"margin:2px;\" data-id=\"' + $(this).data('id') + '\"><span class=\"glyphicon glyphicon-remove\"></span> ' + $(this).data('name') + '</button>');\n\t\t //settings.multiSelect = true;\n\t\t break;\n\t\t }\n\n\t\t if (!settings.multiSelect) {\n\t\t closeMe();\n\t\t } else {\n\t\t //toggle the button\n\t\t if ($(this).hasClass(\"btn-primary\")) {\n\t\t $(this).removeClass(\"btn-primary\").addClass(\"btn-success\");\n\t\t $(this).find('i').removeClass('glyphicon-unchecked').addClass('glyphicon-check');\n\t\t } else {\n\t\t $(this).removeClass(\"btn-success\").addClass(\"btn-primary\");\n\t\t $(this).find('i').removeClass('glyphicon-check').addClass('glyphicon-unchecked');\n\n\t\t //find matching button id and remove it\n\t\t $('.RemoveListItem').each(function () {\n\t\t if ($(btn).data('id') == $(this).data('id')) {\n\t\t $(this).remove();\n\t\t }\n\t\t });\n\n\t\t }\n\n\t\t }\n\n //Do any callback once item is selected\n\t\t if (typeof settings.onSelected == 'function') {\n\t\t settings.onSelected.call();\n\t\t }\n\n\t\t });\n\n\t\t cell.appendChild(btn);\n\n cell = row.insertCell(); \n\t\t $(cell).attr('data-toggle', 'picker-tooltip').attr('title', this.Title);\n\n if (this.Text.length > 30)\n if (!this.Disabled)\n cell.innerText = this.Text.substring(0, 30) + '...';\n else {\n $(cell).css({\"background-color\":\"mistyRose\",\"cursor\":\"not-allowed\"});\n cell.innerHTML = '<span style=\"color:red; font-decoration:line-through; font-style:italic;\" >' + this.Text.substring(0, 30) + '</span>';\n }\n \n else\n if (!this.Disabled)\n cell.innerText = this.Text;\n else {\n $(cell).css({ \"background-color\": \"mistyRose\", \"cursor\": \"not-allowed\" });\n cell.innerHTML = '<span style=\"color:red; font-decoration:line-through; font-style:italic;\" >' + this.Text + '</span>';\n }\n\n\t\t totalRows++;\n\t\t });\n\t\t }\n\t\t // Display message if results are empty\n\t\t if (data.length == 0) {\n\t\t var cell = tbody.insertRow()//.insertCell();\n\t\t cell.innerHTML = '<td colspan=\"2\">No records.</td>';\n\t\t }\n\n\t\t //add overflow when over 15 records\n\t\t if (totalRows > 15) {\n\t\t $(divOverflow).css('height', '500px');\n\t\t $(divOverflow).css('overflow-x', 'auto');\n\t\t }\n\n\t\t //Init Bootstrap Tooltips\n\t\t setTooltips();\n\n\t\t }", "function displaytable(data){\n tbody.html(\"\");\n data.forEach(function(Table) {\n console.log(Table);\n var row = tbody.append(\"tr\");\n Object.entries(Table).forEach(function([key, value]) {\n console.log(key, value);\n // Append a cell to the row for each value\n // in the weather report object\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "render() {\r\n return (\r\n <div>\r\n <h1 id=\"title\">Existing Data Dynamic Table</h1>\r\n <table id=\"students\">\r\n <tbody>\r\n <tr>{this.renderTableHeader()}</tr>\r\n {this.renderTableData()}\r\n </tbody>\r\n </table>\r\n </div>\r\n );\r\n }", "function renderData(data) {\n let dataTable = document.getElementById(\"dataTable\");\n dataTable.innerHTML = \"\";\n\n if (data.length === 0) {\n //No data found.\n renderNoDataFoundError();\n } else {\n\t\t//No Errors, Data found.\n removeErrors();\n for (let i = 0; i < data.length; i++) {\n tableAddElement(data, i, dataTable);\n }\n }\n}", "function init () {\n data.forEach((tableData) => {\n let row = tbody.append(\"tr\");\n Object.values(tableData).forEach(value => {\n let cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "function renderTable(sightings)\n {\n var tbody = d3.select(\"tbody\");\n\n sightings.forEach((sighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(([key, value]) => {\n var cell = tbody.append(\"td\");\n cell.text(value);\n });\n });\n }", "function renderDataTable() {\n\n const worksheets = tableau.extensions.dashboardContent.dashboard.worksheets;\n \n // Unregister Event Listeners for old Worksheet, if exists.\n if (unregisterFilterEventListener != null) {\n unregisterFilterEventListener();\n }\n if (unregisterMarkSelectionEventListener != null) {\n unregisterMarkSelectionEventListener();\n }\n\n // We will try to read the worksheet from the settings, if this exists we will show\n // the configuration screen, otherwise we will clear the table and destroy the\n // reference.\n var sheetName = tableau.extensions.settings.get(\"worksheet\");\n if (sheetName == undefined || sheetName ==\"\" || sheetName == null) {\n $(\"#configure\").show();\n $(\"#datatable\").text(\"\");\n if( tableReference !== null) {\n tableReference.destroy();\n }\n // Exit the function if no worksheet name is present !!!\n return;\n } else {\n // If a worksheet is selected, then we hide the configuration screen.\n $(\"#configure\").hide();\n }\n\n // Use the worksheet name saved in the Settings to find and return\n // the worksheet object.\n var worksheet = worksheets.find(function (sheet) {\n return sheet.name === sheetName;\n });\n\n // Retrieve values the other two values from the settings dialogue window.\n var underlying = tableau.extensions.settings.get(\"underlying\");\n var max_no_records = tableau.extensions.settings.get(\"max_no_records\");\n\n // Add an event listener to the worksheet.\n unregisterFilterEventListener = worksheet.addEventListener(tableau.TableauEventType.FilterChanged, (filterEvent) => {\n renderDataTable();\n });\n unregisterMarkSelectionEventListener = worksheet.addEventListener(tableau.TableauEventType.MarkSelectionChanged, (markSelectionEvent) => {\n renderDataTable();\n });\n\n // If underlying is 1 then get Underlying, else get Summary.\n if (underlying == 1) {\n worksheet.getUnderlyingDataAsync({ maxRows: max_no_records }).then(function (underlying) {\n // We will loop through our column names from our settings and save these into an array\n // We will use this later in our datatable function.\n // https://tableau.github.io/extensions-api/docs/interfaces/datatable.html#columns\n var data = [];\n var column_names = tableau.extensions.settings.get(\"column_names\").split(\"|\");\n for (i = 0; i < column_names.length; i++) {\n data.push({ title: column_names[i] });\n }\n\n // We have created an array to match the underlying data source and then\n // looped through to populate our array with the value data set. We also added\n // logic to read from the column names and column order from our configiration.\n const worksheetData = underlying.data;\n var column_order = tableau.extensions.settings.get(\"column_order\").split(\"|\");\n var tableData = makeArray(underlying.columns.length,underlying.totalRowCount);\n for (var i = 0; i < tableData.length; i++) {\n for (var j = 0; j < tableData[i].length; j++) {\n // you can get teh value or formatted value\n // https://tableau.github.io/extensions-api/docs/interfaces/datavalue.html\n tableData[i][j] = worksheetData[i][column_order[j]-1].formattedValue;\n }\n }\n\n // Destroy the old table.\n if (tableReference !== null) {\n tableReference.destroy();\n $(\"#datatable\").text(\"\");\n }\n \n // Read the Settings and get the single string for UI settings.\n var tableClass = tableau.extensions.settings.get(\"table-classes\");\n $(\"#datatable\").attr('class', '')\n $(\"#datatable\").addClass(tableClass);\n\n // Read the Settings and create an array for the Buttons.\n var buttons = [];\n var clipboard = tableau.extensions.settings.get(\"export-clipboard\");\n if (clipboard == \"Y\") {\n buttons.push('copy');\n }\n var csv = tableau.extensions.settings.get(\"export-csv\");\n if (csv == \"Y\") {\n buttons.push('csv');\n }\n var excel = tableau.extensions.settings.get(\"export-excel\");\n if (excel == \"Y\") {\n buttons.push('excel');\n }\n var pdf = tableau.extensions.settings.get(\"export-pdf\");\n if (pdf == \"Y\") {\n buttons.push('pdf');\n }\n var print = tableau.extensions.settings.get(\"export-print\");\n if (print == \"Y\") {\n buttons.push('print');\n }\n\n // If there are 1 or more Export options ticked, then we will add the dom: 'Bfrtip'\n // Else leave this out.\n if (buttons.length > 0) {\n tableReference = $('#datatable').DataTable({\n dom: 'Bfrtip',\n data: tableData,\n columns: data,\n responsive: true,\n buttons: buttons\n });\n } else {\n tableReference = $('#datatable').DataTable({\n data: tableData,\n columns: data,\n responsive: true\n });\n }\n })\n } else {\n worksheet.getSummaryDataAsync({ maxRows: max_no_records }).then(function (sumdata) {\n // We will loop through our column names from our settings and save these into an array\n // We will use this later in our datatable function.\n // https://tableau.github.io/extensions-api/docs/interfaces/datatable.html#columns\n var data = [];\n var column_names = tableau.extensions.settings.get(\"column_names\").split(\"|\");\n for (i = 0; i < column_names.length; i++) {\n data.push({ title: column_names[i] });\n }\n\n // We have created an array to match the underlying data source and then\n // looped through to populate our array with the value data set. We also added\n // logic to read from the column names and column order from our configiration.\n const worksheetData = sumdata.data;\n var column_order = tableau.extensions.settings.get(\"column_order\").split(\"|\");\n var tableData = makeArray(sumdata.columns.length,sumdata.totalRowCount);\n for (var i = 0; i < tableData.length; i++) {\n for (var j = 0; j < tableData[i].length; j++) {\n tableData[i][j] = worksheetData[i][column_order[j]-1].formattedValue;\n }\n }\n\n // Destroy the old table.\n if (tableReference !== null) {\n tableReference.destroy();\n $(\"#datatable\").text(\"\");\n }\n\n // Read the Settings and get the single string for UI settings.\n var tableClass = tableau.extensions.settings.get(\"table-classes\");\n $(\"#datatable\").attr('class', '')\n $(\"#datatable\").addClass(tableClass);\n\n // Read the Settings and create an array for the Buttons.\n var buttons = [];\n var clipboard = tableau.extensions.settings.get(\"export-clipboard\");\n if (clipboard == \"Y\") {\n buttons.push('copy');\n }\n var csv = tableau.extensions.settings.get(\"export-csv\");\n if (csv == \"Y\") {\n buttons.push('csv');\n }\n var excel = tableau.extensions.settings.get(\"export-excel\");\n if (excel == \"Y\") {\n buttons.push('excel');\n }\n var pdf = tableau.extensions.settings.get(\"export-pdf\");\n if (pdf == \"Y\") {\n buttons.push('pdf');\n }\n var print = tableau.extensions.settings.get(\"export-print\");\n if (print == \"Y\") {\n buttons.push('print');\n }\n\n // If there are 1 or more Export options ticked, then we will add the dom: 'Bfrtip'\n // Else leave this out.\n if (buttons.length > 0) {\n tableReference = $('#datatable').DataTable({\n dom: 'Bfrtip',\n data: tableData,\n columns: data,\n responsive: true,\n buttons: buttons\n });\n } else {\n tableReference = $('#datatable').DataTable({\n data: tableData,\n columns: data,\n responsive: true\n });\n }\n })\n }\n }", "function dataDisplay(item){\n tbody.text(\"\");\n item.forEach(ufo_sighting => {\n console.table(ufo_sighting);\n add_tr = tbody.append(\"tr\");\n\n Object.entries(ufo_sighting).forEach(function([key,value]){\n add_td = add_tr.append(\"td\").text(value);\n });\n });\n}", "function addtable() {\n tbody.html(\"\");\n console.log(`There are ${tableDatashape.length} records in this table.`);\n console.log(\"----------\");\n tableDatashape.forEach(function(sighting) {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n }", "renderTable(asteroids, table, hidden, len = 1) {\n\t\thidden.classList.remove('d-none');\n\t\ttable.innerHTML += `<thead class=\"thead-light\">\n\t\t\t\t<tr>\n\t\t\t\t\t<th scope=\"col\">Datum</th>\n\t\t\t\t\t<th scope=\"col\">Ime</th>\n\t\t\t\t\t<th scope=\"col\">Brzina kretanja(km/h)</th>\n\t\t\t\t\t<th scope=\"col\">Min. Precnik(m)</th>\n\t\t\t\t\t<th scope=\"col\">Max. Precnik(m)</th>\n\t\t\t\t</tr>\n\t\t\t</thead>`\n\t\tfor(let i = (len - 1) * 10; i < len * 10; i++) {\n\t\t\tif(i === asteroids.length) break;\n\t\t\ttable.innerHTML += `<tr>\n\t\t\t\t<td>${asteroids[i].close_approach_data[0].close_approach_date}</td>\n\t\t\t\t<td>${asteroids[i].name}</td>\n\t\t\t\t<td>${asteroids[i].close_approach_data[0].relative_velocity.kilometers_per_hour}</td>\n\t\t\t\t<td>${asteroids[i].estimated_diameter.meters.estimated_diameter_min}</td>\n\t\t\t\t<td>${asteroids[i].estimated_diameter.meters.estimated_diameter_max}</td>\n\t\t\t</tr>`;\n\t\t}\n\t}", "function createTable(UFOdata){\n // clear table of all previous searches\n tbody.html(\"\")\n // Loop through each data entry to create a table row for each entry\n UFOdata.forEach((sighting) => {\n console.log(sighting);\n var row=tbody.append('tr');\n // Add table columns for each key value pair in each entry\n Object.values(sighting).forEach((value) =>{\n console.log(value);\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function fulldata() {\n tbody.html(\"\");\n console.log(`Complete data: ${tableData.length} records in this table.`);\n console.log(\"----------\");\n\n tableData.forEach(function(sighting) {\n\n var row = tbody.append(\"tr\");\n\n Object.entries(sighting).forEach(function([key, value]) {\n\n var cell = row.append(\"td\");\n\n cell.text(value);\n });\n });\n}", "function buildTable(data) {\n // Clear existing data in table\n tbody.html(\"\");\n // Create forEach function to loop through the table\n data.forEach((dataRow) => {\n // Create a variable to add a row to the table\n let row = tbody.append(\"tr\");\n // Reference an object from the array of UFO sightings and put each sighting in its own row of data\n Object.values(dataRow).forEach((val) => {\n // Create a variable to add data to the row\n let cell = row.append(\"td\");\n // Add values \n cell.text(val);\n });\n });\n}", "function renderDataTableData(tableId, data) {\n $(`#${tableId}`).DataTable().clear().rows.add(data).draw();\n}", "function renderDataTable() {\r\n\r\n const worksheets = tableau.extensions.dashboardContent.dashboard.worksheets;\r\n \r\n // Unregister Event Listeners for old Worksheet, if exists.\r\n if (unregisterFilterEventListener != null) {\r\n unregisterFilterEventListener();\r\n }\r\n if (unregisterMarkSelectionEventListener != null) {\r\n unregisterMarkSelectionEventListener();\r\n }\r\n\r\n // We will try to read the worksheet from the settings, if this exists we will show\r\n // the configuration screen, otherwise we will clear the table and destroy the\r\n // reference.\r\n var sheetName = tableau.extensions.settings.get(\"worksheet\");\r\n if (sheetName == undefined || sheetName ==\"\" || sheetName == null) {\r\n $(\"#configure\").show();\r\n\r\n\r\n //$(\"#example-chart\").text(\"\");\r\n if( tableReference !== null) {\r\n tableReference.destroy();\r\n }\r\n // Exit the function if no worksheet name is present !!!\r\n return;\r\n } else {\r\n // If a worksheet is selected, then we hide the configuration screen.\r\n $(\"#configure\").hide();\r\n }\r\n\r\n // Use the worksheet name saved in the Settings to find and return\r\n // the worksheet object.\r\n var worksheet = worksheets.find(function (sheet) {\r\n return sheet.name === sheetName;\r\n });\r\n \r\n var underlying = 2; \r\n\r\n // Add an event listener to the worksheet.\r\n unregisterFilterEventListener = worksheet.addEventListener(tableau.TableauEventType.FilterChanged, (filterEvent) => {\r\n renderDataTable();\r\n });\r\n unregisterMarkSelectionEventListener = worksheet.addEventListener(tableau.TableauEventType.MarkSelectionChanged, (markSelectionEvent) => {\r\n renderDataTable();\r\n });\r\n\r\n // If underlying is 1 then get Underlying, else get Summary.\r\n if (underlying == 1) { \r\n var x=0;\r\n } else {\r\n worksheet.getSummaryDataAsync({ maxRows: 0 }).then(function (sumdata) {\r\n // We will loop through our column names from our settings and save these into an array\r\n // We will use this later in our datatable function. ;; maxRows: max_no_records\r\n // https://tableau.github.io/extensions-api/docs/interfaces/datatable.html#columns\r\n var data_col = [];\r\n var column_names = tableau.extensions.settings.get(\"column_names\").split(\"|\");\r\n var col_d_m_array1 = tableau.extensions.settings.get(\"col_Dim_Measures\").split(\"|\"); \r\n for (i = 0; i < column_names.length; i++) { \r\n var s1 = column_names[i];\r\n s1 = s1.replace('-','');\r\n s1 = s1.replace('SUM','');\r\n s1 = s1.replace('(',''); //s1 = s1.replace('(','[');\r\n s1 = s1.replace(')',''); //s1 = s1.replace(')',']');\r\n //data_col.push({ title: column_names[i], field:column_names[i] }); //,headerVertical:true,headerFilter:true\r\n data_col.push({ title: s1, field:s1, genericname: col_d_m_array1[i] });\r\n //data_col.push({ title: column_names[i] });\r\n //alert(column_names[i]); // ok\r\n //data_col.push(column_names[i]);\r\n //alert(column_names[i]);\r\n //alert(s1);\r\n }\r\n \r\n\r\n // We have created an array to match the underlying data source and then\r\n // looped through to populate our array with the value data set. We also added\r\n // logic to read from the column names and column order from our configiration.\r\n const worksheetData = sumdata.data;\r\n var column_order = tableau.extensions.settings.get(\"column_order\").split(\"|\");\r\n \r\n ////////////////////////////////////////////////////////////////////////////\r\n /* // Create an empty arrays for our labels and data set.\r\n var labels = [];\r\n var data = [];\r\n for (var i = 0; i < worksheetData.length; i++) {\r\n labels.push(worksheetData[i][0].formattedValue);\r\n data.push(worksheetData[i][1].value);\r\n //alert(worksheetData[i][0].formattedValue);\r\n } */\r\n ////////////////////////////////////////////////////////////////////////////\r\n \r\n var jstr = \"\"; var jstr2 = \"\"; var tableData7 ; var tableData8 = [];\r\n var tableData = makeArray(sumdata.columns.length, (sumdata.totalRowCount));\r\n for (var i = 0; i < (tableData.length); i++) {\r\n var str1 = \"\";\r\n for (var j = 0; j < tableData[i].length; j++) {\r\n //tableData[i][j] = worksheetData[i][column_order[j]-1].formattedValue; // for formatted value\r\n tableData[i][j] = worksheetData[i][column_order[j]-1].value;\r\n //alert(tableData[i][j]); \r\n \r\n //str1 = str1 + \" \\\"\"+column_names[j].toString() + \"\\\" : \\\"\" + tableData[i][j].toString() + \"\\\" , \"; //// working fine\r\n //str1 = str1 + \" \\\"\"+data_col[j].title.toString() + \"\\\" : \\\"\" + tableData[i][j].toString() + \"\\\" , \"; /// working fine\r\n str1 = str1 + \" \\\"\"+data_col[j].genericname.toString() + \"\\\" : \\\"\" + tableData[i][j].toString() + \"\\\" , \";\r\n //str1 = str1 + \"Col_\"+j.toString() +\": \" + tableData[i][j].toString() + \" , \"; \r\n }\r\n jstr = jstr + \" { \" + str1.trim().slice(0, -1) + \" }, \";\r\n jstr2 = ' { ' + str1.trim().slice(0, -1) + ' } ';\r\n //alert(jstr2);\r\n //JSONobj.arPoints.push( \" { \" + str1.trim().slice(0, -1) + \" } \");\r\n //var Obj1 = JSON.parse(jstr2);\r\n //alert(\" Column 0 value :\" + Obj1.Col_0);\r\n //tableData8.push( JSON.parse(jstr2) );\r\n }\r\n\r\n //alert(jstr);\r\n //tableData7 = JSON.stringify(\" [ \" + jstr + \"] \");\r\n try{\r\n //alert(\"In try block - begin\");\r\n tableData7 = JSON.parse(\"[\"+jstr.trim().slice(0, -1)+\"]\");\r\n //alert((tableData7));\r\n //alert(JSON.stringify(tableData7));\r\n //document.getElementById(\"t1\").innerHTML = JSON.stringify(tableData7);\r\n //var obj999 = $.parseJSON(\"[\" + jstr.trim().slice(0, -1) + \"]\");\r\n var obj9999 = JSON.parse(\"[\" + jstr.trim().slice(0, -1) + \"]\");\r\n //alert(\"In try block - end\");\r\n }\r\n catch(err) {\r\n //alert(\"catch\");\r\n document.getElementById(\"error\").innerHTML = err.message;\r\n }\r\n \r\n //for(var m=0;m<3;m++)\r\n // { alert(tableData[0][m]); }\r\n\r\n // Destroy the old table.\r\n if (tableReference !== null) {\r\n tableReference.destroy();\r\n //$(\"#datatable\").text(\"\");\r\n $(\"#example-chart\").text(\"\");\r\n } \r\n \r\n\r\n //var tabulator_tbl_type = tableau.extensions.settings.get(\"tabulator_Type\");\r\n //alert(\" Tabulator TYPE :\" + tabulator_tbl_type);\r\n\t\t\r\n\t\t \t\r\n\t\t\t\t\r\n\t\t\t \r\n\t\t\t var tabulator_columns_0 = [];\r\n\t\t\t for(var n=0;n<dim_Count;n++) { tabulator_columns_0.push({title:col_AltNames_array2[n], field:col_d_m_array2[n]}); }\r\n \r\n\t\t\t\tfor(var y=0;y<measure_Cnt;y++) { \r\n\t\t\t\t\tvar m = parseInt(y) + parseInt(dim_Count);\r\n\t\t\t\t\ttabulator_columns_0.push({title:col_AltNames_array2[m], field:col_d_m_array2[m]}); \r\n\t\t\t\t}\r\n\r\n document.getElementById(\"t1\").innerHTML = JSON.stringify(tableData7);\r\n alert(\"hi..\");\r\n \r\n //////---------------- script for d-3 sunburst chart : end --///////////////////////////////\r\n \r\n\r\n //////---------------- script for d-3 sunburst chart : end --///////////////////////////////\r\n \r\n\r\n\r\n })\r\n } ///////////// end of [else block] of Summary data \r\n\r\n } ////////// ------------------- end of renderDataTable()", "function renderTableData(data, totals) {\n // sort data\n data.sort(sortingFunction);\n\n // display data\n document.getElementById('tableBody').innerHTML = getDisplayData(data, totals);\n\n // set sorting arrows\n var el = document.getElementById(wrt.sortData.elId);\n if (el) {\n el.innerHTML = el.innerHTML + (wrt.sortData.dir === 'desc' ? '&#x25BC;' : '&#x25B2;');\n }\n\n // register table events\n registerTableEventHandlers();\n }", "function populateTable (data){\r\n\r\n tbody.html (\"\")\r\n\r\ndata.forEach((weatherReport) => {\r\n\r\n var row = tbody.append(\"tr\");\r\n\r\n Object.entries(weatherReport).forEach(([key, value]) => {\r\n\r\n var cell = row.append(\"td\");\r\n\r\n cell.text(value);\r\n\r\n });\r\n\r\n});\r\n\r\n}", "function displayData(data){ \n tbody.text(\"\")\n data.forEach(function(sighting){\n new_tr = tbody.append(\"tr\")\n Object.entries(sighting).forEach(function([key, value]){\n new_td = new_tr.append(\"td\").text(value)\t\n })\n})}", "function createTable (data) {\n tbody.html(\"\");\n data.forEach(function(UFO) {\n var datarow = tbody.append(\"tr\");\n Object.entries(UFO).forEach(([key, value]) => {\n var cell = datarow.append(\"td\");\n cell.text(value)\n })\n })\n}", "function buildTable(dataArray) {\n var markup = \"<table id='dataTable' class='show'>\";\n for (var i = 0; i < dataArray.length; i++) {\n markup += \"<tr>\";\n var row = dataArray[i];\n\n for (var j = 0; j < dataArray[0].length; j++) {\n markup += \"<td>\";\n markup += row[j];\n markup += \"</td>\";\n }\n markup += \"</tr>\";\n }\n markup += \"</table>\";\n\n\n // $(\"#app\").html(markup);\n $(\"#table\").html(markup);\n}", "function dataTable(table){\n // Reset table\n tbody.text(\"\");\n\n // Populate table\n table.forEach(function(incident) {\n // console.log(incident);\n var row = tbody.append(\"tr\");\n Object.entries(incident).forEach(function([key, value]) {\n // console.log(key, value);\n var cell = row.append(\"td\");\n cell.text(value);\n });\n});\n}", "function renderUsers(objUsers) {\r\n var table = document.getElementById(\"tblUsers\");\r\n\r\n while (table.rows.length > 1) {\r\n table.deleteRow(1)\r\n }\r\n for (var objUser in objUsers.data) {\r\n var row = table.insertRow(-1);\r\n row.id = \"user\"+objUsers.data[objUser].id;\r\n var cell1 = row.insertCell(0);\r\n var cell2 = row.insertCell(1);\r\n var cell3 = row.insertCell(2);\r\n var cell4 = row.insertCell(3);\r\n var cell5 = row.insertCell(4);\r\n cell1.innerHTML = objUsers.data[objUser].id;\r\n cell2.innerHTML = objUsers.data[objUser].email;\r\n cell3.innerHTML = objUsers.data[objUser].first_name;\r\n cell4.innerHTML = objUsers.data[objUser].last_name;\r\n cell5.innerHTML = \"<img src='\" + objUsers.data[objUser].avatar + \"' alt='avatar'>\";\r\n }\r\n}", "function ufoTable(ufoData) {\n // empty contents if any\n tbody.html('')\n // loop through\n ufoData.forEach((ufoSighting) => {\n //append rows day3 activity 2\n let newRow = tbody.append(\"tr\");\n //iterate through data.js values\n Object.entries(ufoSighting).forEach(([, value]) => {\n //append new cells for the values day3 activity 3\n let newCell = newRow.append(\"td\");\n newCell.text(value);\n });\n });\n}", "async #renderTable() {\n $(\"#\" + this.id).dataTable();\n}", "function renderTable(fx) {\n\n\n //Populate table body\n d3.json(url).then(function(response) {\n console.log(response); \n // var name = response.instrument;\n // // console.log(name); \n // var closeMid = [];\n // var highMid = [];\n // var lowMid = [];\n // var openMid = [];\n // var time = [];\n \n // for (var i=0; i<response.candles.length; i++){\n // // console.log(response.candles[i]);\n // closeMid.push(response.candles[i].closeMid);\n // highMid.push(response.candles[i].highMid);\n // lowMid.push(response.candles[i].lowMid);\n // openMid.push(response.candles[i].openMid);\n // time.push(response.candles[i].time.substring(0,10));\n // // console.log(time);\n // };\n\n var tbody = d3.select(\"tbody\");\n\n \n tbody.html(\"\"); \n\n // Iterate through each fileteredData and pend to table\n // filteredData.forEach(sighting => {\n \n // var tbl_col = Object.keys(sighting);\n\n // // console.log(tbl_col);\n\n // var row = tbody.append(\"tr\");\n\n // tbl_col.forEach(s_info => {\n // row.append(\"td\").text(sighting[s_info]); \n // // console.log(sighting);\n // // console.log(tbl_col);\n // // console.log(s_info);\n // }); \n // });\n\n for (var r=0; r<10; r++){\n\n var tbl_col = [\"data\", \"open\", \"high\", \"low\",\"close\"];\n\n var row = tbody.append(\"tr\");\n \n row.append(\"td\").text(response.candles[r].time.substring(0,10));\n row.append(\"td\").text(response.candles[r].openMid);\n row.append(\"td\").text(response.candles[r].highMid);\n row.append(\"td\").text(response.candles[r].lowMid);\n row.append(\"td\").text(response.candles[r].closeMid);\n\n // for (var c=0; c<tbl_col.length; c++){\n // row.append(\"td\").text(response.candles[r].time.substring(0,10));\n // row.append(\"td\").text(response.candles[r].openMid);\n // row.append(\"td\").text(response.candles[r].highMid);\n // row.append(\"td\").text(response.candles[r].lowMid);\n // row.append(\"td\").text(response.candles[r].closeMid);\n // console.log(response.candles[r].closeMid);\n // };\n\n console.log(response.candles[r]);\n \n // console.log(time);\n };\n\n\n }); \n\n\n// }); \n}", "function buildTable(data){\n tbody.html(\"\");\n data.forEach(function(ufoData) {\n console.log(ufoData);\n var row = tbody.append(\"tr\");\n Object.entries(ufoData).forEach(function([key, value]) {\n // Append a cell to the row for each value\n var cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "function buildTable(data){\n tbody.html(\"\");\n data.forEach(function(ufoData) {\n console.log(ufoData);\n var row = tbody.append(\"tr\");\n Object.entries(ufoData).forEach(function([key, value]) {\n // Append a cell to the row for each value\n var cell = row.append(\"td\");\n cell.text(value);\n });\n })\n}", "function poplulateTable(data){\n data.forEach(sightingData=>{\n const trow = tbody.append(\"tr\");\n columns= [\"datetime\", \"city\", \"state\", \"country\", \"shape\", \"durationMinutes\", \"comments\"];\n columns.forEach(key=>{\n trow.append(\"td\").text(sightingData[key]);\n })\n })\n}", "tableBody(datasets) {\n // when there is no uploaded dataset in the database\n console.log(`dataset length: ${datasets.length}, dataset is ${datasets}`)\n if (datasets.length === 0) {\n return (\n <tbody />\n );\n }\n else { // where are dataset stored in the database\n return (\n <tbody>\n {datasets.map((eachDataset, index) =>\n <tr key={index}>\n <td key={'dataset name'}>{eachDataset.FileName}</td>\n <td key={'dataset briefInfo'}>{eachDataset.BriefInfo}</td>\n <td key={'dataset size'}>{eachDataset.Size}</td>\n <td key={\"operateEachDataset\"}>{this.operateDataset(true, eachDataset.FileName, eachDataset.ModelName, eachDataset.UserName)}</td>\n </tr>\n )}\n </tbody>\n );\n }\n\n }", "function renderTableSection() {\n var endingIndex = startingIndex + resultsPerPage;\n var addressSubset = dataSet.slice(startingIndex, endingIndex);\n for (var i = 0; i < addressSubset.length; i++) {\n // Get get the current address object and its fields\n var sight = addressSubset[i];\n var fields = Object.keys(sight);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i + startingIndex);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell at set its inner text to be the current value at the current address's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = sight[field];\n }\n }\n}", "function buildTable(data) {\n tbody.html(\"\");\n\n data.forEach((dataRow) => {\n let row = tbody.append(\"tr\");\n // Create list of table values \n Object.values(dataRow).forEach((val) => {\n let cell = row.append('td');\n cell.text(val);\n });\n })\n}", "function displayTable(sightingList) {\n let tableBody = d3.select(\"tbody\"); \n sightingList.forEach((sighting) => {\n var tblrow = tableBody.append(\"tr\");\n Object.entries(sighting).forEach(([key, value]) => {\n var cell = tblrow.append(\"td\"); \n cell.text(value); \n });\n });\n }", "renderData() {\n\t\tconst { colItem } = styles;\n\t\tif (this.state.personelID) {\n\t\t\tif (this.props.registeredProductsByUser) {\n\t\t\t\treturn this.props.registeredProductsByUser.map((item, index) => {\n\t\t\t\t\tconsole.log(item);\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<tr key={index}>\n\t\t\t\t\t\t\t<td style={colItem}>{item.personelID}</td>\n\t\t\t\t\t\t\t<td style={colItem}>{item.urunID}</td>\n\t\t\t\t\t\t\t<td style={colItem}>{item.urunAdi}</td>\n\t\t\t\t\t\t\t<td style={colItem}>{item.kategoriAdi}</td>\n\t\t\t\t\t\t\t<td style={colItem}>{item.zimmetTarihi}</td>\n\t\t\t\t\t\t\t<td style={colItem}>{item.zimmetKaldirmaTarihi ? item.zimmetKaldirmaTarihi : '-'}</td>\n\t\t\t\t\t\t\t<td style={colItem}>{item.Durum}</td>\n\t\t\t\t\t\t\t<td style={colItem}>{item.Sure}</td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t);\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}", "function buildTable(data){\n\n // clear the current data from the table\n tbody.html(\"\");\n\n // create a forEach loop to loop through the data array\n data.forEach((dataRow)=>{\n\n // add row to body as table row\n let row = tbody.append(\"tr\");\n\n //loop through each object in the data set\n Object.values(dataRow).forEach((val)=>{\n\n // add each object to it's row in table data\n let cell = row.append(\"td\");\n\n // add the values of the key:value pair for each object to the cell\n cell.text(val);\n }\n );\n });\n}", "function renderTable() {\n $tbody.innerHTML = \"\";\n for (var i = 0; i < filteredDateTime.length; i++) {\n // Get get the current date_time object and its fields\n var date_time = filteredDateTime[i];\n var fields = Object.keys(date_time);\n // Create a new row in the tbody, set the index to be i + startingIndex\n var $row = $tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the date_time object, create a new cell at set its inner text to be the current value at the current date_time's field\n var field = fields[j];\n var $cell = $row.insertCell(j);\n $cell.innerText = date_time[field];\n }\n }\n}", "render() {\n if (!this.mounted) {\n return;\n }\n console.log(\"rendering table\");\n this.element.innerHTML = \"\";\n\n const c = document.createTextNode(JSON.stringify(this.data, null, 4));\n const table = el(\"table\", {});\n const thead = el(\"thead\", {});\n const th = el(\"th\");\n const tbody = el(\"tbody\", {});\n const tr = el(\"tr\", {});\n const td = el(\"td\", {});\n const tdStat = el(\"td\");\n const { color, ...colNames } = this.data[0];\n\n const content = table([\n thead(\n tr(\n Object.keys(colNames).map(name =>\n th(\n {\n class: [\n \"header__name\",\n this.sortKey === name ? \"sorting\" : \"\"\n ].join(\" \"),\n sort: name\n },\n name.toUpperCase()\n )\n )\n )\n ),\n tbody(\n this.data.map(({ color, ...rest }) =>\n tr([\n ...Object.values(rest).map(td),\n tdStat({ style: `color: ${color}` }, \"◼\")\n ])\n )\n )\n ]);\n\n content.addEventListener(\"click\", this.handleClickSort);\n\n this.element.appendChild(content);\n }", "function renderTable() {\n clearTable();\n sortInfo();\n info.filter(rowInfo => (showNoPlaybacks || rowInfo.mediaPlaybacks > 0))\n .forEach(rowInfo => engagementTableBody.appendChild(createRow(rowInfo)));\n}", "function populateTable(){\n // Remove previous tbody\n var tbody = d3.select(\"tbody\");\n tbody.remove();\n var table = d3.select(\"#ufo-table\");\n // Append new tbody\n table.append(\"tbody\");\n tbody = d3.select(\"tbody\");\n tableData.forEach(function(event) {\n // Append row\n var row = tbody.append(\"tr\");\n // Append columns\n Object.entries(event).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function buildTable(data) {\n // First, clear out any existing data\n tbody.html(\"\");\n \n // Next, loop through each object in the data\n // and append a row and cells for each value in the row\n data.forEach((dataRow) => {\n // Append a row to the table body\n let row = tbody.append(\"tr\");\n \n // Loop through each field in the dataRow and add\n // each value as a table cell (td)\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n });\n });\n }", "function allData() {\n tbody.html(\"\");\n tableData.forEach((report) => {\n var row = tbody.append(\"tr\");\n Object.entries(report).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n numberEvents.text(objectLength(tableData));\n}", "function tableInit(my_data) {\n // Find the table\n // Use D3 to select the table\n var table = d3.select(\"#ufo-table\");\n //Remove the las tbody to avoid unwanted data\n var my_tbody = table.select('tbody');\n my_tbody.remove();\n //Create e new tbody entity to append the data\n var tbody = table.append(\"tbody\");\n // Build the table\n my_data.forEach((sighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function init() {\n tableData.forEach((sightings) => {\n var row = tbody.append(\"tr\");\n Object.entries(sightings).forEach(([key, value]) => {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function buildTable(data) {\n //clear data\n tbody.html(\"\");\n\n //loop through each data object & append rows & values in each row\n data.forEach((dataRow) => {\n const row = tbody.append(\"tr\");\n\n //loop through each cell in every row to append\n Object.values(dataRow).forEach((val) => {\n let cell = row.append(\"td\");\n cell.text(val);\n }\n );\n });\n\n}", "function renderTable(table, data){\n\t//clear current table\n\tremoveAllChildNodes(table);\n\tgenerateTable(table, data);\t\n\tlet headerRow = Object.keys(data[0]);\n\tgenerateTableHead(table, headerRow)\n\t//add event listeners to remove buttons\n\tlet removeBtns = document.querySelectorAll('button');\n\t//passs in row index to removeClimb (row = button->cell->row)\n\tremoveBtns.forEach(btn => btn.addEventListener('click', () => {removeClimb(btn.parentNode.parentNode.dataset.index)}));\n}", "function buildTable(tableData){\n // Clear the html table section\n tbody.html(\"\");\n //Loop to append data \n tableData.forEach(dataEntry =>{\n var row = tbody.append(\"tr\");\n Object.entries(dataEntry).forEach(([key,value]) =>{\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function generateTable(data) {\n noResults.style('display', 'none');\n tableBody.html('');\n table.style('display', 'table');\n data.forEach(result => {\n var row = tableBody.append('tr');\n var date = row.append('td').text(result.datetime).attr('class', 'datetime').on('click', lookUp);\n var city = row.append('td').text(result.city).attr('class', 'city').on('click', lookUp);\n var state = row.append('td').text(result.state).attr('class', 'state').on('click', lookUp);\n var country = row.append('td').text(result.country).attr('class', 'country').on('click', lookUp);\n var shape = row.append('td').text(result.shape).attr('class', 'shape').on('click', lookUp);\n var duration = row.append('td').text(result.durationMinutes).attr('class', 'duration');\n var description = row.append('td').text(result.comments).attr('class', 'description');\n });\n}", "function tableBuild(data) {\n //used to clear current data on table\n tbody.html(\"\");\n //used forEach to itrate through each ro of data\n data.forEach((row) => {\n //created variable to create a new row on the table\n var dataRow = tbody.append('tr');\n //read values from each row of the dataset\n Object.values(row).forEach((value) => {\n //appened the new row in order to accept the values\n var cell = dataRow.append('td');\n //inserted the values into each corresponing cell on the table\n cell.text(value);\n })\n })\n}", "function render() {\n\tconsole.log(indicatorData);\n\n\td3.select('table#mipex tbody')\n\t\t.selectAll('tr')\n\t\t.data(indicatorData)\n\t\t.enter()\n\t\t.append('tr')\n\t\t\t.html(rowTemplate);\n\n\t// Inform parent frame of new height\n\tfm.resize()\n}", "function buildTable(data){\n //1st step is to clear out existing data with an empty data cell \n tbody.html(\"\");\n\n data.forEach((dataRow) => {\n console.table(dataRow);\n //now that we have the loop, we want to append it to a table row (\"tr\")\n let row = tbody.append(\"tr\");\n\n console.log(Object.values(dataRow));\n\n Object.values(dataRow).forEach((val) => {\n let cell = row.append('td');\n cell.text(val);\n });\n\n\n })\n}", "function table_Build(data) {\n tableBody.html(\"\");\n data.forEach((row) => {\n const new_row = tableBody.append(\"tr\");\n \n Object.values(row).forEach((value) => {\n let dp = new_row.append(\"td\");\n dp.text(value);\n }\n );\n });\n}", "render() { \n const columns = [{\n\t\t\ttitle: 'Name',\n\t\t\tdataIndex: 'name',\n\t\t\tkey: 'name',\n\t\t}, {\n\t\t\ttitle: 'Age',\n\t\t\tdataIndex: 'age',\n\t\t\tkey: 'age',\n\t\t}, {\n\t\t\ttitle: 'Address',\n\t\t\tdataIndex: 'address',\n\t\t\tkey: 'address',\n\t\t}];\n\t\tconst dataSource = [{\n\t\t\tkey: '1',\n\t\t\tname: 'Mike',\n\t\t\tage: 32,\n\t\t\taddress: '10 Downing Street'\n\t\t}, {\n\t\t\tkey: '2',\n\t\t\tname: 'John',\n\t\t\tage: 42,\n\t\t\taddress: '10 Downing Street'\n\t\t}]; \n return (\n <div>\n\t\t\t {getTable(dataSource, columns)}\n </div>\n );\n }", "function ufoTable(sighting) {\n\n // Create variable to set as the table body \n var tbody = d3.select(\"tbody\")\n\n tbody.html(\"\")\n\n // Loop through objects separating key field from value field to add table row and table data\n sighting.forEach((sighting) => {\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function renderTableData (stores) {\n var trEl = document.createElement('tr');\n\n var tdEl = document.createElement('td');//create\n tdEl.textContent = stores.locationName;//add content\n trEl.appendChild(tdEl);//append\n\n var tdEl = document.createElement('td');\n tdEl.textContent = stores.totalDailySales;\n trEl.appendChild(tdEl);\n\n for(var i = 0; i < openHours.length; i++) {\n var tdEl = document.createElement('td');\n tdEl.textContent = stores.cookiesForEachHourArray[i];\n trEl.appendChild(tdEl);\n }\n cookiesTable.appendChild(trEl);\n}", "function buildTable(data){\n // Start By Clearing Existing Data\n tbody.html(\"\");\n // Loop Through `data` \n data.forEach((dataRow) => {\n // Append Table Row to the Table Body \n let row = tbody.append(\"tr\");\n // Iterate Through Values\n Object.values(dataRow).forEach((val) => {\n // add a row\n let cell = row.append(\"td\");\n cell.text(val);\n });\n })\n}", "propertiesDataTable () {\n const columns =[\n {\n \"data\" : \"id\"\n },\n {\n \"data\" : \"nombre\"\n },\n {\n \"data\" : \"nombre\",\n \"render\" :function(data, type, row){\n return row.nombre\n }\n },\n ];\n let head =(<thead>\n <tr>\n <th>id</th>\n <th>Nombre</th>\n <th>Accion</th>\n </tr>\n </thead>);\n return {\n columns : columns,\n head : head\n };\n }", "function UFOsighting(data) {\n tbody.text(\"\")\n data.forEach((sighting)=>{\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(function([key, value]) {\n var cell = row.append(\"td\");\n cell.text(value);\n \n });\n})}" ]
[ "0.78701717", "0.7688644", "0.7636133", "0.75650454", "0.7376295", "0.73651195", "0.7322073", "0.7317811", "0.72682583", "0.72570944", "0.72521484", "0.72020453", "0.70617634", "0.7043836", "0.701574", "0.7003929", "0.698321", "0.6895242", "0.6884901", "0.6883634", "0.6862673", "0.6858447", "0.6857012", "0.6857012", "0.68163055", "0.6814763", "0.68082565", "0.67989886", "0.6794703", "0.6790784", "0.67624605", "0.67572933", "0.6717947", "0.671701", "0.6704872", "0.66842246", "0.6676494", "0.66760314", "0.66759545", "0.6674714", "0.66719973", "0.66181684", "0.6598245", "0.6597026", "0.6594016", "0.6592652", "0.65813947", "0.6575377", "0.6569289", "0.6556366", "0.65538484", "0.6548221", "0.6533192", "0.6525408", "0.6518813", "0.6513768", "0.6512838", "0.65015775", "0.64953125", "0.6492234", "0.64922136", "0.6490941", "0.6485185", "0.64816093", "0.6472077", "0.6467539", "0.6461563", "0.6456575", "0.6454767", "0.64539206", "0.64539206", "0.6453058", "0.6448604", "0.6438662", "0.6438065", "0.64365697", "0.6433696", "0.64236736", "0.6420759", "0.6411399", "0.64068484", "0.6402357", "0.6401326", "0.6393705", "0.6391315", "0.6389638", "0.63805914", "0.6376893", "0.6375755", "0.63738453", "0.63714844", "0.63713604", "0.636837", "0.63639253", "0.6362414", "0.63606924", "0.6359931", "0.63585985", "0.6358279", "0.635606" ]
0.71965265
12
function to handle Search by Shape
function handleSearchButtonClickShape() { // Format the user's search by removing leading and trailing whitespace var filterShape = $shapeInput.value.trim().toLowerCase(); // Set ufoSightings to an array of all dataSet whose "date" matches the filter ufoSightings = dataSet.filter(function(sightings) { var sightingShape = sightings.shape.toLowerCase(); // If true, add the sighting to the filterState, otherwise don't add it to filterState return sightingShape === filterShape; }); renderTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function findShape(event) {\n // debugger;\n\n var p = project.activeLayer.globalToLocal(event.point);\n shapes.shapeIds().forEach(function(key) {\n var shape = shapes.get(key);\n if (shape.outline.hitTest(p)) {\n ui.setCurrentShape(shape.id);\n // console.log(outline);\n }\n });\n \n // for (var key in shapes.shapes) {\n \n // if (shapes.shapes[key].outline.hitTest() {\n // console.log(shapes.shapes[key].outline);\n // ui.setCurrentShape(shapes.)\n // }\n // }\n}", "function searchDiagram() { // called by button\n\tvar input = document.getElementById(\"SearchBox\");\n\tif (!input) return;\n\tinput.focus();\n\n\tmyDiagram.startTransaction(\"highlight search\");\n\n\tif (input.value) {\n\t\t// search four different data properties for the string, any of which may match for success\n\t\t// create a case insensitive RegExp from what the user typed\n\t\tvar regex = new RegExp(input.value, \"i\");\n\t\tvar results = myDiagram.findNodesByExample({ topText: regex });\n\t\tmyDiagram.selectCollection(results);\n\t\t// try to center the diagram at the first node that was found\n\t\tif (results.count > 0) myDiagram.centerRect(results.first().actualBounds);\n\t} else { // empty string only clears highlighteds collection\n\t\tmyDiagram.clearSelection();\n\t}\n\n\tmyDiagram.commitTransaction(\"highlight search\");\n}", "function searchPOI() {\n search = {\n bounds: map.getBounds(),\n types: [document.getElementById('poi').value]\n };\n searchNearby();\n}", "function search(){\n\tthis.X = [];\n\tthis.y = [];\n\tthis.oldX;\n\tthis.oldy;\n\tthis.n = 8;\n\tthis.totaln = 8;\n\tthis.p = 20;\n\tthis.car = [];\n\tthis.box = [];\n}", "function search() {\n\t\n}", "function search() {\n // get the value of the search input field\n var searchString = $('#search').val().toLowerCase();\n\n markerLayer1.setFilter(showType);\n\n // here we're simply comparing the 'name' property of each marker\n // to the search string, seeing whether the former contains the latter.\n function showType(feature) {\n return feature.properties.name\n .toLowerCase()\n .indexOf(searchString) !== -1;\n }\n}", "function shape1(){\n d3.event.preventDefault() \n var shape = d3.select(\"#shape1\").text();\n console.log(shape)\n var filterData = tableData;\n if (shape){\n filterData = filterData.filter((row) => row.shape == shape);\n }\n buildTable(filterData);\n}", "checkHit(givenX, givenY){\n let out = OPERATIONS.NONE;\n let hit = false;\n\n let shapes = this.shapeList.iterator();\n\n while(!shapes.isEmpty() && !hit){\n //check the shape\n let shape = shapes.currItem();\n hit = shape.checkHit(givenX,givenY);\n\n if(hit){\n if(this.selectedButton != null){\n this.selectedButton.unselected();\n }\n this.selectedButton = shape;\n shape.selectedCurrently();\n\n out = shape.getEnum();\n hit = true;\n }\n\n shapes.next();\n }\n\n return out;\n }", "function searchTerm(){\n \n }", "function doGeneralImageSearch() {\n\n}", "function search(quadtree, x0, y0, x3, y3) {\n var pts = [];\n var subPixel = false;\n var subPts = [];\n var scale = getZoomScale();\n console.log(\" scale: \" + scale);\n var counter = 0;\n quadtree.visit(function (node, x1, y1, x2, y2) {\n var p = node.point;\n var pwidth = node.width * scale;\n var pheight = node.height * scale;\n\n // -- if this is too small rectangle only count the branch and set opacity\n if ((pwidth * pheight) <= 1) {\n // start collecting sub Pixel points\n subPixel = true;\n }\n // -- jumped to super node large than 1 pixel\n else {\n // end collecting sub Pixel points\n if (subPixel && subPts && subPts.length > 0) {\n\n subPts[0].group = subPts.length;\n pts.push(subPts[0]); // add only one todo calculate intensity\n counter += subPts.length - 1;\n subPts = [];\n }\n subPixel = false;\n }\n\n if ((p) && (p.x >= x0) && (p.x < x3) && (p.y >= y0) && (p.y < y3)) {\n\n if (subPixel) {\n subPts.push(p.all);\n }\n else {\n if (p.all.group) {\n delete (p.all.group);\n }\n pts.push(p.all);\n }\n\n }\n // if quad rect is outside of the search rect do nto search in sub nodes (returns true)\n return x1 >= x3 || y1 >= y3 || x2 < x0 || y2 < y0;\n });\n console.log(\" Number of removed points: \" + counter);\n return pts;\n\n }", "function SearchEvent() {\n //name = d3.select(\"#searchbox\").value;\n var name = document.getElementById(\"searchbox\").value;\n if (document.getElementById(\"searchbox\").value==\"\"){\n name = d3.select(this).value;\n }\n console.log(d3.select(this).value);\n if (name!=\"\"){\n d3.selectAll(\"circle\")\n .attr(\"opacity\",0.3);\n d3.select(\"body\")\n .selectAll(\".\"+name)\n .attr(\"fill\",\"red\")\n .attr(\"opacity\",1);\n //d3.select(\"body\").selectAll(\".\"+name).attr(\"fill\",\"red\");\n }\n }", "function doubleSearch () {}", "getShapeAt(x, y, root) {\n root = root || this._scene;\n for (var i = 0;i < root.childCount;i++) {\n var shape = root.childAtIndex(i);\n if (shape.containsPoint(x, y)) {\n return shape;\n }\n }\n return null;\n }", "function search(quadtree, x0, y0, x3, y3) {\n var pts = [];\n var subPixel = false;\n var subPts = [];\n var scale = getZoomScale();\n console.log(\" scale: \" + scale);\n var counter = 0;\n quadtree.visit(function (node, x1, y1, x2, y2) {\n var p = node.point;\n var pwidth = node.width * scale;\n var pheight = node.height * scale;\n\n // -- If this is too small rectangle only count the branch and set opacity\n if ((pwidth * pheight) <= 1) {\n // Start collecting sub Pixel points\n subPixel = true;\n }\n // -- Jumped to super node large than 1 pixel\n else {\n // End collecting sub Pixel points\n if (subPixel && subPts && subPts.length > 0) {\n subPts[0].group = subPts.length;\n pts.push(subPts[0]); // add only one todo calculate intensity\n counter += subPts.length - 1;\n subPts = [];\n }\n subPixel = false;\n }\n\n // If point is within boundaries (search rect)\n if ((p) && (p.x >= x0) && (p.x < x3) && (p.y >= y0) && (p.y < y3)) {\n\n if (subPixel) {\n subPts.push(p.all);\n }\n else {\n if (p.all.group) {\n delete (p.all.group);\n }\n pts.push(p.all);\n }\n\n }\n // if quad rect is outside of the search rect do not search in sub nodes (returns true)\n return x1 >= x3 || y1 >= y3 || x2 < x0 || y2 < y0;\n });\n console.log(\" Number of removed points: \" + counter);\n return pts;\n\n }", "function PlaceSearch(point, callback) {\n Places.search({\n location: point,\n types: Types,\n radius: 500\n },\n function(err,res) {\n if(err) {\n console.log(err);\n }\n else {\n callback(res);\n }\n });\n}", "function showOppSearchedArea(target) {\n if (!window.mapImg) {\n window.mapImg = searchGrid.grabImageData();\n var area = $(target).text().substr(5, 2);\n if (area) searchGrid.drawOppSearchArea(area);\n }\n}", "function searchRestaurantDemo(input, mode, selected = []) {\n var count = 0;\n var str = input.toLowerCase().replace(/\\s/g,'');\n var search = new RegExp(str);\n var areaCenter;\n var areaRadius;\n var checkArea = false;\n var isFilter = (selected)?true:false ;\n areas.some((value) => {\n var pattern = new RegExp(value.name);\n if(pattern.test(str)){\n areaCenter = new google.maps.LatLng(value.center[0], value.center[1]);\n areaRadius = value.radius;\n checkArea = true;\n str = str.replace(value.name,'');\n search = new RegExp(str);\n return true;\n }\n })\n markers.filter(value => value.marker.getVisible() == true).forEach(item => {\n if(search.test(item.name.toLowerCase())){\n count++;\n item.marker.setAnimation(google.maps.Animation.BOUNCE);\n stopAnimation(item.marker);\n item.marker.setIcon(blueIcon);\n map.setCenter(item.marker.position);\n item.marker.setVisible(true);\n showing.push(item);\n }else{\n item.marker.setVisible(false);\n item.marker.setIcon(greenIcon);\n }\n if(item.marker.getVisible()){\n if(mode === \"add\"){\n currentLocation[0] = item.marker.position.lat();\n currentLocation[1] = item.marker.position.lng();\n current.setPosition(item.marker.position);\n }\n restaurantInput.value = item.name;\n }\n })\n if(checkArea){\n console.log(\"checking area\")\n markers.forEach(item => {\n if(item.marker.getVisible()){\n if(isInArea(item.marker.position, areaCenter, areaRadius)){\n if(!item.marker.getVisible())count++;\n item.marker.setAnimation(google.maps.Animation.BOUNCE);\n stopAnimation(item.marker);\n item.marker.setIcon(blueIcon);\n map.setCenter(item.marker.position);\n item.marker.setVisible(true);\n }else{\n if(item.marker.getVisible())count--;\n item.marker.setVisible(false);\n item.marker.setIcon(greenIcon);\n }\n if(item.marker.getVisible()){\n if(mode === \"add\"){\n currentLocation[0] = item.marker.position.lat();\n currentLocation[1] = item.marker.position.lng();\n current.setPosition(item.marker.position);\n }\n restaurantInput.value = item.name;\n }\n }\n })\n }\n}", "function search(panoId, param) {\n if (panoId in _pointClouds && getPointCloud(panoId)){\n var pc = getPointCloud(panoId);\n\n // kd-tree. It's slooooooow. I'll try Three.js later.\n // https://github.com/ubilabs/kd-tree-javascript\n //var point = pc.tree.nearest({x: param.x, y: param.y, z: param.z}, 1, 100);\n var point = pc.tree.nearest({x: param.x, y: param.y, z: param.z}, 1, 40);\n if (point && point[0]) {\n var idx = point[0][0].id;\n return idx;\n //var ix = idx / 3 % w;\n //var iy = (idx / 3 - ix) / w;\n //return {ix: ix, iy: iy};\n }\n }\n return null;\n }", "checkHit(givenX, givenY){\n let xcoor = (givenX - (width/2)) / (width/2);\n let ycoor = ((height - givenY) - (height/2)) / (height/2); //weird since canvas is upside down for mouse\n let hit = false;\n //now you have to apply the transformations for world, not inverse\n xcoor = xcoor/this.scaleZoom;\n ycoor = ycoor/this.scaleZoom;\n\n\n xcoor -= this.translateX; //minus because translating left is negative, so subtracting a negative value moves the camera to the right\n ycoor -= this.translateY;\n\n\n let shapes = this.graph.reverseShapeIterator(); //get the shapes, always check in reverse order\n\n while(!shapes.isEmpty() && !hit){\n //check the shape\n let shape = shapes.currItem();\n hit = shape.checkHit(xcoor,ycoor);\n\n if(hit){\n this.graph.setSelectedVert(shape);\n }\n\n shapes.next();\n }\n\n return hit; //returns result if something was hit.\n\n }", "function search(current){\n\n}", "function doFind() {\n //Set the search text to the value in the box\n if (this.id == 'search') {\n findParams.searchText = dom.byId(\"roadName\").value;\n whichSearch = \"grid\";\n } else if (this.id == 'search2') {\n findParams.searchText = dom.byId(\"parcelInfo\").value;\n whichSearch = \"grid1\";\n }\n findTask.execute(findParams, showResults);\n }", "function search(term) {\n clear();\n app.model.term = term;\n $.get(\"/search/\" + term, function (d) {\n if (d.nodes.length === 0) {\n app.showMessage(\"Nothing found\");\n return;\n }\n var nodes = d.nodes;\n var links = d.links;\n var mapper = {};\n for (var i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n var node = addNode(n.name);\n mapper[n.id] = node;\n }\n for (var i = 0; i < links.length; i++) {\n var n = links[i];\n if (i === 0) {\n setStyle(mapper[n.from], \"Orange\");\n app.graph.setBounds(mapper[n.from], new yfiles.geometry.RectD(10, 0, 100, 80));\n }\n var edge = connectNodes(mapper[n.from], mapper[n.to], n.label);\n }\n if(app.preferredLayout==\"organic\")\n organicLayout();\n else\n hierarchyLayout();\n //app.dynamics.go();\n });\n }", "function onSearch(keyword) {\n renderSearchInput(keyword);//if user clicked and not typed\n keyword = keyword.toLowerCase().trim();\n setImgsForDisplay(keyword);\n const images = getImages();\n const isNothingFound = images.every(img => img.isHidden);\n if (isNothingFound) setAllImgsForDisplay();\n renderImgs();\n}", "static _FindShapeInRowInBound(ix,iy, shapeSize, mat, bound)\n {\n var maxCount = 30;\n while(maxCount-- > 0)\n {\n // construct shape\n var shape = TriGridUtils.CreateShapePoints(ix,iy, shapeSize, mat);\n // console.log(\"shape \" + shape);\n if(PathUtils.IsInBound(shape, bound))\n {\n return ix;\n }\n else{\n ix++;\n }\n }\n return ix;\n }", "function search(tree, x0, y0, x3, y3) {\n\t tree.query(x0, y0, x3, y3).map(function (point) {\n\t point.selected = true;\n\t });\n\t // quadtree.visit(function(node, x1, y1, x2, y2) {\n\t // if (!node.length) {\n\t // do {\n\t // var d = node.data;\n\t // d.scanned = true;\n\t // d.selected = (d[0] >= x0) && (d[0] < x3) && (d[1] >= y0) && (d[1] < y3);\n\t // } while (node = node.next);\n\t // }\n\t // return x1 >= x3 || y1 >= y3 || x2 < x0 || y2 < y0;\n\t // });\n\t}", "function submit_search_data(req, res) {\n // variables defined in\n // the Swagger document can be referenced using req.swagger.params.{parameter_name}\n\n let json = req.body;\n\n let type = json.type;\n\n if(type === \"FeatureCollection\") {\n simulatePath.calculatePathsForInput(json, res);\n }\n}", "function triangleSearch(){\n\tif (input.value == \"\") return;\n\t\t\n\t$(displayText).text(\"\");\n\t$(\"#selections\").text(\"\");\n\t$(\"#results\").hide();\n\t$(\"#show-subterms\").hide();\n\tshowLoader();\n\t$(\"#path-subresults\").hide();\n\n\tvar termA = termBank.getSynonym(input.value);\n\tvar type = selectBar.value;\n\t\n\t_withSubterms = subtermsCheckbox.checked;\n\tif(_withSubterms){\n\t\tqueryNeo4j(getMentionsWithSubtermsPayload(termA, type), triangleSearchOnSuccess);\n\t}else{\n\t\tqueryNeo4j(getMentionsPayload(termA, type), triangleSearchOnSuccess);\n\t}\t\n}", "function locateSingleChoice () {\n\td3.selectAll (\"g#vertices circle\").each(function (h,i){\n\t\tvar vtx = d3.select(this);\n\t\tvtx.classed(\"singlechoice\", false);\n\t\tvar isBorder = false;\n\t\tfor (let g of h.ds.vertexCirculator(h)) {\n\t\t\tif (g.isBorder) {\n\t\t\t\tisBorder = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tif (!isBorder) return;\n\t\tvar vtype = vertexNodeType(h);\n\t\tvar matches = archMatch(vtype);\n\t\tif (matches.length == 1) {\n\t\t\td3.select(this).classed(\"singlechoice\", true);\n\t\t}\t\n\t});\n}", "function handleSearch(feature) {\n clearPoint();\n if (isDefined(feature)) {\n if ((isDefined(feature.attributes.City) && feature.attributes.City !== \"\") ||\n (isDefined(feature.attributes.StAddr) && feature.attributes.StAddr !== \"\")) {\n addPoint(feature.geometry);\n usdistrictlayer.queryFeatures({\n geometry: feature.geometry,\n returnGeometry: true,\n outFields: [\"*\"]\n }).then(function (response) {\n mapview.popup.open({\n title: \"Info\",\n content: getDistrictInfoByGeoid(response.features[0].attributes),\n });\n });\n }\n }\n }", "function search(location) {\r\n switch (carType) {\r\n case \"gus\":\r\n searchGus(location);\r\n break;\r\n case \"eletric\":\r\n searchEletric(location);\r\n }\r\n}", "function draw_search(env, after) {\n\tenv.$template('search');\n\tenv.$output({title : 'Search'});\n\tafter();\n}", "function handleSearchButtonClick() {\n var filterDate = $dateTimeInput.value.trim();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n if (filterDate != \"\") {\n filteredData = filteredData.filter(function (date) {\n var dataDate = date.datetime;\n return dataDate === filterDate;\n });\n\n }\n\n if (filterCity != \"\") {\n filteredData = filteredData.filter(function (city) {\n var dataCity = city.city;\n return dataCity === filterCity;\n });\n }\n\n if (filterState != \"\") {\n filteredData = filteredData.filter(function (state) {\n var dataState = state.state;\n return dataState === filterState;\n });\n }\n\n if (filterCountry != \"\") {\n filteredData = filteredData.filter(function (country) {\n var dataCountry = country.country;\n return dataCountry === filterCountry;\n });\n }\n\n if (filterShape != \"\") {\n filteredData = filteredData.filter(function (shape) {\n var dataShape = shape.shape;\n return dataShape === filterShape;\n });\n }\n\n renderTable();\n}", "function search(animals, name) {\n // param animals represents an Array of animals\n // param name represents a String, the name of an animal on which to perform search\n // loop through animals array\n // match animal's name property to name parameter\n for (let i = 0; i < animals.length; i++) {\n if (name.toLowerCase() === animals[i].name.toLowerCase()) {\n console.log(animals[i]);\n return animals[i];\n }\n }\n return null;\n}", "function search(animals, name){ //searches the animals array \n for(let i = 0; i < animals.length; i++){ //for the object name\n if(name === animals[i].name){ //loops through the array \n return animals[i]; \n }else if(i === animals.length - 1){\n return null; //returns null if there is no match\n }\n }\n}", "function searchButtonClick() {\r\n var filterDate = $dateTimeInput.value.trim();\r\n var filterCity = $cityInput.value.trim().toLowerCase();\r\n var filterState = $stateInput.value.trim().toLowerCase();\r\n var filterCountry = $countryInput.value.trim().toLowerCase();\r\n var filterShape = $shapeInput.value.trim().toLowerCase();\r\n\r\n if (filterDate != \"\") {\r\n filteredData = filteredData.filter(function (date) {\r\n var dataDate = date.datetime;\r\n return dataDate === filterDate;\r\n });\r\n\r\n }\r\n\r\n if (filterCity != \"\") {\r\n filteredData = filteredData.filter(function (city) {\r\n var dataCity = city.city;\r\n return dataCity === filterCity;\r\n });\r\n }\r\n\r\n if (filterState != \"\") {\r\n filteredData = filteredData.filter(function (state) {\r\n var dataState = state.state;\r\n return dataState === filterState;\r\n });\r\n }\r\n\r\n if (filterCountry != \"\") {\r\n filteredData = filteredData.filter(function (country) {\r\n var dataCountry = country.country;\r\n return dataCountry === filterCountry;\r\n });\r\n }\r\n\r\n if (filterShape != \"\") {\r\n filteredData = filteredData.filter(function (shape) {\r\n var dataShape = shape.shape;\r\n return dataShape === filterShape;\r\n });\r\n }\r\n\r\n renderTable();\r\n}", "function search(animals, name) {\n \n for (var i = 0; i < animals.length; i++){\n \n if (animals[i].name === name){\n return animals[i];\n } \n \n } return null;\n}", "function di_draw_quick_data_search(draw_div_id, indicator_title, area_title, width, height, indicator_codelist_foler_path, area_codelist_folder_path, indicator_display_type, indicator_value_type, area_display_type, area_value_type, callback_on_search_selection, selection_mode, ind_defalult_text, area_defalut_text, search_img, ind_search_text, area_search_text, ind_block_details, area_block_details, advance_search, suggectionList, search_btn_text, area_isblock_text, callback_on_clear_all_click)\n{ \t\n try\n {\n\t di_draw_qds_ui(draw_div_id, indicator_title, area_title, width, height, indicator_codelist_foler_path, area_codelist_folder_path, indicator_display_type, indicator_value_type, area_display_type, area_value_type, callback_on_search_selection, selection_mode, ind_defalult_text, area_defalut_text, search_img, ind_search_text, area_search_text, ind_block_details, area_block_details, advance_search, suggectionList, search_btn_text, area_isblock_text, callback_on_clear_all_click);\n }\t\n\tcatch(err){}\n}", "function find() {\n //If statements to check from where the search is performed\n if ($(\"input[name='SearchInit']:checked\").val() == \"fromGPSlocation\") {\n findFromPos = true;\n findFromPoint = false;\n findFromTrail = false;\n }\n else if ($(\"input[name='SearchInit']:checked\").val() == \"fromClick\") {\n findFromPos = false;\n findFromPoint = true;\n findFromTrail = false;\n }\n else if ($(\"input[name='SearchInit']:checked\").val() == \"fromTrail\") {\n findFromPos = false;\n findFromPoint = false;\n findFromTrail = true;\n }\n\n //If statements to check what is searched for, point or line and table name\n if ($(\"input[name='SearchChoice']:checked\").val() == \"bathSite\") {\n target = \"point\";\n table = \"w_bathmade\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"NaturBathSite\") {\n target = \"point\";\n table = \"w_bathnatural\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"View\") {\n target = \"point\";\n table = \"w_viewpoint\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"Gems\") {\n target = \"point\";\n table = \"w_nicespots\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"LargeTrail\") {\n target = \"line\";\n table = \"w_pathbig\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"Trail\") {\n target = \"line\";\n table = \"w_pathsmall\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"SmallTrail\") {\n target = \"line\";\n table = \"w_pathnondistinct\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"GreenTrail\") {\n target = \"line\";\n table = \"w_trailgreen\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"RedTrail\") {\n target = \"line\";\n table = \"w_trailhellas5\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"BlueTrail\") {\n target = \"line\";\n table = \"w_traillake\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"PurpleTrail\") {\n target = \"line\";\n table = \"w_trailwhite\";\n }\n else if ($(\"input[name='SearchChoice']:checked\").val() == \"DetailedRoads\") {\n target = \"line\";\n table = \"w_road\";\n }\n\n //If Statements to handle the search if it is performed from the device pos, a clicked point or a marked line\n //Searching from my current position\n if (findFromPos) {\n console.log('find from position');\n if (navigator.geolocation) {\n navigator.geolocation.getCurrentPosition(success, error);\n function success(position) {\n //Extracting the position from geolocation as latitude and longitude\n latitude = position.coords.latitude;\n longitude = position.coords.longitude;\n //Calling a function to handle search for either line or point features from the extracted position\n //\"myPos\" is passed to place the position marker of the search from position in the correct feature\n if (target === \"point\") {\n createfoundpoints(latitude, longitude, \"myPos\");\n }\n else if (target === \"line\") {\n createfoundlines(latitude, longitude, \"myPos\");\n }\n }\n function error() {\n }\n }\n }\n //If searching from a clicked point\n else if (findFromPoint) {\n console.log('find from point');\n //Extracting the latitue and longitude from the clicked position\n latitude = clickcoordinate[1];\n longitude = clickcoordinate[0];\n console.log(latitude, longitude)\n //Calling a function to handle search for either line or point features from the extracted point\n //\"clickedArray\" is passed to place the position marker of the search from position in the correct feature\n if (target === \"point\") {\n createfoundpoints(latitude, longitude, \"clickedArray\");\n }\n else if (target === \"line\") {\n createfoundlines(latitude, longitude, \"clickedArray\");\n }\n }\n //If searching from a marked trail\n else if (findFromTrail) {\n console.log('find from trail');\n //Get table name from clicked line! NOT WORKING YET, JUST HARD CODING THE RED TRAIL\n table2 = \"w_trailhellas5\"\n //Calling a function to handle search for either line or point features from the line feature table extracted\n if (target === \"point\") {\n createfoundpointsfromline(table2);\n }\n else if (target === \"line\") {\n createfoundlinesfromline(table2);\n }\n }\n //function that query and create search points from a point\n function createfoundpoints(latitude, longitude, fromArray) {\n //Extracts the search distance from the input box\n distance = document.getElementById(\"dist\").value\n console.log(table, longitude, latitude, distance)\n //Ajax call to server\n $.ajax({\n url: 'http://localhost:3000/findpointfrompoint',\n type: \"POST\",\n cache: false,\n contentType: \"application/json\",\n //Passes table, search from position and distance as req.body parameters\n data: JSON.stringify({\n table: table,\n longitude: longitude,\n latitude: latitude,\n distance: distance\n }),\n success: function (res) {\n console.log(findFromPos, findFromPoint, findFromTrail, target);\n console.log(res);\n //Clear previous search position markers and adds a new in the correct feature (fromArray)\n clickedArray.clear();\n positionArray.clear();\n addPositionMarker(longitude, latitude, fromArray);\n //Loops the rows of the query result and adds positions markers\n for (var i in res) {\n console.log(latitude, longitude, res[i].latitude, res[i].longitude);\n console.log('Point within distance Yeey!');\n addPositionMarker(res[i].longitude, res[i].latitude, \"searchResult\");\n }\n //Sets the view to the search from position\n map.setView(new View({\n center: fromLonLat([longitude, latitude]),\n zoom: 13\n }))\n }\n })\n }\n //function that query and create search lines from a point\n function createfoundlines(latitude, longitude, fromArray) {\n //Extracts the search distance from the input box\n distance = document.getElementById(\"dist\").value\n console.log(table, longitude, latitude, distance)\n //Ajax call to server\n $.ajax({\n url: 'http://localhost:3000/findlinefrompoint',\n type: \"POST\",\n cache: false,\n contentType: \"application/json\",\n //Passes table, search from position and distance as req.body parameters\n data: JSON.stringify({\n table: table,\n longitude: longitude,\n latitude: latitude,\n distance: distance\n }),\n success: function (res) {\n console.log(findFromPos, findFromPoint, findFromTrail, target);\n console.log(res);\n //Clear previous search position markers and adds a new in the correct feature (fromArray)\n clickedArray.clear();\n positionArray.clear();\n addPositionMarker(longitude, latitude, fromArray);\n //Passes the rows to a parsing function and ads the line features as new features in the searchTrailArray vector source\n var list_Feat = jsonAnswerDataToListElements(res);\n var line_data = {\n \"type\": \"FeatureCollection\",\n \"features\": list_Feat\n }\n searchTrailArray.addFeatures(new ol.format.GeoJSON().readFeatures(line_data, { featureProjection: 'EPSG: 3857' }))\n //Sets the view to the search from position\n map.setView(new View({\n center: fromLonLat([longitude, latitude]),\n zoom: 13\n }))\n }\n })\n }\n //function that query and create search points from a line\n function createfoundpointsfromline(table2) {\n //Extracts the search distance from the input box\n distance = document.getElementById(\"dist\").value\n console.log(table, table2, distance)\n //Ajax call to server\n $.ajax({\n url: 'http://localhost:3000/findpointfromline',\n type: \"POST\",\n cache: false,\n contentType: \"application/json\",\n //Passes tables and distance as req.body parameters\n data: JSON.stringify({\n table1: table,\n table2: table2,\n distance: distance\n }),\n success: function (res) {\n console.log(findFromPos, findFromPoint, findFromTrail, target);\n console.log(res);\n //Clear previous search position markers\n clickedArray.clear();\n positionArray.clear();\n //Loops the rows of the query result and adds positions markers\n for (var i in res) {\n console.log(latitude, longitude, res[i].latitude, res[i].longitude);\n console.log('Point within distance Yeey!');\n addPositionMarker(res[i].longitude, res[i].latitude, \"searchResult\");\n }\n /*\n map.setView(new View({\n center: fromLonLat([res[1].longitude, res[1].latitude]),\n zoom: 13\n }))\n */\n }\n })\n }\n //function that query and create search lines from a line\n function createfoundlinesfromline(table2) {\n //Extracts the search distance from the input box\n distance = document.getElementById(\"dist\").value\n console.log(table, table2, distance)\n //Ajax call to server\n $.ajax({\n url: 'http://localhost:3000/findlinefromline',\n type: \"POST\",\n cache: false,\n contentType: \"application/json\",\n //Passes tables and distance as req.body parameters\n data: JSON.stringify({ //req body\n table1: table,\n table2: table2,\n distance: distance\n }),\n success: function (res) {\n console.log(findFromPos, findFromPoint, findFromTrail, target);\n console.log(res);\n //Clear previous search position markers\n clickedArray.clear();\n positionArray.clear();\n //Passes the rows to a parsing function and ads the line features as new features in the searchTrailArray vector source\n var list_Feat = jsonAnswerDataToListElements(res);\n var line_data = {\n \"type\": \"FeatureCollection\",\n \"features\": list_Feat\n }\n searchTrailArray.addFeatures(new ol.format.GeoJSON().readFeatures(line_data, { featureProjection: 'EPSG: 3857' }))\n /*\n map.setView(new View({\n center: fromLonLat([longitude, latitude]),\n zoom: 13\n }))\n */\n }\n })\n }\n}", "function handleSearch(e) {\n // check if enter was pressed\n if (e.keyCode !== 13) {\n return;\n }\n\n // add a ranking property to color objects\n const rankedArray = colors.map((item) => {\n // rank item's (color object's) similarity to the search string\n const rank = similarity(searchString, item.hex);\n\n // personal function to rank substring matching - simple and character based\n // const rank = searchString.split('').reduce((acc, ch) => {\n // return item.color.includes(ch) ? acc + 1 : acc;\n // }, 0);\n\n return { ...item, rank };\n });\n\n // sort color objects by the added rank property and return the first 50\n const sortedArray = rankedArray.sort(sortByRank).splice(0, 50);\n\n setColorsState(sortedArray);\n }", "intersectsShape(shape2, graphics) {\n // Walk through shape2's line segments and see if they intersect with \n // our line segments.\n // This is O(n^2) so won't scale.\n //. first should check if the point is within the bounding box of this sprite - \n // (x - bounds, y - bounds) to (x + bounds, y + bounds).\n for (let i = 0; i < shape2.nLines - 1; i++) {\n // Get line segment\n const seg2 = shape2.getLineSegment(i)\n if (seg2) {\n // seg2.drawSegment(graphics, 'orange')\n // seg2.drawBoundingBox(graphics, 'orange')\n for (let j = 0; j < this.nLines - 1; j++) {\n const seg1 = this.getLineSegment(j)\n if (seg1) {\n // seg1.drawSegment(graphics, 'red')\n // seg1.drawBoundingBox(graphics, 'red')\n const pointIntersect = seg1.getIntersection(seg2)\n if (pointIntersect) {\n return pointIntersect\n }\n }\n } \n }\n }\n return null\n }", "function searchProduct(){\r\n \r\n var go = \"Thing(?i)\";\r\n \r\n submitProduct(go); \r\n \r\n }", "function customSearch() {\n // retrieve any selected settings from dropdown lists\n var yearSelected = dijit.byId(\"customSearch_Year\").get('value');\n var topicSelected = document.getElementById(\"customSearch_topics\").value;\n var focusAreasSelected = dijit.byId(\"customSearch_FocusAreas\").get('value');\n var missionGroupSelected = dijit.byId(\"customSearch_MissionGroup\").get('value');\n var platformSelected = document.getElementById(\"customSearch_platforms\").value;\n\n // determine if search needs to be made\n var createASearch = false;\n if (yearSelected != \"None\") createASearch = true;\n if (topicSelected != \"None\") createASearch = true;\n if (focusAreasSelected != \"None\") createASearch = true;\n if (missionGroupSelected != \"None\") createASearch = true;\n if (platformSelected != \"None\") createASearch = true;\n\n if (createASearch) {\n // remove any previously plotted GIS layers\n var layersOnMap = map.layerIds.length;\n if (layersOnMap > 1) {\n map.removeAllLayers();\n map.addLayer(basemap);\n map.addLayer(basemapReference);\n map.addLayer(hoverTextLayer);\n map.addLayer(highlightLayer);\n map.addLayer(dataLayer);\n map.addLayer(listHighlightLayer);\n }\n if (hoverTextLayer != undefined) hoverTextLayer.clear();\n if (listHighlightLayer != undefined) listHighlightLayer.clear();\n if (highlightLayer != undefined) highlightLayer.clear();\n\n dataLayer.clear();\n map.infoWindow.hide();\n \n csvStore.fetch({\n onComplete: function(items, request) {\n dojo.forEach(items, function(item, index) {\n yearFound = false;\n themesFound = false;\n focusAreasFound = false;\n missionGroupFound = false;\n platformsFound = false;\n var year = csvStore.getValue(item, \"Year\");\n var cruise = csvStore.getValue(item, \"Cruise\");\n var latitude = csvStore.getValue(item, \"Latitude\");\n var longitude = csvStore.getValue(item, \"Longitude\");\n var themesString = csvStore.getValue(item, \"New Themes\");\n if (themesString != undefined) {\n var themes = themesString.toLowerCase();\n }\n else {\n var themes = csvStore.getValue(item, \"New Themes\");\n }\n var focusAreasString = csvStore.getValue(item, \"OER Focus Areas\");\n if (focusAreasString != undefined) {\n var focusAreas = focusAreasString.toLowerCase();\n }\n else {\n var focusAreas = csvStore.getValue(item, \"OER Focus Areas\");\n }\n var missionGroupString = csvStore.getValue(item, \"Mission Group\");\n if (missionGroupString != undefined) {\n var missionGroup = missionGroupString.toLowerCase();\n }\n else {\n var missionGroup = csvStore.getValue(item, \"Mission Group\");\n }\n var platformsString = csvStore.getValue(item, \"Platforms\");\n if (platformsString != undefined) {\n var platforms = platformsString.toLowerCase();\n }\n else {\n var platforms = csvStore.getValue(item, \"Platforms\");\n }\n var id = csvStore.getIdentity(item);\n if (latitude != undefined && longitude != undefined) {\n if (yearSelected != \"None\") {\n if (year.indexOf(yearSelected) != -1) yearFound = true;\n }\n else {\n yearFound = true;\n }\n if (topicSelected != \"None\") {\n var themesSelected = document.getElementById(\"customSearch_themes\").value;\n if (themesSelected != \"None\") {\n if (themes != undefined) {\n if (themes.indexOf(themesSelected) != -1) themesFound = true;\n }\n }\n else {\n if (topicSelected == \"geology\") {\n if (themes != undefined) {\n if ((themes.indexOf(\"canyon\") != -1) || (themes.indexOf(\"cave\") != -1) || (themes.indexOf(\"fault\") != -1) || (themes.indexOf(\"seamount\") != -1) || (themes.indexOf(\"seep\") != -1) || (themes.indexOf(\"trench\") != -1) || (themes.indexOf(\"volcano\") != -1)) themesFound = true; \n }\n }\n if (topicSelected == \"ecosystems\") {\n if (themes != undefined) {\n if ((themes.indexOf(\"biodiv\") != -1) || (themes.indexOf(\"biolum\") != -1) || (themes.indexOf(\"chemo\") != -1) || (themes.indexOf(\"corals\") != -1) || (themes.indexOf(\"habitat\") != -1) || (themes.indexOf(\"micro\") != -1)) themesFound = true; \n }\n }\n if (topicSelected == \"technology\") {\n if (themes != undefined) {\n if ((themes.indexOf(\"biotech\") != -1) || (themes.indexOf(\"sampling\") != -1) || (themes.indexOf(\"diving\") != -1) || (themes.indexOf(\"mapping\") != -1) || (themes.indexOf(\"sound\") != -1) || (themes.indexOf(\"subs\") != -1) || (themes.indexOf(\"tele\") != -1) || (themes.indexOf(\"newtech\") != -1)) themesFound = true; \n }\n }\n }\n }\n else {\n themesFound = true;\n }\n if (focusAreasSelected != \"None\") {\n if (focusAreas != undefined) {\n if (focusAreas.indexOf(focusAreasSelected) != -1) focusAreasFound = true;\n }\n }\n else {\n focusAreasFound = true;\n }\n if (missionGroupSelected != \"None\") {\n if (missionGroup != undefined) {\n if (missionGroup.indexOf(missionGroupSelected) != -1) missionGroupFound = true;\n }\n }\n else {\n missionGroupFound = true;\n }\n if (platformSelected != \"None\") {\n var platformNamesSelected = document.getElementById(\"customSearch_names\").value;\n if (platformNamesSelected != \"None\") {\n if (platforms != undefined) {\n if (platforms.indexOf(platformNamesSelected) != -1) platformsFound = true;\n }\n }\n else {\n if (platformSelected == \"submersible\") {\n if (platforms != undefined) {\n if ((platforms.indexOf(\"abe\") != -1) || (platforms.indexOf(\"alvin\") != -1) || (platforms.indexOf(\"argus\") != -1) || (platforms.indexOf(\"atlas\") != -1) || (platforms.indexOf(\"clelia\") != -1) || (platforms.indexOf(\"deeprover\") != -1) || (platforms.indexOf(\"deepworker\") != -1) || (platforms.indexOf(\"d2\") != -1) || (platforms.indexOf(\"dsl120\") != -1) || (platforms.indexOf(\"fetch\") != -1) || (platforms.indexOf(\"focus2\") != -1) || (platforms.indexOf(\"gavia\") != -1) || (platforms.indexOf(\"global\") != -1) || (platforms.indexOf(\"herc\") != -1) || (platforms.indexOf(\"hugin\") != -1) || (platforms.indexOf(\"innov\") != -1) || (platforms.indexOf(\"jason\") != -1) || (platforms.indexOf(\"jsl\") != -1) || (platforms.indexOf(\"klein\") != -1) || (platforms.indexOf(\"kraken\") != -1) || (platforms.indexOf(\"lilherc\") != -1) || (platforms.indexOf(\"mir1\") != -1) || (platforms.indexOf(\"mir2\") != -1) || (platforms.indexOf(\"phantom\") != -1) || (platforms.indexOf(\"pisces4\") != -1) || (platforms.indexOf(\"pisces5\") != -1) || (platforms.indexOf(\"prosas\") != -1) || (platforms.indexOf(\"quest4\") != -1) || (platforms.indexOf(\"quest6\") != -1) || (platforms.indexOf(\"rcv\") != -1) || (platforms.indexOf(\"ropos\") != -1) || (platforms.indexOf(\"seaeye\") != -1) || (platforms.indexOf(\"seabed\") != -1) || (platforms.indexOf(\"seabotix\") != -1) || (platforms.indexOf(\"seirios\") != -1) || (platforms.indexOf(\"sentry\") != -1) || (platforms.indexOf(\"sonsub\") != -1) || (platforms.indexOf(\"tiburon\") != -1)) platformsFound = true; \n }\n }\n if (platformSelected == \"vessel\") {\n if (platforms != undefined) {\n if ((platforms.indexOf(\"alliance\") != -1) || (platforms.indexOf(\"aegaeo\") != -1) || (platforms.indexOf(\"akademik\") != -1) || (platforms.indexOf(\"alliance\") != -1) || (platforms.indexOf(\"atlantis\") != -1) || (platforms.indexOf(\"barunajaya\") != -1) || (platforms.indexOf(\"bayhydro\") != -1) || (platforms.indexOf(\"baylis\") != -1) || (platforms.indexOf(\"bigelow\") != -1) || (platforms.indexOf(\"brooks\") != -1) || (platforms.indexOf(\"capefear\") != -1) || (platforms.indexOf(\"caribbean\") != -1) || (platforms.indexOf(\"connecticut\") != -1) || (platforms.indexOf(\"curlew\") != -1) || (platforms.indexOf(\"dominator\") != -1) || (platforms.indexOf(\"donjose\") != -1) || (platforms.indexOf(\"endeavor\") != -1) || (platforms.indexOf(\"endurance\") != -1) || (platforms.indexOf(\"ferguson\") != -1) || (platforms.indexOf(\"flamingo\") != -1) || (platforms.indexOf(\"foster\") != -1) || (platforms.indexOf(\"grapple\") != -1) || (platforms.indexOf(\"gray\") != -1) || (platforms.indexOf(\"gunter\") != -1) || (platforms.indexOf(\"healy\") != -1) || (platforms.indexOf(\"hiialakai\") != -1) || (platforms.indexOf(\"huron\") != -1) || (platforms.indexOf(\"kilomoana\") != -1) || (platforms.indexOf(\"khromov\") != -1) || (platforms.indexOf(\"knorr\") != -1) || (platforms.indexOf(\"kok\") != -1) || (platforms.indexOf(\"lakeguardian\") != -1) || (platforms.indexOf(\"laurentian\") != -1) || (platforms.indexOf(\"laurier\") != -1) || (platforms.indexOf(\"lesuroit\") != -1) || (platforms.indexOf(\"mcarthur\") != -1) || (platforms.indexOf(\"melville\") != -1) || (platforms.indexOf(\"mirai\") != -1) || (platforms.indexOf(\"nautilus\") != -1) || (platforms.indexOf(\"neptune\") != -1) || (platforms.indexOf(\"oceanexp\") != -1) || (platforms.indexOf(\"oceanhunter\") != -1) || (platforms.indexOf(\"oceanic\") != -1) || (platforms.indexOf(\"okeanos\") != -1) || (platforms.indexOf(\"pacificstorm\") != -1) || (platforms.indexOf(\"pelican\") != -1) || (platforms.indexOf(\"pisces\") != -1) || (platforms.indexOf(\"presbitero\") != -1) || (platforms.indexOf(\"roper\") != -1) || (platforms.indexOf(\"ronbrown\") != -1) || (platforms.indexOf(\"sewardjohnson\") != -1) || (platforms.indexOf(\"sila\") != -1) || (platforms.indexOf(\"sonne\") != -1) || (platforms.indexOf(\"spree\") != -1) || (platforms.indexOf(\"srvx\") != -1) || (platforms.indexOf(\"stlaurent\") != -1) || (platforms.indexOf(\"storm\") != -1) || (platforms.indexOf(\"tangaroa\") != -1) || (platforms.indexOf(\"tatoosh\") != -1) || (platforms.indexOf(\"thompson\") != -1) || (platforms.indexOf(\"tjefferson\") != -1) || (platforms.indexOf(\"turks\") != -1) || (platforms.indexOf(\"waltonsmith\") != -1) || (platforms.indexOf(\"weatherbird\") != -1) || (platforms.indexOf(\"westernflyer\") != -1) || (platforms.indexOf(\"whiting\") != -1) || (platforms.indexOf(\"yuhz\") != -1)) platformsFound = true;\n }\n }\n if (platformSelected == \"other\") {\n if (platforms != undefined) {\n if ((platforms.indexOf(\"aquarius\") != -1) || (platforms.indexOf(\"scuba\") != -1)) platformsFound = true; \n }\n }\n }\n }\n else {\n platformsFound = true;\n }\n } \n if (yearFound && themesFound && focusAreasFound && missionGroupFound && platformsFound) {\n createMarker(id, year, cruise, latitude, longitude);\n }\n });\n initializeCruiseListing();\n dojo.connect(dataLayer, \"onClick\", onFeatureClick);\n var cruiseTotals = dijit.byId(\"customCounter\");\n cruiseTotals.attr(\"value\", dataLayer.graphics.length + \" Cruises Displayed\");\n },\n onError: function(error) {\n dojo.byId(\"itemsList\").innerHTML = \"Unable to search the data.\";\n }\n });\n }\n else {\n // remove any previously plotted GIS layers\n var layersOnMap = map.layerIds.length;\n if (layersOnMap > 1) {\n map.removeAllLayers();\n map.addLayer(basemap);\n map.addLayer(basemapReference);\n map.addLayer(hoverTextLayer);\n map.addLayer(highlightLayer);\n map.addLayer(dataLayer);\n map.addLayer(listHighlightLayer);\n }\n if (hoverTextLayer != undefined) hoverTextLayer.clear();\n if (listHighlightLayer != undefined) listHighlightLayer.clear();\n if (highlightLayer != undefined) highlightLayer.clear();\n\n dataLayer.clear();\n map.infoWindow.hide();\n\n csvStore.fetch({\n onComplete: function(items, request) {\n dojo.forEach(items, function(item, index) {\n var year = csvStore.getValue(item, \"Year\");\n var cruise = csvStore.getValue(item, \"Cruise\");\n var latitude = csvStore.getValue(item, \"Latitude\");\n var longitude = csvStore.getValue(item, \"Longitude\");\n var id = csvStore.getIdentity(item);\n if (latitude != undefined && longitude != undefined) {\n createMarker(id, year, cruise, latitude, longitude);\n }\n });\n initializeCruiseListing();\n dojo.connect(dataLayer, \"onClick\", onFeatureClick);\n var cruiseTotals = dijit.byId(\"customCounter\");\n cruiseTotals.attr(\"value\", dataLayer.graphics.length + \" Cruises Displayed\");\n },\n onError: function(error) {\n dojo.byId(\"itemsList\").innerHTML = \"Unable to search the data.\";\n }\n });\n } \n map.setExtent(startExtent);\n }", "function shapeIsSelected(shape)\n{\n if (GC.shape && shape && shape.type == \"rect\")\n {\n if (GC.shape.startX <= shape.startX &&\n GC.shape.startY <= shape.startY &&\n (GC.shape.startX + GC.shape.w) >= (shape.startX + shape.w) &&\n (GC.shape.startY + GC.shape.h) >= (shape.startY + shape.h))\n {\n return true;\n }\n }\n if (GC.shape && shape && shape.type == \"circ\")\n {\n if (GC.shape.startX <= shape.startX &&\n GC.shape.startY <= shape.startY &&\n (GC.shape.startX + GC.shape.w) >= shape.endX &&\n (GC.shape.startY + GC.shape.h) >= shape.endY)\n {\n return true;\n }\n }\n if (GC.shape && shape && shape.type == \"poly\")\n {\n for (var i = 0; i < shape.points.length; i++)\n {\n if (shape.points[i].x <= GC.shape.startX ||\n shape.points[i].y <= GC.shape.startY ||\n shape.points[i].x >= (GC.shape.startX + GC.shape.w) ||\n shape.points[i].y >= (GC.shape.startY + GC.shape.h))\n {\n return false;\n }\n }\n return true;\n }\n return false;\n}", "search(e){\n \n\t e.preventDefault();\n\t let input = document.querySelector('#photo-search');\n\t let term = input.value;\n\t \n\t if(term.length > 2){\t\t \n\t\t input.classList.add('searching');\n\t\t this.container.classList.add('loading');\n\t\t this.search_term = term;\n\t\t this.is_search = true;\n\t\t this.doSearch(this.search_term);\t\t \n\t } else {\t\t \n\t\t input.focus();\t\t \n\t }\n\t \n }", "function handleSearchButtonClick() \n{\n var filterDateTime = $dateTimeInput.value.trim().toLowerCase(); \n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n \n if (filterDateTime || filterCity || filterState || filterCountry || filterShape)\n {\n if (filterDateTime){ \n \n search_data = dataSet.filter (function(sighting) { \n var SightingDateTime = sighting.datetime.toLowerCase();\n return SightingDateTime === filterDateTime;\n });\n } else {search_data = dataSet}; \n \n if (filterCity){\n \n search_data = search_data.filter (function(sighting) {\n var SightingCity = sighting.city.toLowerCase();\n return SightingCity === filterCity;\n });\n } else {search_data = search_data}; \n\n if (filterState){\n search_data = search_data.filter (function(sighting) {\n var SightingState = sighting.state.toLowerCase();\n return SightingState === filterState;\n });\n } else {search_data = search_data}; \n\n if (filterCountry){\n search_data = search_data.filter (function(sighting) {\n var SightingCountry = sighting.country.toLowerCase();\n return SightingCountry === filterCountry;\n });\n } else {search_data = search_data}; \n\n if (filterShape){\n search_data = search_data.filter (function(sighting) {\n var SightingShape = sighting.shape.toLowerCase();\n return SightingShape === filterShape;\n });\n } else {search_data = search_data}; \n\n\n } else {\n // Show full dataset when the user does not enter any serch criteria\n search_data = dataSet; \n }\n $('#table').DataTable().destroy(); \n renderTable(search_data); \n pagination_UFO(); \n}", "function mySearchFn() {\n var obj = {};\n obj.firstname = $('#FirstName').val();\n obj.lastname = $('#LastName').val();\n obj.location = [];\n var locas = $('#Location').children();\n for(var i = 0; i < locas.length; i++){\n obj.location.push(locas[i].innerHTML);\n }\n obj.phone = $('#Phone').val();\n obj.current_class = $('#Class').val();\n var data = getData();\n var newData = [];\n for(var i = 0; i < data.length; i ++){\n if(matchDetail(data[i], obj)){\n newData.push(data[i]);\n }\n }\n showTable(newData);\n }", "function search (array,string){// create a function search, parameters are array, for your animals, and string for what the animal is.\n for (var i = 0; i<= array.length-1; i++){ //Using a for loop to loop over our entire array, incrementing by 1 each loop. \n if(array[i].name === string){//Conditional check to then return a value for our search engine. \n return array[i];//return our animal object, with the information accessed from our for loop\n }\n }return null; //Before returning null, we are wanting our loop to fully be gone through. If our name is not in the entire loop, we will return null\n}", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "function processSpatialForm2(f) {\n\n // This function takes a spatial search form as an argument, and processes\n // it to identify finds within a certain radius of a central point\n\n // NOTE: All calcalations are done using arbitrary Map Units\n\n // First clear the map and tables for a clean slate\n clearMap();\n clearTables();\n\n // Set up variables by getting user input data from the form\n var centre_x = f.centre_x.value // search centre point x-coordinate\n var centre_y = f.centre_y.value // search centre point y-coordinate\n var radius = f.radius.value // search radius\n\n // Get all find x and y coordinates by selecting table cells with a class of \"x\" or \"y\"\n var find_x_elements = document.querySelectorAll('td[class^=\"x\"]')\n var find_y_elements = document.querySelectorAll('td[class^=\"y\"]');\n\n // A variable to keep track of how many finds are identified\n var finds_found = 0;\n\n\n // Loop through the x and y elements, convert the text to integer values,\n // then perform simple Pythagorean geometry to identify those within a certain radius\n for (i=0; i < find_x_elements.length; i++) {\n let x = parseInt(find_x_elements[i].innerText, 10);\n let y = parseInt(find_y_elements[i].innerText, 10);\n let y_difference = Math.abs(y - centre_y);\n let x_difference = Math.abs(x - centre_x);\n let straight_line_distance = Math.sqrt(Math.pow(x_difference, 2) + Math.pow(y_difference, 2))\n // If a find is closer than or equal to the radius set, run through this code:\n if (straight_line_distance <= radius){\n finds_found +=1;\n var find_number = i+1;\n var local_find_id = (\"find\").concat(find_number);\n setSelectedFromFindID(local_find_id); // Calls JS function to set the find as selected and show it on the map and tables\n // Console.log used for debugging\n console.log(\"Find \", i+1 , \"is within \", radius, \"map units of the centre point and has find_id of \", local_find_id)\n }\n }\n // If no successful finds were identified, clear the map from any previous selections, and alert the user to try again:\n if (finds_found == 0) {\n clearMap();\n var alert_string = (\"No match within \" + radius + \" map units of (\" + centre_x + \",\" + centre_y + \") : please try again...\");\n alert(alert_string);\n }\n return false\n }", "function handleSearch(inputElt) {\n\t\tvar query = encodeURIComponent($(inputElt).val());\n\t\t$.ajax({\n\t\t\ttype : \"GET\",\n\t\t\turl : \"http://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/\"+query+\".json\",\n\t\t\tdata : {\n\t\t\t\taccess_token: \"pk.eyJ1IjoibWFwcHktZGV2IiwiYSI6InhBOWRUVHcifQ.YK4jDqt9EXb-Q79QX3O_Mw\"\n\t\t\t},\n\t\t\tsuccess : function(result){\n\t\t\t\tvar best = result.features[0];\n\t\t\t\tmap.setView([best.center[1], best.center[0]], 15);\n\t\t\t},\n\t\t\terror : function(error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t});\n\t}", "function findSearch(searchTerm) {\r\n\r\nfor (var i = 0; i < jobList.length; i++) {\r\n if (jobList[i].JobTitle.toLowerCase().includes(searchTerm.toLowerCase()) || jobList[i].Category.toLowerCase().includes(searchTerm.toLowerCase() ) || jobList[i].Location.toLowerCase().includes(searchTerm.toLowerCase() ) ) {\r\n document.getElementById(i).style.display = \"block\"\r\n }\r\n else{\r\n document.getElementById(i).style.display = \"none\"\r\n }\r\n } \r\n}", "function handleSearchClick(){\r\n var temp = document.getElementById('searchText').value;\r\n fetchRecipesBySearch(temp);\r\n }", "function searchSurveysByText(searchText) {\n\n var searchValue = searchText.toUpperCase();\n dataLayer.clear();\n map.infoWindow.hide();\n\n csvStore.fetch({\n onComplete: function(items, request) {\n dojo.forEach(items, function(item, index) {\n var foundIt = false;\n var year = csvStore.getValue(item, \"Year\");\n var cruise = csvStore.getValue(item, \"Cruise\");\n var latitude = csvStore.getValue(item, \"Latitude\");\n var longitude = csvStore.getValue(item, \"Longitude\");\n var summary = csvStore.getValue(item, \"Summary\");\n var id = csvStore.getIdentity(item);\n if (latitude != undefined && longitude != undefined) {\n if (summary != undefined) {\n var summaryText = summary.toUpperCase();\n if (summaryText.indexOf(searchValue) != -1) {\n foundIt = true;\n }\n }\n if (cruise != undefined) {\n var cruiseText = cruise.toUpperCase();\n if (cruiseText.indexOf(searchValue) != -1) {\n foundIt = true;\n }\n }\n if (foundIt) {\n createMarker(id, year, cruise, latitude, longitude);\n }\n }\n });\n initializeCruiseListing();\n dojo.connect(dataLayer, \"onClick\", onFeatureClick);\n var cruiseTotals = dijit.byId(\"yearCounter\");\n cruiseTotals.attr(\"value\", dataLayer.graphics.length + \" Cruises Displayed\");\n },\n onError: function(error) {\n dojo.byId(\"itemsList\").innerHTML = \"Unable to search the data.\";\n }\n });\n\n map.setExtent(startExtent);\n }", "function PathIndex(shapes, arcs) {\n var boundsQuery = getBoundsSearchFunction(getRingData(shapes, arcs));\n var totalArea = getPathBounds(shapes, arcs).area();\n\n function getRingData(shapes, arcs) {\n var arr = [];\n shapes.forEach(function(shp, shpId) {\n var n = shp ? shp.length : 0;\n for (var i=0; i<n; i++) {\n arr.push({\n ids: shp[i],\n id: shpId,\n bounds: arcs.getSimpleShapeBounds(shp[i])\n });\n }\n });\n return arr;\n }\n\n // Returns shape ids of all polygons that intersect point p\n // (p is inside a ring or on the boundary)\n this.findEnclosingShapes = function(p) {\n var ids = [];\n var cands = findPointHitCandidates(p);\n var groups = groupItemsByShapeId(cands);\n groups.forEach(function(group) {\n if (testPointInRings(p, group)) {\n ids.push(group[0].id);\n }\n });\n return ids;\n };\n\n // Returns shape id of a polygon that intersects p or -1\n // (If multiple intersections, returns one of the polygons)\n this.findEnclosingShape = function(p) {\n var shpId = -1;\n var groups = groupItemsByShapeId(findPointHitCandidates(p));\n groups.forEach(function(group) {\n if (testPointInRings(p, group)) {\n shpId = group[0].id;\n }\n });\n return shpId;\n };\n\n // Returns shape ids of polygons that contain an arc\n // (arcs that are )\n // Assumes that input arc is either inside, outside or coterminous with indexed\n // arcs (i.e. input arc does not cross an indexed arc)\n this.findShapesEnclosingArc = function(arcId) {\n var p = getTestPoint([arcId]);\n return this.findEnclosingShapes(p);\n };\n\n this.findPointEnclosureCandidates = function(p, buffer) {\n var items = findPointHitCandidates(p, buffer);\n return utils.pluck(items, 'id');\n };\n\n this.pointIsEnclosed = function(p) {\n return testPointInRings(p, findPointHitCandidates(p));\n };\n\n // Finds the polygon containing the smallest ring that entirely contains @ring\n // Assumes ring boundaries do not cross.\n // Unhandled edge case:\n // two rings share at least one segment but are not congruent.\n // @ring: array of arc ids\n // Returns id of enclosing polygon or -1 if none found\n this.findSmallestEnclosingPolygon = function(ring) {\n var bounds = arcs.getSimpleShapeBounds(ring);\n var p = getTestPoint(ring);\n var smallest;\n var cands = findPointHitCandidates(p);\n cands.forEach(function(cand) {\n if (cand.bounds.contains(bounds) && // skip partially intersecting bboxes (can't be enclosures)\n !cand.bounds.sameBounds(bounds) && // skip self, congruent and reversed-congruent rings\n !(smallest && smallest.bounds.area() < cand.bounds.area())) {\n if (testPointInRing(p, cand)) {\n smallest = cand;\n }\n }\n });\n\n return smallest ? smallest.id : -1;\n };\n\n this.arcIsEnclosed = function(arcId) {\n return this.pointIsEnclosed(getTestPoint([arcId]));\n };\n\n // Test if a polygon ring is contained within an indexed ring\n // Not a true polygon-in-polygon test\n // Assumes that the target ring does not cross an indexed ring at any point\n // or share a segment with an indexed ring. (Intersecting rings should have\n // been detected previously).\n //\n this.pathIsEnclosed = function(pathIds) {\n return this.pointIsEnclosed(getTestPoint(pathIds));\n };\n\n // return array of paths that are contained within a path, or null if none\n // @pathIds Array of arc ids comprising a closed path\n this.findEnclosedPaths = function(pathIds) {\n var b = arcs.getSimpleShapeBounds(pathIds),\n cands = boundsQuery(b.xmin, b.ymin, b.xmax, b.ymax),\n paths = [],\n index;\n\n if (cands.length > 6) {\n index = new PolygonIndex([pathIds], arcs);\n }\n cands.forEach(function(cand) {\n var p = getTestPoint(cand.ids);\n var isEnclosed = b.containsPoint(p[0], p[1]) && (index ?\n index.pointInPolygon(p[0], p[1]) : geom.testPointInRing(p[0], p[1], pathIds, arcs));\n if (isEnclosed) {\n paths.push(cand.ids);\n }\n });\n return paths.length > 0 ? paths : null;\n };\n\n this.findPathsInsideShape = function(shape) {\n var paths = []; // list of enclosed paths\n shape.forEach(function(ids) {\n var enclosed = this.findEnclosedPaths(ids);\n if (enclosed) {\n // any paths that are enclosed by an even number of rings are removed from list\n // (given normal topology, such paths are inside holes)\n paths = xorArrays(paths, enclosed);\n }\n }, this);\n return paths.length > 0 ? paths : null;\n };\n\n function testPointInRing(p, cand) {\n if (!cand.bounds.containsPoint(p[0], p[1])) return false;\n if (!cand.index && cand.bounds.area() > totalArea * 0.01) {\n // index larger polygons (because they are slower to test via pointInRing()\n // and they are more likely to be involved in repeated hit tests).\n cand.index = new PolygonIndex([cand.ids], arcs);\n }\n return cand.index ?\n cand.index.pointInPolygon(p[0], p[1]) :\n geom.testPointInRing(p[0], p[1], cand.ids, arcs);\n }\n\n //\n function testPointInRings(p, cands) {\n var isOn = false,\n isIn = false;\n cands.forEach(function(cand) {\n var inRing = testPointInRing(p, cand);\n if (inRing == -1) {\n isOn = true;\n } else if (inRing == 1) {\n isIn = !isIn;\n }\n });\n return isOn || isIn;\n }\n\n function groupItemsByShapeId(items) {\n var groups = [],\n group, item;\n if (items.length > 0) {\n items.sort(function(a, b) {return a.id - b.id;});\n for (var i=0; i<items.length; i++) {\n item = items[i];\n if (i === 0 || item.id != items[i-1].id) {\n groups.push(group=[]);\n }\n group.push(item);\n }\n }\n return groups;\n }\n\n function findPointHitCandidates(p, buffer) {\n var b = buffer > 0 ? buffer : 0;\n var x = p[0], y = p[1];\n return boundsQuery(p[0] - b, p[1] - b, p[0] + b, p[1] + b);\n }\n\n // Find a point on a ring to use for point-in-polygon testing\n function getTestPoint(ring) {\n // Use the point halfway along first segment rather than an endpoint\n // (because ring might still be enclosed if a segment endpoint touches an indexed ring.)\n // The returned point should work for point-in-polygon testing if two rings do not\n // share any common segments (which should be true for topological datasets)\n // TODO: consider alternative of finding an internal point of @ring (slower but\n // potentially more reliable).\n var arcId = ring[0],\n p0 = arcs.getVertex(arcId, 0),\n p1 = arcs.getVertex(arcId, 1);\n return [(p0.x + p1.x) / 2, (p0.y + p1.y) / 2];\n }\n\n // concatenate arrays, removing elements that are in both\n function xorArrays(a, b) {\n var xor = [], i;\n for (i=0; i<a.length; i++) {\n if (b.indexOf(a[i]) == -1) xor.push(a[i]);\n }\n for (i=0; i<b.length; i++) {\n if (a.indexOf(b[i]) == -1) xor.push(b[i]);\n }\n return xor;\n }\n }", "function searchForText() {\n // get the keywords to search\n var query = $('form#search input#mapsearch').val();\n\n // extract the fields to search, from the selected 'search category' options\n let category = $('select#search-category').val();\n\n // filter the object for the term in the included fields\n DATA.filtered = searchObject(DATA.tracker_data, query, CONFIG.search_categories[category]);\n\n // suggestions: if the search category is \"company\", include a list of suggestions below \n var suggestions = $('div#suggestions').empty();\n if (category == 'parent') {\n suggestions.show();\n var companies = searchArray(DATA.companies, query).sort();\n companies.forEach(function(company) {\n var entry = $('<div>', {'class': 'suggestion', text: company}).appendTo(suggestions);\n entry.mark(query);\n });\n }\n\n // add the results to map, table, legend\n drawMap(DATA.filtered); // update the map (and legend)\n updateResultsPanel(DATA.filtered, query) // update the results-panel\n drawTable(DATA.filtered, query); // populate the table\n $('form#nav-table-search input').val(query); // sync the table search input with the query\n CONFIG.selected_country.layer.clearLayers(); // clear any selected country\n CONFIG.selected_country.name = ''; // ... and reset the name\n $('div#country-results').show(); // show the results panel, in case hidden\n $('a.clear-search').show(); // show the clear search links\n\n return false;\n}", "runSearch(value) {\n const { filterProjections, filterSearch } = this.props;\n const { allLayers } = this.props;\n let val = value.toLowerCase();\n\n if (val.length === 0) {\n this.setState({\n filteredRows: [],\n listType: 'category',\n inputValue: ''\n });\n } else {\n let terms = val.split(/ +/);\n let filteredRows = allLayers.filter(function(layer) {\n return !(filterProjections(layer) || filterSearch(layer, val, terms));\n });\n this.setState({\n filteredRows: filteredRows,\n listType: 'search',\n inputValue: value\n });\n }\n }", "function wildlifeCentres() {\n\n //check whether the value field is not empty\n // if it is not, proceed with the search\n if(document.getElementById(\"userQuery\").value != \"\") {\n\n // delete any existing markers\n deleteMarkers();\n query = 'Wildlife centres';\n userQuery = document.getElementById(\"userQuery\").value;\n\n //depending on what the user has typed, the title on the page will be changed\n document.querySelector(\".new-heading\").textContent = userQuery;\n\n // create a request object\n let request = {\n placeId: place.place_id,\n // location: globalPos,\n // radius: '100000',\n //again, it doesn't matter where you are, just search for the wildlife centres(query)\n // in the region user has chosen (userQuery)\n query: [ query + ' ' + userQuery ]\n };\n\n // create the service object\n const service = new google.maps.places.PlacesService(map);\n\n // perform a search based on the request object and callback\n service.textSearch(request, callback);\n\n // this is an inner callback function as referenced immediately above\n function callback(results, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n for (let i = 0; i < results.length; i++){\n addMarker(results[i]);\n }\n }\n }\n\n // display all the pins on the map\n displayAllMarkers(map);\n\n //if the user puts an empty value\n } else {alert (\"Search field is empty! Put some value there.\")}\n }", "function searchFunction(searchQuery) {\n var found = searchAndReturn(searchQuery.toString(), \"name\", overlays);\n\n if (!found) {\n if (lastSearch != undefined) {\n searchResult.setMap(null);\n var temp = searchAndReturn(lastSearch.name, \"name\", overlays);//returns array of results, but we only need one\n temp[0].setMap(mapDiv);\n lastSearch = undefined;\n console.log(\"reset last searched object\");\n }\n if (searchQuery != \"\") {\n abp.message.warn(\"Search query not found.\", \"Not Found\");\n }\n $('.searchField').focus();\n }\n else {\n INFOwindow.close();\n //assume there is only one found object\n found = found[0];\n if (found.type === \"POLYGON\") {\n if (lastSearch != undefined && lastSearch.type != \"MARKER\") {\n searchResult.setMap(null);\n var temp = searchAndReturn(lastSearch.name, \"name\", overlays);//returns array of results, but we only need one\n temp[0].setMap(mapDiv);\n console.log(\"reset last searched object\");\n lastSearch = found;\n }\n else {\n lastSearch = found;\n }\n lastSearch.setMap(null);\n searchResult = new google.maps.Polygon({\n paths: found.getPaths(),\n strokeColor: \"#ff0000\",\n fillColor: \"#ff0000\",\n name: found.name,\n zIndex: markerNumber + 1,\n });\n if (lastSearch.category === \"parcel\") {\n searchResult.county = lastSearch.county;\n searchResult.creationTime = lastSearch.creationTime;\n searchResult.irrigatedAcres = lastSearch.irrigatedAcres;\n searchResult.parcelStatus = lastSearch.parcelStatus;\n searchResult.totalAcres = lastSearch.totalAcres;\n\n INFOwindow = new google.maps.InfoWindow;\n searchResult.addListener('click', function (e) {\n var contentString =\n \"<strong>APN #\" + this.name + \"</strong>\" +\n \"<br><strong>Irrigated Acres: </strong>\" + this.irrigatedAcres +\n \"<br><strong>Parcel Status: </strong>\" + parcelTypeArray[this.parcelStatus] +\n \"<br><strong>Total Acres: </strong>\" + this.totalAcres +\n \"<br><strong>County: </strong>\" + this.county +\n \"<br><strong>Creation Time: </strong>\" + this.creationTime;\n INFOwindow.setContent(contentString);\n INFOwindow.setPosition(e.latLng);\n INFOwindow.setZIndex(500000);\n INFOwindow.open(mapDiv, this);\n });\n }\n else if (lastSearch.category === 'field') {\n searchResult.irrMethodPrimary = lastSearch.irrMethodPrimary;\n searchResult.acres = lastSearch.acres;\n searchResult.cropType = lastSearch.cropType;\n searchResult.cropVariety = lastSearch.cropVariety;\n searchResult.name = lastSearch.name\n searchResult.practiceName = lastSearch.practiceName;\n searchResult.id = lastSearch.id\n INFOwindow = new google.maps.InfoWindow;\n searchResult.addListener('click', function (e) {\n var contentString =\n \"<strong>\" + this.name + \"</strong>\" +\n \"<br><strong>Primary Irrigation: </strong>\" + irrTypeArray[this.irrMethodPrimary] +\n \"<br><strong>Acres: </strong>\" + this.acres +\n \"<br><strong>Crop Type: </strong>\" + this.cropType +\n \"<br><strong>Crop Variety: </strong>\" + this.cropVariety +\n \"<br><strong>Practice Name: </strong>\" + this.practiceName +\n \"<br><a class=\\\"EditFieldMap\\\" data-id=\" + this.id + \">Edit Field</a>\";\n INFOwindow.setContent(contentString);\n INFOwindow.setPosition(e.latLng);\n INFOwindow.setZIndex(500000);\n INFOwindow.open(mapDiv, this);\n });\n }\n searchResult.setMap(mapDiv)\n var bounds = new google.maps.LatLngBounds();\n fitMapToPolygon([searchResult], bounds);\n mapDiv.fitBounds(bounds);\n }\n else if (found.type === \"MARKER\") {\n mapDiv.panTo(found.getPosition());\n mapDiv.setZoom(17);\n if (lastSearch != undefined) {\n searchResult.setMap(null);\n var temp = searchAndReturn(lastSearch.name, \"name\", overlays);//returns array of results, but we only need one\n temp[0].setMap(mapDiv);\n console.log(\"reset last searched object\");\n lastSearch = found;\n }\n else {\n lastSearch = found;\n }\n }\n else {\n console.log(\"Something went wrong searching\")\n }\n }\n}", "function handleSearch() {\n\n\tvar value = $(\"#searchBox\").val();\n\t\n\tif(value != null && value != \"\") {\n\t\tsearchStationForName(value);\n\t}\n\n}", "function find() {\n\t\tvar query = $(\"#search-query\").val();\n\n\t\t// check to see if the query contains special commands/characters\n\t\tconvert(query);\n\t\t\n\n\t\tfindSimilar(query);\n\t}", "function availableShape() {\n let shapes = [];\n Object.values(tdata).forEach(value => {\n let shape = value.shape;\n shape = shape[0].toUpperCase() + shape.substring(1);\n if(shapes.indexOf(shape) !== -1) {\n\n }\n else {\n shapes.push(shape);\n }\n });\n return shapes;\n}", "function _search()\n {\n var allCategoryNames = [];\n // Incorporate all terms into\n var oepterms = $scope.selectedOepTerms ? $scope.selectedOepTerms : [];\n var situations = $scope.selectedSituations ? $scope.selectedSituations : [];\n var allCategories = oepterms.concat(situations);\n allCategories.forEach(function(categoryObj) {\n allCategoryNames.push(categoryObj.name);\n checkEmergencyTerms(categoryObj.name);\n });\n search.search({ category: allCategoryNames.join(',') });\n }", "function search(){\n var searchInputValue = searchInput.value;\n var uppercaseValue = searchInputValue.toUpperCase();\n if (uppercaseValue == 'QUEENSTOWN' ||\n uppercaseValue == 'WANAKA' ||\n uppercaseValue == 'CADRONA' ||\n uppercaseValue == 'REMARKABLES' ||\n uppercaseValue == 'THE REMARKABLES' ||\n uppercaseValue == 'THE REMARKS' ||\n uppercaseValue == 'CORONET PEAK' ){\n loadThumbnails(locations.queenstown);\n initMap(168.697751, 45.026377);\n } else if (uppercaseValue == 'CHRISTCHURCH'||\n uppercaseValue == 'CANTERBURY'||\n uppercaseValue == 'MT HUTT' ||\n uppercaseValue == 'MOUNT HUTT' ||\n uppercaseValue == 'TEMPLE BASIN' ||\n uppercaseValue == 'ARTHUR\\'S PASS' ||\n uppercaseValue == 'CHEESEMAN' ||\n uppercaseValue == 'PORTERS' ||\n uppercaseValue == 'MT OLYMPUS' ||\n uppercaseValue == 'MOUNT OLYMPUS' ||\n uppercaseValue == 'BROKEN RIVER'){\n loadThumbnails(locations.christchurch);\n initMap(172.493273, 43.538478);\n } else if (uppercaseValue == 'WHAKAPAPA' ||\n uppercaseValue == 'RUAPEHU' ||\n uppercaseValue == 'MOUNT RUAPEHU' ||\n uppercaseValue == 'MT RUAPEHU' ||\n uppercaseValue == 'TONGARIRO' ||\n uppercaseValue == 'OHAKUNE' ||\n uppercaseValue == 'NATIONAL PARK' ||\n uppercaseValue == 'TUROA'){\n loadThumbnails(locations.whakapapa);\n initMap(175.549994, 39.231289);\n } else {\n thumbnailsBox.innerHTML = '<span class=\"no-results\">No location matched your search, please check your spelling and try again. Hint: Try searching by field name or nearest town, Eg. Queenstown.</span>';\n }\n }", "function searchForText() {\n\n var searchText = dijit.byId(\"wordSearchTB\").get('value');\n var searchValue = searchText.toUpperCase();\n\n // remove any previously plotted GIS layers\n var layersOnMap = map.layerIds.length;\n if (layersOnMap > 1) {\n map.removeAllLayers();\n map.addLayer(basemap);\n map.addLayer(basemapReference);\n map.addLayer(hoverTextLayer);\n map.addLayer(highlightLayer);\n map.addLayer(dataLayer);\n map.addLayer(listHighlightLayer);\n }\n if (hoverTextLayer != undefined) hoverTextLayer.clear();\n if (listHighlightLayer != undefined) listHighlightLayer.clear();\n if (highlightLayer != undefined) highlightLayer.clear();\n\n dataLayer.clear();\n map.infoWindow.hide();\n \n csvStore.fetch({\n onComplete: function(items, request) {\n //alert(items.length);\n dojo.forEach(items, function(item, index) {\n var foundIt = false;\n var year = csvStore.getValue(item, \"Year\");\n var cruise = csvStore.getValue(item, \"Cruise\");\n var latitude = csvStore.getValue(item, \"Latitude\");\n var longitude = csvStore.getValue(item, \"Longitude\");\n var summary = csvStore.getValue(item, \"Summary\");\n var id = csvStore.getIdentity(item);\n if (latitude != undefined && longitude != undefined) {\n if (summary != undefined) {\n var summaryText = summary.toUpperCase();\n if (summaryText.indexOf(searchValue) != -1) foundIt = true;\n }\n if (cruise != undefined) {\n var cruiseText = cruise.toUpperCase();\n if (cruiseText.indexOf(searchValue) != -1) foundIt = true;\n }\n if (foundIt) {\n createMarker(id, year, cruise, latitude, longitude);\n }\n }\n });\n initializeCruiseListing();\n dojo.connect(dataLayer, \"onClick\", onFeatureClick);\n var cruiseTotals = dijit.byId(\"wordCounter\");\n cruiseTotals.attr(\"value\", dataLayer.graphics.length + \" Cruises Displayed\");\n },\n onError: function(error) {\n dojo.byId(\"itemsList\").innerHTML = \"Unable to search the data.\";\n }\n });\n\n map.setExtent(startExtent);\n\n }", "function searchNodes() {\n var term = document.getElementById('searchTerm').value;\n var selected = container.selectAll('.node').filter(function (d, i) {\n return d.name.toLowerCase().search(term.toLowerCase()) == -1;\n });\n selected.style('opacity', '0');\n var link = container.selectAll('.link');\n link.style('stroke-opacity', '0');\n d3.selectAll('.node').transition()\n .duration(5000)\n .style('opacity', '1');\n d3.selectAll('.link').transition().duration(5000).style('stroke-opacity', '0.6');\n }", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "query(range, found){\n if(!this.boundary.intersects(range)){\n //empty array\n return;\n } else {\n for(let i=0;i<this.points.length;i++){\n if(range.contains(this.points[i])){\n found.push(this.points[i]);\n }\n }\n }\n //Recursive ask the children to search for points in range\n if(this.isDivided){\n this.northwest.query(range, found);\n this.northeast.query(range, found);\n this.southwest.query(range, found);\n this.southeast.query(range, found);\n }\n }", "bindSearcher() {\n $('#oompaName').bind(\"change paste keyup\", function() {\n var searchName = $('#oompaName').val().toLowerCase(); \n if((this.actualOompaList !== null)) {\n var a = JSON.parse(this.actualList);\n var tempResults = [];\n a.forEach(function(element){\n var name = element['first_name'].toLowerCase();\n var lastName = element['last_name'].toLowerCase();\n var profession = element['profession'].toLowerCase();\n\n if(name.includes(searchName) || lastName.includes(searchName) ||\n profession.includes(searchName)) {\n tempResults.push(element);\n }\n });\n paintOompaTemp(tempResults);\n }\n });\n }", "function search(quadtree, x0, y0, x3, y3) {\n quadtree.visit(function(node, x1, y1, x2, y2) {\n var p = node.point;\n if (p) {\n p.scanned = true;\n p.selected = (p.x >= x0) && (p.x < x3) && (p.y >= y0) && (p.y < y3);\n }\n return x1 >= x3 || y1 >= y3 || x2 < x0 || y2 < y0;\n });\n}", "function photoSearch(term, cb) {\n _500px.api('/photos/search', _.extend(searchParams, {term:term}), function(r) {\n cb(r.error || null, annotatePhotos(r.data.photos,term));\n });\n }", "function searchCategoriesItem() {\n var x;\n var searchString = document.getElementById(\"searchInput\").value.toUpperCase();\n var index = categories.findIndex(x => x.product == searchString);\n if (index > -1) {\n createAndReturnCategoryDivElement(index, searchDiv);\n }\n else {\n document.getElementById(\"searchDiv\").innerHTML = \"Product not found in categories\";\n document.getElementById(\"searchInput\").value = \"\";\n }\n}", "function onSearchTerm(evt) {\n var text = evt.target.value;\n doSearch(text, $('#types .btn-primary').text());\n }", "function geocode(searchText){\n gs.geocode({ text: searchText, sourceCountry:\"USA\"},function(err, res){\n if(res.locations && res.locations.length > 0){\n var geom = res.locations[0].feature.geometry;\n var params = {\n studyAreas:[{\"geometry\":{\"x\":geom.x,\"y\":geom.y},\n \"areaType\":\"StandardGeography\",\"intersectingGeographies\":[{\"sourceCountry\":\"US\",\"layer\":\"US.ZIP5\"}]}],\n returnGeometry:false\n }\n enrich(params);\n }else{\n alert('Sorry. No matches found.');\n }\n });\n}", "function searchEndPoint(userQuery) {\n\n\tlet found = [];\n\n\t$.ajax({\n\n\t\turl: \"/products\",\n\t\tmethod: \"GET\",\n\t\tformat: \"json\",\n\n\t\tsuccess: function(responseJSON) {\n\n\t\t\tvar name, description, brand, model, condition, category;\n\t\t\tvar namePos, descriptionPos, brandPos, modelPos, conditionPos, categoryPos;\n\n\t\t\t$(\".search\").empty();\n\t\t\t$(\".search\").append(`<h2 class=\"searchTitle\">🔎 Resultados de ${$(\"#ex1\").val()}...</h2>`);\n\t\t\t$(\".search\").append(`<a href=\"./advancedSearch.html\"><button type=\"button\" class=\"btn btn-info advanced-search\">Busqueda Avanzada</button></a>`);\n\t\t\t$(\".search\").append(`<content class=\"searches-content\">`);\n\t\t\t$(\".searches-content\").empty();\n\n\t\t\tfor (let i=0; i<responseJSON.length; i++)\n\t\t\t\tif (!responseJSON[i].bought)\n\t\t\t\t\tfound.push(responseJSON[i]);\n\n\t\t\tfor (let i=0; i<found.length; i++) {\n\n\t\t\t\tname = found[i].name.toLowerCase();\n\t\t\t\tdescription = found[i].description.toLowerCase();\n\t\t\t\tbrand = found[i].brand.toLowerCase();\n\t\t\t\tmodel = found[i].model.toLowerCase();\n\t\t\t\tcondition = found[i].condition.toLowerCase();\n\t\t\t\tcategory = found[i].category.toLowerCase();\n\n\t\t\t\tnamePos = name.search(userQuery);\n\t\t\t\tdescriptionPos = description.search(userQuery);\n\t\t\t\tbrandPos = brand.search(userQuery);\n\t\t\t\tmodelPos = model.search(userQuery);\n\t\t\t\tconditionPos = condition.search(userQuery);\n\t\t\t\tcategoryPos = category.search(userQuery);\n\n\t\t\t\tif (namePos != -1 || descriptionPos != -1 || brandPos != -1 || modelPos != -1 || conditionPos != -1 || categoryPos != -1) {\n\n\t\t\t\t\t$(\".search\").append(`\n\t\t\t\t\t\t<div class=\"searches-container\" id=\"${found[i].id}\">\n\t\t\t\t\t\t\t<div class=\"searches-image\" >\n\t\t\t\t\t\t\t\t<img class=\"searches-image-size\" id=\"${found[i].id}\" src=\"./img/${found[i].image}\">\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"searches-info\" id=\"${found[i].id}\">\n\t\t\t\t\t\t\t\t<h5 class=\"search-info-title\" id=\"${found[i].id}\">${found[i].name}</h5>\n\t\t\t\t\t\t\t\t<ul>\n\t\t\t\t\t\t\t\t\t<li class=\"search-info-description search-info-sub\" id=\"${found[i].id}\">${found[i].description}</li>\n\t\t\t\t\t\t\t\t\t<li class=\"search-info-condition search-info-sub\" id=\"${found[i].id}\">${found[i].condition}</li>\n\t\t\t\t\t\t\t\t\t<li class=\"search-info-location search-info-sub\" id=\"${found[i].id}\">${found[i].location}</li>\n\t\t\t\t\t\t\t\t</ul>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t`);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$(\".search\").append(\n\t\t\t\t`\n\t\t\t\t\t</content>\n\t\t\t\t\t<div class=\"space\"></div>\n\t\t\t\t`\n\t\t\t);\n\n\t\t\tmain();\n\t\t},\n\n\t\terror: function(err) {\n\t\t\tconsole.log(\"Juguito de Chale\", errors)\n\t\t}\n\t});\n}", "function search(size){\n var q = _.map(size, function(d){ return Math.ceil(d / 10) * 10;});\n var result = _(grid).filter({'w':q[0], 'h':q[1]}).value();\n\n if(result.length){\n appendResult(result[0]);\n searchTry=0;\n }else if (searchTry < 100){\n // try a new search\n searchTry++;\n var newSize = [ Math.abs(size[0]) - 10, Math.abs(size[1] + 10)];\n search(newSize);\n }else{\n appendResult(_(grid).shuffle().first()); // get random part\n }\n }", "function handleSearchPoiRequest(atts) {\n\t\t\tvar poi = atts.query;\n\t\t\tvar searchNearRoute = atts.nearRoute;\n\t\t\tvar maxDist = atts.maxDist;\n\t\t\tvar distanceUnit = atts.distUnit;\n\t\t\tvar lastSearchResults = atts.lastSearchResults;\n\t\t\tlastSearchResults = lastSearchResults ? lastSearchResults.split(' ') : null;\n\n\t\t\tui.searchPoiChangeToSearchingState(true);\n\n\t\t\tif (lastSearchResults) {\n\t\t\t\tmap.clearMarkers(map.POI, lastSearchResults);\n\t\t\t}\n\n\t\t\tvar refPoint = null;\n\t\t\tif (searchNearRoute == true) {\n\t\t\t\t//use route points\n\t\t\t\tvar refPoint = (map.theMap.getLayersByName(map.ROUTE_LINES)[0]).features;\n\t\t\t\tif (refPoint && refPoint[0]) {\n\t\t\t\t\trefPoint = (refPoint[0]).geometry.components;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//pick center of map\n\t\t\t\tvar pt = map.theMap.getCenter();\n\t\t\t\tpt = pt.transform(new OpenLayers.Projection(\"EPSG:900913\"), new OpenLayers.Projection(\"EPSG:4326\"));\n\t\t\t\trefPoint = [];\n\t\t\t\trefPoint.push(pt);\n\n\t\t\t\t//this value is measured in meters only\n\t\t\t\tvar width = map.theMap.calculateBounds().getWidth();\n\t\t\t\tvar height = map.theMap.calculateBounds().getHeight();\n\t\t\t\tmaxDist = width < height ? width : height;\n\t\t\t\tmaxDist /= 2;\n\t\t\t}\n\n\t\t\tsearchPoi.requestCounter++;\n\t\t\tsearchPoi.find(poi, refPoint, maxDist, distanceUnit, handleSearchPoiResults, handleSearchPoiFailure, preferences.language);\n\t\t}", "function search(photoData) {\n var query = $(\"#searchField\").val().toLowerCase().trim();\n var error = $(\"#error\").html(\"\"); \n var result = [];\n\n if (query.length > 0){\n for (var i = 0; i < photoData.length; i++){\n if (photoData[i].description.toLowerCase().indexOf(query) != -1) {\n result.push(photoData[i]);\n }else {\n }\n }\n if (result.length > 0) {\n displayThumb(result);\n }else {\n error.html(\"No matching photo found\");\n }\n \n }else {\n displayThumb(photoData);\n }\n }", "boxQuery(searchBox) {\n // initialize return points\n let foundPoints = [];\n\n // return empty array if no intersect\n if (!this.boundary.boxIntersect(searchBox)) {\n return foundPoints;\n\n // else if there are no children, search this box\n } else if (this.childTrees.length == 0) {\n for (let point of this.childPoints) {\n if (searchBox.containsPoint(point)) {\n foundPoints.push(point);\n }\n }\n // else, there ARE children, push the query\n } else { \n // loop over all childBoxes\n for (let childTree of this.childTrees) {\n // find child points\n let childPoints = childTree.boxQuery(searchBox);\n\n // concatenate childPoints onto foundPoints\n foundPoints = foundPoints.concat(childPoints);\n }\n }\n\n // return all foundPoints\n return foundPoints;\n }", "findPaths(){\n gridArray.forEach(function(yValue, yCoord){\n yValue.forEach(function(xValue, xCoord){\n BadBoggle.searchPath([[yCoord, xCoord]], yCoord, xCoord);\n });\n });\n }", "function SearchWrapper () {}", "function post_search(req, res) {\n console.log(req.body);\n Model3d.find_by_string(req.body.search_bar, function(err, docs) {\n if (err) {\n res.send(\"something went wrong\");\n }\n else {\n res.render('navigation/search', {models: docs, selected: \"Search Results\" });\n }\n });\n}", "searchAssets(domian) {\n let {equipmentSelectList} = this.state;\n let {index} = equipmentSelectList;\n let domain = domian ? domian : null;\n let cur = 1;\n let size = 10;\n let offset = 0;\n let model = equipmentSelectList.options[index].title;\n let name = this.state.searchText.value;\n getSearchAssets(domain, model, name, offset, size, data => {\n let newList = intersection(data, this.state.allPoleEquipmentsData);\n this.setState({\n allEquipmentsData: newList\n })\n })\n this.state.searchText.value = '';\n }", "function handleSearch() {\n triggerSearch({}); // need empty braces here\n }", "function searchByText(searchText) {\n removeMarkers(allPlacesMarkers);\n removeRestaurants(allRestaurants);\n\n bounds = map.getBounds();\n\n if (searchText === \"\") {\n displayErrorMessage(\"Please enter a search term.\");\n } else {\n placesService.textSearch(\n {\n query: searchText,\n location: defaultCoords,\n type: [\"food\"],\n radius: 50\n },\n function(results, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n map.setCenter(results[0].geometry.location);\n\n /* Go ahead and create markers */\n createMarkersForMultiplePlaces(results);\n } else {\n alert(\"Sorry, there are no results\");\n\n /* Reset markers and clear existing results */\n removeMarkers(allPlacesMarkers);\n removeRestaurants(allRestaurants);\n }\n }\n );\n }\n}", "forShapesInViewPort(pane, viewPort, visitor) {\n var allShapes = this._allShapes;\n for (var index in allShapes) {\n var shape = allShapes[index];\n if (shape != null) {\n var spane = shape.pane || null;\n if (spane == null) {\n if (pane.name == this.defaultPane) {\n visitor(shape);\n }\n } else if (spane == pane.name) {\n visitor(shape);\n }\n }\n }\n }", "function onRowClickHandler(evt) {\n var clickedGridRow, selectedFeature;\n if (whichSearch == \"grid\") {\n clickedGridRow = evt.grid.getItem(evt.rowIndex).OBJECTID;\n selectedFeature = arrayUtil.filter(map.graphics.graphics, function (graphic) {\n return ((graphic.attributes) && graphic.attributes.OBJECTID === clickedGridRow);\n });\n } else if (whichSearch == \"grid1\") {\n clickedGridRow = evt.grid.getItem(evt.rowIndex).ACCTID;\n selectedFeature = arrayUtil.filter(map.graphics.graphics, function (graphic) {\n return ((graphic.attributes) && graphic.attributes.ACCTID === clickedGridRow);\n });\n }\n if (selectedFeature.length) {\n map.setExtent(selectedFeature[0].geometry.getExtent(), true);\n }\n }", "function handleSearchButtonClick() {\n \n filteredData = dataSet;\n // Format the user's search by removing leading and trailing whitespace, lowercase the string\n var filterDatetime = $dateInput.value.trim().toLowerCase();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function(address) {\n var addressDatetime = address.datetime.toLowerCase();\n var addressCity = address.city.toLowerCase();\n var addressState = address.state.toLowerCase();\n var addressCountry = address.country.toLowerCase();\n var addressShape = address.shape.toLowerCase();\n\n\n\n if ((addressDatetime===filterDatetime || filterDatetime == \"\") && \n (addressCity === filterCity || filterCity == \"\") && \n (addressState === filterState || filterState == \"\") &&\n (addressCountry === filterCountry || filterCountry == \"\") && \n (addressShape === filterShape || filterShape ==\"\")){\n \n return true;\n }\n return false;\n console.log(filteredData);\n });\nloadList();\n}", "function searchByName(name) {\n var testName = name.toLowerCase();\n if (testName===\"bar\"||\"bars\"||\"restaurant\"||\"restaurants\"||\"food\"||\"beer\") {\n var request = {\n location: pos,\n radius: '500',\n type: ['bar', 'restaurant']\n };\n service = new google.maps.places.PlacesService(map);\n service.nearbySearch(request, callback);\n } else {\n var request = {\n query: name,\n fields: ['photos', 'formatted_address', 'name', 'rating', 'opening_hours', 'geometry'],\n locationBias: {radius: 50, center: pos}\n };\n service = new google.maps.places.PlacesService(map);\n service.findPlaceFromQuery(request, callback);\n };\n}", "function search(searchContent) {\r\n smoothTopScroll();\r\n if (searchContent.length==0) {\r\n callCategories();\r\n return;\r\n }\r\n document.getElementById(\"pagetitle\").innerHTML = \"Search\";\r\n var results = {};\r\n Object.keys(itemvarsetidenum).forEach(function(num) {\r\n Object.keys(itemvarsetidenum[num]).forEach(function(key) {\r\n if (key.toLowerCase().includes(searchContent.toLowerCase())) {\r\n results[key]=itemvarsetidenum[num][key];\r\n }\r\n });\r\n });\r\n\r\n hideAllBoxes();\r\n activeSet = 1;\r\n generateBox(\"Back\", null, 0, 1, \"<div class='subtext'>Click to return to categories</div>\");\r\n Object.keys(results).forEach(function(key) {\r\n if (Object.keys(results).indexOf(key) + 2 > 20) {return};\r\n generateBox(key, results, 0, Object.keys(results).indexOf(key) + 2,\r\n \"<div class='subtext shortcut'>\" + results[key] + \"</div>\")\r\n });\r\n}", "function search(){\n\n\n // remove all markers from the map. Useful when a new search is made \n\n for(i=0;i<all_markers.length;i++){\n\n all_markers[i].marker_obj.setMap(null);\n\n }\n\n // hide the placeholder text and remove previous results from the list\n var placetext = document.getElementById(\"placeholder-text\");\n if(placetext) placetext.innerHTML = \"\";\n \n placesList = document.getElementById('places');\n placesList.innerHTML = \"\";\n\n // prepare request object for place api search\n\n var request = {\n location: pyrmont,\n radius: 5000,\n types: [\"restaurant\"]\n };\n\n var keyword = document.getElementById(\"keyword\").value;\n var minprice = document.getElementById(\"minprice\").value;\n var maxprice = document.getElementById(\"maxprice\").value;\n var opennow = document.getElementById(\"opennow\").checked;\n\n if(keyword != \"\") \n request.name = keyword;\n \n request.minprice = minprice;\n request.maxprice = maxprice;\n\n if(opennow) request.opennow = true;\n\n console.log(request);\n\n \n // initialize the service \n var service = new google.maps.places.PlacesService(map);\n service.nearbySearch(request, callback);\n}", "renderShape( shape, x, y ) {\n for( var i = 0; i < shape.mapping.length; i++ ) {\n for( var k = 0; k < shape.mapping.length; k++ ) {\n if( shape.mapping[i][k] === \"X\" ) {\n this.renderTile( x + k, y + i, shape.color );\n }\n }\n }\n }", "function searchKeywords(){\n \n // iterate through caption data text to check for user input text match\n for (let i=1; i<=(captionArray.length); i++) {\n //get live user input and remove case sensitivity\n let searchValue = document.getElementById('search').value.toLowerCase();\n //compare caption text with search input text\n let matchCheck = captionArray[i-1].toLowerCase().includes(searchValue);\n // get the images associated with text-matched caption\n let unmatchedImage = document.getElementById(`thumb${i}`);\n //display matched and ...\n if (matchCheck){ \n unmatchedImage.style.display = \"block\";\n } else {\n //... hide unmatched, and remove parent (a) border style \n unmatchedImage.parentElement.style.border = \"none\"; \n unmatchedImage.style.display = \"none\";\n }\n }\n \n}", "function search(keyword) {\n var color;\n var search = {\n bounds: map.getBounds(),\n keyword: keyword,\n };\n\n places.nearbySearch(search, function(results, status) {\n if (status === google.maps.places.PlacesServiceStatus.OK) {\n console.log(results);\n // clearResults();\n // clearMarkers();\n // Create a marker for each hotel found, and\n // assign a letter of the alphabetic to each marker icon.\n if (keyword == \"food\") {\n color = \"/ff0000/\";\n } else if (keyword == \"bike share\") {\n color = \"/0099FF/\";\n } else if (keyword == \"coworking space\") {\n color = \"/99ff33/\";\n }\n\n for (var i = 0; i < results.length; i++) {\n var markerLetter = String.fromCharCode(\"A\".charCodeAt(0) + i % 26);\n var markerIcon = MARKER_PATH + markerLetter + color;\n // Use marker animation to drop the icons incrementally on the map.\n markers[i] = new google.maps.Marker({\n position: results[i].geometry.location,\n animation: google.maps.Animation.DROP,\n icon: markerIcon,\n });\n // If the user clicks a hotel marker, show the details of that hotel\n // in an info window.\n markers[i].placeResult = results[i];\n google.maps.event.addListener(markers[i], \"click\", showInfoWindow);\n setTimeout(dropMarker(i), i * 100);\n // addResult(results[i], i);\n }\n }\n });\n}", "function search(matrix) {\n\n /* Before Starting You can Clear wall and path by youself if User forgot to clear the prev result */\n clearPath(\"wall\");\n clearPath(\"path\");\n\n /* \n * Declare and initialize an Empty Queue to store the indices and path of each location while searching \n * Each element of queue will be an array of size - 3 which means with indices 0, 1 and 2.\n * 0th element -> 'x' coordinate of the current cell\n * 1st element -> 'y' coordinate of the current cell\n * 2nd element -> 'path' stores the path till current cell starting from source cell.\n */\n let queue = [];\n\n /* Extracting the 'x' and 'y' Coordinate of the source location */\n let src_x = split(src_crd, 0), src_y = split(src_crd, 1);\n\n /* Adding the first element in the queue with coordinate set to coordinate of src location and path containing source location */\n queue.push([src_x, src_y, `${src_x}:${src_y},`]);\n\n /* A Set to mark the location as visited so that our algorithm will be saved from getting in an infinite loop */\n let visited = new Set();\n\n /* \n * Some set of Operations will be done on the Queue till the Queue is Empty.\n * 1. Extract the coordinates and path of the front element in the Queue.\n * 2. check if the location with these coordinates is visited or not.\n * 2.1 If visited then continue, no need to proceed further.\n * 2.2 Otherwise Traverse the other neighbouring locations and check if these locations are valid or not.\n * 2.2.1 If neighbouring location is valid then, color it and push_back in the queue to traverse it later.\n * 2.2.2 Otherwise If locations is not valid then check the other neighbours.\n * 2.3 If you got the destination location anywhere while performing the same operations.\n * 2.3.1 If yes then send the path constructed to printPath function to print and color the shortest path.\n * 2.3.2 Otherwise the path doesnot exist between src and dst, hence print No Path Exist and return.\n * 3. END \n */\n\n while (queue.length != 0) {\n\n /* Remove the Front element from Queue and extract data from the element popped */\n let rp = queue.shift();\n\n /* Exract the 'x' coordinate, 'y' coordinate and 'path' from the front element of the Queue */\n let x = parseInt(rp[0]), y = parseInt(rp[1]), path = rp[2];\n\n /* If the Location is already visited that means is present in the set that means do nothing */\n if (visited.has(`${x}:${y}`)) continue; \n\n /* If the location is new then mark the current location as visited by adding in the set */\n visited.add(`${x}:${y}`);\n\n /* Now loop over all of the neighbours direction available to the cell */\n for (let i = 0; i < dirs.length; i++) {\n\n /* 'newX' is the new 'x' coordinate constructed by adding either 0, -1 or +1 to the current x */\n let newX = x + parseInt(dirs[i][0]); //-1\n\n /* 'newY' is the new 'y' coordinate constructed by adding either 0, -1 or +1 to the current y */\n let newY = y + parseInt(dirs[i][1]); //0\n\n /* If the current neighbour is out of bound or lies on border then still do nothing and continue */\n if (newX <= 0 || newX > rows - 2 || newY <= 0 || newY > cols - 2) {\n continue;\n }\n \n /* If the locations is free from corner cases then check if the location must not be src and neither dst */\n if (matrix[newX][newY] != 1 && matrix[newX][newY] != 2) {\n\n /* If Location is neither src nor destination then check if it wall or not. If yes then continue */\n if (matrix[newX][newY] === 3) {\n continue;\n }\n\n /* Control here defines that this cell is neither src, nor destination and nor wall then color it as extra path */\n document.getElementById(`${newX}:${newY}`).style.fill = \"rgb(149, 202, 255)\";\n matrix[newX][newY] = 7; /* Mark the extra path in the matrix as '7' */\n } else if (matrix[newX][newY] === 2) { /* If the location is Destination then search is finished */\n printPath(path + `${newX}:${newY}`); /* Call the Print Path with Destination added separately */\n return; /* Now no need to travere the aim is achieved and hence return */\n } else {\n continue; /* Any other case then continue no need to advance further */\n }\n\n /* If the neighbour is safe from borders and beyond that and not a wall then append it in the queue for future traversal */\n queue.push([newX, newY, path + `${newX}:${newY},`]);\n }\n }\n\n /* If there exist no path from src to dst then Print the info */\n console.log(\"No Path Exists\");\n}", "function inLogoArea(source, search) {\n for (var i = 0, len = source.length; i < len; i++) {\n if (source[i][0] === search[0] && source[i][1] === search[1]) {\n return true;\n }\n }\n return false;\n}", "function doSpatialSearch()\n {\n spatial_included_ids='';\n\tif(n!=''){\n $.ajax({\n type:\"POST\",\n url: base_url+\"/search/spatial/\",\n data:\"north=\"+n+\"&south=\"+s+\"&east=\"+e+\"&west=\"+w,\n\n success:function(msg)\n {\n spatial_included_ids = msg;\n \n doNormalSearch();\n\n },\n error:function(msg)\n {\n // $(\"#loading\").hide();\n }\n });\n }else if(polygeometry){\n // setCookie('geom',polygeometry,2); not implemented as a cookie (yet)\n // setCookie('bounds',JSON.stringify(polybounds),2);\n \n $.ajax({\n type:\"POST\",\n url: base_url+\"regions/r/search/\",\n data:{ 'geometry': polygeometry , 'bounds' : polybounds},\n success:function(msg) \n {\n spatial_included_ids = msg;\n \n doNormalSearch();\n \n // $(\"#loading\").hide();\n },\n error:function(msg)\n {\n // $(\"#loading\").hide();\n }\n });\n }\n\n }", "find(input) {}", "search(self, dist, limit=Infinity, res=[]) {\n if (self.pos == undefined) return this.searchPosition(self, dist);\n const pos = self.pos;\n if (dist==undefined) dist = self.size || 1;\n const rCellSize = 1 / this.cellSize;\n const ch = (pos[0] * rCellSize);\n const cv = (pos[1] * rCellSize);\n const dist2 = dist * dist;\n var i, v, h, l, n, neighbour, npos, shell, cell, relx, rely, d2;\n res.length = 0;\n for (i=0; i<this.shells.length; i++) {\n shell = this.shells[i];\n if (shell.radius2 > dist2) break;\n h = Math.max(Math.min(~~(ch + shell.h), this.numCellsH - 1), 0);\n v = Math.max(Math.min(~~(cv + shell.v), this.numCellsV - 1), 0);\n cell = this.cells[v * this.numCellsH + h];\n l = cell.length;\n for (n = 0; n < l; n++) {\n neighbour = cell[n];\n // skip self:\n if (self == neighbour) continue;\n // need this check, otherwise non-point objects \n // and objects near borders can appear multiple times\n if (res.indexOf(neighbour) !== -1) continue;\n npos = neighbour.pos;\n relx = npos[0] - pos[0], rely = npos[1] - pos[1];\n d2 = relx * relx + rely * rely;\n if (d2 <= dist2) {\n res.push(neighbour);\n if (res.length >= limit) return res;\n }\n }\n }\n return res;\n }", "function searchPlaces() {\n\n\tvar input = document.getElementById(\"searchBar\").value;\n\tif(input.length <= 0) { return }\n\t\t//returns clears it \n\n\tvar request = {\n\t\tlocation: map.getCenter(),\n\t\tradius: 8000,//getZoomRadius(),\n\t\t// keyword: \"\",\n\t\ttype: ['Restaurants'],\n\t\tfields: ['formatted_address', 'name', 'rating']\n\t}\n\n\tif(input.length > 0) {\n\t\trequest.keyword = input;\n\t}\n\t\n\tinfowindow = new google.maps.InfoWindow();\n\t\n\tvar service = new google.maps.places.PlacesService(map);\n\n\tservice.textSearch(request, searchPlacesCallback);\n}" ]
[ "0.62603474", "0.6091198", "0.60504466", "0.59820247", "0.59375817", "0.59040976", "0.5898056", "0.57619214", "0.5753749", "0.5680645", "0.5606921", "0.5598741", "0.5593221", "0.556642", "0.55538446", "0.55425775", "0.5516636", "0.5514312", "0.55117923", "0.54939526", "0.54848444", "0.54810214", "0.5480116", "0.54787576", "0.54146546", "0.54133755", "0.5410837", "0.5398867", "0.5393949", "0.5385287", "0.5380631", "0.53770787", "0.5369783", "0.5350884", "0.53482246", "0.5342315", "0.5334578", "0.53343827", "0.5321503", "0.5320955", "0.53129554", "0.5307045", "0.5306215", "0.53050303", "0.52909976", "0.52877545", "0.5279567", "0.5273844", "0.5261325", "0.525732", "0.52571416", "0.52499545", "0.5247683", "0.5242818", "0.5242076", "0.5222214", "0.52141434", "0.5209969", "0.5206196", "0.51948136", "0.51925033", "0.5187915", "0.5187309", "0.518133", "0.51696223", "0.51671386", "0.51658094", "0.51652265", "0.5159152", "0.5158357", "0.5147143", "0.51405674", "0.51399523", "0.5139426", "0.51368904", "0.5136119", "0.5133803", "0.51316655", "0.51293635", "0.5126725", "0.51219344", "0.51212233", "0.51126945", "0.5112148", "0.51036227", "0.51000714", "0.5093339", "0.5086834", "0.5084917", "0.5083588", "0.50824255", "0.50804514", "0.5079369", "0.5078063", "0.5076657", "0.50729835", "0.50709546", "0.5066392", "0.5064546", "0.50612026" ]
0.69796854
0
function to handle search by State
function handleSearchButtonClickState() { // Format the user's search by removing leading and trailing whitespace var filterState = $stateInput.value.trim().toLowerCase(); // Set ufoSightings to an array of all dataSet whose "date" matches the filter ufoSightings = dataSet.filter(function(sightings) { var sightingState = sightings.state.toLowerCase(); // If true, add the sighting to the filterState, otherwise don't add it to filterState return sightingState === filterState; }); renderTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "searchByText(event) {\n this.state[event.target.query] = event.target.value;\n //this.props.SearchItems(this.state);\n }", "handleSearchClick(event, passedState) {\n\t\tif(passedState) {\n\t\t\tthis.loadSearchResults(passedState);\n\t\t} else {\n\t\t\tthis.loadSearchResults(this.state);\n\t\t}\n\t\t\n\t}", "filterBooksBySearch(key,value) {\n //update state by search parameters passed from search module to actions to store\n this.setState({\n key: key,\n query: value.toLowerCase()\n });\n }", "function get_search(val){\n setState(val.target.value);\n }", "search() {\n this.props.onSearch(this.state.searchValue);\n }", "handleSearch() {\n if (this.state.searchTerm) {\n this.props.onSearch(this.state.searchTerm);\n }\n else {\n return;\n }\n }", "search() {\n\t\tthis.props.onSearch(this.state.term);\n\t}", "handleSearch (filter) {\n // cambio la propiedad filter de mi estado, con lo que me paso en la funcion\n this.setState({\n filter\n });\n }", "function querySearch(query) {\n return query ? self.states.filter(createFilterFor(query)) : self.states;\n }", "function querySearch(query) {\n return query ? self.states.filter(createFilterFor(query)) : self.states;\n }", "_searchForUser(query){\n this.setState({searchQuery: query});\n //console.log('parent query is ' + this.state.searchQuery);\n\n //search for ids containing query\n let results = this._blockstackSearch(query);\n \n //set searchResults in state\n this.setState({searchResults: results,});\n }", "personSearch( term ){\n this.setState({ \n searched: term\n })\n }", "function querySearch(query) {\n self.states = $scope.listData;\n $log.info('query ...');\n var results = query ? self.states.filter(createFilterFor(query)) : self.states\n return results;\n }", "search(){\n\t\t\t\tlet serviceAddrList = _.cloneDeep(this.state.serviceAddrList)\n\t\t\t\tif(!CommonUtil.isServcieAddrEmpty(this.state.currentAddress,serviceAddrList)){\n\t\t\t\t\t\tserviceAddrList.push(this.state.currentAddress)\n\t\t\t\t}\n\t\t\t\tthis.setState({serviceAddrList})\n\t\t\t\tif(this.validateForm(serviceAddrList)){\n\t\t\t\t\t\tthis.setState({isError:false})\n\t\t\t\t\t\tthis.setState({isProcessing:true,showResult:false})\n\t\t\t\t\t\tthis.props.actions.lookupESIIDsByAddr({serviceAddressList:serviceAddrList});\n\t\t\t\t\t\tthis.setState({isAjaxCalled:true});\n\t\t\t\t\t\t//this.setState({serviceAddrList:[]});//emptying the address list after the call.\n\t\t\t\t}else{\n\t\t\t\t\t\tthis.setState({isError:true, errorMessage:\"StreetNumber and StreetName is required for the search. Please enter required fields.\"})\n\t\t\t\t}\n }", "onSearch(e) {\n e.preventDefault();\n this.setState({ searchTerm: e.target.value });\n\n // TODO refactor this and just call a search method in a 'Products' service that handles all the API calls\n if (e.target.value && e.target.value.length > 2) {\n fetch(`http://localhost:3035/products?q=${e.target.value}`)\n .then(res => res.json())\n .then(searchResults => {\n this.setState({ searchResults })\n });\n } else {\n this.setState({ searchResults: {items: [], total: 0} });\n }\n }", "function search (state = '', action) {\n switch (action.type) {\n case INFORMATION_UPDATE_SEARCH:\n return action.value\n\n case INFORMATION_CLEAR_SEARCH:\n return ''\n\n default:\n return state\n }\n}", "handleSearch() {\n this.props.searchBeerApi(this.state.term);\n }", "search(){\n // Condition checks if nothing has been input when first entering website and clicking the button or when something is typed and then deleted\n // returns out of method if this is the case as there will be no results\n if(this.state === null || this.state.term === ''){\n return;\n }\n\n // Calls the passed down event handler search function from App.js\n this.props.onSearch(this.state.term);\n }", "function querySearch(query) {\n return query ? vm.states.filter(createFilterFor(query)) : vm.states;\n }", "handleSearch(event) {\n\n this.setState({\n\n [event.target.id]: event.target.value\n\n }, function() {\n\n this.setState({\n\n filteredProducts: Object.values(this.state.products).filter(user => user.name.toLowerCase().includes(this.state.search.toLowerCase()))\n \n })\n\n });\n\n }", "updateSearchResults( evt ) {\n\t\tthis.setState( {\n\t\t\tsearchText: evt.target.value,\n\t\t} );\n\t}", "updateSearchResults( evt ) {\n\t\tthis.setState( {\n\t\t\tsearchText: evt.target.value,\n\t\t} );\n\t}", "function querySearch (query) {\n var results = query ? filterForUsers(query) : vm.states;\n\n return results;\n }", "handleSearch(e) {\n let search = e.target.value.toLowerCase();\n if (search !== \"\") {\n this.callApi(search)\n }else{\n this.setState({\n searchValue: search\n });\n }\n }", "searchBar(event) {\n\n this.setState({ searchedText: event.target.value },\n () => {\n this.props.returnedData(this.state.searchedText);\n });\n\n }", "handleSearch(value) {\n\t\tlet lValue = value ? value : null, filter = null;\n\t\tlet data = this.state.initialData, filteredData = data, selection = this.state.selection;\n\t\tlet displayField = this.state.displayField, idField = this.state.idField;\n\t\tlet hasFilter = (typeof this.props.filter == 'function');\n\n\t\t// When the search field has been clear then the value will be null and the data will be the same as initialData, otherwise\n\t\t// the data will be filtered using the .filter() function of Inmutable lib. It return a Inmutable obj with the elements that\n\t\t// match the expresion in the parameter.\n\t\tif (value) {\n\t\t\tlValue = Normalizer.normalize(lValue);\n\n\t\t\t// If the prop `filter´ has a function then use if to filter as an interator over the indexed data.\n\t\t\tif (hasFilter) {\n\t\t\t\tlet filtered = null, filteredIndexes = new Set();\n\n\t\t\t\t// Filter indexed data using the funtion\n\t\t\t\t_.each(this.state.initialIndexed, element => {\n\t\t\t\t\tif (this.props.filter(element, lValue)) {\n\t\t\t\t\t\tfilteredIndexes.add(element._rowIndex);\n\t\t\t\t\t}\n\t\t\t\t});\n\n\t\t\t\t// Then get the data that match with that indexed data\n\t\t\t\tfilteredData = data.filter(element => {\n\t\t\t\t\treturn filteredIndexes.has(element.get('_rowIndex'));\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\tfilteredData = data.filter(element => {\n\t\t\t\t\tfilter = element.get(this.props.filterField, null) || element.get(displayField);\n\n\t\t\t\t\t// When it's a function then use the field in filterField to search, if this field doesn't exist then use the field name or then idField.\n\t\t\t\t\tif (typeof filter == 'function') {\n\t\t\t\t\t\tfilter = element.get('name', null) || element.get(idField);\n\t\t\t\t\t}\n\n\t\t\t\t\tfilter = Normalizer.normalize(filter);\n\t\t\t\t\treturn filter.indexOf(lValue) >= 0;\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Apply selection\n\t\tfilteredData = filteredData.map(element => {\n\t\t\tif (selection.has(element.get(idField, null))) {\n\t\t\t\telement = element.set('_selected', true);\n\t\t\t}\n\n\t\t\treturn element;\n\t\t});\n\n\t\tthis.setState({\n\t\t\tdata: filteredData\n\t\t}, this.sendSearch(lValue));\n\t}", "handleSearch(e) {\n var text = e.target.value;\n this.props.onSearch(text);\n this.setState({\n queryText: text\n });\n }", "onSearch(event) {\n //using this.setState to manipulate the internal component state\n this.setState({ query: event.target.value}); \n }", "_handleInputSearch (event) {\n this.filterStringEdit(event);\n this.setState({\n query: event.target.value,\n })\n }", "searchByName( nameToSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n let nameToSearchLowerCase = nameToSearch.toLocaleLowerCase();\n let nameToSearchSplit = nameToSearchLowerCase.split(' ');\n let name0ToSearch = nameToSearchSplit[0];\n let name1ToSearch = nameToSearchSplit[1];\n \n \n for( let indx=0; indx<list.length; ++indx ) {\n let name = list[indx].name.toString().toLocaleLowerCase();\n let nameSplit= name.split(' ');\n let name0 = nameSplit[0];\n let name1 = nameSplit[1];\n \n if( name0ToSearch && name1ToSearch && nameToSearchLowerCase === name ) {\n itemId = list[indx].id;\n break;\n } else\n if( !name1ToSearch && name0ToSearch && (name0 === name0ToSearch || name1 === name0ToSearch) ) {\n itemId = list[indx].id;\n break;\n }\n }\n console.log('searchByName :',itemId);\n \n return itemId;\n }", "function search() {\n\t\n}", "handleSearch(target){\n this.setState(() => {\n return {\n searchTerm: target,\n searchItem: target\n }\n })\n console.log(this.state);\n }", "handleSearchChange(e, { value }) {\n let { data } = this.state;\n data = data.filter(product => product.name.toUpperCase().includes(value.toUpperCase()));\n this.setState({results: data, value})\n }", "updateState(ev) {\n ev.preventDefault()\n const value = this.input.value\n this.setState({\n query: value,\n })\n this.handleSearch(value)\n }", "function checkSearchState() {\n //check latest state\n if ($rootScope.$state.current.name == 'home.search') {\n return {\n status: true,\n queryString: $rootScope.$stateParams.queryString || \"\"\n }\n } else if ($rootScope.stateHistory.length > 0) {\n //check if previous state was search and current state is post\n if ($rootScope.stateHistory[$rootScope.stateHistory.length - 1].hasOwnProperty('home.search') && $rootScope.$state.current.name == 'home.post') {\n //checking the previous state\n return {\n status: true,\n queryString: $rootScope.stateHistory[$rootScope.stateHistory.length - 1]['home.search'].queryString\n }\n } else {\n return {\n status: false\n }\n }\n } else {\n return {\n status: false\n }\n }\n }", "search(e){\n this.setState({search: e.target.value}, this.searchSportsFromApi.bind(this));\n }", "search(e: Event) {\n // Retrieving input html element with the search string\n const target = ((e.target: any): HTMLInputElement);\n\n // Retrieving search string\n const needle: string = target.value.toLowerCase();\n\n // Asserting search was initialized\n invariant(this._preSearchData && this._preSearchData != null, \"CRUDActions.search: search wasn't initialized\");\n\n // If search string wasn't retrieved successfully or it is an empty string, stop search\n if (!needle) {\n this.crudStore.setData(this._preSearchData);\n return;\n }\n\n // Retrieving fields of data\n const fields: List<string> = this.crudStore.getSchema().map(item => item.id);\n\n // Retrieving all records that have the search string\n let searchData;\n if (this._preSearchData && this._preSearchData != null) {\n searchData = this._retrieveSearchData(this._preSearchData, fields, needle)\n\n // Updating data in store without committing since this update is temporary until\n // search in finished\n this.crudStore.setData(searchData);\n }\n }", "function search(current){\n\n}", "search(keyword) {\n const searchResults = WasteWizard.search(keyword);\n this.setState({ searchResults });\n }", "search(query, action) {\n\n if (query == \"\") {\n return;\n }\n //return if another search is ongoing\n if (this.searching) {\n return;\n }\n //make searchin current screen data first\n // if not found any matching go for backend.\n\n let lastSearchedIndex = this.state.lastSearchedIndex,\n regEx = new RegExp(query, \"gi\"),\n fields = this.state.fields,\n selectedRow = [],\n localIndex;\n let direction = '';\n switch (action) {\n case \"next\": {\n localIndex = this.state.mainTableData.findIndex((row, index) => {\n if (index > lastSearchedIndex)\n for (let i = 0; i < fields.length; i++) {\n if (row[fields[i]] && row[fields[i]].toString().match(regEx) != null) {\n selectedRow.push(row.EZID);\n return true;\n }\n }\n });\n direction = \"N\"\n }\n break;\n case \"previous\": {\n let reverserMainTableData = this.state.mainTableData.concat([]).reverse();\n let reverseLastSearchedIndex = reverserMainTableData.length - lastSearchedIndex;\n let reversedLocalIndex = reverserMainTableData.findIndex((row, index) => {\n if (index >= reverseLastSearchedIndex)\n for (let i = 0; i < fields.length; i++) {\n if (row[fields[i]].toString().match(regEx) != null) {\n selectedRow.push(row.EZID);\n return true;\n }\n }\n });\n\n localIndex = reversedLocalIndex > -1 ? reverserMainTableData.length - reversedLocalIndex - 1 : -1;\n direction = \"P\"\n }\n break;\n case \"search\": {\n localIndex = this.state.mainTableData.findIndex((row, index) => {\n for (let i = 0; i < fields.length; i++) {\n if (row[fields[i]].toString().match(regEx) != null) {\n selectedRow.push(row.EZID);\n return true;\n }\n }\n });\n }\n\n }\n\n //if valid searched data is found.\n if (localIndex > -1) {\n this.setState({\n lastSearchedIndex: localIndex,\n selectedRow: selectedRow,\n searchedText: query\n });\n }\n else {\n\n\n this.searching = true;\n this.setState({\n searchedText: query\n });\n this.fetchData({type: \"SEARCH_RECORD\", data: {query: query, direction: direction}})\n }\n }", "function search() {\n let search_text = $search_text.value;\n decide_search(search_text)\n}", "handleSearch(e) {\n this.setState({\n search: e.target.value,\n });\n }", "searchHandler(e){\n this.setState({\n term : e.target.value \n });\n}", "runSearch(state, timeout) {\n // TODO\n }", "loadSearchResults(passedState) {\n\t\t// TODO, server call\n\t\tSearchAPI.searchKey = passedState.searchKey;\n\t\tSearchAPI.filters.mealType = passedState.filters.mealType;\n\t\tSearchAPI.filters.cuisineType = passedState.filters.cuisineType;\n\t\tconst searchresults = SearchAPI.search();\n\t\tthis.setState({searchresults: searchresults});\n\t}", "handleSearch(queryString) {\n const helper = algoliasearchHelper(client, indexName);\n\n helper.on(\"result\", content => {\n this.setState({\n query: queryString,\n searchResults: content.hits,\n currentResults: content.hits.slice(0, 5),\n count: content.nbHits,\n searchTime: content.processingTimeMS,\n currentCategory: null,\n currentPayment: null\n });\n });\n\n if (!this.state.geoLocation) {\n helper\n .setQueryParameter(`aroundLatLngViaIP`, true)\n .setQuery(queryString)\n .search();\n } else {\n const { lat, lng } = this.state.geoLocation;\n helper\n .setQueryParameter(`aroundLatLng`, `${lat}, ${lng}`)\n .setQuery(queryString)\n .search();\n }\n }", "onSearch(e) {\n let term = e.target.value;\n // Clear the current projects/samples selection\n this.props.resetSelection();\n this.props.search(term);\n }", "handleSearchChange(event) {\n this.setState({ query: event.target.value });\n }", "function handleSearch() {\n triggerSearch({}); // need empty braces here\n }", "searchClicked(_) { console.log(this.state.term) }", "function search () {\n saveState();\n self.filtered = self.gridController.rawItems.filter(self.filterFunc);\n self.gridController.doFilter();\n }", "searchData(firebase){\n this.setState({loading:true, noMatches: false});\n this.props.search(firebase, this.state.name, this)\n\n }", "function handleSearchSubmit() {\n\t$('#rep-state-search').on('click', function (event) {\n\t\tevent.preventDefault();\n\n\t\tlet userState = $('#state-select').val();\n\t\t$(\"#pick-rep\").show();\n\t\tgetProPublicaFedHouse(userState);\n\t getProPublicaFedSenate(userState);\n\t});\n}", "function querySearch (query) {\r\n var results = query ? self.states.filter( createFilterFor(query) ) : [];\r\n return results;\r\n }", "searchBooks() {\n\t\tif (this.state.query === '' || this.state.query === undefined) {\n\t\t\treturn this.setState({ searchResults: [] })\n\t\t}\n\t\tBooksAPI.search(this.state.query.trim()).then(matches => {\n\t\t\tif (matches.error) {\n\t\t\t\treturn this.setState({ searchResults: [] })\n\t\t\t} else {\n\t\t\t\t// If book already on a shelf, update shelf status in search results\n\t\t\t\tmatches.forEach(b => {\n\t\t\t\t\tconst listBook = this.state.books.filter(myBook => myBook.id === b.id)\n\t\t\t\t\tif (listBook.length) {\n\t\t\t\t\t\tb.shelf = listBook[0].shelf\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\treturn this.setState({ searchResults: matches })\n\t\t}})\n\t}", "searchByProfessions( professionSearch ) {\n let itemId = this.ItemNotFound;\n let list = this.state[this.townName];\n \n \n for( let indx=0; indx<list.length; ++indx ) {\n for( let indxProf=0; indxProf<list[indx].professions.length; ++indxProf ) {\n if( list[indx].professions[indxProf].toLowerCase() === professionSearch.toLowerCase() ) {\n itemId = list[indx].id;\n break;\n } \n }\n }\n console.log('searchByProfessions :',itemId);\n\n return itemId;\n }", "onSearch(e) {\n let productSearch = e.target.value; \n\n let tmpArr = this.state.ls.filter((e)=>{\n if(e.name.includes(productSearch)) return e;\n });\n\n if(tmpArr.length > 0){\n this.setState({ls:tmpArr})\n this.setState({searching: true})\n }\n }", "function handleSearchClick(){\r\n var temp = document.getElementById('searchText').value;\r\n fetchRecipesBySearch(temp);\r\n }", "function search(data){\n setSearch(data); \n }", "search() {\n let location = ReactDOM.findDOMNode(this.refs.Search).value;\n if (location !== '') {\n let path = `/search?location=${location}`;\n makeHTTPRequest(this.props.updateSearchResults, path);\n }\n }", "searchTerm(e) {\n this.setState({\n searchTerm: e\n });\n }", "function findStates()\n{\n var filter = '';\n\n superGroupSearchService.findStates(filter, populateStates);\n\n return false;\n}", "handleFilterSearch(e) {\n this.setState({\n ...this.state,\n tableData: this.searcher.search(e.target.value)\n });\n }", "async search() {\n this.mixpanelTrack(\"Discover Stax Search Started\");\n if(this.state.catgorychoosen==Strings.discover_category_home)\n { \n await this.catWisestax(this.state.searchquery);\n }\n else\n { \n await this.categoryselected(\"\", this.state.catgorychoosen)\n }\n }", "handleSearch(event) {\n this.setState({ search: event.target.value });\n }", "updateSearchState(event) {\n let search = event.target.value;\n return this.setState({\n search: search\n });\n }", "onSearchRepository(searchString) {\n const searchResults = this.state.userReposDefault.filter(repo => repo.name.toLowerCase().includes(searchString.toLowerCase()));\n\n this.setState({userRepos: searchResults});\n }", "triggersearch(){\r\n\t\t\tlet query='';\r\n\t\t\tif(this.props.keyword){\r\n\t\t\t\tquery=this.props.keyword\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tquery=this.props.query\r\n\t\t\t}\r\n\t\t\tthis.props.fetchSearchResults(query);\r\n\t}", "handleSearchTermChange (ev, e) {\n let submissions = this.filterSubmissionsBySearchQuery(this.state.searchQuery, e.value)\n this.setState({submissions, chosenSearchField: e.value})\n }", "function handleSearch(e) {\n const value = e.target.value;\n const filtered = tasks.filter(item => item.tarefa.toLowerCase().includes(value.toLowerCase()));\n setRendTasks(filtered);\n setSearch(value);\n }", "onSearchSubmit(event) {\n const { searchTerm } = this.state;\n\n // set the searchKey whenever search is submitted using that search query string\n this.setState({ searchKey : searchTerm }); \n \n if(this.needsToSeachTopStories(searchTerm)) {\n this.fetchSearchTopStories(searchTerm);\n }\n\n // if you try to search without this, the browser will reload. That's a native browser behavior\n // for a submit callback in an HTML form. In React, you will often come across the preventDefault()\n // event method to suppress the native browser behavior\n event.preventDefault();\n }", "handleClick(event) {\n if (event.target.value === \"search\") {\n // handle search to show single pokemon\n let found = false;\n const pokemon = this.state.search.toLowerCase();\n this.state.pokemon.forEach((i) => {\n if (i.name === pokemon) {\n this.setState({singleSearch: true, searchedPokemon: [i]})\n found = true\n }\n })\n if (!found) {\n alert('pokemon not found')\n }\n }\n else {\n // handle reset\n this.setState(\n {\n singleSearch: false, \n seeAll: false, \n showCollection: false\n }\n )\n }\n \n }", "function handleSearchButtonClick() {\n \n filteredData = dataSet;\n // Format the user's search by removing leading and trailing whitespace, lowercase the string\n var filterDatetime = $dateInput.value.trim().toLowerCase();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function(address) {\n var addressDatetime = address.datetime.toLowerCase();\n var addressCity = address.city.toLowerCase();\n var addressState = address.state.toLowerCase();\n var addressCountry = address.country.toLowerCase();\n var addressShape = address.shape.toLowerCase();\n\n\n\n if ((addressDatetime===filterDatetime || filterDatetime == \"\") && \n (addressCity === filterCity || filterCity == \"\") && \n (addressState === filterState || filterState == \"\") &&\n (addressCountry === filterCountry || filterCountry == \"\") && \n (addressShape === filterShape || filterShape ==\"\")){\n \n return true;\n }\n return false;\n console.log(filteredData);\n });\nloadList();\n}", "function searchTerm(){\n \n }", "doPerformSearch() {\n var self = this;\n var query = this.searchInput.value;\n\n cl(\"performing search\");\n\n appStore.discoverQuery({ query: query })\n .then((results) => {\n self.setState({ searchResults: results, isSearching: true });\n })\n }", "function searchSelect(e) {\n setSearchState({ ...searchState, searchType: e, dropdownTitle: e });\n }", "searchQuery(state, payload) {\n let filtered = [];\n if (payload === \"\") alert(\"Enter Valid Warehouse Name\");\n else {\n filtered = state.data.filter((item) => {\n return item.name.toLowerCase().includes(payload.toLowerCase());\n });\n state.warehouses = filtered;\n }\n }", "searchBook(search) {\n this.jsonLog('searchBook sending data', search);\n this.setState({waitingSearch: true});\n this.bookCtrl.searchBook(search, (err, resp) => {\n if (err) {this.error(err);}\n else {\n var searchResults = resp.items;\n this.log('searchBook with ' + search + ' response OK');\n this.log('items.length ' + resp.items.length);\n this.setState({\n searchResults: searchResults,\n waitingSearch: false\n });\n }\n });\n }", "handleSearch(e) {\n e.persist();\n // eslint-disable-next-line\n for (let key in this.state.addons) {\n if (!key.includes(e.target.value.toLowerCase())) {\n this.setState(prevState => ({\n addons: {\n ...prevState.addons,\n [key]: false\n }\n }));\n } else {\n this.setState(prevState => ({\n addons: {\n ...prevState.addons,\n [key]: true\n }\n }));\n }\n }\n }", "handleSearch(e) {\n const searchQuery = e.target.value.toLowerCase();\n\n const displayedHeroes = HEROES.filter(hero => {\n const searchString = hero.name.toLowerCase() + hero.firstAppearance.toLowerCase();\n\n return searchString.indexOf(searchQuery) !== -1;\n });\n\n this.setState({\n displayedHeroes,\n });\n }", "function handleSearch() {\n\n\tvar value = $(\"#searchBox\").val();\n\t\n\tif(value != null && value != \"\") {\n\t\tsearchStationForName(value);\n\t}\n\n}", "handleSearchChange( e ) {\n const search = e.target.value;\n const {fullCharList,charList} = this.state;\n if ('' === search) {\n this.setState({charList: fullCharList})\n } else {\n var filteredCharacters = this.resultsCache[search] ? this.resultsCache[search] : this.performSearch(search);\n this.resultsCache[search] = filteredCharacters;\n const {charList} = this.charListFromCharacters(filteredCharacters, 0);\n this.setState({charList});\n }\n this.setState({search});\n }", "function handleSearchInputChange(event){\n const value = event.target.value;\n const name = event.target.name;\n setSearchState({...searchState, [name]: value});\n }", "handleSearchOnChange(event) {\n\t\tthis.setState({search_term: event.target.value,\n\t\t\tsearch_term_query: event.target.value },()=>{\n\t\t\t\tthis.refreshSearchData();\n\t\t\t})\n\t}", "handlerSearch(search){\n const filterContacts = this.state.contacts.filter( contact =>\n contact.name.toLowerCase().includes(search.toLowerCase())\n || contact.email.toLowerCase().includes(search.toLowerCase())\n || contact.website.toLowerCase().includes(search.toLowerCase())\n || checkPhone(contact.phone, search)\n || contact.company.name.toLowerCase().includes(search.toLowerCase())\n || contact.address.country.toLowerCase().includes(search.toLowerCase())\n );\n this.setState({filterContacts});\n }", "search(term) {\n Spotify.search(term)\n .then(searchResults => this.setState({\n searchResults: searchResults\n }));\n }", "static search(props, state, seekIndex, expand, singleSearch) {\n const {\n onChange,\n getNodeKey,\n searchFinishCallback,\n searchQuery,\n searchMethod,\n searchFocusOffset,\n onlyExpandSearchedNodes,\n } = props;\n\n const { instanceProps } = state;\n\n // Skip search if no conditions are specified\n if (!searchQuery && !searchMethod) {\n if (searchFinishCallback) {\n searchFinishCallback([]);\n }\n\n return { searchMatches: [] };\n }\n\n const newState = { instanceProps: {} };\n\n // if onlyExpandSearchedNodes collapse the tree and search\n const { treeData: expandedTreeData, matches: searchMatches } = find({\n getNodeKey,\n treeData: onlyExpandSearchedNodes\n ? toggleExpandedForAll({\n treeData: instanceProps.treeData,\n expanded: false,\n })\n : instanceProps.treeData,\n searchQuery,\n searchMethod: searchMethod || defaultSearchMethod,\n searchFocusOffset,\n expandAllMatchPaths: expand && !singleSearch,\n expandFocusMatchPaths: !!expand,\n });\n\n // Update the tree with data leaving all paths leading to matching nodes open\n if (expand) {\n newState.instanceProps.ignoreOneTreeUpdate = true; // Prevents infinite loop\n onChange(expandedTreeData);\n }\n\n if (searchFinishCallback) {\n searchFinishCallback(searchMatches);\n }\n\n let searchFocusTreeIndex = null;\n if (\n seekIndex &&\n searchFocusOffset !== null &&\n searchFocusOffset < searchMatches.length\n ) {\n searchFocusTreeIndex = searchMatches[searchFocusOffset].treeIndex;\n }\n\n newState.searchMatches = searchMatches;\n newState.searchFocusTreeIndex = searchFocusTreeIndex;\n\n return newState;\n }", "function handleSearch(e) {\n const { value } = e.target;\n setSearch(value);\n if (!value) dispatch(searchContent({ val: null, type: \"all\" }));\n if (value.length < 3) return \"\";\n return debouncedSearch({ ...sorter, type: \"search\", search: value });\n }", "search(term) {\n // search is Promise based (thenable), set the state when the Promise is fulfilled\n Spotify.search(term).then(results => {\n this.setState({searchResults: results});\n });\n }", "function handleSearch(event) {\n event.preventDefault();\n\n let query = event.target.search.value;\n API.searchBooks(query)\n .then(({ data }) => {\n console.log(data);\n let newArray = data.items.map((book) => ({\n _id: book.id,\n title: book.volumeInfo.title,\n authors: book.volumeInfo.authors || \"No authors listed\",\n description: book.volumeInfo.description || \"No description listed\",\n image:\n book.volumeInfo.imageLinks?.thumbnail || \"No thumbnail included\",\n link: book.volumeInfo.infoLink,\n }));\n setSearchResult(newArray);\n })\n .catch((err) => console.log(err));\n }", "function searchHelper() {\r\n let searchValue = searchField.value;\r\n if (searchValue.length) search(searchValue);\r\n else getAll();\r\n }", "submitSearch(){\n //Term that we will use for query\n const searchTerm = this.state.searchTerm;\n\n //Require that name not be an empty string\n if(searchTerm.length === 0)\n {\n //Reset state\n this.setState({\n loading: false,\n lastSearchTerm: '',\n results: []\n });\n }\n //Avoid unneeded duplicate requests by checking if search term has changed at all from the term whose results are currently being displayed\n else if(searchTerm !== this.state.lastSearchTerm){\n this.setState({\n lastSearchTerm: searchTerm,//Store this search term as what was previously searched to avoid unneeded duplicate requests\n loading: true//Begin showing loading spinner until results are received\n });\n\n //Send test search with query in format \"[search term] in [location]\"\n PlacesService.textSearch({\n //Searching by zip sucks - like Schenectady, NY's zip code is 12345 and google doesn't know what to do with that\n //Instead, using the formatted name of the location gets way cleaner results!\n query: `${searchTerm} in ${this.props.locationName}`\n }, this.handleSearchResults);\n }\n }", "onSearch(value) {\n let tempPhones = [];\n for (let i = 0; i < this.state.phonesTemp.length; i++) {\n // If the phone's name contains the name entered then add it\n if (this.state.phonesTemp[i].name.toLowerCase().includes(value.toLowerCase())) {\n tempPhones.push(this.state.phonesTemp[i]);\n }\n }\n this.setState({ phones: tempPhones }); // Render phones mathing criteria\n }", "function callback() {\n let latLong = self.state.latLong;\n let search = `${latLong['lat']},${latLong['lng']},${self.state.searchRadius}`\n self.setState({searchParams: search});\n self.props.search(self.state.searchParams, self.state.latLong);\n }", "search(queryStr) {\n\n this.queryStr = queryStr;\n this.saveQueryStr();\n let normalizedQueryStr = RefSearchQuery.normalizeQueryStr(queryStr);\n\n this.results.length = 0;\n // Always select the first result when the search query changes\n this.selectedResultIndex = 0;\n\n if (normalizedQueryStr === '') {\n this.isLoadingResults = false;\n this.onUpdateSearchStatus();\n return;\n }\n\n return this.searchByRef(normalizedQueryStr);\n\n }", "searchWardrobe(query) {\n this.props.searchWardrobe(query.target.value);\n }", "handleSearch(event) {\n if(this.state.term && this.state.location){\n this.props.searchYelp(this.state.term, this.state.location, this.state.sortBy);\n event.preventDefault();\n this.setState({ arrow: \"visible\"});\n this.setState({ searchError: ''});\n }else{\n this.setState({ searchError: 'Please ensure you fill the What food? and Where? fields before clicking the Let\\'s Go button'});\n }\n \n }", "search() {\n // If the search base is the id, just load the right card.\n if (this.queryData['searchBase'] == 'id' && this.queryData['search']) {\n this.selectItem(this.queryData['search']);\n } else {\n this.loadData();\n }\n }", "handleSearch(query) {\n const auth = config.EVENT_API_KEY;\n const eventApiParams = `?q=${query}&client_id=${auth}`;\n const str = config.EVENT_API + `${eventApiParams}`;\n const url = str.replace(/ /g, '+')\n fetch(url, {\n method: 'GET',\n headers: {\n 'content-type': 'application/json'\n }\n })\n .then(response => {\n if (response.ok) {\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then(responseJson => {\n if (responseJson.events.length !== 0) {\n this.setState({\n searchResults: responseJson.events,\n })\n } else {\n this.setState({\n searchResults: [{\n datetime_local: '',\n id: '',\n performers: [{\n image: 'https://images.unsplash.com/photo-1499415479124-43c32433a620?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=1789&q=80'\n }],\n title: 'No Search Results',\n type: 'No events for this artist currently, search another!',\n url: '',\n venue: {\n name: '',\n display_location: ''\n }\n }]\n })\n\n }\n })\n .catch(error => {\n console.error({ error })\n })\n }", "checkTopStoriesSearchTerm(searchTerm){\n return !this.state.results[searchTerm];\n }" ]
[ "0.76675767", "0.7386061", "0.7250629", "0.7220179", "0.7214401", "0.71855944", "0.71477973", "0.70581025", "0.7055681", "0.7055681", "0.70479727", "0.6995786", "0.69919586", "0.6974798", "0.6969081", "0.6960766", "0.69603825", "0.6951622", "0.6951567", "0.6946523", "0.6946069", "0.6946069", "0.69409204", "0.69143355", "0.6902139", "0.6892073", "0.688284", "0.68788385", "0.68752307", "0.6866914", "0.68502724", "0.6836485", "0.68077594", "0.67907465", "0.67859524", "0.67808384", "0.6772247", "0.67697716", "0.6754296", "0.6750103", "0.67482126", "0.6746914", "0.67436427", "0.67408186", "0.67383325", "0.67071813", "0.67065877", "0.67037225", "0.6699387", "0.66970223", "0.668905", "0.6672246", "0.66679347", "0.6660348", "0.66588455", "0.6658542", "0.66515404", "0.66428614", "0.66275156", "0.66260606", "0.66185856", "0.66183716", "0.6607793", "0.65949583", "0.65926486", "0.6591582", "0.658996", "0.6586116", "0.6577987", "0.65772283", "0.657645", "0.6573443", "0.65699947", "0.6566206", "0.65564716", "0.6550609", "0.6548012", "0.6547326", "0.654693", "0.653859", "0.6537865", "0.65367913", "0.6530146", "0.6528578", "0.6522578", "0.6515806", "0.6512401", "0.6511798", "0.65065974", "0.6500028", "0.6495478", "0.6490206", "0.6489769", "0.64861524", "0.6480179", "0.6479268", "0.647597", "0.64722395", "0.64705503", "0.64681894" ]
0.72544533
2
function to handle Search by Date
function handleSearchButtonClickDate() { // Format the user's search by removing leading and trailing whitespace var filterDate = $dateInput.value.trim().toLowerCase(); // Set ufoSightings to an array of all dataSet whose "date" matches the filter ufoSightings = dataSet.filter(function(sightings) { var sightingDate = sightings.date.toLowerCase(); // If true, add the sighting to the filterState, otherwise don't add it to filterState return sightingDate === filterDate; }); renderTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchDate(evt) {\n\t\t\t\t\tvar date,\n\t\t\t\t\t\tkey = evt.keyCode ? evt.keyCode : evt.which,\n\t\t\t\t\t\tdateStr = evt.currentTarget.value;\n\n\t\t\t\t\tdate = (_h.isISOString(dateStr) && _h.isValidDate(dateStr)) ? _h.constructDate(dateStr) : null;\n\n\t\t\t\t\tif (date && key === 13) {\n\t\t\t\t\t\tdrawMonthView(date);\n\t\t\t\t\t\tsetWeekAndDayIndexes(date);\n\t\t\t\t\t\tif (!_h.isGreaterThan(date, curDay) || _h.areDatesEqual(date, curDay)) {\n\t\t\t\t\t\t\tselectWeek(indexObj.weekIdx, drawWeekView);\n\t\t\t\t\t\t\tselectDay(indexObj.dayIndexInWeek);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselectWeek(indexObj.weekIdx, drawWeekView);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\trecalcCanvasWidth();\n\t\t\t\t}", "function handleSearchButtonClick() {\n var filterDate = $dateInput.value;\n\n // Filter on date\n if (filterDate != \"\") {\n tableData = data.filter(function(address) {\n var addressDate = address.datetime;\n return addressDate === filterDate;\n });\n } else { tableData };\n\n renderTable();\n}", "function searchByDate() {\n // Prompts the user to enter a search query, captures their response\n var ui = SpreadsheetApp.getUi();\n var response = ui.prompt(\"📅 Enter the search date\", \"Enter a date in MM/DD/YY format\\n\\n✅ 04/05/2020\\n✅ 4/5/21\\n✅ 12-05-19\\n\\n\", ui.ButtonSet.OK);\n if (response.getSelectedButton() == ui.Button.OK) {\n var date = response.getResponseText();\n };\n \n // Store the search query in the \"Infrastructure\" Sheet\n SpreadsheetApp.getActive().getSheetByName('Infrastructure').getRange(8, 2).setValue(date);\n \n displayDateSearch();\n}", "function GetDateForQuery(index) {\n var chuoisearch = \"\";\n var fd = \" \", td = \" \";\n var today = new Date();\n switch (index) {\n case 0:\n fd = td = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n case 1:\n fd = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n today.setDate(today.getDate() + 1)\n td = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n case 2:\n var dayOfWeekStartingSundayZeroIndexBased = today.getDay(); // 0 : Sunday ,1 : Monday,2,3,4,5,6 : Saturday\n var mondayOfWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - today.getDay() + 1);\n var sundayOfWeek = new Date(today.getFullYear(), today.getMonth(), today.getDate() - today.getDay() + 7);\n fd = (mondayOfWeek.getDate() + '/' + (mondayOfWeek.getMonth() + 1) + '/' + mondayOfWeek.getFullYear());\n td = (sundayOfWeek.getDate() + '/' + (sundayOfWeek.getMonth() + 1) + '/' + sundayOfWeek.getFullYear());\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n default:\n chuoisearch = \"_\" + fd + \"_\" + td + \"_false\";\n return chuoisearch;\n }\n}", "function handleSearchButtonClick() { \n var filterdt = datetimeInput.value.trim();\n \n filterData = dataSet.filter(function(ovni)\n {\n var dt = ovni.datetime;\n return dt === filterdt;\n });\n \nrenderTable();\n}", "function searchMYEvent() {\n storyOrEvent = document.getElementById('searchName').value;\n dateInfo = document.getElementById('searchDatepicker').value;\n retrieveSelectedMYEvents(storyOrEvent, dateInfo);\n}", "function searchAndValid(term) {\n\n\n var userNameRegex = /^(19|20)\\d\\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$/; // rgex for validation of search input by this format yyyy-mm-dd \n if (userNameRegex.test(term) == true) {\n var element = document.getElementById(\"searchInp\");\n element.classList.add(\"is-valid\");\n element.classList.remove(\"is-invalid\");\n \n }\n else{\n var element = document.getElementById(\"searchInp\");\n element.classList.add(\"is-invalid\");\n element.classList.remove(\"is-valid\");\n }\n// validation-end\n\n\n\n// search function start ===>\n var temp = '';\n let num=0; // var to count number of documents\n for (i = 0; i < sortedByDate.length; i++) {\n\n if (sortedByDate[i].createdAt.includes(term) == true) {\n\n let fullDate = sortedByDate[i].createdAt; // method to slice only date ex:\"2021-07-16T18:00:00\";\nlet day = fullDate.slice(0, 10); // Date is \"2021-07-16\"\n\nlet pointsIn=\"\"; // empty var to add value of point_in \n\n\n // if condition to check where point_is prporty and if it's exist or no in every object \n if ('points_in' in sortedByDate[i] == true){ \n pointsIn=sortedByDate[i].points_in\n }\n\n else if ('goal' in sortedByDate[i] == true){\n pointsIn=sortedByDate[i].goal.points_in\n }\n\n else if ('goal' in sortedByDate[i] == false && 'points_in' in sortedByDate[i] ==false ){\n pointsIn=\"no data\"\n }\n \n\n let goalType=\"\"; // empty var to add value of goal_type \n// if condition to check where goal_type prporty and if it's exist or no in every object\n if ('goal_type' in sortedByDate[i] == true){ \n goalType=sortedByDate[i].goal_type\n }\n\n else if ('goal' in sortedByDate[i] == true){\n goalType=sortedByDate[i].goal.goal_type\n }\n\n else if ('goal' in sortedByDate[i] == false && 'goal_type' in sortedByDate[i] ==false ){\n goalType=\"no data\"\n }\n temp +=\n `<div class=\"col-lg-3 my-2\">\n <ul class=\"list-group\">\n <li class=\"list-group-item list-group-item-primary\"> <strong class=\"text-danger\">Document number : </strong> ${num++}</li>\n <li class=\"list-group-item list-group-item-secondary\"><strong class=\"text-danger\">Points in : </strong> ${pointsIn}</li>\n <li class=\"list-group-item list-group-item-danger\"><strong class=\"text-danger\">Goal Type : </strong> ${goalType}</li>\n <li class=\"list-group-item list-group-item-warning\"><strong class=\"text-danger\">user_hits/day : </strong>${day}</li>\n\n</ul>\n</div>`\n\n };\n };\n document.getElementById(\"rowData\").innerHTML = temp; \n \n\n}", "filterBySearchDate(fieldName, operator, searchTerms, version) {\n let query = '';\n let searchValues;\n if (Array.isArray(searchTerms) && searchTerms.length > 1) {\n searchValues = searchTerms;\n if (operator !== OperatorType.rangeExclusive && operator !== OperatorType.rangeInclusive) {\n operator = this._gridOptions.defaultFilterRangeOperator;\n }\n }\n // single search value\n if (!Array.isArray(searchValues) && Array.isArray(searchTerms) && searchTerms.length === 1 && searchTerms[0]) {\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchTerms[0], true));\n if (searchValue1) {\n return `${fieldName} ${this.mapOdataOperator(operator)} ${searchValue1}`;\n }\n }\n // multiple search value (date range)\n if (Array.isArray(searchValues) && searchValues.length === 2 && searchValues[0] && searchValues[1]) {\n // date field needs to be UTC and within DateTime function\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[0], true));\n const searchValue2 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[1], true));\n if (searchValue1 && searchValue2) {\n if (operator === OperatorType.rangeInclusive) {\n // example:: (Finish >= DateTime'2019-08-11T00:00:00Z' and Finish <= DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} ge ${searchValue1} and ${fieldName} le ${searchValue2})`;\n }\n else if (operator === OperatorType.rangeExclusive) {\n // example:: (Finish > DateTime'2019-08-11T00:00:00Z' and Finish < DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} gt ${searchValue1} and ${fieldName} lt ${searchValue2})`;\n }\n }\n }\n return query;\n }", "filterBySearchDate(fieldName, operator, searchTerms, version) {\n let query = '';\n let searchValues;\n if (Array.isArray(searchTerms) && searchTerms.length > 1) {\n searchValues = searchTerms;\n if (operator !== OperatorType.rangeExclusive && operator !== OperatorType.rangeInclusive) {\n operator = this._gridOptions.defaultFilterRangeOperator;\n }\n }\n // single search value\n if (!Array.isArray(searchValues) && Array.isArray(searchTerms) && searchTerms.length === 1 && searchTerms[0]) {\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchTerms[0], true));\n if (searchValue1) {\n return `${fieldName} ${this.mapOdataOperator(operator)} ${searchValue1}`;\n }\n }\n // multiple search value (date range)\n if (Array.isArray(searchValues) && searchValues.length === 2 && searchValues[0] && searchValues[1]) {\n // date field needs to be UTC and within DateTime function\n const searchValue1 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[0], true));\n const searchValue2 = this.odataQueryVersionWrapper('dateTime', version, fieldName, parseUtcDate(searchValues[1], true));\n if (searchValue1 && searchValue2) {\n if (operator === OperatorType.rangeInclusive) {\n // example:: (Finish >= DateTime'2019-08-11T00:00:00Z' and Finish <= DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} ge ${searchValue1} and ${fieldName} le ${searchValue2})`;\n }\n else if (operator === OperatorType.rangeExclusive) {\n // example:: (Finish > DateTime'2019-08-11T00:00:00Z' and Finish < DateTime'2019-09-12T00:00:00Z')\n query = `(${fieldName} gt ${searchValue1} and ${fieldName} lt ${searchValue2})`;\n }\n }\n }\n return query;\n }", "function getResults() {\n var searchText = document.getElementById('search').value;\n \n odkData.query('pediatria', 'regdate = ?', [searchText], null, null, \n \t\tnull, null, null, null, true, cbSRSuccess, cbSRFailure);\n}", "function searchMYStory() {\n storyOrEvent = document.getElementById('searchName').value;\n dateInfo = document.getElementById('searchDatepicker').value;\n retrieveSelectedMYStories(storyOrEvent, dateInfo);\n}", "function runSearch() {\n\n // Prevent the page from refreshing\n d3.event.preventDefault();\n\n // Select the input element and get value\n var inputValue = d3.select(\"#datetime\").property(\"value\");\n\n // Set filered data to the entire dataset\n var filteredData = tableData;\n\n // Check if a date was entered, if yes filter on that date\n if (inputValue != \"\") {\n filteredData = filteredData.filter(UFOSighting => UFOSighting.datetime === inputValue);\n }\n\n // Call function to build the html table\n buildTable(filteredData);\n}", "function datesSearch() {\n let error = false;\n\n dateFrom = $('#dateFrom').val();\n dateTo = $('#dateTo').val();\n\n if (dateFrom.length !== 0) {\n $('#dateFrom').removeClass('error');\n } else {\n $('#dateFrom').addClass('error');\n error = true;\n }\n if (dateTo.length !== 0) {\n $('#dateTo').removeClass('error');\n } else {\n $('#dateTo').addClass('error');\n error = true;\n }\n if (error) {\n $('#dateLengthErr').show();\n } else {\n $('#dateLengthErr').hide();\n }\n\n let dateFromMoment = moment(dateFrom, \"YYYY-MM-DD\");\n if (dateFromMoment.isAfter(dateTo)) {\n $('#dateFrom').addClass('error');\n $('#dateError').show();\n error = true;\n } else {\n $('#dateError').hide();\n }\n\n if (error) {\n return;\n }\n\n // Custom datatable search function to only return rows that are between the 2 dates\n $.fn.dataTableExt.afnFiltering.push(\n function(oSettings, aData, iDataIndex) {\n let dateFrom = parseDateValue($('#dateFrom').val());\n let dateTo = parseDateValue($('#dateTo').val());\n\n let evalDate = parseDateValue(aData[1]);\n\n if (evalDate >= dateFrom && evalDate <= dateTo) {\n return true;\n } else {\n return false;\n }\n }\n );\n\n // Once the table has been searched it must be redrawn to show the filtered results\n datatable.draw();\n\n sumTableData();\n updateChart();\n}", "function searchdate() {\n var input, filter, table, tr, td, i, txtValue;\n input = document.getElementById(\"myInput\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"myTable\");\n tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[0];\n td = tr[i].getElementsByTagName(\"td\")[0];\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "function searchUFO() {\n // set function query and create array of rows\n \n let query = d3.select('#dateSearch').property('value');\n let searchDate = new Date(query);\n // let searchDate = new Date(`${query[2]}/${query[1]}/${query[0]}`);\n // loop through each row in table\n for (let i = 0; i < data.length; i++){\n let row = d3.select(`#sighting_${i}`);\n\n // compare dates using Date()\n let rowDate = row.select('.datetime').text();\n if (rowDate != searchDate) {\n row.style('display', 'none');\n console.log(searchDate);\n console.log(rowDate);\n }\n else {\n row.style('display', 'table-row');\n // console.log(searchDate);\n // console.log(rowDate);\n }\n }\n\n}", "function searchHotelsByDate(){\n totalNight();\n resultHotel= [];\n const start = new Date (dateFrom.value).getTime();\n const end = new Date (dateTo.value).getTime();\n if(start <= end){\n resultHotel = hotels.filter((hotel)=>{\n let available = false\n hotel.availability.forEach( date =>{\n var availableFrom = new Date(date.from.split('-').reverse().join('-')).getTime();\n var availableTo = new Date(date.to.split('-').reverse().join('-')).getTime();\n if(start <= availableFrom && end >= availableTo ){\n return available = true\n }\n // let fromString = date.from.split('-');\n // let toString = date.to.split('-');\n // let fromDate = new Date(fromString[2], fromString[1]-1, fromString[0]);\n // let toDate = new Date(toString[2], toString[1]-1, toString[0]);\n // if(fromDate.getTime() >= start && toDate.getTime() <= end)\n // {\n // // resultHotel.push(hotel);\n // return available = true;\n // }\n\n })\n return available;\n }) \n }else{\n alerts(\"Select Correct Range\",3000);\n }\n // console.log(resultHotel)\n display(resultHotel);\n range();\n filterByPrice();\n}", "function searchEvent() {\n storyOrEvent = document.getElementById('searchName').value;\n console.log(storyOrEvent);\n dateInfo = document.getElementById('searchDatepicker').value;\n selectedOption = document.getElementById('optionSelect').value;\n if (selectedOption == \"Event\") {\n //Search for events\n retrieveSelectedEvents(storyOrEvent, dateInfo);\n } else{\n retrieveSelectedStories(storyOrEvent, dateInfo); //Search for stories\n }\n}", "function searchEvents(searchFilter, searchCriteria) {\n $('#events-panel').show();\n $('#attraction-panel').hide();\n \n //Getting the date\n let date = new Date();\n let dd = date.getDate();\n let mm = date.getMonth() + 1;\n let yyyy = date.getFullYear();\n \n if (dd < 10) {\n dd = '0' + dd;\n }\n if (mm < 10) {\n mm = '0' + mm;\n }\n // 2017-12-06T16:37:00Z\n let today = yyyy + '-' + mm + '-' + dd + 'T00:00:00Z';\n console.log(today);\n \n if (page < 0) {\n page = 0;\n return;\n }\n if (page > 0) {\n if (page > getEvents.json.page.totalPages - 1) {\n page = 0;\n return;\n }\n }\n //Displaying the new results after the search \n $.ajax({\n type:\"GET\",\n url:\"https://app.ticketmaster.com/discovery/v2/events.json?\" + searchFilter + \"=\" + searchCriteria + \"&startDateTime=\" + today + \"&apikey=5QGCEXAsJowiCI4n1uAwMlCGAcSNAEmG&size=4&page=\"+page,\n async:true,\n dataType: \"json\",\n success: function(json) {\n getEvents.json = json;\n showEvents(json);\n },\n error: function(xhr, status, err) {\n console.log(err);\n }\n });\n}", "function filterByDate(sighting) {\n return sighting.datetime === inputDate;\n }", "function performSearch(callback) {\n\n var fromVal = document.getElementById('from').value;\n var toVal = document.getElementById('to').value;\n var targetDate = moment(document.getElementById(\"date\").value);\n var today = moment().format('YYYY-MM-DD');\n var diff = moment.duration(targetDate.diff(today)).asDays(); // determine difference between target date and today\n\n if(diff < 0) { \n alert(\"Sorry - can't book flights in the past !\");\n return callback(false);\n }\n\n if(!fromVal || !toVal || !targetDate.isValid()) {\n return callback(false);\n }\n\n var from = fromVal.match( /\\(([A-Z]*)\\)/ )[1]; // capture stuff inside parentheses\n var to = toVal.match( /\\(([A-Z]*)\\)/ )[1];\n var dateRangeOffset = diff < 2 ? -diff : -2; // ensure that date range never extends into the past \n\n // create a range of 5 dates, surrounding targetDate:\n var dates = [];\n for(var i = dateRangeOffset; i < dateRangeOffset + 5; i++) {\n dates.push(moment(targetDate).add(i, 'day').format('YYYY-MM-DD'));\n }\n\n getFlights(from, to, dates, function(flights) {\n if(flights) {\n var sortMode = $(\"input[name='sort-mode']:checked\").val();\n var descending = !!document.getElementById('descending').checked;\n var flightsSorted = sortFlights(flights, sortMode, descending);\n showFlights(flightsSorted, dates, 1-dateRangeOffset);\n callback(true);\n } else {\n callback(false);\n }\n });\n }", "handleChangeDate(value) {\n this.changeSearchWithType(null, null, value);\n }", "function search_data(input_date, input_state){\n tableData.forEach(function(the_date) { \n var date= the_date.datetime;\n var state= the_date.state;\n if(input_state==='') {\n state='';\n }\n \n\n console.log(\"state \", state);\n if(input_date === date && input_state === state) {\n date_selection.push(the_date); \n console.log(date, state, \" added to date_selection array\");\n } \n });\n console.log(date_selection)\n return(date_selection);\n}", "function handleFilterButtonClick() {\n var datefilter = $dateInput.value;\n\n\n // Filter on date\n if (datefilter != \"\") {\n tableData = data.filter(function(results) {\n var resultsDate = results.datetime;\n return resultsDate === datefilter;\n });\n } else { tableData };\n\n getTable();\n}", "function searchDate(keyDate, myArray){\n var count = 0;\n for (var i=0; i < myArray.length; i++) {\n\n if (myArray[i].date.getFullYear() == keyDate.getFullYear() &&\n myArray[i].date.getMonth() == keyDate.getMonth() &&\n myArray[i].date.getDate() == keyDate.getDate()) {\n count++;\n }\n }\n return count;\n }", "onSubmitSearch() { \n if ((!this.state.fromDate) || (!this.state.toDate)) {\n Alert.alert(\n '',\n 'Please select both start date and end date',\n [\n { text: 'OK', style: 'cancel' },\n ],\n );\n return false;\n }\n if ((new Date(this.state.fromDate)).getTime() > (new Date(this.state.toDate)).getTime()) {\n Alert.alert(\n '',\n 'End date should be greater than start date',\n [\n { text: 'OK', style: 'cancel' },\n ],\n );\n return false;\n }\n /* Get assignment list */\n this.getAssignmentList()\n }", "async searchActivity(searchObj) {\n let queryParams = ''\n const { startDate, endDate, tags, city, name } = searchObj //if a data is not given it will send undifined\n if(startDate) {\n queryParams += `startDate=${startDate}&`\n }\n if(endDate) {\n queryParams += `endDate=${endDate}&`\n }\n if(tags) {\n const stringTags = JSON.stringify(tags)\n queryParams += `tags=${stringTags}&`\n }\n if(city) {\n queryParams += `city=${city}&`\n }\n if(name) {\n queryParams += `name=${name}&`\n }\n const requiredActivities = await $.get(`/activity/?${queryParams}`)\n for(let i in requiredActivities){\n const d = new Date(requiredActivities[i].date)\n var year = d.getFullYear();\n var month = (\"0\" + (d.getMonth() + 1)).slice(-2);\n var day = (\"0\" + d.getDate()).slice(-2);\n requiredActivities[i].date = `${day}-${month}-${year}`\n }\n this.searchedActivities = requiredActivities\n }", "checksearchCriteria() {\n const { resolution, fromDate, toDate } = this.state;\n this.setState({\n disableBtn: true\n });\n let toDateTime = toDate.getTime();\n let frmDateTime = fromDate.getTime();\n if (toDateTime > frmDateTime) {\n switch (resolution) {\n case \"daily\":\n this.searchButtonValidator(3, 1);\n break;\n case \"weekly\":\n this.searchButtonValidator(3, 3);\n break;\n case \"monthly\":\n this.searchButtonValidator(12, 12);\n break;\n default:\n break;\n }\n }\n }", "function dateHandler() {\n\n d3.event.preventDefault();\n\n console.log(dateInput.property(\"value\"));\n\n // Create table showing filtered data\n var filterTable = tableData.filter(alienSighting => alienSighting.datetime === dateInput.property(\"value\"));\n\n // Display the filtered table\n alienData(filterTable);\n}", "function ordersByDate(str) {\n if (str == \"\") {\n document.getElementById(\"results\").innerHTML = \"\";\n return;\n } else {\n var type = \"date\";\n var xmlhttp = new XMLHttpRequest();\n xmlhttp.onreadystatechange = function () {\n if (this.readyState == 4 && this.status == 200) {\n document.getElementById(\"results\").innerHTML = this.responseText;\n }\n };\n xmlhttp.open(\"GET\", \"getOrders.php?type=\" + type + \"&q=\" + str, true);\n xmlhttp.send();\n }\n}", "function filterDataByDate(sample){\r\n\t\t\treturn (Date.parse(sample.date_local) == Date.parse(dateselector.node().value));\r\n\t\t\t}", "function order_search()\n{\n\tsearchval = $(\"#ordersearchval\").val();\n\tstartdate = $(\"#sdate\").val();\n\tenddate = $(\"#edate\").val();\n\n\t$baseurl = getBaseURL();\n\t$.ajax({\n\t url: $baseurl+\"admin/merchant_payment_search/\",\n\t type: \"post\",\n\t data : { 'sval':searchval,'stdate':startdate,'eddate':enddate},\n\t dataType: \"html\",\n\t success: function(responce){\n\t\t\t$(\"#userdata\").html(responce);\n\t }\n\t});\n}", "function filterDate(date){\n //Test\n console.log(\"I am filtering a date\")\n return date.datetime === inputValue;\n}", "function addArticleToArticleSearchDate(article) {\n var publishedDate = utils.correctDateInFuture(article['pub_date'].substring(0, 10), '-');\n \n if(articleSearchDate[publishedDate] === undefined) {\n articleSearchDate[publishedDate] = [ article ];\n } else {\n articleSearchDate[publishedDate].push( article );\n }\n}", "function searchDate () {\n // Grabs data from the \"Schedule a depo\" Sheet, iterates over each row, and pushes results to an array\n var results = [];\n var ss = SpreadsheetApp.getActive();\n var scheduleSheet = ss.getSheetByName('Schedule a depo');\n var allScheduledData = scheduleSheet.getRange(2, 1, scheduleSheet.getLastRow(), scheduleSheet.getLastColumn()).getValues();\n \n // Get query from the \"Infrastructure\" sheet\n var query = SpreadsheetApp.getActive().getSheetByName('Infrastructure').getRange(8, 2).getValue().toString();\n \n // Parse date query into month, day, and year\n var queryMonth = monthToMm(query.substring(4, 7));\n var queryDay = query.substring(8, 10);\n var queryYear = query.substring(11, 15);\n \n // Grabs data from the \"Schedule a depo\" Sheet, iterates over each row, and pushes results to an array\n var allScheduledData = scheduleSheet.getRange(2, 1, scheduleSheet.getLastRow(), scheduleSheet.getLastColumn()).getValues();\n for (var i = 0; i < allScheduledData.length; i++) {\n var isMatch = matchDate(queryMonth, queryDay, queryYear, allScheduledData[i][1]);\n if (isMatch == true) {\n results.push(allScheduledData[i]);\n };\n };\n \n var resultString = ''; \n \n // Determines whether results were found, prints response on Search Sheet \n if (results.length == 0) {\n var rawDate = query.toString();\n var date = rawDate.substring(0, 15);\n return '⚠️ No depositions found matching ' + date + '. Make sure the date entered is in month/day/year format.';\n } else {\n\n // Format the string contribution for each result \n for (var i = 0; i < results.length; i++) {\n var resultCount = i + 1;\n resultString += '<strong>↩ Result ' + resultCount + '</strong><br>';\n var rawDate = results[i][1].toString();\n var date = rawDate.substring(0, 15);\n var witness = results[i][2];\n var orderer = results[i][3];\n var firm = results[i][7];\n var ordererEmail = results[i][4];\n var caseStyle = results[i][5];\n var services = results[i][23];\n var courtReporter = results[i][24];\n var videographer = results[i][25];\n var pip = results[i][26];\n var depoCity = results[i][19];\n var depoState = results[i][20];\n resultString += '1️⃣ Key Information:<br>Witness: <em>' + witness + '</em><br>Firm: <em> '+ firm + '</em><br>Ordered by: <em>' + orderer + '</em><br><br>2️⃣ Additional Information:<br>' + '</em>Orderer email: <em>' + ordererEmail + '</em><br>Case Style: <em>' + caseStyle + '</em><br>Services: <em>' + services + '</em><br>Court reporter? <em>' + courtReporter + '</em><br>Videographer? <em>' + videographer + '</em><br>PIP? <em>' + pip + '</em><br>City: <em>' + depoCity + '</em><br>State: <em>' + depoState + '</em><br><br>';\n };\n };\n return resultString;\n}", "function filterByDate(fDate, filteredData){\n\t\t\t\t\tvar temp = [];\n\t\t\t\t\tvar iFDate = parseInt(fDate);\n\n\t\t\t\t\t//if filtered data is null then add authors that have dates\n\t\t\t\t\t//equal or less than the date filter provided\n\t\t\t\t\tif(filteredData === null){\n\t\t\t\t\t\tfor(var i = 0; i < scope.data.coauthors.length; i++){\n\t\t\t\t\t\t\tfor(var j = 0; j < scope.data.coauthors[i].dates.length; j++){\n\t\t\t\t\t\t\t\tif(iFDate <= parseInt(scope.data.coauthors[i].dates[j])){\n\t\t\t\t\t\t\t\t\ttemp.push(scope.data.coauthors[i]);\n\t\t\t\t\t\t\t\t\tbreak;\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} else {\n\t\t\t\t\t\tfor(var i = 0; i < filteredData.length; i++){\n\t\t\t\t\t\t\tfor(var j = 0; j < filteredData[i].dates.length; j++){\n\t\t\t\t\t\t\t\tif(iFDate <= parseInt(filteredData[i].dates[j])){\n\t\t\t\t\t\t\t\t\ttemp.push(filteredData[i]);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//return the results\n\t\t\t\t\treturn temp;\n\t\t\t\t}", "function filterRequestByDate(requestList) {\n const filteredData = requestList.filter(function (request) {\n // console.log(\"Request Date : \", request.date);\n // console.log(\"dateQuery.starDate : \", dateQuery.startDate);\n // console.log(\"request.date >= dataQuery.startDate\", (request.date >= dateQuery.startDate))\n return (\n request.date >= dateQuery.startDate && request.date <= dateQuery.endDate\n );\n });\n return filteredData;\n }", "function executeAssociatedDateCondition(options) {\n const filterSearchType = options && (options.filterSearchType || options.fieldType) || FieldType.dateIso;\n const FORMAT = mapMomentDateFormatWithFieldType(filterSearchType);\n const searchTerms = Array.isArray(options.searchTerms) && options.searchTerms || [];\n let isRangeSearch = false;\n let dateSearch1;\n let dateSearch2;\n // return when cell value is not a valid date\n if (searchTerms.length === 0 || searchTerms[0] === '' || searchTerms[0] === null || !moment$3(options.cellValue, FORMAT, true).isValid()) {\n return false;\n }\n // cell value in moment format\n const dateCell = moment$3(options.cellValue, FORMAT, true);\n if (searchTerms.length === 2 || (searchTerms[0].indexOf('..') > 0)) {\n isRangeSearch = true;\n const searchValues = (searchTerms.length === 2) ? searchTerms : searchTerms[0].split('..');\n const searchValue1 = (Array.isArray(searchValues) && searchValues[0] || '');\n const searchValue2 = (Array.isArray(searchValues) && searchValues[1] || '');\n const searchTerm1 = moment$3(searchValue1, FORMAT, true);\n const searchTerm2 = moment$3(searchValue2, FORMAT, true);\n // return if any of the 2 values are invalid dates\n if (!moment$3(searchTerm1, FORMAT, true).isValid() || !moment$3(searchTerm2, FORMAT, true).isValid()) {\n return false;\n }\n dateSearch1 = moment$3(searchTerm1, FORMAT, true);\n dateSearch2 = moment$3(searchTerm2, FORMAT, true);\n }\n else {\n // return if the search term is an invalid date\n if (!moment$3(searchTerms[0], FORMAT, true).isValid()) {\n return false;\n }\n dateSearch1 = moment$3(searchTerms[0], FORMAT, true);\n }\n // run the filter condition with date in Unix Timestamp format\n if (isRangeSearch) {\n const isInclusive = options.operator && options.operator === OperatorType.rangeInclusive;\n const resultCondition1 = testFilterCondition((isInclusive ? '>=' : '>'), parseInt(dateCell.format('X'), 10), parseInt(dateSearch1.format('X'), 10));\n const resultCondition2 = testFilterCondition((isInclusive ? '<=' : '<'), parseInt(dateCell.format('X'), 10), parseInt(dateSearch2.format('X'), 10));\n return (resultCondition1 && resultCondition2);\n }\n return testFilterCondition(options.operator || '==', parseInt(dateCell.format('X'), 10), parseInt(dateSearch1.format('X'), 10));\n}", "findByDate (req, res) {\n return availability\n .findAll({\n where: {\n doctor_id: req.params.doctor,\n date: req.params.date\n }\n })\n .then(availability => res.status(200).send(availability))\n .catch(error => res.status(400).send(error))\n }", "function dateSelect() {\r\n // Prevent the page from refreshing\r\n event.preventDefault();\r\n\r\n // change date format to datetime\r\n tableData.forEach(row => row.datetime = new Date(row.datetime));\r\n\r\n // save user input\r\n // d3 object\r\n var userDate = d3.select('#datetime').property('value');\r\n console.log(userDate);\r\n // format to datetime\r\n var userDateFormatted = new Date(userDate);\r\n console.log(userDateFormatted);\r\n\r\n // filter data table by user input\r\n // add if else to enable non-date searches\r\n if (userDate !== '') {\r\n var newData = tableData.filter(function(row) {\r\n var rowDate = row.datetime;\r\n return rowDate.getTime() === userDateFormatted.getTime();\r\n });\r\n }\r\n\r\n else {\r\n var newData = tableData;\r\n };\r\n \r\n var finalData = filterSightings(newData);\r\n console.log(finalData);\r\n\r\n // populate table\r\n tableAppend(finalData);\r\n}", "function handleSearchButtonClick() {\n var filterDate = $dateTimeInput.value.trim();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n if (filterDate != \"\") {\n filteredData = filteredData.filter(function (date) {\n var dataDate = date.datetime;\n return dataDate === filterDate;\n });\n\n }\n\n if (filterCity != \"\") {\n filteredData = filteredData.filter(function (city) {\n var dataCity = city.city;\n return dataCity === filterCity;\n });\n }\n\n if (filterState != \"\") {\n filteredData = filteredData.filter(function (state) {\n var dataState = state.state;\n return dataState === filterState;\n });\n }\n\n if (filterCountry != \"\") {\n filteredData = filteredData.filter(function (country) {\n var dataCountry = country.country;\n return dataCountry === filterCountry;\n });\n }\n\n if (filterShape != \"\") {\n filteredData = filteredData.filter(function (shape) {\n var dataShape = shape.shape;\n return dataShape === filterShape;\n });\n }\n\n renderTable();\n}", "function runEnterDate(){\n\n // Clear the table from index.html\n tbody.html(\"\");\n\n // Prevent the page \".event\" from refreshing \n d3.event.preventDefault();\n\n // Select the input element to get the raw HTML node\n var inputElementData=d3.select(\"#datetime\");\n\n\n // On the \"inputElement\", get the value of the property\n var inputValueData=inputElementData.property(\"value\");\n\n\n // Console out the user's input date in date format\n // console.log(inputValue);\n\n // Filter the each info, select a piece of info if its datetime equals the inputValue\n var filteredData=tableData.filter(info=>info.datetime===inputValueData); \n\n // Console out the rows of date user is looking for\n console.log(filteredData);\n\n // Display the rows user is searching for in table in html\n filteredData.map(processData);\n\n}", "function SearchKPIByDate(date) {\n var returnArr = new Array();\n var locStorage = new Storage();\n\n\n var counter = 0;\n for(var i=0, l=locStorage.size(); i<l; i++) {\n var value = locStorage.get(i); \n if (FormatDate(value.KPI_Date).getMonth() == date.getMonth()) {\n if (FormatDate(value.KPI_Date).getFullYear() == date.getFullYear()) {\n var dataPoint = new Array(2);\n dataPoint[0] = value.KPI_Name;\n dataPoint[1] = value.KPI_Value;\n returnArr.push(dataPoint);\n }\n }\n }\n return returnArr;\n}", "function filterbyDate(dataset, inDateStr) {\n // initialize filterdData array\n var filteredData = [];\n\n // parse the date and check to see if valid date\n var parseDate = d3.timeParse(\"%m/%d/%Y\");\n var inputDate = parseDate(inDateStr);\n \n if (inputDate !== null) {\n console.log(`${inDateStr} parsed to datetime: ${inputDate}`);\n\n // filter table by date-time that is taken from inputvalue.\n // var filteredData = tableData.filter(report => (parseDate(report.datetime) == inputDate));\n filteredData = \n dataset.filter(report => (parseDate(report.datetime).getTime() === inputDate.getTime()));\n\n // console.log(filteredData);\n \n } else {\n console.log(`INPUT ERROR: Invalid date entered: ${inDateStr}`)\n }\n\n return filteredData\n}", "search() {\n\t\t// check that we have good search dates\n\t\tif (!this.searchDates || this.searchDates.start > this.searchDates.stop) {\n\t\t\treturn [];\n\t\t}\n\n\t\t// no reservations otherwise means everything is available\n\t\tif (this.reservations.length === 0) {\n\t\t\treturn this.campsites;\n\t\t}\n\n\t\t// perform search if we have valid input\n\t\treturn this.linearSearch();\n\t}", "search(start_date, end_date,token ) {\n \n axios.get(`https://api.giosg.com/api/reporting/v1/rooms/84e0fefa-5675-11e7-a349-00163efdd8db/chat-stats/daily/?start_date=${start_date}&end_date=${end_date}`,{\n headers: {\n 'Authorization': `token ${token}`\n }\n })\n .then(response => {\n console.log(response)\n this.setState({datas: response.data})\n this.setState({data_found: true})\n })\n .catch(error=>{\n console.log(error)\n this.setState({errorMsg: 'Error retreiving data'})\n this.setState({data_found: false})\n })\n\n }", "function filterDate() {\r\n var startDate = new Date(\"2015-08-04\");\r\n var endDate = new Date(\"2015-08-12\");\r\n\r\n var resultProductData = product_data.filter(function(a) {\r\n var hitDates = a.ProductHits || {};\r\n // extract all date strings\r\n hitDates = Object.keys(hitDates);\r\n // improvement: use some. this is an improment because .map()\r\n // and .filter() are walking through all elements.\r\n // .some() stops this process if one item is found that returns true in the callback function and returns true for the whole expression\r\n hitDateMatchExists = hitDates.some(function(dateStr) {\r\n var date = new Date(dateStr);\r\n return date >= startDate && date <= endDate\r\n });\r\n return hitDateMatchExists;\r\n });\r\n console.log(resultProductData);\r\n}", "function getEntriesByDate(date) {\n return rest.one('date', date).get();\n }", "function search() {\n restartSearch();\n if (searchField.val()) {\n dt.search(searchField.val()).draw();\n }\n if (searchSelect.val()) {\n dt.columns(2).search(searchSelect.val()).draw();\n }\n}", "function updateEnterDate(data_) {\n inputElement = d3.select(\"input#datetime\")\n\n var date = inputElement.property(\"value\");\n\n if ( date != '' ) {\n var filteredData = data_.filter(function (row) {\n return Date.parse(row.datetime) <= Date.parse(date)\n });\n }\n else {\n var filteredData = data_\n }\n return filteredData\n}", "function handleSearchButtonClick() {\n // prevents the page from refreshing when an action is done\n d3.event.preventDefault();\n\n // extract the text from the dateInput element\n var userDate = $dateInput.property('value');\n console.log('userDate:', userDate);\n\n // clear the html (delete all of the old rows)\n tbody.html('');\n\n // for loop, but filtering out only what matches the input\n for (let i = 0; i < data.length; i += 1) {\n // console.log(data[i]); //data[0], data[1], data[2], ...\n // grab reference to the dictionary and storing it in a variable\n let sighting = data[i];\n\n if (sighting['datetime'] == userDate) {\n\n // creating a row and adding it to the table body\n let row = tbody.append('tr');\n\n // create 7 cells with their respective values and adding them to the row\n // Date\tCity\tState\tCountry\tShape\tDuration\tComments\n row.append('td').text(sighting['datetime']);\n row.append('td').text(sighting['city']);\n row.append('td').text(sighting['state']);\n row.append('td').text(sighting['country']);\n row.append('td').text(sighting['shape']);\n row.append('td').text(sighting['durationMinutes']);\n row.append('td').text(sighting['comments']);\n\n }\n\n }\n}", "function createSearchEntry(query, searchDate, sortChoice) {\n\t\t//direct the browser to the search form end point\n\t\tbrowser.get(ROOT + '/');\n\t\t//find element by its ng-model attribute value & enter query value into input\n\t element(by.model('query')).sendKeys(query);\n\t \t//input date 5/1/2016 into both datepickers\n\t \telement.all(by.css('.md-datepicker-input')).sendKeys(searchDate);\n\t //and finally, the same w/ sort by 'newest' radio button\n\t element(by.id('newestRadio')).sendKeys(sortChoice);\n\t //after entering values, find & click submit button\n\t return element(by.css('button[type=submit]')).click();\n\t}", "function onChangeDatepicker(){\n vm.dateString = getFormattedDateString(vm.datepickerStartDate,\n vm.datepickerEndDate);\n performDateSearch();\n }", "function searchVisitHistory() {\r\n\t\r\n\thistoryClear();\t// Clear of the visit history table.\r\n\t\r\n\t// Set phone number\r\n\t//document.querySelector( '#usrId' ).value = document.querySelector( '#phone1' ).value + document.querySelector( '#phone2' ).value + document.querySelector( '#phone3' ).value;\r\n\t\r\n\tpageNo = firstPageNo;\t// Initiate variable of page number.\r\n\t\r\n\t// Check search conditions.\r\n\t//console.log( \"from = \" + document.querySelector( \"#sFromDate\" ).value );\r\n\t//console.log( \"to = \" + document.querySelector( \"#sToDate\" ).value );\r\n\tif( document.querySelector( \"#sFromDate\" ).value > document.querySelector( \"#sToDate\" ).value ) {\r\n\t\tshowComModal( {msg:mLang.get(\"checkdatestartandend\"),closeCallbackFnc:function(){ document.querySelector( \"#sFromDate\" ).nextElementSibling.focus() }} );\r\n\t \treturn false;\r\n\t}\r\n\t\r\n\t// Send ajax data.\r\n\tajaxSend( \"./findVisitHistory.json\" \r\n\t\t\t, { usrId\t: document.querySelector( 'input[name=\"usrId\"]'\t).value\r\n\t\t\t\t, fDt\t: document.querySelector( \"#sFromDate\" \t\t\t).value\r\n\t\t\t\t, tDt\t: document.querySelector( \"#sToDate\" \t\t\t).value\r\n\t\t\t\t, usrNm\t: document.querySelector( \"#usrNm\" \t\t\t).value\r\n\t\t\t }\r\n\t\t\t, searchVisitHistoryAft );\r\n\t\r\n}", "function searchAll(q, dspan, from, subject, where) {\n keywords = q\n current_retention = dspan\n current_query = q\n global_deep = true\n var wherel = \"*\"\n var whered = \"*\"\n if (where && where == 'xlist') {\n var a = xlist.split(/@/)\n wherel = a[0]\n whered = a[1]\n }\n var url = \"/api/stats.lua?list=\"+wherel+\"&domain=\"+whered+\"&q=\" + encodeURIComponent(q) + \"&d=\" + encodeURIComponent(dspan)\n if (from) {\n url += \"&header_from=\" + \"\\\"\"+ encodeURIComponent(from) + \"\\\"\"\n current_query += \" FROM:\" + \"\\\"\"+ encodeURIComponent(from) + \"\\\"\"\n }\n if (subject) {\n url += \"&header_subject=\\\"\" + encodeURIComponent(subject) + \"\\\"\"\n current_query += \" SUBJECT:\\\"\" + encodeURIComponent(subject) + \"\\\"\"\n }\n GetAsync(url, {\n deep: true\n }, buildPage)\n var arr = datePickerDouble(dspan)\n var howlong = arr[3]\n if (howlong == null || isNaN(howlong)) {\n howlong = \"custom date range\"\n } else {\n if (howlong >= 365) {\n howlong = parseInt(howlong/365) + \" year\"\n } else if (howlong >= 30) {\n howlong = \"last \" + parseInt(howlong/30) + \" month\" + (howlong>59 ? \"s\" : \"\")\n } else {\n howlong = howlong + \" day\"\n }\n }\n document.getElementById('listtitle').innerHTML = \"Deep Search, \" + howlong + \" view <a class='btn btn-warning' href='javascript:void(0);' onclick='getListInfo(xlist)'>Clear filters</a>\"\n clearCalendarHover()\n return false;\n}", "function queryEqualDate(path,key,date,criteria){\n\t\tif(!(date==null || date==\"\")) {\n\t\t\tstartAt=date+\"T00:00:00\";\n\t\t\tendAt=date+\" 23:59:59\";\n\t\t\tqueryBetween(path,key,startAt,endAt,criteria)\n\t\t}\n\t\telse throw {\"message\":\"Date cannot be null\"};\n\t}", "function searchButtonClick() {\r\n var filterDate = $dateTimeInput.value.trim();\r\n var filterCity = $cityInput.value.trim().toLowerCase();\r\n var filterState = $stateInput.value.trim().toLowerCase();\r\n var filterCountry = $countryInput.value.trim().toLowerCase();\r\n var filterShape = $shapeInput.value.trim().toLowerCase();\r\n\r\n if (filterDate != \"\") {\r\n filteredData = filteredData.filter(function (date) {\r\n var dataDate = date.datetime;\r\n return dataDate === filterDate;\r\n });\r\n\r\n }\r\n\r\n if (filterCity != \"\") {\r\n filteredData = filteredData.filter(function (city) {\r\n var dataCity = city.city;\r\n return dataCity === filterCity;\r\n });\r\n }\r\n\r\n if (filterState != \"\") {\r\n filteredData = filteredData.filter(function (state) {\r\n var dataState = state.state;\r\n return dataState === filterState;\r\n });\r\n }\r\n\r\n if (filterCountry != \"\") {\r\n filteredData = filteredData.filter(function (country) {\r\n var dataCountry = country.country;\r\n return dataCountry === filterCountry;\r\n });\r\n }\r\n\r\n if (filterShape != \"\") {\r\n filteredData = filteredData.filter(function (shape) {\r\n var dataShape = shape.shape;\r\n return dataShape === filterShape;\r\n });\r\n }\r\n\r\n renderTable();\r\n}", "function DateFilter(){\n // pull data for UFO sightings \n var filterDateTime = UFOsighting\n d3.event.preventDefault();\n\n // Set up a variable to hold the datetime entered by user\n var userDateTime=d3.select(\"#datetime\").property(\"value\");\n\n // Use input from field to filter the data for datetime\n // if user enters a datetime, filter data to include sightings that match the criteria\n if(userDateTime) {\n filterDateTime=filterDateTime.filter(item => item.datetime===userDateTime);\n };\n\n // run the createTable function with the filtered data\n createTable(filterDateTime);\n}", "function search(keyword, start_date, start_time, end_date, end_time, category, location){\n\n let searchRequest = {\"lost_or_found\": 0, // 0 == found\n \"keyword\": keyword,\n \"start_date\": start_date,\n \"start_time\": start_time,\n \"end_date\": end_date,\n \"end_time\": end_time,\n \"category\": category,\n \"location\":location}\n \n let xhr = new XMLHttpRequest();\n xhr.open(\"POST\",\"/search\");\n xhr.setRequestHeader('Content-Type', 'application/json')\n \n xhr.addEventListener(\"load\", function() {\n if (xhr.status == 200) {\n // Do something here with the results...\n console.log(xhr.responseText)\n \n var entries = JSON.parse(xhr.responseText)\n \n for(var i = 0; i < entries.length; i++){\n addNewResult(entries[i].title, \n entries[i].photo_url,\n entries[i].category,\n entries[i].location,\n entries[i].date,\n entries[i].description);\n }\n \n } else {\n console.log(\"ERROR IN search: \", xhr.responseText);\n }\n });\n xhr.send(JSON.stringify(searchRequest));\n}", "function filterByDay(val){\n return val.date == this;\n }", "function findHSIF_row_ByDate(date)\n{\n\t// var searchString = \"180112\";\n\tvar searchString = date;\n\tvar sheet = getSheetByName(\"HSIF\"); \n\tvar column =1; //column Index \n\tvar columnValues = sheet.getRange(2, column, sheet.getLastRow()).getValues(); //1st is header row\n\tvar searchResult = columnValues.findListListIndex(searchString) + 2; //Row Index - 2\n\n\t//return searchResult;\n\n\tif(searchResult != -1){\n //searchResult + 2 is row index.\n //setActiveRange(sheet.getRange(searchResult, 1))\n\t}\n}", "function searchIt() {\n var term = input.value();\n // Loop through every year\n for (var i = 0; i < total; i++) {\n var year = start + i;\n // Make the API query URL\n var url = makeURL(term, year);\n // Run the query and keep track of the index\n goJSON(url, i);\n }\n}", "function handleSearchButtonClick() {\n \n filteredData = dataSet;\n // Format the user's search by removing leading and trailing whitespace, lowercase the string\n var filterDatetime = $dateInput.value.trim().toLowerCase();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function(address) {\n var addressDatetime = address.datetime.toLowerCase();\n var addressCity = address.city.toLowerCase();\n var addressState = address.state.toLowerCase();\n var addressCountry = address.country.toLowerCase();\n var addressShape = address.shape.toLowerCase();\n\n\n\n if ((addressDatetime===filterDatetime || filterDatetime == \"\") && \n (addressCity === filterCity || filterCity == \"\") && \n (addressState === filterState || filterState == \"\") &&\n (addressCountry === filterCountry || filterCountry == \"\") && \n (addressShape === filterShape || filterShape ==\"\")){\n \n return true;\n }\n return false;\n console.log(filteredData);\n });\nloadList();\n}", "customDateFilter(date,view){\n\t\treturn true;\n\t}", "function search() {\n var searchTerm = $(\"#searchTerm\").val();\n var numRecords = $(\"#articleRetrieve\").val();\n var startYear = $(\"#startYear\").val();\n var endYear = $(\"#endYear\").val();\n\n var queryURL = 'https://api.nytimes.com/svc/search/v2/articlesearch.json?api-key=gnonuSaxEo5iK92FxNJduzfDGBhhhehk&fq=source:(\"The New York Times\")&q='+searchTerm;\n if (startYear!==\"\") {\n queryURL += \"&begin_date=\"+startYear+\"0101\";\n }\n if (endYear!==\"\") {\n queryURL += \"&end_date=\"+endYear+\"1231\";\n }\n\n $.ajax({\n url: queryURL,\n method: \"GET\"\n })\n .then(function(response) {\n console.log(response);\n\n\n\n\n });\n\n }", "function search() {\n __globspace._gly_searchadvanced.removeAll();\n _gly_ubigeo.removeAll();\n let sql = '1=1', \n idtable='#tbl_searchadvanced', \n isexportable=true, \n nquery=__query.length;\n\n // formación del sql \n for (let i = 0; i < nquery; i++){\n let item = __query[i],\n filter = item.filter.toUpperCase(),\n typedata=item.typedata,\n auxsql='';\n\n switch (typedata) {\n case 'double': case 'small-integer': case 'integer': case 'single':\n auxsql = ` ${item.fieldname} ${item.condition} \"${filter}\"`;\n break;\n case 'date':\n console.log(filter);\n let fi = moment(filter).add(5, 'hours').format('YYYY-MM-DD HH:mm:ss'); //consulta al servicio en hora utc (+5);\n let ff = moment(filter).add(29, 'hours').subtract(1, 'seconds').format('YYYY-MM-DD HH:mm:ss');\n \n if(item.condition == '=' || item.condition == 'contiene'){\n auxsql = `(${ item.fieldname } BETWEEN timestamp '${ fi }' AND timestamp '${ ff }')`;\n }else{\n if(item.condition == '<='){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${ff}'`; \n }else if(item.condition == '>='){\n fi = moment(filter).add(5, 'hours').subtract(1, 'seconds').format('YYYY-MM-DD HH:mm:ss');\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${fi}'`;\n }else if(item.condition == '>'){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${ff}'`;\n }else if(item.condition == '<'){\n auxsql = ` ${item.fieldname} ${item.condition} timestamp '${fi}'`;\n }\n }\n break;\n default:\n auxsql = `Upper(${item.fieldname}) ${item.condition} '${filter}'`;\n break;\n }\n\n if (item.option == '--') {\n if(typedata == 'date'){\n sql = auxsql;\n }else{\n item.condition == 'contiene' ? sql += ` and Upper(${item.fieldname}) like '%${filter}%'` : sql = auxsql;\n }\n } else {\n if(typedata == 'date'){\n sql += ` ${item.option} ${auxsql}`;\n }else{\n item .condition == 'contiene' ? sql += ` ${item.option} Upper(${item.fieldname}) like '%${filter}%'` : sql += ` ${item.option} ${auxsql}`;\n }\n }\n }\n \n __globspace.currentview.graphics.remove(_gra_ubigeo);\n\n // si se a selecionado un item de ubigeo primero obtengo la geometria del ubigeo y luego la consulta propia\n if(__url_ubigeo!=''){\n let _queryt = new QueryTask({url:__url_ubigeo}),\n _qparams = new Query(); \n _qparams.returnGeometry = true;\n _qparams.where = __sql_ubigeo;\n\n _queryt.execute(_qparams).then(function(response){\n \n __ubigeogeometry=response.features[0].geometry;\n\n let _queryt2 = new QueryTask({url:__url_query}),\n _qparams2 = new Query(); \n\n _qparams2.where = sql;\n _qparams2.outFields = [\"*\"];\n _qparams2.geometry = __ubigeogeometry;\n _qparams2.spatialRelationship = \"intersects\";\n _qparams2.returnGeometry = true;\n\n _queryt2.execute(_qparams2).then(function(response){\n let nreg = response.features.length;\n let fields = response.fields;\n if(nreg==0){\n alertMessage(\"La consulta no tiene registros a mostrar\", \"warning\",'', true)\n Helper.hidePreloader();\n }else{\n if(nreg>=1000){\n alertMessage('El resultado supera el límite, por ello solo se muestra los primeros 1000 registros. \\n Para mejorar su consulta, ingrese más filtros.','warning', 'bottom-right');\n }\n Helper.loadTable(response, fields, __titlelayer, idtable, isexportable);\n // Helper.renderToZoom(response, __globspace._gly_searchadvanced);\n Helper.renderGraphic(response, __globspace._gly_searchadvanced);\n\n\n if(Object.keys(_gra_ubigeo).length ==0){\n _gra_ubigeo = new Graphic({\n geometry: __ubigeogeometry, \n symbol:_symbol,\n });\n }\n _gra_ubigeo.geometry=__ubigeogeometry;\n __globspace.currentview.graphics.add(_gra_ubigeo);\n __globspace.currentview.when(function () {\n __globspace.currentview.goTo({\n target: __ubigeogeometry\n });\n });\n }\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\", error);\n })\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\", error);\n })\n }else{\n let _queryt = new QueryTask({url:__url_query}),\n _qparams = new Query();\n\n _qparams.where = sql;\n _qparams.outFields = [\"*\"];\n _qparams.returnGeometry = true;\n\n _queryt.execute(_qparams).then(function(response){\n let nreg = response.features.length;\n let fields = response.fields;\n if(nreg==0){\n alertMessage(\"La consulta no tiene registros a mostrar\", \"warning\", '', true);\n Helper.hidePreloader();\n }else{\n if(nreg>=1000){\n alertMessage('El resultado supera el límite, por ello solo se muestra los primeros 1000 registros. \\n Para mejorar su consulta, ingrese más filtros.','warning', 'bottom-right');\n }\n Helper.loadTable(response, fields, __titlelayer, idtable, isexportable);\n Helper.renderToZoom(response, __globspace._gly_searchadvanced);\n }\n }).catch(function (error) {\n Helper.hidePreloader();\n console.log(\"query task error\");\n console.log(error);\n })\n }\n }", "function handleClick() {\n d3.event.preventDefault();\n\n let date = d3.select('datetime').property('value');\n let filterData = tableData;\n\n // Conditional filter for search\n if(date) {\n filterData = filterData.filter((row) => row.datetime === date);\n }\n\n buildTable(filterData);\n\n}", "function handleClick(){\n // Cancels the event if it is cancelable\n d3.event.preventDefault();\n // Define variable that represents the request for the datetime value as the search criteria\n let date = d3.select(\"#datetime\").property(\"value\");\n // Create copy of tableData variable with a new name 'filterData' to use in if statement\n let filterData = tableData;\n\n // If 'date' variable is equal to {}\n if(date) {\n // Filter through the data.js data, determine if datetime value input equals 'date' and return results\n filterData = filterData.filter((row) => row.datetime === date);\n }\n // Build a table from the filtered data\n buildTable(filterData);\n}", "changeDateFilter(tab, event) {\n const {setProp} = this.props;\n const value = event.target.value;\n setProp(value, 'search', tab, 'filter');\n // Revert to page one, update search\n const search = this.updateBeforeRetrieval(tab, 'filter', value);\n this.retrieveRecords(tab, search);\n }", "function performSearchFromHompage(){\n\tvar queryString = new Array();\n\t//Logic below credits go to aspdotnetcodebook-blogspot-com from StackOverflow\n\tif (queryString.length == 0) {\n if (window.location.search.split('?').length > 1) {\n var params = window.location.search.split('?')[1].split('&');\n for (var i = 0; i < params.length; i++) {\n var key = params[i].split('=')[0];\n var value = decodeURIComponent(params[i].split('=')[1]);\n queryString[key] = value;\n }\n }\n }\n if (queryString[\"datesearch\"] != null) {\n var data = \"\";\n data += queryString[\"datesearch\"];\n searchDatabase(data);\n displayActivitiesByName(data);\n }else if(queryString[\"selectedDateplan\"] != null){\n \tvar data = \"\";\n data += queryString[\"selectedDateplan\"];\n \tgetFullDatePlanByID(data);\n }\n else if(queryString[\"selectedActivity\"] != null){\n \tvar data = \"\";\n data += queryString[\"selectedActivity\"];\n \tgetActivityById(data);\n }\n}", "function XayDungChuoiGiaTriSearch() {\n var chuoiSearch = \"\";\n chuoiSearch = $(\"#textboxsearch\").val().trim().replace(\"_\", \"\");\n $(\"#groupbuttondate button\").each(function (index) {\n if ($(this).hasClass(\"btn-primary\")) {\n var fd = \"\", td = \"\";\n if ($(this).attr(\"name\") == \"other\") {\n fd = $(\"#startdate\").val();\n td = $(\"#enddate\").val();\n if (fd == \"\" || td == \"\") {\n var today = new Date();\n fd = td = (today.getDate() + '/' + (today.getMonth() + 1) + '/' + today.getFullYear());\n }\n chuoiSearch += \"_\" + fd + \"_\" + td + \"_false\";\n }\n else {\n chuoiSearch += GetDateForQuery(index);\n }\n }\n });\n\n $(\"#checkliststatus input[type='checkbox']\").each(function (index) {\n chuoiSearch += \"_\" + this.checked;\n });\n $(\"#checklistpriority input[type='checkbox']\").each(function (index) {\n chuoiSearch += \"_\" + this.checked;\n });\n $(\"#checklistbug input[type='checkbox']\").each(function (index) {\n chuoiSearch += \"_\" + this.checked;\n });\n $(\"#ListSearchForTask\").load($(\"#buttonsearch\").attr(\"data-button-search\") + \"?q=\" + chuoiSearch + \"&pid=\" + $(\"#hiddenprojectid\").val() + \"&page=\");\n}", "function filteredDate(dateValue,cityValue,stateValue,countryValue,shapeValue) {\n var tableDataFiltered = tableData.filter(d => d.datetime === dateValue \n || d.city === cityValue\n || d.state === stateValue\n || d.country === countryValue\n || d.shape === shapeValue)\n return tableDataFiltered;\n}", "async searchForVisitsUsingIdAndDate(url, venueid, date) {\r\n const query = `${url}/visit?restaurantid=${venueid}&visitdate=${date}`;\r\n return await axios.get(query);\r\n }", "function inputDateSearch(inputDate) {\n\n //console.log(\"else inputDate: \" + inputDate);\n \n //FILTER BY INPUT DATE\n function filterByDate(sighting) {\n return sighting.datetime === inputDate;\n }\n \n //Use the filterByDate function and .filter to extract tableData\n var filteredTableData = data.filter(filterByDate);\n console.log(filteredTableData);\n \n //Loop through the filteredTableData and log each UFO sighting\n filteredTableData.forEach(function(daysighting) {\n\n //use d3 to reference table body for adding data fields\n var tbody = d3.select(\"tbody\");\n\n //make new row in tbody\n var row = tbody.append(\"tr\");\n\n //use Object.entries on sighting to get all key, value pairs.\n var ufos = Object.entries(daysighting);\n \n //Arrays from Object.entries ar correct.\n //console.log(ufos);\n\n //using map produces an listing of arrays for key, value pairs I called value.\n ufos.map(function(value) {\n\n //console.log(value[1]); gives second element in value arrays\n \n var cell = row.append(\"td\");\n \n //each array called value in the .map function has the value at [1]\n cell.text(value[1]);\n });\n });\n }", "function filterResults(){\n\t// Set filters to localstorage\n\tvar formName = $(\"#searchTitle\").val();\n\tvar beginHour = $(\"#beginHour\").val();\n\tvar beginMin = $(\"#beginMin\").val();\n\t\n\tvar endHour = $(\"#endHour\").val();\n\tvar endMin = $(\"#endMin\").val();\n\t\n\tvar beginTime = beginHour + beginMin;\n\tvar endTime = endHour + endMin;\n\t//var beginTime = beginMin + \"\" + beginHour;\n\n\tsearchResults(formName, beginTime, endTime);\n}", "function buttonClick(){\n // Prevent the page from refreshing\n d3.event.preventDefault();\n // Create & display new table with filtered/searched data\n var filtered_table = tableData.filter(ufo_sighting => ufo_sighting.datetime===dateInputText.property(\"value\"))\n displayData(filtered_table);\n}", "function getNews(query, fromPublishedDate, toPublishedDate){\n $('.loader').removeClass('hidden');\n var params = {\n \"autoCorrect\": \"false\",\n\t \"pageNumber\": itemNumber,\n\t \"pageSize\": pageSize,\n\t \"q\": query,\n \"fromPublishedDate\": fromPublishedDate,\n \"toPublishedDate\": toPublishedDate\n }\n \n const options = {\n headers: new Headers({\n \"x-rapidapi-host\": \"contextualwebsearch-websearch-v1.p.rapidapi.com\",\n \"x-rapidapi-key\": key\n })\n };\n\n const queryString = formatQueryParams(params);\n const url = searchUrl + '?' + queryString;\n\n fetch(url, options)\n .then(response => { \n $('.loader').addClass('hidden');\n $('.news-section-title').removeClass('hidden');\n if(response.ok){\n return response.json();\n }\n throw new Error(response.statusText);\n })\n .then(responseJson => displayNewsResults(responseJson, pageSize))\n .catch (err => {\n console.log(`${err.message}`);\n });\n}", "function getLuceneDateString(date)\r\n{\r\n var temp = new Date();\r\n temp.setTime(Date.parse(date));\r\n return temp.getFullYear() + \"-\" + (temp.getMonth() + 1) + \"\\\\-\" +\r\n (temp.getDate() < 10 ? \"0\" + temp.getDate() : temp.getDate()) + \"T00:00:00\";\r\n}", "function dataFilter() { \n\n // Select the date from the in put\n var date = inputField.property(\"value\");\n\n // Set temporary variable to be written over with reduced data\n tempData = tableData;\n\n // Condition to check date goes here, if DNE or empty then load normally\n if (date) { // This will check if there is a value that have been passed\n tempData = tempData.filter(ufoData => ufoData.datetime === date)\n }\n\n tableTalk(tempData);\n}", "function search() {\n\t\n}", "getAllDocumentsByDate(req, res) {\n const { page, limit } = req.params;\n\n return Document.find({\n dateCreated: {\n $gt: moment().subtract(1, 'day'),\n $lt: moment().add(1, 'day'),\n },\n })\n .skip((page - 1) * limit)\n .limit(limit)\n .then((documents) => res.json(documents))\n .catch((err) => res.send(err));\n }", "function search(){\n\tvar searchString=document.getElementById(\"search-box\").value;\n\tvar filteredData=[];\n\tfor(i=0;i<object.Data.length;i++){\n\t\tif(object.Data[i].Name.indexOf(searchString)==-1 && object.Data[i].Technician.indexOf(searchString)==-1 && object.Data[i].Order_Date.indexOf(searchString)==-1 && \n\t\tobject.Data[i].Type.indexOf(searchString)==-1 && object.Data[i].Cell_Number.indexOf(searchString)==-1 && object.Data[i].Email.indexOf(searchString)==-1 &&\n\t\tobject.Data[i].Order.indexOf(searchString)==-1){\n\t\t}\n\t\telse{\n\t\t\tfilteredData[filteredData.length]=object.Data[i];\n\t\t}\n\t}\n\tloaddata(filteredData);\n}", "function searchButtonClick() {\n var dateFilter = $dateInput.value;\n var stateFilter = $stateInput.value.trim().toLowerCase();\n var cityFilter = $cityInput.value.trim().toLowerCase();\n var countryFilter = $countryInput.value.trim().toLowerCase();\n var shapeFilter = $shapeInput.value.trim().toLowerCase();\n\n // Date Filter\n if (dateFilter != \"\") {\n tableData = data.filter(function (sighting) {\n var sightingDate = sighting.datetime;\n return sightingDate === dateFilter;\n });\n }\n else { tableData };\n\n // State Filter\n if (stateFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingState = sighting.state;\n return sightingState === stateFilter;\n });\n }\n else { tableData };\n\n // City Filter\n if (cityFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingCity = sighting.city;\n return sightingCity === cityFilter;\n });\n }\n else { tableData };\n\n // Country Filter\n if (countryFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingCountry = sighting.country;\n return sightingCountry === countryFilter;\n });\n }\n else { tableData };\n\n // Shape Filter\n if (shapeFilter != \"\") {\n tableData = tableData.filter(function (sighting) {\n var sightingShape = sighting.shape;\n return sightingShape === shapeFilter;\n });\n }\n else { tableData };\n\n populateTable();\n}", "function valSearchGirviByDateInputs(obj) {\r\n if (validateSelectField(document.search_girvi_panel.dayDD.value, \"Please select Day in Date!\") == false) {\r\n document.search_girvi_panel.dayDD.focus();\r\n return false;\r\n } else if (validateSelectField(document.search_girvi_panel.monthMonth.value, \"Please select Month in Date!\") == false) {\r\n document.search_girvi_panel.monthMonth.focus();\r\n return false;\r\n } else if (validateSelectField(document.search_girvi_panel.yearYYYY.value, \"Please select Year in Date!\") == false) {\r\n document.search_girvi_panel.yearYYYY.focus();\r\n return false;\r\n }\r\n return true;\r\n}", "function dateEvent(obj, index) {\n var value = document.querySelector(\"#mathjax-container > div.article-wrapper.u-padding-s-top.grid.row > article > div.Copyright > span\");\n window.ScraperExt.push(value.innerHTML);\n nextSearchItem(obj, index + 1);\n}", "function dateFilter() {\n //check empty fields\n if ($('#from-date').val() === \"\" || $('#to-date').val() === \"\") {\n alert(\"هر دو فیلد تاریخ را پر کنید\")\n } else {\n\n $.ajax({\n type: \"POST\",\n url: \"/companies/filter\",\n data: {\n dateFrom: $('#from-date').val(),\n dateTo: $('#to-date').val()\n },\n success: function (res) {\n if (res === \"notFound\") {\n alert(\"در این بازه شرکتی وجود ندارد\")\n } else {\n document.location = '/companies/allCompanies';\n }\n },\n error: function (err) {\n document.location = '/error'\n }\n });\n }\n}", "function todoQueryFilter(evt){\n if(evt.shiftKey || evt.altKey)\n {\n var clickedElem = evt.target\n var clickedElemText = clickedElem.innerText\n clickedElemText = clickedElemText.toLowerCase()\n\n if(clickedElemText.includes(\"query:\") || clickedElemText.includes(\"[[query]]:\"))\n {\n var querySyntax = clickedElemText\n var startOfBetween = querySyntax.indexOf('between:')\n if(startOfBetween < 0){return;} //Exit function as no between query parameter\n var hiddenCtr = 0;\n\n var phToday = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate())\n var phTomorrow = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()+1)\n var phNextWeek = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()+7)\n var phNextMonth = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()+31)\n var phYesterday = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()-1)\n var phLastWeek = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()-7)\n var phLastMonth = new Date(new Date().getFullYear(),new Date().getMonth() , new Date().getDate()-31)\n\n //Find \"between\"\n var afterBetween = querySyntax.substring(startOfBetween + 8)\n var endOfBetween = afterBetween.indexOf('}')\n var dateRangeStr = afterBetween.substring(0,endOfBetween).trim()\n var startDateStr = dateRangeStr.substring(0,dateRangeStr.indexOf(' [[')).trim().split(\"[\").join(\"\").split(\"]\").join(\"\")\n var endDateStr = dateRangeStr.substring(dateRangeStr.indexOf(' [[')).trim().split(\"[\").join(\"\").split(\"]\").join(\"\")\n var startDate\n var endDate\n\n //console.log(startDateStr)\n //console.log(endDateStr)\n\n switch(startDateStr)\n {\n case 'today':\n startDate = Date.parse(phToday)\n break;\n case 'tomorrow':\n startDate = Date.parse(phTomorrow)\n break;\n case 'next week':\n startDate = Date.parse(phNextWeek)\n break;\n case 'next month':\n startDate = Date.parse(phNextMonth)\n break;\n case 'yesterday':\n startDate = Date.parse(phYesterday)\n break;\n case 'last week':\n startDate = Date.parse(phLastWeek)\n break;\n case 'last month':\n startDate = Date.parse(phLastMonth)\n break;\n default:\n startDateStr = startDateStr.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\")\n startDate = Date.parse(startDateStr)\n }\n\n switch(endDateStr)\n {\n case 'today':\n endDate = Date.parse(phToday)\n break;\n case 'tomorrow':\n endDate = Date.parse(phTomorrow)\n break;\n case 'next week':\n endDate = Date.parse(phNextWeek)\n break;\n case 'next month':\n endDate = Date.parse(phNextMonth)\n break;\n case 'yesterday':\n endDate = Date.parse(phYesterday)\n break;\n case 'last week':\n endDate = Date.parse(phLastWeek)\n break;\n case 'last month':\n endDate = Date.parse(phLastMonth)\n break;\n default:\n endDateStr = endDateStr.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\")\n endDate = Date.parse(endDateStr)\n }\n\n if(endDate < startDate)\n {\n var tmpEndDate = endDate\n endDate = startDate\n startDate = tmpEndDate\n }\n\n var queryParent = clickedElem.parentElement\n var queryResults = queryParent.getElementsByClassName(\"rm-mentions refs-by-page-view\");\n queryResults = queryResults[0]\n var childrenResult = queryResults.children;\n\n //Loop through each page that has query results\n for (var i = 0; i < childrenResult.length; i++)\n {\n //LOOPING THROUGH EACH \"PAGE\" that has query results under it\n\n var eachChild = childrenResult[i];\n var pageTitle = eachChild.getElementsByClassName(\"rm-ref-page-view-title\");\n pageTitle = pageTitle[0]\n var pageTitleStr = pageTitle.innerText\n //Check if page title is a date\n //Don't actually use this part for anything but leaving in for future\n pageTitleStr = pageTitleStr.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\")\n var pgDateTimeValue = Date.parse(pageTitleStr)\n if(isNaN(pgDateTimeValue))\n {\n //console.log(\"PAGE is Not a date\")\n }\n else\n {\n //console.log(\"PAGE is a date\")\n }\n\n var childSections = eachChild.getElementsByClassName(\"rm-reference-item\");\n for (var j = 0; j < childSections.length; j++)\n {\n //LOOPING THROUGH EACH \"SECTION\" (nested location of the blocks) THAT HAS BLOCK RESULTS FOR QUERY\n\n eachSection = childSections[j]\n\n //console.log('*******************************')\n //console.log(eachSection.innerText)\n //console.log('*******************************')\n\n //Look for any dates in the \"parent\" blocks which are called \"zoom mentions\" in Roam html\n var zoomMentions = eachSection.getElementsByClassName(\"rm-zoom zoom-mentions-view\");\n zoomMentions = zoomMentions[0]\n //Find all page links / tags to see if are dates\n var parentDateLinks = zoomMentions.querySelectorAll('[data-link-title], [data-tag]')\n //Counting how many dates found in parent blocks inside the between range and also in future outside between range\n var parDatesFound = 0\n var parDatesIn = 0\n var parDatesFuture = 0\n\n for (var y = 0; y < parentDateLinks.length; y++)\n {\n //LOOPING THROUGH EACH PAGE/TAG TO SEE IF IT IS A DATE\n eachTag2 = parentDateLinks[y]\n\n if(eachTag2 !== null && eachTag2 !== 'undefined' && typeof eachTag2 !== 'undefined')\n {\n var startingDate2 = eachTag2.innerText\n //console.log(startingDate2)\n startingDate2 = startingDate2.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\").replace(\"#\",\"\")\n var dateTimeValue2 = Date.parse(startingDate2)\n if(isNaN(dateTimeValue2))\n {\n //console.log(\"Not a date...\")\n }\n else\n {\n parDatesFound = parDatesFound + 1\n if(dateTimeValue2 >= startDate && dateTimeValue2 <= endDate)\n {\n parDatesIn = parDatesIn + 1\n //console.log(\"Date FOUND in range!\")\n }\n else\n {\n //console.log(\"Date FOUND, but OUTSIDE range...\")\n //Check if future date (as opposed to before the between range)\n if(dateTimeValue2 > endDate)\n {\n //If future date then we want to hide because it really isn't \"past due\"\n parDatesFuture = parDatesFuture + 1\n }\n }\n }\n }\n else\n {\n //No pages/tags in block\n //console.log(\"No pages/tags found in parents\")\n }\n }\n\n var foundCtr = 0\n var childBlocks = eachSection.getElementsByClassName(\"roam-block dont-unfocus-block hoverparent rm-block-text\");\n for (var k = 0; k < childBlocks.length; k++)\n {\n //LOOPING THROUGH EACH BLOCK THAT IS RESULT OF QUERY\n\n eachBlock = childBlocks[k]\n //console.log(eachBlock.innerText)\n var dateLinks = eachBlock.querySelectorAll('[data-link-title], [data-tag]')\n var foundDates = 0\n var foundDateInRange = 0\n var foundDateInFuture = 0\n for (var x = 0; x < dateLinks.length; x++)\n {\n //LOOPING THROUGH EACH PAGE/TAG TO SEE IF IT IS A DATE\n\n eachTag = dateLinks[x]\n\n if(eachTag !== null && eachTag !== 'undefined' && typeof eachTag !== 'undefined')\n {\n //console.log(eachTag.innerText)\n var startingDate = eachTag.innerText\n startingDate = startingDate.replace(\"st,\",\",\").replace(\"rd,\",\",\").replace(\"th,\",\",\").replace(\"nd,\",\",\").replace(\"#\",\"\")\n var dateTimeValue = Date.parse(startingDate)\n if(isNaN(dateTimeValue))\n {\n //console.log(\"Not a date...\")\n }\n else\n {\n foundDates = foundDates + 1\n if(dateTimeValue >= startDate && dateTimeValue <= endDate)\n {\n foundDateInRange = foundDateInRange + 1\n //console.log(\"Date FOUND!\")\n //console.log(dateTimeValue)\n }\n else\n {\n //console.log(\"Date FOUND, but OUTSIDE between range...\")\n //Check if future date (as opposed to before the between range)\n if(dateTimeValue > endDate)\n {\n //If future date then we want to hide because it really isn't \"past due\"\n foundDateInFuture = foundDateInFuture + 1\n }\n }\n }\n }\n else\n {\n //No pages/tags in block\n }\n }\n\n if(foundDates > 0)\n {\n //Date(s) in child/TODO block\n if(foundDateInFuture > 0)\n {\n //Hide block as there is a future date in TODO block (not past due)\n eachBlock.style.display = \"none\"\n hiddenCtr = hiddenCtr + 1\n }\n else\n {\n //Keep showing block\n foundCtr = foundCtr + 1\n }\n }\n else if(parDatesFound > 0)\n {\n //Date(s) in parent block(s)\n if(parDatesFuture > 0)\n {\n //Hide block as no dates in child/TODO and there is a future date in parent block (not past due)\n eachBlock.style.display = \"none\"\n hiddenCtr = hiddenCtr + 1\n }\n else\n {\n //Keep showing block\n foundCtr = foundCtr + 1\n }\n }\n else\n {\n //No dates found in child/TODO or Parent blocks\n //Since it is showing up in query results, then the page its on must be a daily notes page within between range\n foundCtr = foundCtr + 1\n }\n }\n\n //Checks to see if any child/TODO block(s) were left shown, if so, do NOT hide the SECTION\n if(foundCtr == 0)\n {\n //console.log(\"Hiding this section...\")\n //console.log(eachSection)\n eachSection.style.display = \"none\"\n }\n }\n }\n console.log(hiddenCtr + \" items hidden\")\n }\n }\n}", "function search(q, d, nopush, all) {\n keywords = q\n current_retention = d // we use this later in the pagebuilder\n current_query = q // ditto\n var arr = xlist.split('@', 2)\n var listname = arr[0]\n var olist = listname\n var domain = arr[1]\n \n // are we checking *@foo.tld ?\n if (document.getElementById('checkall')) {\n all = document.getElementById('checkall').checked\n }\n // If checking multiple lists, the globa_deep will tell the pagebuilder to also\n // include the mailing list name in each result\n global_deep = false\n if (all == true) {\n listname = \"*\"\n global_deep = true\n }\n \n // we just made a new search, clear the selected month in the calendar to the left if that makes sense\n clearCalendarHover()\n \n // As usual, push new history state\n if (!nopush) {\n window.history.pushState({}, \"\", \"list.html?\" + listname + \"@\" + domain + \":\" + d + \":\" + encodeURIComponent(q));\n }\n \n // get the data from backend, push to page builder func\n GetAsync(\"/api/stats.lua?list=\" + listname + \"&domain=\" + domain + \"&q=\" + encodeURIComponent(q) + \"&d=\" + d, null, buildPage)\n \n // for the list title, prepare the date range\n // TODO: improve this much like we have with trends.html\n var arr = datePickerDouble(d)\n var howlong = datePickerValue(d)\n // howlong may begin with a month which should not be lower-cased.\n // or it may be 'Less than 1 month ago'\n // Avoid checking by starting a new sentence\n document.getElementById('listtitle').innerHTML = listname + \"@\" + domain + \" (Quick Search. \" + howlong + \") <a class='btn btn-warning' href='javascript:void(0);' onclick='getListInfo(xlist)'>Clear filters</a>\"\n xlist = olist + \"@\" + domain\n return false;\n}", "function handleSearchButtonClick() \n{\n var filterDateTime = $dateTimeInput.value.trim().toLowerCase(); \n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n \n if (filterDateTime || filterCity || filterState || filterCountry || filterShape)\n {\n if (filterDateTime){ \n \n search_data = dataSet.filter (function(sighting) { \n var SightingDateTime = sighting.datetime.toLowerCase();\n return SightingDateTime === filterDateTime;\n });\n } else {search_data = dataSet}; \n \n if (filterCity){\n \n search_data = search_data.filter (function(sighting) {\n var SightingCity = sighting.city.toLowerCase();\n return SightingCity === filterCity;\n });\n } else {search_data = search_data}; \n\n if (filterState){\n search_data = search_data.filter (function(sighting) {\n var SightingState = sighting.state.toLowerCase();\n return SightingState === filterState;\n });\n } else {search_data = search_data}; \n\n if (filterCountry){\n search_data = search_data.filter (function(sighting) {\n var SightingCountry = sighting.country.toLowerCase();\n return SightingCountry === filterCountry;\n });\n } else {search_data = search_data}; \n\n if (filterShape){\n search_data = search_data.filter (function(sighting) {\n var SightingShape = sighting.shape.toLowerCase();\n return SightingShape === filterShape;\n });\n } else {search_data = search_data}; \n\n\n } else {\n // Show full dataset when the user does not enter any serch criteria\n search_data = dataSet; \n }\n $('#table').DataTable().destroy(); \n renderTable(search_data); \n pagination_UFO(); \n}", "function onDatesFilterSelect (e, elm) {\n var $filterDate = $('select.SimpleHistory__filters__filter--date')\n var val = $filterDate.val()\n\n if (val === 'customRange') {\n // show custom date fields\n $elms.filter_container.addClass('is-customDateFilterActive')\n } else {\n // hide custom date fields\n $elms.filter_container.removeClass('is-customDateFilterActive')\n }\n }", "function filterTable() {\n d3.event.preventDefault();\n errDisplay.text('');\n\n let inputField = d3.select('#datetime');\n let inputValue = inputField.property('value');\n let filteredTable = tableData.filter(date => date.datetime === inputValue);\n\n errDisplay.html(\"\");\n errDisplay.text(\"Did you find what you looking for?? Keep searching..\");\n\n if(filteredTable.length == 0) {\n tableInfo(tableData);\n errDisplay.html(\"\");\n errDisplay.text(\"Date out of range, please input correct date..\");\n console.log(errDisplay);\n }\n else {\n tableInfo(filteredTable);\n }\n}", "function searchphotoDB(searchquery){\n //console.log(\"searching\")\n console.log(photoDB);\n\n var test = photoDB.indexOf(\"GPSLatitude\");\n //console.log(test);\n document.getElementById(\"daylable\").textContent = test; //set Day Lable to correct day \n\n\n\n // for (i = 0; i < 2003; i++) {\n // var a = photoDB[i].FileName;\n // if (a == searchquery) {\n // //console.log(photoDB[i].FileName);\n // NewSelection(photoDB[i-1].nbr, 1);\n // }\n // };\n}", "function dateFilter() {\n let inputText = d3.select(\"#datetime\").node().value;\n let tables = d3.select(\".ufos-table\");\n let subData = data.filter(d => d.datetime === inputText)\n console.log(subData)\n tableBody.html(\"\")\n tableValues(subData);\n}", "function findDate(element) {\n return element['name']=='Date';\n}", "function getCriteria() {\n \n // prevent page refresh\n d3.event.preventDefault();\n \n // search criteria\n if ( dateSearch.property('value') == '') { var sDate = '' } \n else { var sDate = new Date(dateSearch.property('value')); }\n var sCity = citySearch.property('value');\n var sState = stateSearch.property('value');\n var sCountry = countrySearch.property('value');\n var sShape = shapeSearch.property('value');\n\n // filtered data\n var filterData = data.filter( sightings => { return ( \n ( sDate == '' ||\n ( new Date(sightings.datetime).getFullYear() == sDate.getFullYear() &&\n new Date(sightings.datetime).getMonth() == sDate.getMonth() &&\n new Date(sightings.datetime).getDate() == sDate.getDate() ) ) &&\n ( sightings.city.toLowerCase() == sCity.toLowerCase() || sCity == '') &&\n ( sightings.state.toLowerCase() == sState.toLowerCase() || sState == '') &&\n ( sightings.country.toLowerCase() == sCountry.toLowerCase() || sCountry == '') &&\n ( sightings.shape.toLowerCase() == sShape.toLowerCase() || sShape == '')\n ) } );\n\n // populate table with filtered dataset\n loadTable(filterData);\n}", "search(now, old) {\n return db.drugs.query(`function(doc) {\n if ( ~ doc.name.indexOf('${now}'))\n emit(true)\n }`)\n }", "function Query_If_RangeHasChanged(){\n\n var sFrom = document.getElementById(\"txt_dtmFrom\").value;\n var sTo = document.getElementById(\"txt_dtmTo\").value;\n\n if(sFrom != sParamDateFrom || sTo != sParamDateTo)\n ExecuteNewSearch();\n}", "function myFilter() {\n var input, filter, table, tr, td, td1, i, txtValue;\n input = document.getElementById(\"datetime\");\n filter = input.value.toUpperCase();\n table = document.getElementById(\"ufo-table\");\n tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n\n // determines what column to filter by. \"0\" is date, 1 is city, etc.\n td = tr[i].getElementsByTagName(\"td\")[0];\n\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(filter) > -1)\n\n {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "function doSearch(formData)\n{\n\tif( formData != null)\n\t{\n\t\tconsole.log('get request from post array:');\n\t\tvar myForm = formData;\n\t\tvar mycontentType = 'multipart/form-data';\n\t}\n\telse\n\t{\n\t\tconsole.log('get request from form:');\n\t\tvar myForm = $(\"#caveSearchForm\");\n \n //convert datepickers date to unixTimestamp to search into db\n var datepickers = $(\".hasDatepicker\");\n //iterate through datpickers to convert data type\n datepickers.each(function (e){\n if ( $(this).val() != ''){\n unixTimestamp = Date.parse( $(this).val() ) /1000 ; //convert date in epoch in sec\n myForm.find('[name=\"' + $(this).attr('name') + '\"]').val(unixTimestamp); \n }\n });\n \n myForm = $(\"#caveSearchForm\").serialize();\n console.log(myForm);\n var mycontentType = 'application/x-www-form-urlencoded'\n\t}\n\t\n\t$.ajax(\n\t{\n\t\t\t\ttype: 'POST',\n\t\t\t\turl: 'search.php',\n\t\t\t\tprocessData: false,\n\t\t\t\tcontentType: mycontentType,\n\t\t\t\tdata: myForm,\n\t\t\t\tdataType: \"json\",\n\t\t\t\tsuccess: searchSuccess,\n\t\t\t\terror: searchError,\n\t});\n\t\n\treturn true;\n\t\t\n}", "function getRange(flower, day) {\n var startRange = new Date();\n startRange.setDate(day - 1);\n var endRange = new Date();\n endRange.setDate(startRange.getDate() + 2);\n\n var arr = [\n 'select * where flowerType=',\n \"'\",\n flower,\n \"'\",\n ' and created gte ',\n startRange.getTime(),\n ' and created lte ',\n endRange.getTime(),\n ' order by created asc'\n ]\n\n var searchParameters = arr.join('');\n return (encodeURIComponent(searchParameters));\n}", "_onFilterUpdated(filter) {\n this.setState({\n filter,\n showFilterDialog: false\n })\n const searchParams = {\n workshopSetId: this.props.params.id\n }\n if (filter.startDate) {\n searchParams.startingDtBegin = moment(filter.startDate).format('YYYY-MM-DD')\n searchParams.startingDtEnd = moment(filter.startDate).add(1, 'years').format('YYYY-MM-DD')\n }\n if (filter.endDate) {\n searchParams.endingDtBegin = moment(filter.endDate).format('YYYY-MM-DD')\n searchParams.endingDtEnd = moment(filter.endDate).add(1, 'years').format('YYYY-MM-DD')\n }\n if (filter.campusId) {\n searchParams.campusId = filter.campusId\n }\n this.props.searchWorkshops(searchParams)\n }" ]
[ "0.7209805", "0.70610374", "0.6977224", "0.69260305", "0.68615276", "0.6859402", "0.6801849", "0.6791086", "0.6791086", "0.67344105", "0.6629149", "0.6601612", "0.6543571", "0.65352726", "0.6511577", "0.6441816", "0.64414483", "0.64088637", "0.6330055", "0.632979", "0.631156", "0.626153", "0.62468064", "0.621039", "0.6204071", "0.6172737", "0.61215997", "0.6113742", "0.61084694", "0.6104579", "0.6104114", "0.6095759", "0.60902286", "0.6072069", "0.6053608", "0.6032016", "0.60289234", "0.6022669", "0.6008041", "0.6001497", "0.5991932", "0.5981708", "0.5975485", "0.59648156", "0.593921", "0.593904", "0.59307873", "0.5929767", "0.59193337", "0.5916375", "0.59035283", "0.5896757", "0.5896424", "0.58953035", "0.5884502", "0.5877768", "0.58517855", "0.58506405", "0.58477765", "0.58470726", "0.5823934", "0.58059716", "0.57972234", "0.5769576", "0.5767939", "0.57479626", "0.57380086", "0.573019", "0.57159775", "0.5712939", "0.569297", "0.569202", "0.5687016", "0.5680545", "0.567622", "0.56684446", "0.56510437", "0.5650684", "0.5621223", "0.56193477", "0.5617775", "0.56149846", "0.56145126", "0.5606871", "0.56006336", "0.5599362", "0.55973256", "0.5588112", "0.55788416", "0.5574038", "0.557313", "0.55729884", "0.55598617", "0.5557359", "0.5554156", "0.5547157", "0.5539752", "0.5532423", "0.5531371", "0.55293614" ]
0.76074237
0
function to handle Search by City
function handleSearchButtonClickCity() { // Format the user's search by removing leading and trailing whitespace var filterCity = $cityInput.value.trim().toLowerCase(); // Set ufoSightings to an array of all dataSet whose "date" matches the filter ufoSightings = dataSet.filter(function(sightings) { var sightingCity = sightings.city.toLowerCase(); // If true, add the sighting to the filterState, otherwise don't add it to filterState return sightingCity === filterCity; }); renderTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function searchCity(savedCity){\n \n getCurrentWeather( savedCity);\n getForecastWeather( savedCity);\n \n}", "function searchCity(event) {\n event.preventDefault();\n var input = userInput.value;\n if (!input || input == \"\") return;\n addToSearchHistory(input);\n createListItem(input);\n getweatherdata(input);\n}", "function mainSearch() {\n event.preventDefault()\n const cityName = document.querySelector('#cityBox').value\n citySearch(cityName)\n}", "function searchCity(event) {\n event.preventDefault();\n let cityInput = document.querySelector(\"#search-bar\");\n let mainCity = document.querySelector(\"#show-city\");\n mainCity.innerHTML = `${cityInput.value}`;\n search(cityInput.value);\n}", "function searchCity(li) {\n const city = li.innerText;\n fetch(`${api.base}weather?q=${city}&units=metric&APPID=${api.key}`)\n .then(weather => {\n return weather.json();\n })\n .then(displayResults)\n .catch(searchError);\n}", "function geocodeSearch (){\n\t\tvar cityValue = $('#searchBox').val();\n\t\tvar geocoder = new google.maps.Geocoder();\n\t\tvar geocoderOptions = {\n\t\t\taddress: cityValue\n\t\t}\n\t\t\n\t\tgeocoder.geocode(geocoderOptions, function(results, status) {\n\t\t\tif (status === 'OK'){\n\t\t\t\tvar latitude = results[0].geometry.location.lat();\n\t\t\t\tvar longitude = results[0].geometry.location.lng();\t\n\n\t\t\t\tgetWeather(latitude, longitude, results[0].formatted_address);\n\n\t\t\t\tmap.setCenter(results[0].geometry.location);\n\n\t\t\t\tif(!marker) {\n\t\t\t\t\tmarker = new google.maps.Marker({\n\t\t\t\t\t\tmap: map,\n\t\t\t\t\t\tposition: results[0].geometry.location\t\n\t\t\t\t\t});\n\t\t\t\t}else {\n\t\t\t\t\tmarker.setPosition(results[0].geometry.location);\n\t\t\t\t}\n\n\t\t\t} else { \n\t\t\t\tconsole.log(\"Geocode Error\" + status);\n\t\t\t}\n\t\t});\n\t}", "function searchCity(city) {\n //API stored in function\n let apiKey = `a9f6c0e1b1497b25ded5be0fd029e8ec`;\n let units = `metric`;\n let apiEndpoint = `https://api.openweathermap.org/data/2.5/weather`;\n let apiUrl = `${apiEndpoint}?q=${city}&appid=${apiKey}&units=${units}`;\n axios.get(`${apiUrl}`).then(showWeather);\n}", "function searchCity(e) {\n e.preventDefault();\n const form = e.currentTarget;\n setCity(form.search.value);\n form.reset();\n }", "function searchWeather(city) {\n fetchWeather(city);\n addNewCity(city);\n}", "function searchCity(city) {\n let apiKey = \"c2d9b90e33955a3023ce0c9c75586190\";\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(displayTemperature);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=${units}`;\n axios.get(apiUrl).then(displayForecast);\n}", "function searchCity(city) {\n let apiKey = \"f902315c1bb8b7c1ac10cb7eaa68c265\";\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(showWeather);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&&units=${units}`;\n axios.get(apiUrl).then(displayForecast);\n}", "function searchCity(city) {\n let apiKey = \"47b783e374dd1d17b34b52141082af29\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(showWeather);\n\n apiUrlFor = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=metric`;\n axios.get(apiUrlFor).then(showForecast);\n}", "function search(city) {\n\tlet apiKey = \"754ef6f31ce264860cfc37f3accd1fdf\";\n\tlet apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=imperial`;\n\taxios.get(apiUrl).then(displayWeather);\n}", "function search (city) {\n let apiKey = \"fa4c25ecf74bb9185db3d2b06a17953e\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl). then(displayCurrentWeather);\n}", "function outputCity(event) {\n event.preventDefault();\n let searchInput = document.querySelector(\"#city-input\");\n let city = `${searchInput.value}`;\n city = city.trim().toLowerCase();\n searchCity(city);\n}", "function searchByClick(e) {\n setCity(e.target.value);\n setIsSearch(false)\n }", "function search(city) {\n let apiKey = \"5625fc4e2f1e1a9677dec96db881138a\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(showWeather);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(showForecast);\n}", "function getCities(userSearch, cities) { // arguments are user input and cities array\n return cities.filter(place => { // filtering the array need to return here\n const regex = new RegExp(userSearch, 'gi'); // find where ever it will match with Regex\n return place.city.match(regex)}); // matching the regex and city name (includes doesn't work) need to return here too\n}", "function search(city) {\n let apiKey = \"a05f0202382b8935188265308a3e5140\";\n let apiUnits = \"metric\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&APPID=${apiKey}&units=${apiUnits}`;\n axios.get(apiUrl).then(showTemperature);\n let forecastApiURL = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&APPID=${apiKey}&units=${apiUnits}`;\n axios.get(forecastApiURL).then(displayForecast);\n}", "function handleSearchSubmit(event) {\n event.preventDefault();\n let cityInput = document.querySelector(\"#city-input\");\n cityInput = cityInput.value.trim().toLowerCase();\n searchCity(cityInput);\n} // handles the behaviour of the search bar", "function searchCity(event) {\n event.preventDefault();\n\n var cityInput = $(\"#search-city\").val();\n\n if (cityInput === \"\") {\n return;\n }\n\n searchCurrentWeather(cityInput);\n\n populateSearchHistory(cityInput);\n\n $(\"#searchcity\").val(\"\");\n}", "function findCity(event) {\n event.preventDefault();\n let citySearch = document.querySelector(\"#search-input\");\n let city = document.querySelector(\"#searched-city\");\n city.innerHTML = citySearch.value;\n getWeather(citySearch.value);\n}", "search(city, result) {\n $.get(`${this.basePath}/search?page=1&per_page=25&location=${city}&distance=10&stolenness=proximity`)\n .then(function(response) {\n result(response.bikes);\n })\n .fail(function(error) {\n throw(error.responseText);\n });\n }", "function searchCity(event) {\n event.preventDefault();\n let cityInput = document.querySelector(\"#search-text-input\");\n let h1 = document.querySelector(\"h1\");\n if (cityInput.value) {\n h1.innerHTML = `${cityInput.value}`;\n searchWeather(cityInput.value);\n } else {\n h1.innerHTML = null;\n }\n}", "function search(location) {\r\n switch (carType) {\r\n case \"gus\":\r\n searchGus(location);\r\n break;\r\n case \"eletric\":\r\n searchEletric(location);\r\n }\r\n}", "function searchByCity(contact) {\n return contact.city + \" \" + contact.firstName + \" \" + contact.lastName;\n }", "function search(){\n let query;\n if(searchLocation===\"location\"){\n searchLocation(\"\")\n }\n query=`https://ontrack-team3.herokuapp.com/students/search?location=${searchLocation}&className=${searchClass}&term=${searchName}` \n prop.urlFunc(query);\n }", "function searchYourCity(event) {\n event.preventDefault();\n let input = document.querySelector(\"#citySearch\");\n let cityName = document.querySelector(\"#searchedCity\");\n if(input.value.length > 0)\n {\n cityName.innerHTML = input.value.toUpperCase();\n checkWeatherByCity(input.value,checkUnitsSelected());\n }\n else\n {\n alert(\"Please enter a city\");\n }\n}", "function search(city) {\n let apiKey = \"ccd7e3ef34f8befeaea04a6b52aa4224\";\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(showTemperature);\n\n\n apiUrl =`https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=${units}`\n axios.get(apiUrl).then(displayForecast)\n\n}", "function searchedCity(city) {\n let apiKey = \"47946c44662c2450dc8f43f4b76c1cb0\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric`;\n axios.get(`${apiUrl}&appid=${apiKey}`).then(showTemp);\n}", "function searchCity() {\n searchWeather();\n search.value = '';\n // Reset local time\n clearInterval(getLocalTime);\n}", "function search(searchType, searchText)\n{\t\n\tswitch (searchType){\n\t\tcase \"City\":\n\t\t\tsearchCity(searchText);\n\t\t\tbreak;\n\t\tcase \"Region\":\n\t\t\tsearchRegion(searchText);\n\t\t\tbreak;\n\t\tcase \"Team\":\n\t\t\tsearchTeam(searchText);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\n\t}\n}", "function search(event) {\n event.preventDefault();\n let searchInput = document.querySelector(\"#search\");\n\n let city = document.querySelector(\"#search-city\");\n if (searchInput.value) {\n city.innerHTML = `${searchInput.value}`;\n } else {\n alert(\"Please write a location to search\");\n }\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${searchInput.value}&units=metric&appid=${apiKey}`;\n axios.get(apiUrl).then(tempCitySearched);\n}", "function searchCityList(url, callback) {\n\t//var url = \"citySearch.php?cityInput=\" + cityInput + \"&stateInput=\" + stateInput;\n\tvar request = new XMLHttpRequest();\n\trequest.open(\"GET\", url, true); // url = \"citySearch.php?cityInput=\" + cityInput + \"&stateInput=\" + stateInput;\n\trequest.onreadystatechange = function() {\n\t\tif (this.readyState == 4)\n\t\t{\n\t\t\tif (this.status == 200)\n\t\t\t{\n\t\t\t\t// this.responseText will be an array with just one element.\n\t\t\t\t// That one element will be the city's data (not the city's weather data)\n\t\t\t\tvar result = this.responseText;\n\t\t\t\tcallback(JSON.parse(result));\n\t\t\t}\n\t\t}\n\t}\n\trequest.send();\n}", "searchCities(query) {\n var me = this;\n me.noCities = false;\n return this.$http({\n method: 'GET',\n url: `/suggestions/?q=${query}&lat=12&long=12`\n }).then(function successCallback(response) {\n me.cities = response.data.suggestions;\n return response.data.suggestions;\n }, function errorCallback(response) {\n if(response.status == 404) {\n // no cities found\n me.noCities = true;\n me.cities = [];\n }\n });\n }", "function searchVenue(){\n\t\t$(\"#query\").click(function(){\n\t\t\t$(this).val(\"\");\n\t\t});\n\n\t\t$(\"#query\").blur(function(){\n\t\t\tif ($(this).val() == \"\") {\n\t\t\t\t$(this).val(\"Example: Ninja Japanese Restaurant\");\n\t\t\t}\n\t\t\n\t\t\tif ($(this).val() != \"Example: Ninja Japanese Restaurant\") {\n\t\t\t\t$(this).addClass(\"focus\");\n\t\t\t} else {\n\t\t\t\t$(this).removeClass(\"focus\");\n\t\t\t}\n\t\t});\n\n\t\t//Submit search query and call to getVenues\n\t\t$(\"#searchform\").submit(function(event){\n\t\t\tevent.preventDefault();\n\t\t\tif (!lat) {\n\t\t\t\tnavigator.geolocation.getCurrentPosition(getLocation);\n\t\t\t} else {\n\t\t\t\tgetVenues();\n\t\t\t}\t\t\n\t\t});\n\n\t}", "function search() {\n\n let eventText = event.target.textContent\n //get the city from the search box\n\n if (eventText == \"Search!\") {\n city = searchInput.value\n }\n //create and display current weather for that city\n currentWeather(city)\n //create and display forecasted weather for that city\n fiveDay(city)\n //add that city to the history\n addToHistory(city)\n}", "function geoIdentify() {\n var searchCity = $(\"#inputGroupSelect03\").val();\n console.log(searchCity);\n localStorage.setItem(\"cityName\", searchCity);\n selectedCity = searchCity;\n $.ajax({\n url: apiBase + searchCity,\n method: \"GET\",\n }).done(function (response) {\n console.log(response);\n querySecondURL =\n response._embedded[\"city:search-results\"][0]._links[\"city:item\"].href;\n urbanSlug();\n });\n }", "function handleSearch(inputElt) {\n\t\tvar query = encodeURIComponent($(inputElt).val());\n\t\t$.ajax({\n\t\t\ttype : \"GET\",\n\t\t\turl : \"http://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/\"+query+\".json\",\n\t\t\tdata : {\n\t\t\t\taccess_token: \"pk.eyJ1IjoibWFwcHktZGV2IiwiYSI6InhBOWRUVHcifQ.YK4jDqt9EXb-Q79QX3O_Mw\"\n\t\t\t},\n\t\t\tsuccess : function(result){\n\t\t\t\tvar best = result.features[0];\n\t\t\t\tmap.setView([best.center[1], best.center[0]], 15);\n\t\t\t},\n\t\t\terror : function(error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t});\n\t}", "function handleSubmit(event) {\n event.preventDefault();\n let city = document.querySelector(\"#search-box\").value;\n\n searchCity(city);\n}", "function searchForCity(event) {\n event.preventDefault();\n let givenCity = document.querySelector(\"#search-bar-input\");\n let theCity = document.querySelector(\".searchedCity\");\n if (givenCity.value) {\n theCity.innerHTML = `${givenCity.value}`;\n } else {\n alert(\"Please enter a city\");\n }\n}", "function changeCity(event){\n event.preventDefault();\n let searchInput = document.querySelector(\"#search-input\");\n apiInfo(searchInput.value);\n}", "function readSearchData() {\n var searchTerm = document.getElementById(\"keyword\").value;\n var state = document.getElementById(\"state\").value;\n var city = document.getElementById(\"city\").value;\n orgSearch(searchTerm, state, city);\n}", "function search() {\n var search = document.getElementById(\"search\");\n enteredvalue = search.value.toUpperCase();//getting entered value\n divelements = document.getElementById(\"row\");\n innerdivs = divelements.getElementsByTagName(\"div\");\n // transversing through all the div elements in the root element.\n for (let i = 0; i < innerdivs.length; i++) {\n td = innerdivs[i].getElementsByTagName(\"p\")[1];\n valu = td.innerHTML.split(\",\")[searchby];//getting value of city or state using search by\n //indexof will check weather the input value is part of city or state.\n // if it is apart of city or state it will return the index \n // else it will return the index as -1\n if (valu.toUpperCase().indexOf(enteredvalue) > -1)\n innerdivs[i].style.display = \"\";\n else innerdivs[i].style.display = \"none\"; //chaning the dispaly to none if it is not a part of the city or state field.\n }\n}", "function searchWeather(city) {\n fetch(`https://api.openweathermap.org/data/2.5/weather?${searchMethod}=${city}&APPID=${apiId}&units=${units}&lang=pl`).then(result => {\n return result.json();\n }).then(result => {\n init(result);\n })\n}", "function handleSubmit(event){\n event.preventDefault();\n let cityInputElement = document.querySelector(\"#city-input\");\n search(cityInputElement.value);\n}", "function searchCity() {\n\n let citySearch = $('#input').val().toLowerCase()\n let stateSearch = $('#state').val().toLowerCase()\n\n $(\".container2\").empty();\n $(\".container2\").append(`<div id= \"main-row\"class=\"grid-row\"></div>`)\n\n $.get(\"/api/gig\").then(data => {\n\n //console.log(data)\n\n for (var i = 0; i < data.length; i++) {\n if (data[i].city.toLowerCase() === citySearch && data[i].state.toLowerCase() == stateSearch) {\n\n console.log(data[i].city)\n $(\".container2\").append(`\n\n <div class=\"card\">\n <div class=\"card-body\">\n <h5 class=\"card-title\">${data[i].jobTitle}</h5>\n <p class=\"card-text\">${data[i].city} ${data[i].state}</p>\n <p class=\"card-text\">${data[i].jobUrl}</p>\n <img src=\"stylesheets/computer.png\">\n <a href=${data[i].jobUrl} class=\"btn btn-primary\" id=\"gig\">Gig It!</a>\n </div>\n </div>\n `)\n }\n }\n\n\n })\n }", "function citySearch(keyword) {\n var regexp = RegExp(keyword, 'i');\n var result = cities.filter(function (city) {\n return city.match(regexp);\n });\n\n return result;\n}", "function citySearch(keyword) {\n var regexp = RegExp(keyword, 'i');\n var result = cities.filter(function (city) {\n return city.match(regexp);\n });\n\n return result;\n}", "search (query) {\n\t\t// Store lat/lng of locality to use in this url (focus.point.lat, focus.point.lon)\n \t\t//const endpoint = `https://search.mapzen.com/v1/autocomplete?text=${query}&api_key=${this.props.config.mapzen.apiKey}&focus.point.lat=${this.props.coordinates[0]}&focus.point.lon=${this.props.coordinates[1]}&layers=venue`\n \t\tconst placetype = this.state.placetype\n \t\tconst endpoint = `https://whosonfirst-api.mapzen.com/?method=whosonfirst.places.search&api_key=${this.props.config.mapzen.apiKey}&q=${query}&${placetype}=${this.props.source.id}&placetype=venue&per_page=100&extras=geom:latitude,geom:longitude,sg:,addr:full,wof:tags`\n \t\tthis.throttleMakeRequest(endpoint)\n\t}", "function doLookup(event) {\n event.preventDefault();\n var citySearchInput = $(\"#city-search-input\");\n var city = citySearchInput.val().trim();\n\n \n if (city === \"\") {\n $(\"#errorMsg\").text(\"Please enter a city name.\");\n $(\".modal\").modal('show');\n }\n else {\n citySearchInput.val(\"\"); // this clears out all searches\n getSavedInfo(city);\n }\n}", "function searchCityWeather() {\n let name = ele.getElementsByClassName(\"city-name\")[0].value;\n if (!name) return;\n let wData = getDataFromLocalStorage(name);\n if (!wData) {\n fetch(getApiURL(name))\n .then(response => response.json())\n .then(data => {\n setDataToDisplay(data);\n setDataToLocalStroage(name, data);\n })\n .catch(error => console.error(error));\n } else {\n setDataToDisplay(wData);\n }\n}", "function search() {\n\tclearEventSpecificInfo();\n\t// Fetch address from the set location box.\n\t// If default or blank, use the home address.\n\tvar address = $('#set_location_box').val();\n\tif (address == 'Address, City, State or Zip' || address == '') {\n\t\taddress = currentAddress;\n\t}\n\tif (geocoder) {\n geocoder.geocode (\n \t{'address': address},\n \tfunction(results, status) {\n \tif (status == google.maps.GeocoderStatus.OK) {\n\t\t\t\t\tvar location = results[0].geometry.location;\n\t\t\t\t\tstoreMyLocation(location.lat(), location.lng());\n\t\t\t\t\tinitChores();\n \t}\n }\n );\n\t}\n}", "function searchLocation(event) {\n event.preventDefault();\n const city = event.target['name'].value;\n getData(city);\n status();\n textArea.value = \"\";\n}", "function searchHistoryHandler(event) {\n let city = event.target.innerText;\n getCity(city);\n}", "function handleSearchClick(event) {\n event.preventDefault();\n cityName = $('#search').val();\n\n // This clears the search bar after the user enters their search.\n $('#search').val('');\n\n // Calling functions for to get the weather and golf courses.\n dailyWeather(cityName);\n getGolf(cityName);\n console.log(cityName);\n\n}", "function getCityWeatherData(){\n //grabs city name from search input bar\n const city = $(\"#city-search-input\").val();\n //adds city to the list\n addCityToList(city);\n //store city list to local storage\n storeCityList();\n //api key\n const apiKey = \"&appid=27ffb5b5dc6407d635a7bcd87cd32739\";\n //city name, state code and country code divided by comma, use ISO 3166 country codes.\n const query = \"q=\";\n //openweathermap.org request url for daily\n const urlWeather = \"https://api.openweathermap.org/data/2.5/weather?\";\n //combine url, query, and api key to get a query url\n const queryurlWeather = urlWeather + query + city + apiKey;\n //this runs the ajax query function with the queryurlWeather argument\n ajaxQuery(queryurlWeather, apiKey);\n //clears search input field after search for better user experience\n $(\"#city-search-input\").val(\"\");\n}", "function searchContactOnCityState(firstName,city,state){\n let citySearch=record.filter(contact=>contact.firstName==firstName&&contact.city==city);\n let stateSearch=record.filter(contact=>contact.firstName==firstName&&contact.state==state);\n if (citySearch==undefined){\n if (stateSearch==undefined){\n console.log(firstName+\" does not exist.\");\n }else {console.log(contact);}\n }else {console.log(contact);}\n}", "function handleSearch() {\n\n\tvar value = $(\"#searchBox\").val();\n\t\n\tif(value != null && value != \"\") {\n\t\tsearchStationForName(value);\n\t}\n\n}", "function searchCity(event) {\n event.preventDefault();\n let inputCity = document.querySelector(\"#input-search-city\");\n let showSearchCity = document.querySelector(\"h1.showCity\");\n showSearchCity.innerHTML = `What shall we do today <br /> in <span style=\"color: rgb(69, 147, 173);\">${inputCity.value}</span> ?`;\n let apiKey = \"5105e9ba47cefb06b8ba8c75ae83f74e\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${inputCity.value}&appid=${apiKey}&units=metric`;\n axios.get(`${apiUrl}`).then(showTemperatureSearch);\n}", "function validateSearchCriteria(e) {\n e.preventDefault();\n var cityName = document.querySelector(\"#cityText\").value.trim();\n //cityName = cityName.trim();\n if (cityName !== '') {\n fetchCurrentWeather(cityName);\n }\n}", "function form(event) {\n event.preventDefault();\n let search = document.querySelector(\"#searchcity\");\n //let city = document.querySelector(\".city\");\n //city.innerHTML = search.value;\n //console.log(search.value);\n let cityname = search.value;\n searchCity(cityname);\n f.classList.remove(\"active\");\n c.classList.add(\"active\");\n}", "function performSearch(event) {\n event.preventDefault();\n\n request = $.ajax({\n url: 'https://api.openweathermap.org/data/2.5/weather',\n type: \"GET\",\n data: {\n // Default is set to Celsius (metric)\n q: $(\"#city\").val(),\n appid: '478383033577a354a3049bfdcd0fa60d',\n units: 'metric'\n }\n });\n\n // After promise new function creates the Weather search for city input\n request.then(function(response) {\n formatSearch(response);\n getForecast(response.coord.lat, response.coord.lon)\n });\n}", "function handleSubmit(event) {\n event.preventDefault();\n let cityInputElement = document.querySelector(\"#city-input\");\n search(cityInputElement.value);\n}", "function findMatches(wordToMatch , cities){\n return cities.filter(place => {\n\n //here we have to check if the state city or country matches what is searched\n const regex = new RegExp(wordToMatch , 'gi');\n return place.name.match(regex) || place.capital.match(regex) || place.phone_code.match(regex);\n });\n}", "function doSearch(query, pageNum, locale, category, catOnly) {\n cleanOut(oneSource);\n cleanOut(tempSource);\n var city = $('#city-state').val();\n if (catOnly == 'yes') {\n var cat = parseInt(category, 10);\n runWPAPI(locale, cat, city);\n } else {\n runWPAPI(locale, cat, city);\n }\n var cleanQuery = query.replace(/\\s/g, '+');\n var proxyAPI = 'XXXXXXXXX';\n if ($('#city').val() && $('#state').val()) {\n var city = $('#city').val();\n var cityCleanUp = city.replace(/\\s/g, '+');\n var state = $('#state').val();\n var queryLocale = \"&l=\" + cityCleanUp + \"%2C+\" + state;\n var target2API = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&start=\" + pageNum + \"&q=\" + cleanQuery + queryLocale;\n var targetAPIALT = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&q=\" + cleanQuery + queryLocale;\n } else {\n var target2API = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&start=\" + pageNum + \"&q=\" + cleanQuery;\n var targetAPIALT = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&q=\" + cleanQuery;\n }\n getAPIData(target2API + \"&callback=?\", function(returndata) {\n var data = returndata;\n //var dataTempFiltered = [];\n var totalPull = Math.round(data.totalResults / 25);\n if (totalPull > 50) {\n // loop\n for (i = 0; i < 50; i++) {\n var targetNum = 25 * i;\n var numTrack = i;\n if (numTrack == 49) {\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n checkGlobalGym();\n })\n } else {\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n })\n }\n }\n //end loop\n } else {\n //loop\n for (i = 0; i < totalPull; i++) {\n var targetNum = 25 * i;\n var numTrack = i;\n if (numTrack == (totalPull - 1)) {\n //console.log('final api under 40');\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n checkGlobalGym();\n })\n } else {\n //console.log('run api under 40');\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n })\n }\n }\n //end loop\n }\n })\n async function checkGlobalGym() {\n setupDataNew(tempSource);\n }\n}", "function handleSearch(event) {\n event.preventDefault();\n let city = document.querySelector(\".form-control\");\n let apiKey = \"a05f0202382b8935188265308a3e5140\";\n let apiUnits = \"metric\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city.value}&APPID=${apiKey}&units=${apiUnits}`;\n axios.get(apiUrl).then(showTemperature);\n axios.get(apiUrl).then(showIcon);\n let forecastApiURL = `https://api.openweathermap.org/data/2.5/forecast?q=${city.value}&APPID=${apiKey}&units=${apiUnits}`;\n axios.get(forecastApiURL).then(displayForecast);\n}", "function search(){\n var searchInputValue = searchInput.value;\n var uppercaseValue = searchInputValue.toUpperCase();\n if (uppercaseValue == 'QUEENSTOWN' ||\n uppercaseValue == 'WANAKA' ||\n uppercaseValue == 'CADRONA' ||\n uppercaseValue == 'REMARKABLES' ||\n uppercaseValue == 'THE REMARKABLES' ||\n uppercaseValue == 'THE REMARKS' ||\n uppercaseValue == 'CORONET PEAK' ){\n loadThumbnails(locations.queenstown);\n initMap(168.697751, 45.026377);\n } else if (uppercaseValue == 'CHRISTCHURCH'||\n uppercaseValue == 'CANTERBURY'||\n uppercaseValue == 'MT HUTT' ||\n uppercaseValue == 'MOUNT HUTT' ||\n uppercaseValue == 'TEMPLE BASIN' ||\n uppercaseValue == 'ARTHUR\\'S PASS' ||\n uppercaseValue == 'CHEESEMAN' ||\n uppercaseValue == 'PORTERS' ||\n uppercaseValue == 'MT OLYMPUS' ||\n uppercaseValue == 'MOUNT OLYMPUS' ||\n uppercaseValue == 'BROKEN RIVER'){\n loadThumbnails(locations.christchurch);\n initMap(172.493273, 43.538478);\n } else if (uppercaseValue == 'WHAKAPAPA' ||\n uppercaseValue == 'RUAPEHU' ||\n uppercaseValue == 'MOUNT RUAPEHU' ||\n uppercaseValue == 'MT RUAPEHU' ||\n uppercaseValue == 'TONGARIRO' ||\n uppercaseValue == 'OHAKUNE' ||\n uppercaseValue == 'NATIONAL PARK' ||\n uppercaseValue == 'TUROA'){\n loadThumbnails(locations.whakapapa);\n initMap(175.549994, 39.231289);\n } else {\n thumbnailsBox.innerHTML = '<span class=\"no-results\">No location matched your search, please check your spelling and try again. Hint: Try searching by field name or nearest town, Eg. Queenstown.</span>';\n }\n }", "function lookup() {\n\n var country = $country.val();\n var zipcode = $zipcode.val();\n\n // check inputs\n if (!country) {\n $result.text(SELECT_COUNTRY);\n } else if (!zipcode) {\n $result.text(ENTER_ZIPCODE);\n } else {\n $submit.prop(\"disabled\", true);\n\n geoQuery(country, zipcode, '', function(result) {\n\n if (!result) {\n $result.text(INVALID_ZIPCODE);\n return;\n }\n \n var localities = [];\n \n // Get a list of primary cities\n var cities = result.address_components.filter(function(component) {\n return component.types.indexOf('locality') !== -1\n }).map(function(component) {\n return component.long_name;\n });\n\n // collect cities which share the same postcode\n var pl = result.postcode_localities;\n if (pl && pl.length) {\n for (var j = 0; j < pl.length; j++) {\n if (cities.indexOf(pl[j]) === -1 && localities.indexOf(pl[j]) === -1) {\n localities.push(pl[j]);\n }\n }\n }\n\n // no other cities share the postcode, just render resultd\n if (!localities.length) {\n parseResults([ result ]);\n }\n\n // collect all other cities\n else {\n\n var mergedResults = [ result ];\n\n function receive(result, data) {\n localities.splice(localities.indexOf(data.address), 1);\n if (result) {\n mergedResults.push(result);\n }\n if (!localities.length) {\n parseResults(mergedResults);\n }\n }\n\n for (var i = localities.length - 1; i >= 0; i--) {\n (function (address) {\n geoQuery(country, zipcode, address, receive);\n })(localities[i]);\n }\n }\n });\n }\n }", "function searchSubmitHandler(event) {\n event.preventDefault();\n var cityName = cityNameEl.value.trim();\n //console.log(\"in submit and city name is\", cityName);\n if (cityName) {\n getCityWeather(cityName);\n addToHistory(cityName);\n } else {\n alert(\"Please enter city name\");\n }\n}", "function weatherInCity(event){ \n // Stops the submit doing its normal behaviour\n event.preventDefault();\n // Assigns the input value to the newCIty\n newCity = searchInput.value;\n // Resets the searcher\n searchInput.value = \"\";\n // Paints the city name in the app\n currentCityElement.innerHTML = newCity;\n // Grabs the current weather for that city\n fetchCurrentWeatherFromCity();\n // Grabs the forecast weather for that city\n fetchForecastWeatherFromCity();\n}", "function searchLocation(){\n let city_name = document.getElementById(\"city_name\").value;\n if(city_name.length){\n $(\".input-loader-wrapper\").removeClass(\"hide-loader\");\n const proxy = \"https://cors-anywhere.herokuapp.com/\";\n const api_city = `${proxy}api.openweathermap.org/data/2.5/forecast?q=${city_name}&appid=876e8c245f496abbff404eb049199580`;\n fetch(api_city)\n .then((response) => {\n if(!response.ok)\n throw response;\n return response.json();\n }) \n .then(data => {\n changeValues(data);\n $(\".input-loader-wrapper\").addClass(\"hide-loader\");\n document.getElementById(\"city_name\").value=\"\";\n })\n .catch(error => {\n $(\".input-loader-wrapper\").addClass(\"hide-loader\");\n error.json().then((body)=>{\n alert(body.message);\n document.getElementById(\"city_name\").value=\"\";\n });\n })\n \n }\n}", "search(event){\n this.placeService.textSearch({\n query: `${event.target.value}`,\n type: 'airport'\n }, this.handleSuggestions);\n }", "function search(event) {\n event.preventDefault();\n let searchInput = document.querySelector(\"#inlineFormInputName2\");\n let searchCity = `${searchInput.value}`;\n let apiEndpoint = \"https://api.openweathermap.org/data/2.5/weather?\";\n let apiKey = \"f8789029e0a5277fb2e5a66c29f35e2c\";\n let apiUrl = `${apiEndpoint}q=${searchCity}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(localWeather);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${searchCity}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(displayForecast);\n}", "function processCities(cityInput){\n\t$.getJSON( cityInput, function( data ) {\n\t\tfor(var i = 0; i < data.length; i++) {\n\t \tvar obj = data[i];\n\t \tcodeAddress(obj.name);\n\t\t}\n\t});\n}", "async getLocationCity(latitude, longitude) {\r\n this.filterItemsJson = [];\r\n const apiCurrentLocation = `${process.env.GOOGLE_GEO_CODE_URL}${latitude},${longitude}&key=${this.apiKey}`;\r\n const filterItemsJson = await dxp.api(apiCurrentLocation);\r\n const currentCountryLocation = filterItemsJson.results[1].address_components;\r\n const city = this.findResult(currentCountryLocation, 'locality');\r\n const state = this.findResult(currentCountryLocation, 'administrative_area_level_1');\r\n const country = this.findResult(currentCountryLocation, 'country');\r\n const currentLocationSearch = {};\r\n currentLocationSearch['description'] = `${city}, ${state}, ${country}`;\r\n return currentLocationSearch;\r\n }", "function getCitiesFromAPI(term) {\n\n //Check whether the term is already searched for from localstorage, if yes load it from cache\n for (var i = 0, len = localStorage.length; i < len; ++i) {\n if (localStorage.key(i) == term) {\n populateList(JSON.parse(localStorage.getItem(term)));\n return;\n }\n }\n var xhr = new XMLHttpRequest();\n xhr.open(\"GET\", \"https://api.myjson.com/bins/uaro7?term=\" + term, true);\n xhr.onload = function () {\n //console.log(xhr.responseText);\n var data = JSON.parse(xhr.responseText);\n if (Object.keys(data).length == 0) {\n alert(\"Empty response !!\");\n }\n else {\n //Filter the response data based on user input and narrow it down\n let matches = [] = data.filter(s => s.includes(term));\n //console.log(matches);\n //Store the result in localstorage\n localStorage.setItem(term, JSON.stringify(matches));\n populateList(matches);\n\n }\n\n };\n xhr.send();\n}", "function search(city) {\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=6b93f7db7d89a630dd34ca79b7238880&units=metric`;\n console.log(apiUrl);\n\n axios.get(apiUrl).then(showWeather);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=6b93f7db7d89a630dd34ca79b7238880&units=metric`;\n axios.get(apiUrl).then(displayHourForecast);\n}", "function askAndReturnSearchCity() {\n return readline.question('Digite uma cidade: ')\n }", "function myCities() {\n \n var input, table, tr, td, i, txtValue;\n input = document.getElementById(\"myCity\").value.toUpperCase();\n table = document.getElementById(\"myTable\");\n tr = table.getElementsByTagName(\"tr\");\n for (i = 0; i < tr.length; i++) {\n td = tr[i].getElementsByTagName(\"td\")[2];\n if (td) {\n txtValue = td.textContent || td.innerText;\n if (txtValue.toUpperCase().indexOf(input) > -1) {\n tr[i].style.display = \"\";\n } else {\n tr[i].style.display = \"none\";\n }\n } \n }\n }", "function search(city){\nlet apiKey = \"e49f4dac5b0d3a8c77d299a55302727f\";\nlet apiUrl= `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=metric`;\naxios.get(apiUrl).then(displayWeather); \n\napiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=metric`;\n axios.get(apiUrl).then(displayForecast);\n\n}", "function onSubmitHandler(e) {\n e.preventDefault();\n props.Search(props.cities);\n }", "function locateCity(req, res, next) {\n // get params\n const cityName = req.body.name;\n const countryCode = req.body.country; \n\n // locate city\n cityService.locateCity(cityName, countryCode).then(function (data) {\n res.status(200).json({\n status: 'success',\n data: data,\n message: 'City GEO LOCALIZED'\n })\n }).catch(function (err) {\n return next(err);\n })\n}", "function searchWeather( ) {\n $('#search-term').keyup( e => {\n \n if (e.keyCode === 13){\n e.preventDefault();\n $('#search-button').click();\n }\n });\n $('#search-button').on('click', function(event) {\n // event.preventDefault();\n var city = $('#search-term').val();\n $('#search-term').val(\"\")\n fetchCityWeather(city);\n \n });\n}", "handlerSearch(search){\n const filterContacts = this.state.contacts.filter( contact =>\n contact.name.toLowerCase().includes(search.toLowerCase())\n || contact.email.toLowerCase().includes(search.toLowerCase())\n || contact.website.toLowerCase().includes(search.toLowerCase())\n || checkPhone(contact.phone, search)\n || contact.company.name.toLowerCase().includes(search.toLowerCase())\n || contact.address.country.toLowerCase().includes(search.toLowerCase())\n );\n this.setState({filterContacts});\n }", "function weatherCheck(){\n error();\n clearResults();\n city = $(\"#city-input\").val();\n weatherSearch();\n}", "function getCityFromURL(search) {\n let city = search.split('=')[1]\n\n return city\n // TODO: MODULE_ADVENTURES\n // 1. Extract the city id from the URL's Query Param and return it\n\n}", "function searchbyCityOrState() {\n let inputCity = prompt(\"Enter city to search person : \");\n let inputState = prompt(\"Enter state to search person : \");\n addressBookArray.forEach(addressBook => {\n if(addressBook.city == inputCity || addressBook.state == inputState) {\n console.log(\"Person in city \" +inputCity+ \" and state \" +inputState);\n }\n });\n addressBookArray.filter(contact => contact.city == inputCity)\n addressBookArray.filter(contact => contact.city == inputCity)\n addressBookArray.forEach(contact => console.log(addressBookArray));\n}", "function search() {\n let apiKey = \"d35ea4f1a6c2987f94eb1e419288d906\";\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&appid=${apiKey}&units=${units}`;\n axios.get(apiUrl).then(showInput);\n\n apiUrl = `https://api.openweathermap.org/data/2.5/forecast?q=${city}&appid=${apiKey}&units=${units}`;\n axios.get(apiUrl).then(showForecast);\n}", "function search(evt){\r\n\r\n if (evt){\r\n // don't search if pressing keys to navigate the list\r\n switch(evt.which){\r\n case 13:\r\n case 37:\r\n case 38:\r\n case 40:\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n return false; \r\n break;\r\n }\r\n }\r\n\r\n var searchstring = plugin.pcwInput.val();\r\n\r\n if (searchstring == ''){\r\n return;\r\n }\r\n\r\n // store the search string\r\n plugin.pcwInput.data('search-text',searchstring);\r\n\r\n if ($.trim(searchstring) == ''){\r\n return false;\r\n }\r\n \r\n $.ajax({\r\n url: constants.searchURL.replace('{{key}}', plugin.config.apikey) + searchstring,\r\n type: 'GET',\r\n dataType: 'jsonp',\r\n success: function(data){\r\n \r\n var addresses = data.predictions;\r\n\r\n if (addresses.length > 0){\r\n\r\n if (addresses.length == 1){\r\n // go straight to browse ??\r\n //browse(addresses[0][1]);\r\n }\r\n\r\n plugin.pcwAddressBrowse.trigger('hide');\r\n plugin.pcwAddressSelect.html('');\r\n\r\n // check searchstring is still current.\r\n if (searchstring === plugin.pcwInput.val()){\r\n \r\n // add the addresses to the Select drop down\r\n $.each(addresses, function(index, value){\r\n var listitem = $('<li></li>');\r\n var css = (value.complete) ? 'finish' : 'browse';\r\n var listitemlink = $('<a href=\"#\" class=\"'+css+'\">'+value.prediction+'</a>').data((value.complete)?'finish-id':'browse-id',value.refs);\r\n\r\n plugin.pcwAddressSelect.append(listitem.append(listitemlink)).trigger('show');\r\n\r\n });\r\n\r\n }\r\n\r\n }else{\r\n // try and filter any results we already have ??\r\n //filter(plugin.pcwAddressSelect, evt);\r\n }\r\n\r\n },\r\n error: function() { debug('Search failed',2) },\r\n timeout: 2000\r\n });\r\n }", "function searchNow(event) {\n event.preventDefault();\n let searchCity = document.querySelector(\"#search-input\");\n let headingCity = document.querySelector(\"#main-loc\");\n let apiKey = \"72dc5df4c3f125c3cc1a3df3d0aec808\";\n let city = searchCity.value;\n let apiUrl = `https://api.openweathermap.org/data/2.5/weather?q=${city}&units=metric&appid=${apiKey}`;\n\n headingCity.innerHTML = `${city}`;\n axios.get(apiUrl).then(showMainTemp);\n}", "searchingCity(details){\n return axios.put(DETAILS_URL+'/searchingCity',details);\n }", "updateSearchResults() {\n let input = this.state.input.toLowerCase();\n while (input.length > 0 && input.charAt(0)===' ') {\n input = input.substring(1);\n }\n if (input.length < 3) {\n this.setState({searchResults: null});\n } else {\n let newResults = [];\n cities.cities.map(function(city, index) {\n if (city.length >= input.length && city.substring(0, input.length)===input) {\n newResults.push(\n {\n name: city,\n id: index\n }\n );\n }\n })\n this.setState({searchResults: newResults});\n }\n }", "function cityNameSet() {\n cityNameEl.text(searchInputEl.val());\n APISearch();\n}", "function searchPlaces(input) {\n // default input\n if (input == \"add a city, place, or address\") return;\n\n if (input.split(\",\").length == 2 && Number(input.split(\",\")[0]) && Number(input.split(\",\")[1])) {\n mesh.add(input.split(\",\")[0], input.split(\",\")[1], input);\n self.updateBounds();\n return;\n }\n\n //var query = input.replace(\"&\",\"and\").replace(/[^\\w ]/ig, \"\").replace(\" \",\"+\");\n var query = input;\n\n var url = \"https://search.mapzen.com/v1/search?text=\" + query + \"&api_key=\" + mapzenapi;\n\n clearBox();\n\n $.ajax({\n url: url,\n cache: false,\n crossDomain: false,\n dataType: 'json',\n beforeSend: function() {\n loadingGif.show();\n },\n error: function(error, error1, error2){\n console.log(error2);\n },\n success: function(data){\n var results = data.features;\n loadingGif.hide();\n\n if (typeof results == \"undefined\" || results[0].geometry.length == 0) {\n // var msg = \"Hrm, we weren't able to find your search. Try again?\";\n searchError.fadeIn();\n searchbox.focus();\n return;\n } else if (results.length) {\n var bbox = results[0].bbox ? results[0].bbox : null;\n addPoint(results[0].geometry.coordinates, input, bbox, results[0].properties.country_a);\n }\n }\n });\n }", "function getSearchUrl(inputstr) {\n\t// if there is a comma delimiter within the input string...\n\tif (inputstr.search(\",\" != -1))\n\t{\n\t\t// Split up the input into an array to fill the state and city variables.\n\t\t// The limit is set to 3 so that no garbage collects in the second array element (in case more commas were added after state)\n\t\tvar inputArray = inputstr.split(\",\", 3);\n\t\tvar city = inputArray[0];\n\t\tvar state = inputArray[1];\n\t}\n\telse\n\t{\n\t\tvar city = inputstr;\n\t\tvar state = null;\n\t}\n\n\tif (state != null)\n\t{\n\t\t// returns the url used for searchCityList\n\t\treturn phpPath + \"citySearch.php?cityInput=\" + city + \"&stateInput=\" + state;\n\t}\n\telse\n\t{\n\t\t// keyurl not given since state is required for the cookie system to work.\n\t\treturn phpPath + \"citySearch.php?cityInput=\" + city;\n\t}\n}", "function searchNow(){\n\tvar inputstring = \"San Diego\";\n\tif ($(\"#searchbox\").val() != \"\"){\n\t\tinputstring = $(\"#searchbox\").val();\n\t}\n\tsearched = true;\n\tvar geocoderequest = new google.maps.Geocoder();\n\tvar geocoderesult;\n\tvar geocodestatus;\n\tgeocoderequest.geocode({address: inputstring}, function(geocoderesult, geocodestatus){\n\t\tif (geocodestatus == \"OK\"){\n\t\t\t$.each(geocoderesult, function(index, value){\n\t\t\t\tthisx = this;\n\t\t\t\tif(index == 0){\n\t\t\t\t\tmap.fitBounds(value.geometry.viewport);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t})\n\t\t}\n\t\telse if (geocodestatus == \"ZERO_RESULTS\"){\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\"#info\").html(\"Error, try again later\");\n\t\t}\n\t});\n}", "function searchNow(){\n\tvar inputstring = \"San Diego\";\n\tif ($(\"#searchbox\").val() != \"\"){\n\t\tinputstring = $(\"#searchbox\").val();\n\t}\n\tsearched = true;\n\tvar geocoderequest = new google.maps.Geocoder();\n\tvar geocoderesult;\n\tvar geocodestatus;\n\tgeocoderequest.geocode({address: inputstring}, function(geocoderesult, geocodestatus){\n\t\tif (geocodestatus == \"OK\"){\n\t\t\t$.each(geocoderesult, function(index, value){\n\t\t\t\tthisx = this;\n\t\t\t\tif(index == 0){\n\t\t\t\t\tmap.fitBounds(value.geometry.viewport);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t})\n\t\t}\n\t\telse if (geocodestatus == \"ZERO_RESULTS\"){\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\"#info\").html(\"Error, try again later\");\n\t\t}\n\t});\n}", "function SearchContactInCity(City)\n{\n let cityArray = contactsArray.filter(p =>p.city == City);\n console.log(\"Searched contacts in city \"+ City);\n console.log(cityArray);\n}", "function handleSearchFormSubmit(event) {\n event.preventDefault();\n\n var cityText = cityInput.value.trim();\n\n // Return from function early if submitted citytext is blank\n if (cityText === \"\") {\n return;\n }\n\n // // print to the page\n cityListEl.append(cityText);\n\n // Add new cityText to cities array, clear the input\n if (!cities.includes(cityText)) {\n cities.push(cityText);\n }\n // cityInput.value = \"\";\n\n console.log(cityText);\n\n // Store updated cities in localStorage, re-render the list\n storeCities();\n renderCities();\n searchApi(cityText);\n}" ]
[ "0.7724174", "0.75796634", "0.73582375", "0.73442787", "0.72965163", "0.72839326", "0.7275037", "0.72639036", "0.7254467", "0.72539014", "0.7252551", "0.7240956", "0.7237662", "0.721005", "0.71844906", "0.71435875", "0.7139418", "0.7124022", "0.7105823", "0.706064", "0.6975396", "0.6975184", "0.69533044", "0.69523597", "0.6927977", "0.69016856", "0.6889587", "0.68762004", "0.6872234", "0.68709385", "0.6869109", "0.6867045", "0.68528485", "0.68120235", "0.68029165", "0.6800941", "0.6798923", "0.6792449", "0.6788601", "0.6765203", "0.67633486", "0.6749397", "0.6747297", "0.674491", "0.67257357", "0.6719079", "0.6704568", "0.6696861", "0.6696861", "0.6685604", "0.66834706", "0.6659787", "0.66595286", "0.665788", "0.665683", "0.6656056", "0.6640214", "0.6635123", "0.66345906", "0.66267794", "0.66216743", "0.66201144", "0.66164", "0.6604488", "0.65981543", "0.656539", "0.6529545", "0.6525018", "0.652209", "0.6520289", "0.6514906", "0.6508127", "0.65038407", "0.65019447", "0.64976406", "0.6494419", "0.6493887", "0.6479259", "0.6479105", "0.647718", "0.6459192", "0.64560795", "0.64548004", "0.6451454", "0.6446767", "0.64394736", "0.64266765", "0.6424694", "0.64112806", "0.64019936", "0.63900006", "0.638544", "0.63828087", "0.6381101", "0.6379018", "0.6374908", "0.6365799", "0.6365799", "0.6359656", "0.63580185" ]
0.7460447
2
function to handle Search by Country
function handleSearchButtonClickCountry() { // Format the user's search by removing leading and trailing whitespace var filterCountry = $countryInput.value.trim().toLowerCase(); // Set ufoSightings to an array of all dataSet whose "date" matches the filter ufoSightings = dataSet.filter(function(sightings) { var sightingCountry = sightings.country.toLowerCase(); // If true, add the sighting to the filterState, otherwise don't add it to filterState return sightingCountry === filterCountry; }); renderTable(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function search(country) {\n \n searchFunnyVideos(country);\n searchAboutVideos(country);\n \n}", "function searching(){\r\n const REST_URL = \"https://restcountries.eu/rest/v2/name/\";\r\n\r\n let url = REST_URL;\r\n\r\n let country = document.querySelector(\"#searchterm\").value;\r\n countryShown = country;\r\n\r\n country = country.trim();\r\n\r\n country = encodeURIComponent(country);\r\n\r\n if(country.length < 1)return;\r\n\r\n url += country;\r\n\r\n document.querySelector(\"#status\").innerHTML = \"<b>Searching for '\" + countryShown + \"'</b>\";\r\n getData(url);\r\n}", "function countrySearch(){\n var countries = $(\"#countrySearchList\").children(\"input\");\n var countriesText = $(\"#countrySearchList\").children(\"span\");\n\n var query = $(\"#countrySearchInput\").val().toUpperCase();\n\n for (var i = 0; i < countries.length; i++) {\n if (countries[i].value.toUpperCase().indexOf(query) > -1) {\n countries[i].style.display = \"\";\n countriesText[i].style.display = \"\";\n\n }\n else {\n countries[i].style.display = \"none\";\n countriesText[i].style.display = \"none\";\n }\n }\n}", "function onSearchCountry(){\n setCountry(item)\n }", "function searchFromFilter() {\r\n GetAjaxData(\"https://restcountries.eu/rest/v2/all?fields=name;topLevelDomain;capital;currencies;flag\", response => filterArrayOfCountries(response) , err => console.log(err))\r\n}", "function search(data, countryFromList) {\n let obj = data.find((o) => o.Country === countryFromList);\n printResults(obj);\n}", "function search()\n\t\t{\n\t\t\tvar q = document.getElementById('searchBox').value;\n\t\t\t\n\t\t\tif(q==\"\")\n\t\t\t{\n\t\t\t\talert(\"Enter a keyword\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif(activeRequests > 0)\n\t\t\t{\n\t\t\t\talert(\"Please Wait..\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tclearDisplay();\n\t\t\t\n\t\t\t// Search each country in list.\n\t\t\tfor (var country in countryDomainList)\n\t\t\t{\n\t\t\t\tsearchImage(q,country);\n\t\t\t}\n\t\t\n \n }", "function findCountry(country) {\r\n if (country.name == \"India\") {\r\n return country;\r\n }\r\n }", "function searchAllCountries() {\r\n GetAjaxData(\"https://restcountries.eu/rest/v2/all?fields=name;topLevelDomain;capital;currencies;flag\", response => createArrayFromAllCountries(response) , err => console.log(err))\r\n}", "async function CountrySearch(country_search, region) {\n let el = $('#countrieslist');\n el.html('');\n let apiURL = 'https://restcountries.eu/rest/v2/all';\n\n if(country_search == '') { // Show all countries\n apiURL = 'https://restcountries.eu/rest/v2/all';\n } else if(country_search != null && region == null) { // Show specific country - Search area\n apiURL = 'https://restcountries.eu/rest/v2/name/'+country_search+'';\n } else if (region != null) { // Show countries based on the region - Dropdown value\n apiURL = 'https://restcountries.eu/rest/v2/region/'+region+'';\n }\n\n // Function bellow prints all the cards\n const apiGet = await getByApi(apiURL);\n apiGet.forEach(function(country){ \n const elAppend = `\n <a id=\"click\" class=\"a\" onclick=\"countryInfo('${country.alpha2Code}')\" href=\"#\">\n <div id=\"card\" class=\"card\" style=\"width: 18rem;\">\n <img class=\"card-img-top\" src=\"${country.flag}\"alt=\"Card image cap\">\n <div class=\"card-body\"><h5 id=\"countryName\" class=\"card-text\">${country.name}</h5> \n <div id=\"card-description\" class=\"card-description\">\n <p class=\"info\"><span class=\"card-text\">Population: </span>${country.population.toLocaleString('en-US') }\n </p><p class=\"info\"><span class=\"card-text\">Region: </span>${country.region }\n </p><p class=\"info\"><span class=\"card-text\">Capital: </span>${country.capital }\n </p></div></div></a>` \n el.append(elAppend);\n }) \n}", "function addCountryFilter(country) {\n var uppercase = country.toUpperCase();\n if(uppercase === \"ALL\") {\n activeSheet.applyFilterAsync(\n \"Country / Region\",\n \"\",\n tableau.FilterUpdateType.ALL);\n } else {\n var match = matchVoiceToDataCase(data, columnIndex, country);\n activeSheet.applyFilterAsync(\n \"Country / Region\",\n match,\n tableau.FilterUpdateType.ADD);\n }\n }", "function searchCountriesOnTypeAhead() {\n var name = document.getElementById('countryName');\n if (name.value.length > 1) {\n searchCountries();\n }\n}", "function getCountryCode(country, obj) {\n if (!country) {\n return '';\n }\n country = country.trim().toLowerCase();\n // country = country.slice(0, 1).toUpperCase() + country.slice(1);\n\n for (var i = 0; i < obj.geonames.length; i++) {\n var countryName = obj.geonames[i][\"countryName\"].toLowerCase();\n if (countryName === country) {\n return obj.geonames[i][\"countryCode\"];\n }\n }\n alert(\"Cannot find country name, will guess location based on city\");\n // getLocation();\n }", "function onSearch() {\r\n\r\n let valueOfInput = $(\"#valueOfSearch\");\r\n let isValidInput = validateInput(valueOfInput);\r\n\r\n if (!isValidInput) {\r\n return;\r\n }\r\n\r\n //init of input border\r\n valueOfInput.css(\"border\", \"\");\r\n\r\n let querySelectorAll = \"/rest/v2/name/\";\r\n\r\n let url = DOMAIN + querySelectorAll + valueOfInput.val().trim();\r\n\r\n $.get(url).then(\r\n function (countries) {\r\n $(\"#valueOfSearch\").val(\"\");\r\n removeAll();\r\n showCountries(countries);\r\n\r\n })\r\n .catch(function (error) {\r\n console.log(\"my error: \" + JSON.stringify(error));\r\n valueOfInput.css(\"border\", \"solid 3px red\");\r\n alert(\"Try again cannot found the country\");\r\n });\r\n }", "function search(address, country, data, $http) {\n var args = \"?q=\" + encodeURIComponent(address) + \",\" + country + \"&APPID=b2cc0479a61b2a6e145fddca11691478\" + \"&callback=JSON_CALLBACK\";\n $http({\n method: 'JSONP',\n url: '//api.openweathermap.org/data/2.5/weather' + args,\n }).then(function(response) {\n console.log(response);\n angular.extend(data, response.data, { status: 'OK' });\n }, function(response) {\n console.log(response);\n angular.extend(data, { status: 'ERR', statusText: response.statusText })\n });\n }", "function filterArrayOfCountries(countriesToFilter) {\r\n let filteredCoinsObj = new Array();\r\n let searchValue = document.getElementById(\"searchInputText\").value.toUpperCase();\r\n for( let i=0; i<countriesToFilter.length; i++ )\r\n if( countriesToFilter[i].name.toString().toUpperCase().includes(searchValue) == true) {\r\n filteredCoinsObj.push(countriesToFilter[i]);\r\n }\r\n createCountriesOnScreen(filteredCoinsObj);\r\n}", "function CountryFilter(value) {\n return (value.Country == selected_countries[0] || value.Country == selected_countries[1])\n}", "function search(evt){\r\n\r\n if (evt){\r\n // don't search if pressing keys to navigate the list\r\n switch(evt.which){\r\n case 13:\r\n case 37:\r\n case 38:\r\n case 40:\r\n evt.preventDefault();\r\n evt.stopPropagation();\r\n return false; \r\n break;\r\n }\r\n }\r\n\r\n var searchstring = plugin.pcwInput.val();\r\n\r\n if (searchstring == ''){\r\n return;\r\n }\r\n\r\n // store the search string\r\n plugin.pcwInput.data('search-text',searchstring);\r\n\r\n if ($.trim(searchstring) == ''){\r\n return false;\r\n }\r\n \r\n $.ajax({\r\n url: constants.searchURL.replace('{{key}}', plugin.config.apikey) + searchstring,\r\n type: 'GET',\r\n dataType: 'jsonp',\r\n success: function(data){\r\n \r\n var addresses = data.predictions;\r\n\r\n if (addresses.length > 0){\r\n\r\n if (addresses.length == 1){\r\n // go straight to browse ??\r\n //browse(addresses[0][1]);\r\n }\r\n\r\n plugin.pcwAddressBrowse.trigger('hide');\r\n plugin.pcwAddressSelect.html('');\r\n\r\n // check searchstring is still current.\r\n if (searchstring === plugin.pcwInput.val()){\r\n \r\n // add the addresses to the Select drop down\r\n $.each(addresses, function(index, value){\r\n var listitem = $('<li></li>');\r\n var css = (value.complete) ? 'finish' : 'browse';\r\n var listitemlink = $('<a href=\"#\" class=\"'+css+'\">'+value.prediction+'</a>').data((value.complete)?'finish-id':'browse-id',value.refs);\r\n\r\n plugin.pcwAddressSelect.append(listitem.append(listitemlink)).trigger('show');\r\n\r\n });\r\n\r\n }\r\n\r\n }else{\r\n // try and filter any results we already have ??\r\n //filter(plugin.pcwAddressSelect, evt);\r\n }\r\n\r\n },\r\n error: function() { debug('Search failed',2) },\r\n timeout: 2000\r\n });\r\n }", "function search_country(search){\n\tvar sResult = [];\n\tfor(let films in search_results){\n\t\tvar film = search_results[films];\n\t\tif(film.country){\n\t\tif(film.country.toLowerCase().includes(search.toLowerCase())){\n\t\t\tcountry.innerHTML+= \"<li><a href= \\\"show_movie.html?id=\" + films + \"\\\">\" + film.otitle + \"</a> </li> <br>\";\n\t\t}\n\t\t\t\n\t\t}\n\t}\n\tconsole.log(sResult);\n\t\n}", "function countrySearch() {\n // Get the input element\n const ctryInput = document.getElementById(\"ctry\");\n\n //Add Event listener\n ctryInput.addEventListener(\"keyup\", e => {\n const ctryClone = ctryInput.value.toLowerCase();\n const names = document.querySelectorAll(\"main h1\");\n const content = document.querySelector(\".display-wrapper\");\n\n // Loop through each country name to see if it contains user search\n names.forEach(name => {\n const nameConverted = name.textContent.toLowerCase();\n if(nameConverted.indexOf(ctryClone) !== -1) {\n name.parentElement.parentElement.style.display = \"block\";\n } else {\n name.parentElement.parentElement.style.display = \"none\";\n }\n }); \n });\n}", "function selectSalesCountry(country, name) { //39774936\n\t$(\"#dropdownMenuButtonLand\").text(name);\n\t\n\n\tswitch (country) {\n\t\tcase '6463683':\n\t\t\t$(\".selectSverige\").hide();\n\t\t\t$(\".selectNorge\").show();\n\t\t\t$(\"#search-persons\").val(name);\n\t\tbreak;\n\n\t\tcase '4190527':\n\t\t\t$(\".selectSverige\").show();\n\t\t\t$(\".selectNorge\").hide();\n\t\t\t$(\"#search-persons\").val(name);\n\t\tbreak;\n\n\t\tdefault:\n\t\t\t$(\".selectSverige\").show();\n\t\t\t$(\".selectNorge\").show();\n\t\t\t$(\"#search-persons\").val('');\n\t\tbreak;\n\t} \n\n\tvar inputFilter = document.getElementById('table-filter-input');\n\tinputFilter.addEventListener('input', function() {\n\n\t})\n\n\tif (country == 0) {\n\t\t$(\"#dropdownMenuButtonLand\").text(\"Alle\");\n\t\t$(\"#resetbtn\").fadeOut();\n\t\tfilterOptions[2] = \"\";\n\t} else {\n\t\tfilterOptions[2] = country;\n\t\t$(\"#resetbtn\").fadeIn();\n\t}\n\n\t$('#table-filter-input').val(filterOptions[0] + \" \" + filterOptions[1] + \" \" + filterOptions[2] + \" \" + filterOptions[3]);\n\tinputFilter.dispatchEvent(new Event('input'));\n\t\n\tgetStats();\n}", "autosearchCountry(e){\n\n\t\tdocument.getElementById('countryDropdownHideButton').style.display='inline-block'; //Show the hide button\n\t\tdocument.getElementById('countryDropdownShowButton').style.display='none';//Hide the show button\n\t\t\n\t\tlet countryName= document.getElementById(\"countrySearch\").value; //get the value in the input box\n\t\n\t\tthis.props.autosearchCountry(countryName, e); //lift state up to retrieve countries\n\t\t\n\t}", "function filterDiscover(default_filter, default_country, map, infowindow) {\n var filter = default_filter,\n recur_filter = 'approved=1&recur=1',\n type = document.getElementById('tournament_type_id').value,\n countrySelector = document.getElementById('location_country'),\n stateSelector = document.getElementById('location_state'),\n country = countrySelector.options[parseInt(countrySelector.value)+1].innerHTML,\n state = stateSelector.options[parseInt(stateSelector.value)+1].innerHTML,\n includeOnline = document.getElementById('include-online').checked;\n // type filtering\n if (type > 0) {\n filter = filter + '&type=' + type;\n $('#filter-type').addClass('active-filter');\n } else {\n $('#filter-type').removeClass('active-filter');\n }\n // country filtering\n if (country !== '---') {\n filter = filter + '&country=' + country;\n recur_filter = recur_filter + '&country=' + country;\n $('#filter-country').addClass('active-filter');\n $('#filter-online').removeClass('hidden-xs-up');\n if (country === 'United States') {\n $('#filter-state').removeClass('hidden-xs-up');\n $('#filter-spacer').addClass('hidden-xs-up');\n // state filtering\n if (state !== '---') {\n filter = filter + '&state=' + state;\n recur_filter = recur_filter + '&state=' + state;\n $('#filter-state').addClass('active-filter');\n } else {\n $('#filter-state').removeClass('active-filter');\n }\n }\n if (includeOnline) {\n filter = filter + '&include_online=1';\n }\n } else {\n $('#filter-country').removeClass('active-filter');\n $('#filter-online').addClass('hidden-xs-up');\n }\n // state filter only visible for US\n if (country !== 'United States') {\n $('#filter-state').addClass('hidden-xs-up');\n $('#filter-spacer').removeClass('hidden-xs-up');\n }\n // user's default country\n if (countrySelector.value == default_country) {\n $('#label-default-country').removeClass('hidden-xs-up');\n } else {\n $('#label-default-country').addClass('hidden-xs-up');\n }\n\n clearMapMarkers(map);\n var bounds = new google.maps.LatLngBounds();\n calendardata = {};\n // get tournaments\n updateDiscover('#discover-table', ['title', 'date', 'type', 'location', 'cardpool', 'players'], filter, map, bounds,\n infowindow, function() {\n // get weekly events\n updateDiscover('#recur-table', ['title', 'location', 'recurday'], recur_filter, map, bounds, infowindow, function() {\n drawCalendar(calendardata);\n hideRecurring();\n hideRecurringMap(map);\n updatePaging('discover-table');\n updatePaging('recur-table');\n });\n });\n}", "searchInputCountry(e) {\n //we create a function variable that takes the target of the input, and puts every letter one next to each other\n let { value } = e.target;\n //Then we select all the country names created earlier with the class 'country-name\"\n let names = document.querySelectorAll(\".country-name\");\n //And for each country name, we check if the country name contains the introduced value by the user (with method include) and in case that it contains it, we set the display to block.\n names.forEach((name) => {\n if (name.innerText.toLowerCase().includes(value.toLowerCase())) {\n name.parentElement.parentElement.style.display = \"block\";\n }\n //If it doesn't contain it, we hide it setting the display to none\n else {\n name.parentElement.parentElement.style.display = \"none\";\n }\n //And then we always will check if there is no input value by the user, we will make all of the countries been displaied as block, and this will make that if user typed something and then he deletes it, will make all the countries show again\n if (!value) {\n name.parentElement.parentElement.style.display = 'block'\n }\n })\n }", "function searchNow(){\n\tvar inputstring = \"San Diego\";\n\tif ($(\"#searchbox\").val() != \"\"){\n\t\tinputstring = $(\"#searchbox\").val();\n\t}\n\tsearched = true;\n\tvar geocoderequest = new google.maps.Geocoder();\n\tvar geocoderesult;\n\tvar geocodestatus;\n\tgeocoderequest.geocode({address: inputstring}, function(geocoderesult, geocodestatus){\n\t\tif (geocodestatus == \"OK\"){\n\t\t\t$.each(geocoderesult, function(index, value){\n\t\t\t\tthisx = this;\n\t\t\t\tif(index == 0){\n\t\t\t\t\tmap.fitBounds(value.geometry.viewport);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t})\n\t\t}\n\t\telse if (geocodestatus == \"ZERO_RESULTS\"){\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\"#info\").html(\"Error, try again later\");\n\t\t}\n\t});\n}", "function searchNow(){\n\tvar inputstring = \"San Diego\";\n\tif ($(\"#searchbox\").val() != \"\"){\n\t\tinputstring = $(\"#searchbox\").val();\n\t}\n\tsearched = true;\n\tvar geocoderequest = new google.maps.Geocoder();\n\tvar geocoderesult;\n\tvar geocodestatus;\n\tgeocoderequest.geocode({address: inputstring}, function(geocoderesult, geocodestatus){\n\t\tif (geocodestatus == \"OK\"){\n\t\t\t$.each(geocoderesult, function(index, value){\n\t\t\t\tthisx = this;\n\t\t\t\tif(index == 0){\n\t\t\t\t\tmap.fitBounds(value.geometry.viewport);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t})\n\t\t}\n\t\telse if (geocodestatus == \"ZERO_RESULTS\"){\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\"#info\").html(\"Error, try again later\");\n\t\t}\n\t});\n}", "dropdownSearch() {\n //We make the same as we did with the searchInputElement function, but using the regions. We select all regions with a querySelectorAll, and then for each one of them we check if it includes the selected region of the dropdown. We use include because the field 'country-region' is \"Region: Eurpoe\", so if we compare it will never be true\n let countryRegions = document.querySelectorAll('.country-region')\n countryRegions.forEach(region => {\n //Same as before, we check if it includes it and if it's true we display block the country\n if (this.innerText == 'All') {\n region.parentElement.parentElement.style.display = 'block'\n } \n //if the user press the All regions, we just show all of them wiht a display block\n else if (region.innerText.includes(this.innerText)) {\n region.parentElement.parentElement.style.display = 'block'\n } \n //and if not we just hide it with display none\n else {\n region.parentElement.parentElement.style.display = 'none'\n }\n })\n }", "function getData(country) {\n inputCountry = country;\n}", "function clickCountry(e) {\n // exit early if we are at high zoom\n if (CONFIG.map.getZoom() > 7) return;\n // clear the map search input\n $('form#search input').val('');\n // get the name of the clicked country, and keep a reference to it\n var name = e.target.feature.properties['NAME'];\n CONFIG.selected_country.name = name;\n highlightCountryLayer(e.target.feature);\n // call the search function\n searchCountry(name, e.target._bounds);\n}", "function country_select(view_name, option) {\n var site_name = document.getElementById(\"site_select\").value;\n var site_view = g_site_views[view_name];\n var field = 'country.keyword';\n var filters = site_view['filters'];\n var index = filters[field].indexOf(option);\n if (index >= 0) {\n filters[field].splice(index, 1);\n } else {\n filters[field].push(option);\n }\n show_breadcrumps(site_name);\n}", "function postalCodeLookup() {\n\n\t\t\tvar country = document.getElementById('country').value;\n\n\n if (geonamesPostalCodeCountries.toString().search(country) == -1) {\n return; // selected country not supported by geonames\n }\n // display 'loading' in suggest box\n document.getElementById('suggestBoxElement').style.visibility = 'visible';\n document.getElementById('suggestBoxElement').innerHTML = '<img src=\"/images/progress_arrow.gif\" border=\"0\"><small><i>Cargando...</i></small>';\n\n var postalcode = document.getElementById('postcode').value;\n\n request = 'http://www.geonames.org/postalCodeLookupJSON?postalcode=' + postalcode + '&country=' + country + '&callback=getLocation';\n\n //alert(\"request: \"+request);\n\n // Create a new script object\n aObj = new JSONscriptRequest(request);\n //alert(\"JSONrequest: \"+aObj);\n // Build the script tag\n aObj.buildScriptTag();\n // Execute (add) the script tag\n aObj.addScriptTag();\n\n}", "function findCountry(country, data){\n var key = country;\n var object = data[0][key];\n return object;\n }", "function getCountry(name){\nreturn countryData[name.toUpperCase()]\n}", "function searchCountry(name, bounds, delay=1) {\n // get the data for this country, *only* for updating the results panel\n // the map and table, continue to show all data\n var data = [];\n // search the data for matches to the country name\n DATA.tracker_data.forEach(function(feature) {\n // look for matching names in feature.properties.countries\n if (name == feature.country) data.push(feature);\n });\n\n // because we are not filtering the map, but only changing the bounds\n // results on the map can easily get out of sync due to a previous search filter\n // so first we need to explicity render() the map with all data, but not the table or results\n render({ name: name, map: true, results: false, table: false, fitbounds: false });\n // THEN update results panel for *this* country data only\n updateResultsPanel(data, name);\n // THEN the table, with all data, but not with this name\n // may seem superfluous, but important to keep the map/table in sync, and showing all data\n drawTable(DATA.tracker_data);\n\n // Last step: zoom the map to the selected country\n // some countries require special/custom bounds calcs, because they straddle the dateline or are otherwise non-standard\n switch (name) {\n case 'Russia':\n bounds = L.latLngBounds([38.35400, 24], [78.11962,178]);\n break;\n case 'United States':\n bounds = L.latLngBounds([18.3, -172.6], [71.7,-67.4]);\n break;\n case 'Canada':\n bounds = L.latLngBounds([41.6, -141.0], [81.7,-52.6]);\n break;\n default:\n break;\n }\n setTimeout(function() {\n CONFIG.map.fitBounds(bounds);\n }, delay)\n}", "function dropSearch(e){\r\n const REST_URL = \"https://restcountries.eu/rest/v2/name/\";\r\n\r\n let url = REST_URL;\r\n\r\n let country = e.srcElement.innerHTML;\r\n countryShown = country;\r\n\r\n country = encodeURIComponent(country);\r\n\r\n if(country.length < 1)return;\r\n\r\n url += country;\r\n document.querySelector(\"#status\").innerHTML = \"<b>Searching for '\" + countryShown + \"'</b>\";\r\n getData(url);\r\n}", "findByName(name, codeCountry = '') {\n let params = `${this.units}${this.lang}&appid=${this.APIKEY}`;\n let filter = '';\n if (codeCountry === '') {\n filter = `q=${name}`;\n }\n else {\n filter = `q=${name},${codeCountry}`;\n }\n const url = `${constants_1.URL_LOCALHOST}${constants_1.CURRENT}${filter}${params}`;\n return this.requestApi(url);\n }", "function searchForText() {\n // get the keywords to search\n var query = $('form#search input#mapsearch').val();\n\n // extract the fields to search, from the selected 'search category' options\n let category = $('select#search-category').val();\n\n // filter the object for the term in the included fields\n DATA.filtered = searchObject(DATA.tracker_data, query, CONFIG.search_categories[category]);\n\n // suggestions: if the search category is \"company\", include a list of suggestions below \n var suggestions = $('div#suggestions').empty();\n if (category == 'parent') {\n suggestions.show();\n var companies = searchArray(DATA.companies, query).sort();\n companies.forEach(function(company) {\n var entry = $('<div>', {'class': 'suggestion', text: company}).appendTo(suggestions);\n entry.mark(query);\n });\n }\n\n // add the results to map, table, legend\n drawMap(DATA.filtered); // update the map (and legend)\n updateResultsPanel(DATA.filtered, query) // update the results-panel\n drawTable(DATA.filtered, query); // populate the table\n $('form#nav-table-search input').val(query); // sync the table search input with the query\n CONFIG.selected_country.layer.clearLayers(); // clear any selected country\n CONFIG.selected_country.name = ''; // ... and reset the name\n $('div#country-results').show(); // show the results panel, in case hidden\n $('a.clear-search').show(); // show the clear search links\n\n return false;\n}", "function valCountriesAndRegions() { \n var rcrdsObj = entityObj.curRcrds;\n var countries = buildCountryRefObj(); \n \n for (var locDesc in rcrdsObj) { checkCntryAndRegion(rcrdsObj[locDesc]); }\n\n function checkCntryAndRegion(rcrdsAry) { //console.log(\"checkCntryAndRegion called. rcrdsAry = %O\", rcrdsAry)\n rcrdsAry.forEach(function(rcrd){\n if (rcrd.country === null) { return; }\n if (rcrd.country in countries) { //console.log(\"----country key found\")\n checkRegion(rcrd)\n } else if (countryCanBeDetermined(rcrd.country, rcrd)) { //console.log(\"--------country can be determined\") \n checkRegion(rcrd)\n } else { console.log(\"unable to determine country = %s, rcrd = %O \", rcrd.country, rcrd) }\n });\n\n function countryCanBeDetermined(cntryStr, rcrd) {\n if (cntryStrInCntryKey(cntryStr, rcrd) || cntryHasNameVariant(cntryStr, rcrd)) {\n return true;\n } else { return false; }\n } \n function cntryStrInCntryKey(cntryStr, rcrd) {\n var capsCntry = cntryStr.toUpperCase();\n\n for (var cntryKey in countries) {\n var capsCntryKey = cntryKey.toUpperCase(); \n if (capsCntryKey.search(capsCntry) !== -1) { //console.log(\"cntryStrInCntryKey found. org = %s, new = %s\", cntryStr, cntryKey)\n rcrd.country = cntryKey;\n return true; \n }\n }\n }\n function cntryHasNameVariant(cntryStr, rcrd) {\n var nameVariations = { \n \"USA\": \"United States\",\n \"US Virgin Islands\": \"Virgin Islands, U.S.\",\n \"Niue Island\": \"Niue\",\n \"Java\": \"Indonesia\",\n };\n if (cntryStr in nameVariations) { //console.log(\"cntryHasNameVariant. org = %s, new = %s\", cntryStr, nameVariations[cntryStr])\n rcrd.country = nameVariations[cntryStr];\n return true; \n }\n }\n function checkRegion(rcrd) { \n var cntryRegion = countries[rcrd.country];// console.log(\"cntryRegion = \", cntryRegion);\n if (rcrd.region === null) { rcrd.region = cntryRegion; //console.log(\"------------region null.\") \n } else if (rcrd.region === cntryRegion) { //console.log(\"------------regions equal\") \n } else if ( regionCanBeDetermined() ) {// console.log(\"--------regions can be determined\") \n } else { console.log(\"unable to determine region. rcrd = %O\", rcrd) }\n \n function regionCanBeDetermined() { //console.log(\"regionCanBeDetermined?? region = %s, rcrd = %O\", rcrd.region, rcrd) \n var nameVariations = {\n \"Caribbean\": \"Caribbean Islands\",\n \"West Africa\": \"Sub-Saharan Africa\",\n }\n if (rcrd.region in nameVariations) { //console.log(\"regionCanBeDetermined. org = %s, new = %s, rcrd = %O\", rcrd.region, nameVariations[rcrd.region], rcrd)\n rcrd.region = nameVariations[rcrd.region];\n return true; \n } else if (rcrd.country === \"Mexico\" && rcrd.region === \"North America\") {\n rcrd.region = \"Central America\";\n return true; \n } else { return false; }\n }\n } /* End checkRegion */\n } /* End checkCntryAndRegion */\n }", "function set_country_list(query){\n let country_list = document.getElementById(\"city_search_list\");\n let html = \"\";\n\n let founded = STATS.countries.filter((el) => {\n return ( el.name.toLowerCase().includes(query) );\n });\n\n founded.forEach(function(el){\n let {code, name} = el;\n if( code.toLowerCase() != \"dp\" ){\n html += `<li class=\"input-dropdown-item\"><a href=\"#\" data-set-view=\"country\" data-params='{\"slug\":\"${code}\"}' data-value=\"${code} ${ get_country(code) }\" class=\"input-dropdown-button\" z-index=\"1\"><img src=\"${return_flag_url(code.toLowerCase())}\"/> ${ get_country(code) }</a></li>`;\n }\n });\n\n country_list.innerHTML = html;\n\n update_set_view_triggers();\n\n country_list.querySelectorAll(\"a\").forEach(function(el){\n el.addEventListener('click', function(e){\n if( country_list.classList.contains(\"show\") ){\n country_list.classList.remove(\"show\");\n country_list.previousElementSibling.value = \"\";\n }\n });\n });\n}", "function postalCodeSearch(postalCode,countryCode) {\n\n\t//Default to the US if there is no country code provided\n\tif(countryCode==undefined){\n\t\tcountryCode = 'US';\n\t}\n\n\t//\tAPI Key/Username for geonames\n\t// register for a user name at http://www.geonames.org/login\n\tvar apiUserName = \"[REPLACE WITH GEONAMES USERID]\";\n\n\tvar input = {\n\t method : 'get',\n\t returnedContentType : 'json',\n\t path : 'postalCodeSearchJSON',\n\t\tparameters: {\n\t\t\t\t\t\t'postalcode':postalCode,\n\t\t\t\t\t\t'country':countryCode,\n\t\t\t\t\t\t'maxRows':'10',\n\t\t\t\t\t\t'username':apiUserName\n\t\t\t\t\t}\n\t};\n\n\tvar response = MFP.Server.invokeHttp(input);\n\n\tvar postalCode\t=\t{};\n\tif(response.statusCode == 200){\n\t\t// Parse out all the stuff that doesn't need to be returned with the response body.\n\t\t// Grab just the first postal code response & return that\n\t\tpostalCode= response.postalCodes[0];\n\t} else {\n\t\tpostalCode = response\n\t}\n\n\treturn postalCode;\n}", "function searchActivity() {\n const place = autocomplete.getPlace();\n if (countryField.value == \"all\") {\n alert(\"Please choose a country and city before searching for an activity\");\n resetForm();\n } else if ($(\"#autocomplete\").val() == \"\") {\n alert(\"Please enter a city\");\n } else if (place === undefined) {\n alert(\"City is not valid, please select a valid city\");\n } else {\n searchOptions($(\"#activity\").val());\n }\n}", "function searchCity(savedCity){\n \n getCurrentWeather( savedCity);\n getForecastWeather( savedCity);\n \n}", "function loadFunctionality() {\n document.getElementById(\"search-button\").onclick = () => { getCountryInformation(countryInput.value) };\n countryInput.addEventListener(\"keypress\", (e) => {\n if (e.code === \"Enter\") {\n getCountryInformation(countryInput.value);\n }\n });\n}", "function search(location) {\r\n switch (carType) {\r\n case \"gus\":\r\n searchGus(location);\r\n break;\r\n case \"eletric\":\r\n searchEletric(location);\r\n }\r\n}", "function geocodeSearch (){\n\t\tvar cityValue = $('#searchBox').val();\n\t\tvar geocoder = new google.maps.Geocoder();\n\t\tvar geocoderOptions = {\n\t\t\taddress: cityValue\n\t\t}\n\t\t\n\t\tgeocoder.geocode(geocoderOptions, function(results, status) {\n\t\t\tif (status === 'OK'){\n\t\t\t\tvar latitude = results[0].geometry.location.lat();\n\t\t\t\tvar longitude = results[0].geometry.location.lng();\t\n\n\t\t\t\tgetWeather(latitude, longitude, results[0].formatted_address);\n\n\t\t\t\tmap.setCenter(results[0].geometry.location);\n\n\t\t\t\tif(!marker) {\n\t\t\t\t\tmarker = new google.maps.Marker({\n\t\t\t\t\t\tmap: map,\n\t\t\t\t\t\tposition: results[0].geometry.location\t\n\t\t\t\t\t});\n\t\t\t\t}else {\n\t\t\t\t\tmarker.setPosition(results[0].geometry.location);\n\t\t\t\t}\n\n\t\t\t} else { \n\t\t\t\tconsole.log(\"Geocode Error\" + status);\n\t\t\t}\n\t\t});\n\t}", "function searchVenue(){\n\t\t$(\"#query\").click(function(){\n\t\t\t$(this).val(\"\");\n\t\t});\n\n\t\t$(\"#query\").blur(function(){\n\t\t\tif ($(this).val() == \"\") {\n\t\t\t\t$(this).val(\"Example: Ninja Japanese Restaurant\");\n\t\t\t}\n\t\t\n\t\t\tif ($(this).val() != \"Example: Ninja Japanese Restaurant\") {\n\t\t\t\t$(this).addClass(\"focus\");\n\t\t\t} else {\n\t\t\t\t$(this).removeClass(\"focus\");\n\t\t\t}\n\t\t});\n\n\t\t//Submit search query and call to getVenues\n\t\t$(\"#searchform\").submit(function(event){\n\t\t\tevent.preventDefault();\n\t\t\tif (!lat) {\n\t\t\t\tnavigator.geolocation.getCurrentPosition(getLocation);\n\t\t\t} else {\n\t\t\t\tgetVenues();\n\t\t\t}\t\t\n\t\t});\n\n\t}", "async function searchForCountry(){\n let response = await fetch(`https://restcountries.com/v3.1/name/${searchBar.value}`);\n \n\n let filtered = await response.json();\n \n let i = null;\n filteredNations = [];\n \n for(i=0;i<filtered.length;i++){ \n let {name,capital,region,population,flags} = filtered[i];\n \n let country = {\n \n name: name.common,\n capital: capital,\n region: region,\n population: population,\n flag: flags.svg\n }\n \n filteredNations.push(country);\n }\n\n showCountries(filteredNations);\n console.log(filteredNations);\n console.log(filterCountries.value);\n}", "function requestCountrySpecificData() {\n DevSearchStore.getCountryDataFromServer();\n DevSearchStore.getDeveloperCountByCountryFromServer();\n DevSearchStore.getDeveloperCountByLanguageFromServer();\n}", "function selectFilter() {\n var select = document.getElementById('inputFirstSelect');\n select.addEventListener('change', function () {\n var option = this.selectedOptions[0];\n var value = option.textContent;\n if (value == 'Região')\n searchRegion()\n\n if (value == 'Capital')\n searchCapital()\n\n if (value == 'Língua')\n searchLanguage()\n\n if (value == 'País')\n searchCountry()\n\n if (value == 'Cod. Ligação')\n searchCallingCode()\n });\n\n}", "function getCountryInfo() {\n var e = document.getElementById(\"country\");\n var strCountry = e.options[e.selectedIndex].value;\n twlGeo.getGeoNames('countryInfo', { country: strCountry }, countryInfo)\n}", "handleChange(event) {\n const searchValue = event.target.value\n // updates search value to filter countries names\n this.setState({ searchValue })\n }", "async getCitiesByCountries(req, res, next) {\n try {\n const { country } = req.params;\n const cities = await models.Locations.findAll({\n attributes: ['city_name'],\n where: { country_name: country },\n returning: true\n });\n if (!cities.length) {\n return response.success(res, 200, 'No cities saved in the country');\n }\n return response.success(res, 200, cities);\n } catch (error) {\n return next({ message: error.message });\n }\n }", "function main(error, search_data, countries_data) {\n\tif (error) throw error;\n\t\n\tcountries = countries_data;\n\tsearch = search_data;\n\tupdate(\"Aliens of the Deep\");\n\t\n}", "function filterCovidData(value) {\n let searchResults = covidData.filter(object => {\n // console.log(object.country);\n let countryString = object.country.toLowerCase();\n return countryString.includes(value); //might want to do a regex in the future\n });\n return searchResults;\n}", "function searchLocations() {\n\n var address = document.getElementById(\"addressInput\").value;\n\n var geocoder = new google.maps.Geocoder();\n\n geocoder.geocode({ address: address }, function( results, status ) {\n\n if (status == google.maps.GeocoderStatus.OK) {\n searchLocationsNear(results[0].geometry.location);\n } else {\n alert(address + ' not found');\n }\n \n });\n\n }", "function getCountryData(searchObject) {\n return CountrySearchService.getCountryData(searchObject);\n }", "function search() {\n\tclearEventSpecificInfo();\n\t// Fetch address from the set location box.\n\t// If default or blank, use the home address.\n\tvar address = $('#set_location_box').val();\n\tif (address == 'Address, City, State or Zip' || address == '') {\n\t\taddress = currentAddress;\n\t}\n\tif (geocoder) {\n geocoder.geocode (\n \t{'address': address},\n \tfunction(results, status) {\n \tif (status == google.maps.GeocoderStatus.OK) {\n\t\t\t\t\tvar location = results[0].geometry.location;\n\t\t\t\t\tstoreMyLocation(location.lat(), location.lng());\n\t\t\t\t\tinitChores();\n \t}\n }\n );\n\t}\n}", "function selectRegion(){\n let selectedOption = document.getElementById('region-filter')\n let selectedValue = selectedOption.options[selectedOption.selectedIndex].value\n if(selectedValue === 'Africa'){\n countryToShow = state.countryList.filter((country) =>\n country.region.includes(selectedValue)\n );\n renderCountries(countryToShow);\n }else if(selectedValue === 'America'){\n countryToShow = state.countryList.filter((country) =>\n country.region.includes(selectedValue)\n );\n renderCountries(countryToShow);\n }else if(selectedValue === 'Asia'){\n countryToShow = state.countryList.filter((country) =>\n country.region.includes(selectedValue)\n );\n renderCountries(countryToShow);\n }else if(selectedValue === 'Europe'){\n countryToShow = state.countryList.filter((country) =>\n country.region.includes(selectedValue)\n );\n renderCountries(countryToShow);\n }else if(selectedValue === 'Oceania'){\n countryToShow = state.countryList.filter((country) =>\n country.region.includes(selectedValue)\n );\n renderCountries(countryToShow);\n }else {\n renderCountries(state.countryList);\n return;\n }\n }", "function lookup() {\n\n var country = $country.val();\n var zipcode = $zipcode.val();\n\n // check inputs\n if (!country) {\n $result.text(SELECT_COUNTRY);\n } else if (!zipcode) {\n $result.text(ENTER_ZIPCODE);\n } else {\n $submit.prop(\"disabled\", true);\n\n geoQuery(country, zipcode, '', function(result) {\n\n if (!result) {\n $result.text(INVALID_ZIPCODE);\n return;\n }\n \n var localities = [];\n \n // Get a list of primary cities\n var cities = result.address_components.filter(function(component) {\n return component.types.indexOf('locality') !== -1\n }).map(function(component) {\n return component.long_name;\n });\n\n // collect cities which share the same postcode\n var pl = result.postcode_localities;\n if (pl && pl.length) {\n for (var j = 0; j < pl.length; j++) {\n if (cities.indexOf(pl[j]) === -1 && localities.indexOf(pl[j]) === -1) {\n localities.push(pl[j]);\n }\n }\n }\n\n // no other cities share the postcode, just render resultd\n if (!localities.length) {\n parseResults([ result ]);\n }\n\n // collect all other cities\n else {\n\n var mergedResults = [ result ];\n\n function receive(result, data) {\n localities.splice(localities.indexOf(data.address), 1);\n if (result) {\n mergedResults.push(result);\n }\n if (!localities.length) {\n parseResults(mergedResults);\n }\n }\n\n for (var i = localities.length - 1; i >= 0; i--) {\n (function (address) {\n geoQuery(country, zipcode, address, receive);\n })(localities[i]);\n }\n }\n });\n }\n }", "function printCountries(countries, region, search = false) {\n var summeryObj = {\n NewConfirmed: 0,\n TotalConfirmed: 0,\n NewDeaths: 0,\n TotalDeaths: 0,\n NewRecovered: 0,\n TotalRecovered: 0,\n };\n var template = loadTemplate(\"countryinfo.ejs\");\n $(\".capiCountryContainer\").html(\"\");\n\n $.each(countries, function (i, field) {\n if (\n countriesMapping[field.CountryCode].region == region ||\n region == \"global\" ||\n search == true\n ) {\n summeryObj[\"NewConfirmed\"] =\n summeryObj[\"NewConfirmed\"] + field.NewConfirmed;\n summeryObj[\"TotalConfirmed\"] =\n summeryObj[\"TotalConfirmed\"] + field.TotalConfirmed;\n summeryObj[\"NewDeaths\"] = summeryObj[\"NewDeaths\"] + field.NewDeaths;\n summeryObj[\"TotalDeaths\"] = summeryObj[\"TotalDeaths\"] + field.TotalDeaths;\n summeryObj[\"NewRecovered\"] =\n summeryObj[\"NewRecovered\"] + field.TotalDeaths;\n summeryObj[\"TotalRecovered\"] =\n summeryObj[\"TotalRecovered\"] + field.TotalRecovered;\n $(\".capiCountryContainer\").append(ejs.render(template, field));\n }\n });\n updatedCapiInformation(\n region,\n summeryObj.NewConfirmed,\n summeryObj.TotalConfirmed,\n summeryObj.NewDeaths,\n summeryObj.TotalDeaths,\n summeryObj.NewRecovered,\n summeryObj.TotalRecovered\n );\n}", "function additional_search()\n\t{\t\n\t\t$.mobile.showPageLoadingMsg();\n\t\tvar location=$('#pgeo').val();\n\t\t//alert(location);\n\t\tif(location == \"\")\n\t\t{\n\t\t\talert('Please enter a location to search');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t $(\"#geo-of-parent\").geocomplete('find',location);\n\t\t\t $(\"#geo-of-parent\").trigger(\"geocode\");\n\t\t\t $.mobile.hidePageLoadingMsg();\n\t\t\t $.mobile.changePage('#recherche',{transition:'flip'});\n\t\t}\n\t}", "function countryMatch(searchTerm) {\n var allCountries = \"https://api.covid19api.com/countries\";\n var currentCountry = \"\";\n $.ajax({\n url: allCountries,\n method: \"GET\",\n }).then(function (response) {\n for (var i = 0; i < response.length; i++) {\n if (response[i].Country === searchTerm) {\n // add the name of the country to the country element\n countryText.text(\" \" + response[i].Country);\n // set the current country to the slug\n currentCountry = response[i].Slug;\n // grab the country's ISO2 abbreviation to find the flag\n countryISO = response[i].ISO2;\n i = response.length;\n formattedISO = countryISO.toLowerCase();\n var imageLocation = \"./flagImages/\" + formattedISO + \".jpg\";\n // add the flag image to the flag element\n flagEle.attr(\"src\", imageLocation);\n // pass the countries ISO2 code to get the ISO3 code\n threeLetterCode(countryISO);\n // if searchterm exsists in database then create a button out of it\n createButton(searchTerm);\n }\n }\n // check to see if there was a response from the country api\n if (currentCountry === \"\") {\n //create notification that tells user to change input\n var notificationColumn = $(\"<div>\").addClass(\"column is-4 is-offset-4\");\n var notificationEle = $(\"<div>\").addClass(\"notification\");\n var deleteButton = $(\"<button>\").addClass(\"delete\");\n notificationEle.append(deleteButton);\n var notificationText = $(\"<p>\");\n notificationText.text(\n \"Your search did not match a country. Please make sure your spelling and capitalization are correct.\"\n );\n notificationEle.append(notificationText);\n notificationColumn.append(notificationEle);\n $(\"body\").append(notificationColumn);\n }\n // send the current country to be searched in the COVID api and to create a new button\n activeSearch(currentCountry);\n });\n}", "function filterCountry(countryCode,data){\n\n\tvar result;\n\n\tdata.forEach(function(entry) {\n\n\t\tif (entry.key == countryCode || entry.iso == countryCode){\n\t\t\tresult = entry\n\t\t}\n\t})\n\n\treturn result\n}", "function search_map() {\n\n\t\t$(\".searchbox-submit\").click(function() {\n\n\t\t\tevent.preventDefault();\n\n\t\t\t//Clear map of all selected regions\n\t\t\tclear_map();\n\n\t\t\t//Get search string\n\t\t\tsearch_string = $(\".searchbox-input\").val(); //In 1.4.1.2, search string is DECLARED here, why not in 1.4.1.1?\n\n\t\t\t//Convert search string to country code\n\t\t\tif(search_string) {\n\n\t\t\t\tif(search_string == 'rice' || search_string == 'arroz' || search_string == 'Arroz') {\n\t\t\t\t\tsearch_string = 'arroz';\n\t\t\t\t\tcountry_code = ['BD','BT','CN','ES','IN','ID','PH','VN','TH','MM','FR','BR','JP','US','KP','KR','CO','PE','VE','KH','IR','LA','MG','NP','NE','PK','LK'];\n\t\t\t\t} else if(search_string == 'gallo pinto') {\n\t\t\t\t\tsearch_string = 'gallo pinto';\n\t\t\t\t\tcountry_code = ['CR','NI'];\n\t\t\t\t} else if(search_string == 'bisi bele bath' || search_string == 'Bisi bele bath') {\n\t\t\t\t\tcountry_code = ['IN'];\n\t\t\t\t}\n\n\t\t\t\t//Add countries to array for display\n\t\t\t\tfor (var id in country_code) {\n\t\t\t\t\t$(\"#results\").append(' ' + search_string + ' (ID: ' + country_code[id] + ')');\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\t//Push countries to selected array\n\t\t\tfor (var id in country_code) {\n\t\t\t\tmap.dataProvider.areas.push({ id: country_code[id], showAsSelected: true});\n\t\t\t}\n\n\t\t\t//Esto hace que el mapa haga su gracia\n\t\t\t//Reflect changes in map\n\t\t\tmap.validateNow();\n\n\t\t});\n\t}", "function findCountry(){\n document.querySelector(\"input\").addEventListener(\"keypress\", function(){\n if(event.which == 13){\n // PREVENT FORM FROM SUBMITTING\n const element = document.querySelector(\"form\").addEventListener(\"submit\", function(e){\n e.preventDefault();\n });\n if(this.value == \"\")\n showCountries(\"all\");\n else\n showCountries(\"name/\" + this.value.toLowerCase());\n this.value = \"\";\n }\n });\n}", "handlerSearch(search){\n const filterContacts = this.state.contacts.filter( contact =>\n contact.name.toLowerCase().includes(search.toLowerCase())\n || contact.email.toLowerCase().includes(search.toLowerCase())\n || contact.website.toLowerCase().includes(search.toLowerCase())\n || checkPhone(contact.phone, search)\n || contact.company.name.toLowerCase().includes(search.toLowerCase())\n || contact.address.country.toLowerCase().includes(search.toLowerCase())\n );\n this.setState({filterContacts});\n }", "function countryFilter(value) { \n return (value.Country == checkedCountries[0]\n || value.Country == checkedCountries[1]\n || value.Country == checkedCountries[2]);\n}", "function findData (d, countryCodes, country_data) {\n var country_name = \"\";\n for (var j = 0; j < countryCodes.length; j++)\n {\n if (countryCodes[j].id == d.id)\n {\n country_name = countryCodes[j].name;\n break;\n }\n }\n\n for (j = 0; j < country_data.length; j++)\n {\n if (country_data[j].Name == country_name)\n {\n return (country_data[j]);\n }\n }\n}", "function search(searchType, searchText)\n{\t\n\tswitch (searchType){\n\t\tcase \"City\":\n\t\t\tsearchCity(searchText);\n\t\t\tbreak;\n\t\tcase \"Region\":\n\t\t\tsearchRegion(searchText);\n\t\t\tbreak;\n\t\tcase \"Team\":\n\t\t\tsearchTeam(searchText);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\n\t}\n}", "function init() {\n var name = localStorage.getItem('SearchTerm');\n console.log(\"Name:\", name);\n if (name !== null && name !== '') {\n document.getElementById(\"countryName\").value = name;\n searchCountries();\n }\n }", "function getCountries() {\n var countryChoices = [\n {\n \"abbr\":\"\",\n \"name\":\"(not applicable)\"\n },\n {\n \"abbr\":\"AF\",\n \"name\":\"Afghanistan\"\n },\n {\n \"abbr\":\"AX\",\n \"name\":\"Akrotiri\"\n },\n {\n \"abbr\":\"AL\",\n \"name\":\"Albania\"\n },\n {\n \"abbr\":\"AG\",\n \"name\":\"Algeria\"\n },\n {\n \"abbr\":\"AQ\",\n \"name\":\"American Samoa\"\n },\n {\n \"abbr\":\"AN\",\n \"name\":\"Andorra\"\n },\n {\n \"abbr\":\"AO\",\n \"name\":\"Angola\"\n },\n {\n \"abbr\":\"AV\",\n \"name\":\"Anguilla\"\n },\n {\n \"abbr\":\"AY\",\n \"name\":\"Antarctica \"\n },\n {\n \"abbr\":\"AC\",\n \"name\":\"Antigua and Barbuda\"\n },\n {\n \"abbr\":\"AR\",\n \"name\":\"Argentina\"\n },\n {\n \"abbr\":\"AM\",\n \"name\":\"Armenia\"\n },\n {\n \"abbr\":\"AA\",\n \"name\":\"Aruba\"\n },\n {\n \"abbr\":\"AT\",\n \"name\":\"Ashmore and Cartier Islands\"\n },\n {\n \"abbr\":\"AS\",\n \"name\":\"Australia\"\n },\n {\n \"abbr\":\"AU\",\n \"name\":\"Austria\"\n },\n {\n \"abbr\":\"AJ\",\n \"name\":\"Azerbaijan\"\n },\n {\n \"abbr\":\"BF\",\n \"name\":\"Bahamas\"\n },\n {\n \"abbr\":\"BA\",\n \"name\":\"Bahrain\"\n },\n {\n \"abbr\":\"FQ\",\n \"name\":\"Baker Island \"\n },\n {\n \"abbr\":\"BG\",\n \"name\":\"Bangladesh\"\n },\n {\n \"abbr\":\"BB\",\n \"name\":\"Barbados \"\n },\n {\n \"abbr\":\"BO\",\n \"name\":\"Belarus\"\n },\n {\n \"abbr\":\"BE\",\n \"name\":\"Belgium\"\n },\n {\n \"abbr\":\"BH\",\n \"name\":\"Belize\"\n },\n {\n \"abbr\":\"BN\",\n \"name\":\"Benin\"\n },\n {\n \"abbr\":\"BD\",\n \"name\":\"Bermuda\"\n },\n {\n \"abbr\":\"BT\",\n \"name\":\"Bhutan\"\n },\n {\n \"abbr\":\"BL\",\n \"name\":\"Bolivia\"\n },\n {\n \"abbr\":\"BK\",\n \"name\":\"Bosnia-Herzegovina\"\n },\n {\n \"abbr\":\"BC\",\n \"name\":\"Botswana\"\n },\n {\n \"abbr\":\"BV\",\n \"name\":\"Bouvet Island\"\n },\n {\n \"abbr\":\"BR\",\n \"name\":\"Brazil\"\n },\n {\n \"abbr\":\"IO\",\n \"name\":\"British Indian Ocean Territory\"\n },\n {\n \"abbr\":\"VI\",\n \"name\":\"British Virgin Islands\"\n },\n {\n \"abbr\":\"BX\",\n \"name\":\"Brunei\"\n },\n {\n \"abbr\":\"BU\",\n \"name\":\"Bulgaria\"\n },\n {\n \"abbr\":\"UV\",\n \"name\":\"Burkina Faso\"\n },\n {\n \"abbr\":\"BM\",\n \"name\":\"Burma\"\n },\n {\n \"abbr\":\"BY\",\n \"name\":\"Burundi\"\n },\n {\n \"abbr\":\"CB\",\n \"name\":\"Cambodia\"\n },\n {\n \"abbr\":\"CM\",\n \"name\":\"Cameroon\"\n },\n {\n \"abbr\":\"CA\",\n \"name\":\"Canada \"\n },\n {\n \"abbr\":\"CV\",\n \"name\":\"Cape Verde\"\n },\n {\n \"abbr\":\"CJ\",\n \"name\":\"Cayman Islands\"\n },\n {\n \"abbr\":\"CT\",\n \"name\":\"Central African Republic\"\n },\n {\n \"abbr\":\"CD\",\n \"name\":\"Chad\"\n },\n {\n \"abbr\":\"CI\",\n \"name\":\"Chile\"\n },\n {\n \"abbr\":\"CH\",\n \"name\":\"China \"\n },\n {\n \"abbr\":\"KT\",\n \"name\":\"Christmas Island\"\n },\n {\n \"abbr\":\"IP\",\n \"name\":\"Clipperton Island\"\n },\n {\n \"abbr\":\"CK\",\n \"name\":\"Cocos (Keeling) Islands\"\n },\n {\n \"abbr\":\"CO\",\n \"name\":\"Colombia\"\n },\n {\n \"abbr\":\"CN\",\n \"name\":\"Comoros \"\n },\n {\n \"abbr\":\"CF\",\n \"name\":\"Congo (Brazzaville)\"\n },\n {\n \"abbr\":\"CG\",\n \"name\":\"Congo (Kinshasa)\"\n },\n {\n \"abbr\":\"CW\",\n \"name\":\"Cook Islands\"\n },\n {\n \"abbr\":\"CR\",\n \"name\":\"Coral Sea Islands\"\n },\n {\n \"abbr\":\"CS\",\n \"name\":\"Costa Rica\"\n },\n {\n \"abbr\":\"IV\",\n \"name\":\"Cote D'Ivoire (Ivory Coast)\"\n },\n {\n \"abbr\":\"HR\",\n \"name\":\"Croatia\"\n },\n {\n \"abbr\":\"CU\",\n \"name\":\"Cuba\"\n },\n {\n \"abbr\":\"UC\",\n \"name\":\"Curacao\"\n },\n {\n \"abbr\":\"CY\",\n \"name\":\"Cyprus\"\n },\n {\n \"abbr\":\"EZ\",\n \"name\":\"Czech Republic\"\n },\n {\n \"abbr\":\"DA\",\n \"name\":\"Denmark\"\n },\n {\n \"abbr\":\"DX\",\n \"name\":\"Dhekelia\"\n },\n {\n \"abbr\":\"DJ\",\n \"name\":\"Djibouti\"\n },\n {\n \"abbr\":\"DO\",\n \"name\":\"Dominica\"\n },\n {\n \"abbr\":\"DR\",\n \"name\":\"Dominican Republic\"\n },\n {\n \"abbr\":\"TT\",\n \"name\":\"East Timor \"\n },\n {\n \"abbr\":\"EC\",\n \"name\":\"Ecuador\"\n },\n {\n \"abbr\":\"EG\",\n \"name\":\"Egypt\"\n },\n {\n \"abbr\":\"ES\",\n \"name\":\"El Salvador\"\n },\n {\n \"abbr\":\"EK\",\n \"name\":\"Equatorial Guinea\"\n },\n {\n \"abbr\":\"ER\",\n \"name\":\"Eritrea\"\n },\n {\n \"abbr\":\"EN\",\n \"name\":\"Estonia\"\n },\n {\n \"abbr\":\"ET\",\n \"name\":\"Ethiopia\"\n },\n {\n \"abbr\":\"FK\",\n \"name\":\"Falkland Islands (Islas Malvinas)\"\n },\n {\n \"abbr\":\"FO\",\n \"name\":\"Faroe Islands\"\n },\n {\n \"abbr\":\"FM\",\n \"name\":\"Federated States of Micronesia\"\n },\n {\n \"abbr\":\"FJ\",\n \"name\":\"Fiji\"\n },\n {\n \"abbr\":\"FI\",\n \"name\":\"Finland\"\n },\n {\n \"abbr\":\"FR\",\n \"name\":\"France\"\n },\n {\n \"abbr\":\"FP\",\n \"name\":\"French Polynesia\"\n },\n {\n \"abbr\":\"FS\",\n \"name\":\"French Southern and Antarctic Lands\"\n },\n {\n \"abbr\":\"GB\",\n \"name\":\"Gabon\"\n },\n {\n \"abbr\":\"GA\",\n \"name\":\"The Gambia\"\n },\n {\n \"abbr\":\"GG\",\n \"name\":\"Georgia\"\n },\n {\n \"abbr\":\"GM\",\n \"name\":\"Germany\"\n },\n {\n \"abbr\":\"GH\",\n \"name\":\"Ghana\"\n },\n {\n \"abbr\":\"GI\",\n \"name\":\"Gibraltar\"\n },\n {\n \"abbr\":\"GR\",\n \"name\":\"Greece\"\n },\n {\n \"abbr\":\"GL\",\n \"name\":\"Greenland\"\n },\n {\n \"abbr\":\"GJ\",\n \"name\":\"Grenada\"\n },\n {\n \"abbr\":\"GQ\",\n \"name\":\"Guam\"\n },\n {\n \"abbr\":\"GT\",\n \"name\":\"Guatemala\"\n },\n {\n \"abbr\":\"GK\",\n \"name\":\"Guernsey\"\n },\n {\n \"abbr\":\"GV\",\n \"name\":\"Guinea\"\n },\n {\n \"abbr\":\"PU\",\n \"name\":\"Guinea-Bissau\"\n },\n {\n \"abbr\":\"GY\",\n \"name\":\"Guyana\"\n },\n {\n \"abbr\":\"HA\",\n \"name\":\"Haiti\"\n },\n {\n \"abbr\":\"HM\",\n \"name\":\"Heard Island and McDonald Islands\"\n },\n {\n \"abbr\":\"VT\",\n \"name\":\"Holy See\"\n },\n {\n \"abbr\":\"HO\",\n \"name\":\"Honduras\"\n },\n {\n \"abbr\":\"HK\",\n \"name\":\"Hong Kong\"\n },\n {\n \"abbr\":\"HQ\",\n \"name\":\"Howland Island \"\n },\n {\n \"abbr\":\"HU\",\n \"name\":\"Hungary\"\n },\n {\n \"abbr\":\"IC\",\n \"name\":\"Iceland\"\n },\n {\n \"abbr\":\"IN\",\n \"name\":\"India\"\n },\n {\n \"abbr\":\"ID\",\n \"name\":\"Indonesia\"\n },\n {\n \"abbr\":\"IR\",\n \"name\":\"Iran\"\n },\n {\n \"abbr\":\"IZ\",\n \"name\":\"Iraq\"\n },\n {\n \"abbr\":\"EI\",\n \"name\":\"Ireland\"\n },\n {\n \"abbr\":\"IS\",\n \"name\":\"Israel\"\n },\n {\n \"abbr\":\"IT\",\n \"name\":\"Italy\"\n },\n {\n \"abbr\":\"JM\",\n \"name\":\"Jamaica\"\n },\n {\n \"abbr\":\"JN\",\n \"name\":\"Jan Mayen\"\n },\n {\n \"abbr\":\"JA\",\n \"name\":\"Japan\"\n },\n {\n \"abbr\":\"DQ\",\n \"name\":\"Jarvis Island\"\n },\n {\n \"abbr\":\"JE\",\n \"name\":\"Jersey\"\n },\n {\n \"abbr\":\"JQ\",\n \"name\":\"Johnston Atoll\"\n },\n {\n \"abbr\":\"JO\",\n \"name\":\"Jordan\"\n },\n {\n \"abbr\":\"KZ\",\n \"name\":\"Kazakhstan\"\n },\n {\n \"abbr\":\"KE\",\n \"name\":\"Kenya\"\n },\n {\n \"abbr\":\"KQ\",\n \"name\":\"Kingman Reef\"\n },\n {\n \"abbr\":\"KR\",\n \"name\":\"Kiribati\"\n },\n {\n \"abbr\":\"KN\",\n \"name\":\"Korea, North\"\n },\n {\n \"abbr\":\"KS\",\n \"name\":\"Korea, South\"\n },\n {\n \"abbr\":\"KV\",\n \"name\":\"Kosovo\"\n },\n {\n \"abbr\":\"KU\",\n \"name\":\"Kuwait\"\n },\n {\n \"abbr\":\"KG\",\n \"name\":\"Kyrgyzstan\"\n },\n {\n \"abbr\":\"LA\",\n \"name\":\"Laos\"\n },\n {\n \"abbr\":\"LG\",\n \"name\":\"Latvia\"\n },\n {\n \"abbr\":\"LE\",\n \"name\":\"Lebanon\"\n },\n {\n \"abbr\":\"LT\",\n \"name\":\"Lesotho\"\n },\n {\n \"abbr\":\"LI\",\n \"name\":\"Liberia\"\n },\n {\n \"abbr\":\"LY\",\n \"name\":\"Libya\"\n },\n {\n \"abbr\":\"LS\",\n \"name\":\"Liechtenstein\"\n },\n {\n \"abbr\":\"LH\",\n \"name\":\"Lithuania\"\n },\n {\n \"abbr\":\"LU\",\n \"name\":\"Luxembourg \"\n },\n {\n \"abbr\":\"MC\",\n \"name\":\"Macau\"\n },\n {\n \"abbr\":\"MK\",\n \"name\":\"Macedonia\"\n },\n {\n \"abbr\":\"MA\",\n \"name\":\"Madagascar\"\n },\n {\n \"abbr\":\"MI\",\n \"name\":\"Malawi\"\n },\n {\n \"abbr\":\"MY\",\n \"name\":\"Malaysia\"\n },\n {\n \"abbr\":\"MV\",\n \"name\":\"Maldives\"\n },\n {\n \"abbr\":\"ML\",\n \"name\":\"Mali\"\n },\n {\n \"abbr\":\"MT\",\n \"name\":\"Malta\"\n },\n {\n \"abbr\":\"IM\",\n \"name\":\"Man, Isle of\"\n },\n {\n \"abbr\":\"RM\",\n \"name\":\"Marshall Islands\"\n },\n {\n \"abbr\":\"MR\",\n \"name\":\"Mauritania\"\n },\n {\n \"abbr\":\"MP\",\n \"name\":\"Mauritius\"\n },\n {\n \"abbr\":\"MX\",\n \"name\":\"Mexico\"\n },\n {\n \"abbr\":\"MQ\",\n \"name\":\"Midway Islands\"\n },\n {\n \"abbr\":\"MD\",\n \"name\":\"Moldova\"\n },\n {\n \"abbr\":\"MN\",\n \"name\":\"Monaco\"\n },\n {\n \"abbr\":\"MG\",\n \"name\":\"Mongolia \"\n },\n {\n \"abbr\":\"MJ\",\n \"name\":\"Montenegro\"\n },\n {\n \"abbr\":\"MH\",\n \"name\":\"Montserrat\"\n },\n {\n \"abbr\":\"MO\",\n \"name\":\"Morocco\"\n },\n {\n \"abbr\":\"MZ\",\n \"name\":\"Mozambique\"\n },\n {\n \"abbr\":\"WA\",\n \"name\":\"Namibia\"\n },\n {\n \"abbr\":\"NR\",\n \"name\":\"Nauru\"\n },\n {\n \"abbr\":\"BQ\",\n \"name\":\"Navassa Island\"\n },\n {\n \"abbr\":\"NP\",\n \"name\":\"Nepal\"\n },\n {\n \"abbr\":\"NL\",\n \"name\":\"Netherlands\"\n },\n {\n \"abbr\":\"NC\",\n \"name\":\"New Caledonia\"\n },\n {\n \"abbr\":\"NZ\",\n \"name\":\"New Zealand\"\n },\n {\n \"abbr\":\"NU\",\n \"name\":\"Nicaragua\"\n },\n {\n \"abbr\":\"NG\",\n \"name\":\"Niger\"\n },\n {\n \"abbr\":\"NI\",\n \"name\":\"Nigeria\"\n },\n {\n \"abbr\":\"NE\",\n \"name\":\"Niue \"\n },\n {\n \"abbr\":\"NF\",\n \"name\":\"Norfolk Island\"\n },\n {\n \"abbr\":\"CQ\",\n \"name\":\"Northern Mariana Islands\"\n },\n {\n \"abbr\":\"NO\",\n \"name\":\"Norway\"\n },\n {\n \"abbr\":\"MU\",\n \"name\":\"Oman\"\n },\n {\n \"abbr\":\"PK\",\n \"name\":\"Pakistan\"\n },\n {\n \"abbr\":\"PS\",\n \"name\":\"Palau\"\n },\n {\n \"abbr\":\"LQ\",\n \"name\":\"Palmyra Atoll\"\n },\n {\n \"abbr\":\"PM\",\n \"name\":\"Panama \"\n },\n {\n \"abbr\":\"PP\",\n \"name\":\"Papua-New Guinea\"\n },\n {\n \"abbr\":\"PF\",\n \"name\":\"Paracel Islands\"\n },\n {\n \"abbr\":\"PA\",\n \"name\":\"Paraguay\"\n },\n {\n \"abbr\":\"PE\",\n \"name\":\"Peru\"\n },\n {\n \"abbr\":\"RP\",\n \"name\":\"Philippines\"\n },\n {\n \"abbr\":\"PC\",\n \"name\":\"Pitcairn Islands\"\n },\n {\n \"abbr\":\"PL\",\n \"name\":\"Poland\"\n },\n {\n \"abbr\":\"PO\",\n \"name\":\"Portugal \"\n },\n {\n \"abbr\":\"RQ\",\n \"name\":\"Puerto Rico\"\n },\n {\n \"abbr\":\"QA\",\n \"name\":\"Qatar\"\n },\n {\n \"abbr\":\"RO\",\n \"name\":\"Romania\"\n },\n {\n \"abbr\":\"RS\",\n \"name\":\"Russia\"\n },\n {\n \"abbr\":\"RW\",\n \"name\":\"Rwanda\"\n },\n {\n \"abbr\":\"TB\",\n \"name\":\"Saint Barthelemy\"\n },\n {\n \"abbr\":\"RN\",\n \"name\":\"Saint Martin\"\n },\n {\n \"abbr\":\"WS\",\n \"name\":\"Samoa\"\n },\n {\n \"abbr\":\"SM\",\n \"name\":\"San Marino\"\n },\n {\n \"abbr\":\"TP\",\n \"name\":\"Sao Tome and Principe\"\n },\n {\n \"abbr\":\"SA\",\n \"name\":\"Saudi Arabia\"\n },\n {\n \"abbr\":\"SG\",\n \"name\":\"Senegal\"\n },\n {\n \"abbr\":\"RI\",\n \"name\":\"Serbia\"\n },\n {\n \"abbr\":\"SE\",\n \"name\":\"Seychelles \"\n },\n {\n \"abbr\":\"SL\",\n \"name\":\"Sierra Leone\"\n },\n {\n \"abbr\":\"SN\",\n \"name\":\"Singapore\"\n },\n {\n \"abbr\":\"NN\",\n \"name\":\"Sint Maarten\"\n },\n {\n \"abbr\":\"LO\",\n \"name\":\"Slovakia\"\n },\n {\n \"abbr\":\"SI\",\n \"name\":\"Slovenia\"\n },\n {\n \"abbr\":\"BP\",\n \"name\":\"Solomon Islands\"\n },\n {\n \"abbr\":\"SO\",\n \"name\":\"Somalia\"\n },\n {\n \"abbr\":\"SF\",\n \"name\":\"South Africa\"\n },\n {\n \"abbr\":\"SX\",\n \"name\":\"South Georgia and The S Sandwich Islands\"\n },\n {\n \"abbr\":\"OD\",\n \"name\":\"South Sudan\"\n },\n {\n \"abbr\":\"SP\",\n \"name\":\"Spain\"\n },\n {\n \"abbr\":\"PG\",\n \"name\":\"Spratly Islands \"\n },\n {\n \"abbr\":\"CE\",\n \"name\":\"Sri Lanka\"\n },\n {\n \"abbr\":\"SH\",\n \"name\":\"St. Helena\"\n },\n {\n \"abbr\":\"SC\",\n \"name\":\"St. Kitts and Nevis\"\n },\n {\n \"abbr\":\"ST\",\n \"name\":\"St. Lucia Island\"\n },\n {\n \"abbr\":\"SB\",\n \"name\":\"St. Pierre and Miquelon\"\n },\n {\n \"abbr\":\"VC\",\n \"name\":\"St. Vincent and Grenadines\"\n },\n {\n \"abbr\":\"SU\",\n \"name\":\"Sudan\"\n },\n {\n \"abbr\":\"NS\",\n \"name\":\"Suriname\"\n },\n {\n \"abbr\":\"SV\",\n \"name\":\"Svalbard\"\n },\n {\n \"abbr\":\"WZ\",\n \"name\":\"Swaziland\"\n },\n {\n \"abbr\":\"SW\",\n \"name\":\"Sweden \"\n },\n {\n \"abbr\":\"SZ\",\n \"name\":\"Switzerland\"\n },\n {\n \"abbr\":\"SY\",\n \"name\":\"Syria\"\n },\n {\n \"abbr\":\"TW\",\n \"name\":\"Taiwan\"\n },\n {\n \"abbr\":\"TI\",\n \"name\":\"Tajikistan\"\n },\n {\n \"abbr\":\"TZ\",\n \"name\":\"Tanzania\"\n },\n {\n \"abbr\":\"TH\",\n \"name\":\"Thailand\"\n },\n {\n \"abbr\":\"TO\",\n \"name\":\"Togo\"\n },\n {\n \"abbr\":\"TL\",\n \"name\":\"Tokelau \"\n },\n {\n \"abbr\":\"TN\",\n \"name\":\"Tonga\"\n },\n {\n \"abbr\":\"TD\",\n \"name\":\"Trinidad and Tobago\"\n },\n {\n \"abbr\":\"TS\",\n \"name\":\"Tunisia\"\n },\n {\n \"abbr\":\"TU\",\n \"name\":\"Turkey\"\n },\n {\n \"abbr\":\"TX\",\n \"name\":\"Turkmenistan\"\n },\n {\n \"abbr\":\"TK\",\n \"name\":\"Turks and Caicos Islands\"\n },\n {\n \"abbr\":\"TV\",\n \"name\":\"Tuvalu\"\n },\n {\n \"abbr\":\"UG\",\n \"name\":\"Uganda\"\n },\n {\n \"abbr\":\"UP\",\n \"name\":\"Ukraine\"\n },\n {\n \"abbr\":\"AE\",\n \"name\":\"United Arab Emirates\"\n },\n {\n \"abbr\":\"UK\",\n \"name\":\"United Kingdom\"\n },\n {\n \"abbr\":\"UY\",\n \"name\":\"Uruguay\"\n },\n {\n \"abbr\":\"UZ\",\n \"name\":\"Uzbekistan\"\n },\n {\n \"abbr\":\"NH\",\n \"name\":\"Vanuatu\"\n },\n {\n \"abbr\":\"VE\",\n \"name\":\"Venezuela\"\n },\n {\n \"abbr\":\"VM\",\n \"name\":\"Vietnam\"\n },\n {\n \"abbr\":\"VQ\",\n \"name\":\"Virgin Islands\"\n },\n {\n \"abbr\":\"WQ\",\n \"name\":\"Wake Island\"\n },\n {\n \"abbr\":\"WF\",\n \"name\":\"Wallis and Futuna\"\n },\n {\n \"abbr\":\"WI\",\n \"name\":\"Western Sahara\"\n },\n {\n \"abbr\":\"YM\",\n \"name\":\"Yemen (Aden)\"\n },\n {\n \"abbr\":\"ZA\",\n \"name\":\"Zambia\"\n },\n {\n \"abbr\":\"ZI\",\n \"name\":\"Zimbabwe\"\n },\n {\n \"abbr\":\"OC\",\n \"name\":\"Other Countries\"\n }\n ];\n return countryChoices;\n}", "function parseCities(data, local){\n var cities = [];\n //if country selector is active\n if(local) {\n for(var k = 0; k < data[local].length; k++) {\n cities[k] = capitalizeLetter(data[local][k]);\n }\n }\n //if not we display all cities from all countries\n else {\n var key = Object.keys(data);\n var c = 0;\n for(var i = 0; i < key.length; i++) {\n for(var j = 0; j < data[key[i]].length; j++) {\n cities[c] = capitalizeLetter(data[key[i]][j]);\n c++;\n }\n }\n }\n $('input[data-lf-searchform-query]').typeahead({\n selector: {\n dropdown: 'dropdown-menu dropdown-menu-right',\n list: 'dropdown-menu',\n hint: 'form-control'\n },\n source: {\n data: cities\n }\n });\n}", "function makeCountrySearchAutocomplete(fieldId) { \n\tjQuery(\"#\"+fieldId).autocomplete({\n\t\tsource: function (request, response) {\n\t\t\t$.ajax({\n\t\t\t\turl: \"/localities/component/search.cfc\",\n\t\t\t\tdata: { term: request.term, method: 'getCountryAutocomplete' },\n\t\t\t\tdataType: 'json',\n\t\t\t\tsuccess : function (data) { response(data); },\n\t\t\t\terror : function (jqXHR, textStatus, error) {\n\t\t\t\t\thandleFail(jqXHR,textStatus,error,\"making a country search autocomplete\");\n\t\t\t\t}\n\t\t\t})\n\t\t},\n\t\tselect: function (event, result) {\n\t\t\tevent.preventDefault();\n\t\t\t$('#'+fieldId).val(\"=\" + result.item.value);\n\t\t},\n\t\tminLength: 3\n\t}).autocomplete( \"instance\" )._renderItem = function( ul, item ) {\n\t\treturn $(\"<li>\").append( \"<span>\" + item.value + \" (\" + item.meta +\")</span>\").appendTo( ul );\n\t};\n}", "function manualLookUp() {\n $('#search').addClass('searchBarLoading');\n var text = input.value;\n if (text == null || text.trim().length == 0) {\n alert('Oops! please type in your address, or postcode, or places');\n $('#search').removeClass('searchBarLoading');\n } else {\n var req = {\n bounds: searchBound,\n address: text,\n componentRestrictions: {country: 'AU',administrativeArea: 'VIC'}\n\n }\n geoCodingService.geocode(req, callback);\n }\n}", "function doSearch(query, pageNum, locale, category, catOnly) {\n cleanOut(oneSource);\n cleanOut(tempSource);\n var city = $('#city-state').val();\n if (catOnly == 'yes') {\n var cat = parseInt(category, 10);\n runWPAPI(locale, cat, city);\n } else {\n runWPAPI(locale, cat, city);\n }\n var cleanQuery = query.replace(/\\s/g, '+');\n var proxyAPI = 'XXXXXXXXX';\n if ($('#city').val() && $('#state').val()) {\n var city = $('#city').val();\n var cityCleanUp = city.replace(/\\s/g, '+');\n var state = $('#state').val();\n var queryLocale = \"&l=\" + cityCleanUp + \"%2C+\" + state;\n var target2API = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&start=\" + pageNum + \"&q=\" + cleanQuery + queryLocale;\n var targetAPIALT = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&q=\" + cleanQuery + queryLocale;\n } else {\n var target2API = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&start=\" + pageNum + \"&q=\" + cleanQuery;\n var targetAPIALT = proxyAPI + \"&co=\" + locale + \"&sort=date&fromage=90&limit=25&q=\" + cleanQuery;\n }\n getAPIData(target2API + \"&callback=?\", function(returndata) {\n var data = returndata;\n //var dataTempFiltered = [];\n var totalPull = Math.round(data.totalResults / 25);\n if (totalPull > 50) {\n // loop\n for (i = 0; i < 50; i++) {\n var targetNum = 25 * i;\n var numTrack = i;\n if (numTrack == 49) {\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n checkGlobalGym();\n })\n } else {\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n })\n }\n }\n //end loop\n } else {\n //loop\n for (i = 0; i < totalPull; i++) {\n var targetNum = 25 * i;\n var numTrack = i;\n if (numTrack == (totalPull - 1)) {\n //console.log('final api under 40');\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n checkGlobalGym();\n })\n } else {\n //console.log('run api under 40');\n getAPIData(targetAPIALT + \"&start=\" + targetNum + \"&callback=?\", function(returndata) {\n var data = returndata;\n compileAPIData(data);\n })\n }\n }\n //end loop\n }\n })\n async function checkGlobalGym() {\n setupDataNew(tempSource);\n }\n}", "function handleSearch() {\n\n\tvar value = $(\"#searchBox\").val();\n\t\n\tif(value != null && value != \"\") {\n\t\tsearchStationForName(value);\n\t}\n\n}", "search(event){\n this.placeService.textSearch({\n query: `${event.target.value}`,\n type: 'airport'\n }, this.handleSuggestions);\n }", "function searchPlace() {\n\t\t\t var address = $(\"#search_location_input\").attr('value');\n geocoder.geocode( { 'address': address}, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n map.setCenter(results[0].geometry.location);\n map.fitBounds(results[0].geometry.bounds);\n } else {\n $(\"span.search_not_found\").stop().fadeIn().delay(2000).fadeOut();\n }\n });\n\t\t\t}", "function replaceCountryFilter(country) {\n var match = matchVoiceToDataCase(data, columnIndex, country);\n activeSheet.applyFilterAsync(\n \"Country / Region\",\n match,\n tableau.FilterUpdateType.REPLACE);\n }", "requestCountryList() {\n\t\tapi.get(`/gcountry`).then(function(resp) {\n\t\t\tresp.data.forEach(function(el) {\n\t\t\t\tvar countryId = parseInt(el.country_id);\n\t\t\t\tvar countryName = this.UICountries[countryId];\n\t\t\t\tvar option = document.createElement('option');\n\t\t\t\t\toption.value = countryId;\n\t\t\t\t\toption.innerHTML = countryName;\n\t\t\t\tthis.countryInput.appendChild(option);\n\t\t\t}.bind(this));\n\n\t\t\t//init searchable dropdown\n\t\t\t$('#country_input').select2();\n\n\t\t}.bind(this)).catch(function(err) {\n\t\t\tconsole.log(err);\n\t\t});\n\t}", "search (query) {\n\t\t// Store lat/lng of locality to use in this url (focus.point.lat, focus.point.lon)\n \t\t//const endpoint = `https://search.mapzen.com/v1/autocomplete?text=${query}&api_key=${this.props.config.mapzen.apiKey}&focus.point.lat=${this.props.coordinates[0]}&focus.point.lon=${this.props.coordinates[1]}&layers=venue`\n \t\tconst placetype = this.state.placetype\n \t\tconst endpoint = `https://whosonfirst-api.mapzen.com/?method=whosonfirst.places.search&api_key=${this.props.config.mapzen.apiKey}&q=${query}&${placetype}=${this.props.source.id}&placetype=venue&per_page=100&extras=geom:latitude,geom:longitude,sg:,addr:full,wof:tags`\n \t\tthis.throttleMakeRequest(endpoint)\n\t}", "function setAutocompleteCountry() {\n var country = document.getElementById(\"country\").value\n if (country == \"all\") {\n autocomplete.setComponentRestrictions({ country: [] })\n map.setCenter({ lat: 15, lng: 0 })\n map.setZoom(2)\n } else {\n autocomplete.setComponentRestrictions({ country: country })\n map.setCenter(countries[country].center)\n map.setZoom(countries[country].zoom)\n }\n clearResults()\n clearMarkers()\n}", "function setAutocompleteCountry() {\n const country = document.getElementById(\"country\").value;\n if (country == \"all\") {\n autocomplete.setComponentRestrictions({\n country: [],\n });\n map.setCenter({\n lat: 15,\n lng: 0,\n });\n map.setZoom(3);\n } else {\n autocomplete.setComponentRestrictions({\n country: country,\n });\n map.setCenter(countries[country].center);\n map.setZoom(countries[country].zoom);\n }\n clearResults();\n clearMarkers();\n}", "function filterResult(region) {\n const result = []\n if (region == \"All\") {\n renderResult(data)\n\n }\n else {\n for (let country of data) {\n if (country['region'] == region) {\n result.push(country)\n }\n }\n renderResult(result)\n }\n\n}", "function get_country_data(world_data, country_name)\n{\n //http://stackoverflow.com/questions/7176908/how-to-get-index-of-object-by-its-property-in-javascript\n country_index = -1;//world_data.map(function(e) { return e.name; }).indexOf(country_name);\n for(i in world_data)\n {\n if(world_data[i].name == country_name)\n {\n country_index = i;\n break;\n }\n }\n\n return world_data[country_index];\n}", "function searchCoins() {\n var textToSearch = document.querySelector(\"#search-country-by-name\").value;\n result = coins.filter(({ symbol }) => symbol===(`${textToSearch}`));\n showAllCoins(result);\n}", "function search(){\n let query;\n if(searchLocation===\"location\"){\n searchLocation(\"\")\n }\n query=`https://ontrack-team3.herokuapp.com/students/search?location=${searchLocation}&className=${searchClass}&term=${searchName}` \n prop.urlFunc(query);\n }", "function _search()\n {\n var allCategoryNames = [];\n // Incorporate all terms into\n var oepterms = $scope.selectedOepTerms ? $scope.selectedOepTerms : [];\n var situations = $scope.selectedSituations ? $scope.selectedSituations : [];\n var allCategories = oepterms.concat(situations);\n allCategories.forEach(function(categoryObj) {\n allCategoryNames.push(categoryObj.name);\n checkEmergencyTerms(categoryObj.name);\n });\n search.search({ category: allCategoryNames.join(',') });\n }", "function handleResult(item) {\n // console.log('object: ', item);\n let destination = document.getElementById('destination');\n destination.value = item.country; //new value for input field\n\n let searchBar = document.getElementById('search-bar');\n searchBar.innerHTML = ''; //erase the previous results\n\n displayCountryCard(item);\n linkSearchToChart(item); //links search to chart\n\n}", "function countryDetect() {\n if ($(\"#location-container .select-selected\").attr('data-value') !== undefined) {\n var geoLoc = $(\"#location-container .select-selected\").attr('data-value');\n var cityState = $(\"#city-state-container\");\n cityState.removeClass('hide-opacity');\n var pathURL = 'js/';\n cleanUpMatches();\n switch (geoLoc) {\n case 'us':\n var targetAPI = pathURL + 'locations_us.json';\n runCountryAPI(targetAPI);\n break;\n case 'gb':\n var targetAPI = pathURL + 'locations_uk.json';\n runCountryAPI(targetAPI);\n break;\n case 'au':\n var targetAPI = pathURL + 'locations_au.json';\n runCountryAPI(targetAPI);\n break;\n case 'ca':\n var targetAPI = pathURL + 'locations_ca.json';\n runCountryAPI(targetAPI);\n break;\n case 'dk':\n var targetAPI = pathURL + 'locations_dk.json';\n runCountryAPI(targetAPI);\n break;\n case 'fr':\n var targetAPI = pathURL + 'locations_fr.json';\n runCountryAPI(targetAPI);\n break;\n case 'se':\n var targetAPI = pathURL + 'locations_se.json';\n runCountryAPI(targetAPI);\n break;\n case 'ie':\n var targetAPI = pathURL + 'locations_uk.json';\n runCountryAPI(targetAPI);\n break;\n case 'il':\n var targetAPI = pathURL + 'locations_il.json';\n runCountryAPI(targetAPI);\n break;\n case 'nl':\n var targetAPI = pathURL + 'locations_nl.json';\n runCountryAPI(targetAPI);\n break;\n case 'no':\n var targetAPI = pathURL + 'locations_no.json';\n runCountryAPI(targetAPI);\n break;\n case 'sg':\n cityState.addClass('hide-opacity');\n break;\n case 'nz':\n var targetAPI = pathURL + 'locations_nz.json';\n runCountryAPI(targetAPI);\n break;\n case 'hk':\n cityState.addClass('hide-opacity');\n break;\n }\n }\n}", "function nameCountry(country) {\n const found = listCountry.some((value) => value.sigla === country);\n if (found) {\n const result = listCountry.filter((value) => value.sigla === country);\n return result[0].nome;\n } else {\n return country;\n }\n}", "function handleSearch(inputElt) {\n\t\tvar query = encodeURIComponent($(inputElt).val());\n\t\t$.ajax({\n\t\t\ttype : \"GET\",\n\t\t\turl : \"http://api.tiles.mapbox.com/v4/geocode/mapbox.places-v1/\"+query+\".json\",\n\t\t\tdata : {\n\t\t\t\taccess_token: \"pk.eyJ1IjoibWFwcHktZGV2IiwiYSI6InhBOWRUVHcifQ.YK4jDqt9EXb-Q79QX3O_Mw\"\n\t\t\t},\n\t\t\tsuccess : function(result){\n\t\t\t\tvar best = result.features[0];\n\t\t\t\tmap.setView([best.center[1], best.center[0]], 15);\n\t\t\t},\n\t\t\terror : function(error){\n\t\t\t\tconsole.log(error);\n\t\t\t}\n\t\t});\n\t}", "function handleSearchButtonClick() {\n \n filteredData = dataSet;\n // Format the user's search by removing leading and trailing whitespace, lowercase the string\n var filterDatetime = $dateInput.value.trim().toLowerCase();\n var filterCity = $cityInput.value.trim().toLowerCase();\n var filterState = $stateInput.value.trim().toLowerCase();\n var filterCountry = $countryInput.value.trim().toLowerCase();\n var filterShape = $shapeInput.value.trim().toLowerCase();\n\n // Set filteredAddresses to an array of all addresses whose \"state\" matches the filter\n filteredData = dataSet.filter(function(address) {\n var addressDatetime = address.datetime.toLowerCase();\n var addressCity = address.city.toLowerCase();\n var addressState = address.state.toLowerCase();\n var addressCountry = address.country.toLowerCase();\n var addressShape = address.shape.toLowerCase();\n\n\n\n if ((addressDatetime===filterDatetime || filterDatetime == \"\") && \n (addressCity === filterCity || filterCity == \"\") && \n (addressState === filterState || filterState == \"\") &&\n (addressCountry === filterCountry || filterCountry == \"\") && \n (addressShape === filterShape || filterShape ==\"\")){\n \n return true;\n }\n return false;\n console.log(filteredData);\n });\nloadList();\n}", "function SearchByName(){\n if(inputSearch.value !== \"\"){\n setTimeout(responsiveVoice.speak(inputSearch.value),0);\n resultHotel= [];\n result = hotels.filter((hotel) =>{\n if( hotel.name.toLocaleLowerCase().indexOf(inputSearch.value.toLocaleLowerCase()) > -1){\n return hotel;\n }\n })\n inputSearch.value=\"\";\n resultHotel = result;\n display(result);\n }else{\n alerts(\"Add your Search\",3000);\n }\n range();\n filterByPrice()\n}", "function gcode(country) {\n if (country == \"United States\") {country = \"USA\";}\n \tgeocoder.geocode( { 'address': country }, function(results, status) {\n if (status == google.maps.GeocoderStatus.OK) {\n var marker = new google.maps.Marker({\n map: map,\n position: results[0].geometry.location,\n });\n google.maps.event.addListener(marker, 'click', function() {\n infowindow = new google.maps.InfoWindow({\n content: country\n });\n infowindow.open(map, marker);\n });\n map.setCenter(results[0].geometry.location);\n }\n \t});\n }", "function populateLocCountryFilters(countryList){\n if(countryList.length > 0){\n $('#sector-country-filter').show();\n var tempCountryLocations = '';\n $.each(countryList,function(i, val){\n tempCountryLocations = tempCountryLocations + '<li><label for=\"location_country_'+val['recipient_country']['code']+'\" title=\"'+val['recipient_country']['name']+'\"><input id=\"location_country_'+val['recipient_country']['code']+'\" type=\"checkbox\" value=\"'+val['recipient_country']['code']+'\" class=\"location_country\" name=\"locationCountry\">'+val['recipient_country']['name']+'</label></li>';\n });\n tempCountryLocations = '<div class=\"proj-filter-exp-collapse-sign proj-filter-exp-collapse-sign-up\"></div><span class=\"proj-filter-exp-collapse-text\" style=\"cursor:pointer\"><h4>Countries</h4></span><div class=\"mContent\"><fieldset class=\"no-style\"><legend>Countries</legend><ul style=\"display: block;margin: 5px;\">' + tempCountryLocations + '</ul></fieldset></div><input type=\"hidden\" id=\"locationCountryFilterStates\" value=\"\" />';\n $('#sector-country-filter').html(tempCountryLocations);\n }\n else{\n $('#sector-country-filter').hide();\n }\n }", "function geocode(searchText){\n gs.geocode({ text: searchText, sourceCountry:\"USA\"},function(err, res){\n if(res.locations && res.locations.length > 0){\n var geom = res.locations[0].feature.geometry;\n var params = {\n studyAreas:[{\"geometry\":{\"x\":geom.x,\"y\":geom.y},\n \"areaType\":\"StandardGeography\",\"intersectingGeographies\":[{\"sourceCountry\":\"US\",\"layer\":\"US.ZIP5\"}]}],\n returnGeometry:false\n }\n enrich(params);\n }else{\n alert('Sorry. No matches found.');\n }\n });\n}", "getCovidInfo(country) {\n if(country.country == 'England'){\n const formated_country= 'UK'\n const urlString = 'https://corona.lmao.ninja/v2/countries/'+ formated_country + '?yesterday&strict&query='\n return axios.get(urlString) \n .catch(function (error) {\n console.log(error);\n });\n } else if (country.country == 'United States'){\n const formated_country = 'USA'\n const urlString = 'https://corona.lmao.ninja/v2/countries/'+ formated_country + '?yesterday&strict&query='\n return axios.get(urlString) \n .catch(function (error) {\n console.log(error);\n });\n } else{\n const formated_country = country.country\n const urlString = 'https://corona.lmao.ninja/v2/countries/'+ formated_country + '?yesterday&strict&query='\n return axios.get(urlString) \n .catch(function (error) {\n console.log(error);\n });\n }\n\n}", "getSuggestions(input) {\n const inputValue = input.toLowerCase();\n if (inputValue.length === 0) return [];\n\n fetch(\"/api/countries/\" + inputValue)\n .then(response => {\n if (response.ok) {\n return response.json();\n } else {\n throw new Error(\"Failed to fetch\");\n }\n })\n .then(response => {\n this.setState({\n suggestions: response.results\n })\n });\n }", "function cambiarTexto(query){\r\n\r\n var api_dir='https://autocomplete.geocoder.api.here.com/6.2/suggest.json'; \r\n\r\n $.ajax({\r\n url: api_dir,\r\n type: 'GET',\r\n dataType: 'jsonp',\r\n jsonp: 'jsoncallback',\r\n data:{\r\n app_id: app_id,\r\n app_code: app_code,\r\n query:query,\r\n language:'es',\r\n matchLevel: 'city',\r\n },\r\n success: function(response) {\r\n $(\"#list\").empty();\r\n if (response.suggestions != null) {\r\n for(sug of response.suggestions){\r\n if (sug.matchLevel=='city'){\r\n $option= `<option> ${sug.label}</option>`;\r\n $(\"#list\").append($($option));\r\n\r\n /* Prueba: Separar ciudad de país.\r\n console.log(sug.label.split(\",\")[3]);\r\n */\r\n }\r\n }\r\n }\r\n },\r\n \r\n });\r\n\r\n}" ]
[ "0.73724514", "0.7269201", "0.7154021", "0.7081818", "0.70135707", "0.7005278", "0.68958056", "0.67829365", "0.67517054", "0.6714325", "0.666597", "0.6632361", "0.6628928", "0.65981025", "0.6586485", "0.6584458", "0.6550702", "0.65276533", "0.64858663", "0.6476013", "0.64550287", "0.64519936", "0.6449725", "0.64454174", "0.64281934", "0.64281934", "0.6425756", "0.6418044", "0.64150625", "0.6414829", "0.6389065", "0.638428", "0.63697106", "0.6362719", "0.63502246", "0.63490564", "0.63490486", "0.63357645", "0.6327865", "0.6278779", "0.6276122", "0.6239121", "0.6239019", "0.6238204", "0.62318254", "0.6230844", "0.62252814", "0.6224379", "0.62241817", "0.6214296", "0.62113386", "0.6204009", "0.61945605", "0.6189921", "0.6182386", "0.61796016", "0.61745054", "0.61738485", "0.6173092", "0.61715835", "0.6169549", "0.61577773", "0.615302", "0.6127746", "0.6109904", "0.61071724", "0.610294", "0.6094427", "0.60882306", "0.6080898", "0.6079127", "0.6078887", "0.6072438", "0.60691863", "0.60614973", "0.6056861", "0.6054822", "0.6041146", "0.6039064", "0.6034238", "0.6032746", "0.60240555", "0.60190666", "0.6017154", "0.60150796", "0.60144204", "0.60126895", "0.59951663", "0.59722215", "0.5970417", "0.5951116", "0.5950215", "0.5939807", "0.59360963", "0.5927863", "0.59231466", "0.59137774", "0.59098756", "0.5909507", "0.5908865" ]
0.72667724
2
gkhead.src = ' ball.src = ' Adds ctx.getTransform() returns an SVGMatrix Adds ctx.transformedPoint2(x,y) returns an SVGPoint
function trackTransforms(ctx){ var svg = document.createElementNS("http://www.w3.org/2000/svg",'svg'); var xform = svg.createSVGMatrix(); ctx.getTransform = function(){ return xform; }; var savedTransforms = []; var save = ctx.save; ctx.save = function(){ savedTransforms.push(xform.translate(0,0)); return save.call(ctx); }; var restore = ctx.restore; ctx.restore = function(){ xform = savedTransforms.pop(); return restore.call(ctx); }; var scale = ctx.scale; ctx.scale = function(sx,sy){ xform = xform.scaleNonUniform(sx,sy); return scale.call(ctx,sx,sy); }; var rotate = ctx.rotate; ctx.rotate = function(radians){ xform = xform.rotate(radians*180/Math.PI); return rotate.call(ctx,radians); }; var translate = ctx.translate; ctx.translate = function(dx,dy){ xform = xform.translate(dx,dy); return translate.call(ctx,dx,dy); }; var transform = ctx.transform; ctx.transform = function(a,b,c,d,e,f){ var m2 = svg.createSVGMatrix(); m2.a=a; m2.b=b; m2.c=c; m2.d=d; m2.e=e; m2.f=f; xform = xform.multiply(m2); return transform.call(ctx,a,b,c,d,e,f); }; var setTransform = ctx.setTransform; ctx.setTransform = function(a,b,c,d,e,f){ xform.a = a; xform.b = b; xform.c = c; xform.d = d; xform.e = e; xform.f = f; return setTransform.call(ctx,a,b,c,d,e,f); }; var pt = svg.createSVGPoint(); ctx.transformedPoint = function(x,y){ pt.x=x; pt.y=y; return pt.matrixTransform(xform.inverse()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateShape(point) {\n model.context.clearRect(0, 0, model.cnv.width, model.cnv.height);\n model.cnv.width = model.cnv.width;\n\n var width = model.width;\n var height = model.height;\n\n model.context.setTransform(1, 0, 0, 1, 0, 0);\n\n let dx = point.xAxis + 0.5 * width;\n let dy = point.yAxis + 0.5 * height;\n model.context.translate(dx, dy);\n\tmodel.context.rotate(0.7931);\n // model.context.fillStyle = model.bgColor;\n // model.context.fillRect(-0.5 * width, -0.5 * height, width, height);\n model.context.drawImage(this.csImage, -0.5 * width, -0.5 * height, width, height);\n}", "function dc1(ob) {\r\n\tob.src = app_path_images+'balloon_left.png';\r\n}", "constructor(ctx, posX, img) {\n \n }", "updateTransform() {\n this.transform = Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"toSVG\"])(Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"smoothMatrix\"])(this.transformationMatrix, 100));\n }", "function tick() {\n path.attr(\"d\", linkArc);\n ellipse.attr(\"transform\", transform);\n polygon.attr(\"transform\", transform);\n rectangle.attr(\"transform\", transform);\n rectangle2.attr(\"transform\", transform);\n text.attr(\"transform\", transform);\n }", "function setup(){\n createCanvas(windowWidth, windowHeight);\n strokeWeight( 1 );\n frameRate(60);\n\n // Create the waypoints for the target dot to follow\n let w_op = [width/10, width/2, width*9/10];\n let h_op = [height/20, height/2, height*19/20];\n // // center,mid-right,topright,topleft, midleft, botleft, botright, mid-right again\n // nx_arr = [w_op[1], w_op[2], w_op[2], w_op[0], w_op[0], w_op[0], w_op[2], w_op[2]]\n // ny_arr = [h_op[1], h_op[1], h_op[0], h_op[0], h_op[1], h_op[2], h_op[2], h_op[1]];\n\n //center botmid, botleft, mid left, topleft, topright, midright, botright\n nx_arr = [w_op[1], w_op[1], w_op[0], w_op[0], w_op[0], w_op[2], w_op[2], w_op[2]]\n ny_arr = [h_op[1], h_op[2], h_op[2], h_op[1], h_op[0], h_op[0], h_op[1], h_op[2]]\n\n // Set initial target dot position\n X = nx_arr[calib_counter];\n Y = ny_arr[calib_counter];\n nX = nx_arr[(calib_counter+1) % 5];\n nY = ny_arr[(calib_counter+1) % 5];\n\n moveAmountPerFrame = [(nX-X)/numSteps , (nY-Y)/numSteps];\n\n // Start it in a stopped state\n stillsTaken = num_ims_still\n stopped = true;\n\n // Load instruction images\n instructions_imgs.push(\"static/headshot3.jpg\")\n\n}", "render(svg, paddle1, paddle2) {\n this.x += this.vx;\n this.y += this.vy;\n\n //Ball =============================================================\n let ball = document.createElementNS(SVG_NS, \"circle\");\n ball.setAttributeNS(null, \"r\", this.radius);\n ball.setAttributeNS(null, \"cx\", this.x);\n ball.setAttributeNS(null, \"cy\", this.y);\n ball.setAttributeNS(null, \"fill\", \"white\");\n svg.appendChild(ball);\n\n this.wallCollision();\n this.paddleCollision(paddle1, paddle2);\n\n //Detect Goal ======================================================\n const rightGoal = this.x + this.radius >= this.boardWidth;\n const leftGoal = this.x - this.radius <= 0;\n\n if(rightGoal){\n this.goal(paddle1);\n this.direction = -1;\n this.chime.play();\n \n } else if(leftGoal){\n this.goal(paddle2);\n this.direction = 1;\n this.chime.play();\n }\n\n }", "function initImage() {\n csImage.onload = function () {\n updateShape(new Point(model.x, model.y));\n };\n csImage.src = 'http://www.biobest.co.uk/assets/images/home/blood-samples-web.jpg';\n}", "function draw() {\r\n\t\t\t ctx.clearRect(0,0,WIDTH,HEIGHT);\r\n\t\t\t // draw string\r\n\t\t\t var distance = BB.MathUtils.dist( X, Y, ball.position.x, ball.position.y );\r\n\t\t\t if(distance>500) distance = 500;\r\n\t\t\t ctx.lineWidth = BB.MathUtils.map( distance, 0, 500, 5, 1);\r\n\t\t\t ctx.beginPath();\r\n\t\t\t ctx.moveTo(X,Y);// assigns the values so that now the object moves using data from leapmotion sensor\r\n\t\t\t ctx.lineTo( ball.position.x, ball.position.y );\r\n\t\t\t ctx.closePath();\r\n\t\t\t ctx.stroke();\r\n\t\t\t // draw logo\r\n\t\t\t logo.draw();\r\n\t\t}", "function _loadBallPath() {\n\n if (typeof(d3) != 'undefined') {\n\n // If running directly from the file, this will fail in Chrome due to security reasons\n try {\n placeholder.each(function(){\n var i = this;\n d3.xml(settings.img_directory + \"turn_ball_path.svg\", \"image/svg+xml\", function(xml) {\n $(i).find('div.instrument.turn div.turn_ball_path').append(xml.documentElement);\n });\n });\n\n // Inject SVG path via JS if the code above doesn't work\n } catch (err) {\n console.log(\"Unable to load turn_ball_path.svg. Injecting a path instead.\");\n placeholder.each(function(){\n d3.select($(this).find('div.instrument.turn div.turn_ball_path')[0]).append(\"svg\")\n .attr(\"width\", 400)\n .attr(\"height\", 400)\n .attr(\"class\", \"box\")\n .append(\"path\")\n .attr(\"id\", \"move_path\")\n // This line must be updated if the path SVG file is altered\n .attr(\"d\", \"m 126.04736,251.79367 c 32.2868,5.88557 51.30081,7.6955 74.28947,7.69341 22.93061,0.002 41.52108,-1.7986 73.61092,-7.64849\");\n });\n }\n\n } else console.log(\"Unable to find d3js. Will not animate slip ball.\");\n\n }", "draw() {\r\n this.ctx.save()\r\n this.ctx.translate(this.x + (this.pSize / 2), this.y + (this.pSize / 2))\r\n this.ctx.rotate(this.angle)\r\n this.ctx.translate(-(this.x + (this.pSize / 2)), -(this.y + (this.pSize / 2)))\r\n this.ctx.drawImage(this.pl1, this.x, this.y, this.pSize, this.pSize)\r\n this.ctx.rotate(this.angle)\r\n this.ctx.restore()\r\n }", "animate(x, y) {\n ctx.drawImage(this.driver, x, y);\n }", "function changePicture(){\r\n\tb1.style.opacity = '1'\r\n\torange.style.transform = \"translate(0, 0)\"\r\n\tblue.src = \"images/vegeta2.png\";\r\n}", "draw(ctx) {\n const animating = (this.creationTime !== 0);\n let value = 1;\n if (animating) {\n const elapsedTime = Date.now() - this.creationTime;\n if (elapsedTime < 0) return; // still have some delay, first\n if (elapsedTime > BuildTime) this.creationTime = 0;\n value = houseBez(elapsedTime / BuildTime); // Goes between 0 and (greater than bc of bezier) 1'\n }\n\n const { x, y, flip, img, width, height } = this;\n ctx.translate(x, y - height);\n\n if (flip) { ctx.translate(width, 0); ctx.scale(-1, 1); }\n if (animating) {\n // Starting from a fixed scale like 0.6 looks nicer than appearing from nowhere.\n // const scale = 0.8 + (value * 0.2);\n // if scaling: this x value during animation ensures it animates from the center, not the left side as it scales up\n ctx.translate(/* (1 - scale) * (width / 2) */ 0, (height - (height * value)));\n // ctx.scale(scale, scale);\n }\n\n\n if (this.imgx) {\n ctx.drawImage(img, this.imgx, this.imgy, this.imgw, this.imgh, 0, 0, width, height);\n } else {\n ctx.drawImage(img, 0, 0, width, height); // NYI\n }\n\n ctx.resetTransform();\n // if (animating) {\n // ctx.scale(valfrac, valfrac);\n // ctx.translate(0, -(h - (h * value)));\n // }\n // if (flip) { ctx.scale(-1, 1); ctx.translate(-w, 0); }\n // ctx.translate(-x, -y);\n }", "function Xf(){this.ha=E(\"g\",{},null);this.Zh=E(\"path\",{\"class\":\"blocklyPathDark\",transform:\"translate(1, 1)\"},this.ha);this.gd=E(\"path\",{\"class\":\"blocklyPath\"},this.ha);this.$h=E(\"path\",{\"class\":\"blocklyPathLight\"},this.ha);this.gd.gc=this;Gf(this.gd);bg(this)}", "function tick() {\n\tif(this.id == 0)\n\tthis.src = \"x.png\";\n}", "_alignObejctToBrahmnabhi() {\r\n // CLASS REFERENCE\r\n let that = this;\r\n\r\n d3.select('[name=\"align-center\"]').on('click', () => {\r\n if (d3.select('.svg-object.active[data-object]').node() != null) {\r\n\r\n let object = d3.select('.svg-object.active[data-object]');\r\n let id = object.attr('id');\r\n let wrapper = d3.select(`.sjx-svg-wrapper[data-id=\"${id}\"]`);\r\n\r\n\r\n let objectName = object.attr('data-object');\r\n let src = object.select('image').attr('href');\r\n let width = object.select('image').attr('width');\r\n let height = object.select('image').attr('height');\r\n let x = this.centroid.x - width / 2;\r\n let y = this.centroid.y - height / 2;\r\n\r\n object.remove();\r\n wrapper.remove();\r\n\r\n // console.log(\"x\",object.select('image').attr('x'),\"y\",object.select('image').attr('x'));\r\n\r\n let data = {\r\n src: src,\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n let objectInstance = new Object({\r\n layer: that.canvas,\r\n data: data,\r\n canvasSize: that.canvasSize,\r\n objectName: objectName,\r\n attribute: that.attribute,\r\n });\r\n\r\n // object.select('image').attr('x', `${this.centroid.x - width / 2}`);\r\n // object.select('image').attr('y',`${this.centroid.y - height / 2}`);\r\n // console.log(this.centroid.x - width / 2,this.centroid.y - height / 2);\r\n // object.attr('transform',\"\").attr('data-cx',\"\").attr('data-cy',\"\");\r\n // wrapper.attr('transform',\"\");\r\n }\r\n\r\n })\r\n }", "draw() {\r\n this.ctx.save()\r\n this.ctx.translate(this.x + (this.pSize / 2), this.y + (this.pSize / 2))\r\n this.ctx.rotate(this.angle)\r\n this.ctx.translate(-(this.x + (this.pSize / 2)), -(this.y + (this.pSize / 2)))\r\n this.ctx.drawImage(this.pl2, this.x, this.y, this.pSize, this.pSize)\r\n this.ctx.rotate(this.angle)\r\n this.ctx.restore()\r\n }", "function drawTank() {\r\n ctx.beginPath();\r\n var img = new Image();\r\n img.src = 'images/tank.png';\r\n ctx.drawImage(img, tank.get(\"X\"), tank.get(\"Y\"), tank_width, tank_height);\r\n ctx.closePath();\r\n}", "function tgtDraw() {\r\n\t var w = $(\"#holder\").width();\r\n\r\n\t var pi = Math.PI;\r\n\r\n\t var center = Math.round(w / 3);\r\n\t var center2 = center * 1.25;\r\n\t var radius = (w / 3.25);\r\n\r\n\t var losRad = parseFloat(document.getElementById('LOS').value) * (pi / 180);\r\n\t var crsTRad = parseFloat(document.getElementById('tgtCRS').value) * (pi / 180);\r\n\r\n\t var taSin = Math.sin(crsTRad - losRad);\r\n\t var taCos = Math.cos(crsTRad - losRad);\r\n\r\n\t var nTX = center + (taSin * radius);\r\n\t var nTY = center2 + ((-1 * taCos) * radius);\r\n\r\n\t var tanim = Raphael.animation({\r\n\t cx: nTX,\r\n\t cy: nTY\r\n\t }, 1e1);\r\n\t tHandle.animate(tanim);\r\n\r\n\t tVectorArray[1][1] = nTX;\r\n\t tVectorArray[1][2] = nTY;\r\n\t tVector.attr({\r\n\t path: tVectorArray\r\n\t });\r\n\r\n\t}", "updateLogo(step) {\n\t\tthis.logo.x -= this.skier.xv * step;\n\t\tthis.logo.y -= this.skier.yv * step;\n\t}", "draw(context)\n\t{\n\t\tif ( !this.visible )\n\t\t\treturn;\n\t\t\n\t\tcontext.setTransform(1,0, 0,1, this.position.x, this.position.y);\n\n\t\t// image, 4 source parameters, 4 destination parameters\n context.drawImage(this.texture.image, \n this.texture.region.position.x, this.texture.region.position.y, \n this.texture.region.width, this.texture.region.height,\n -this.rectangle.width/2, -this.rectangle.height/2, \n this.rectangle.width, this.rectangle.height);\n\t}", "function al_main(){\r\n var res = document.evaluate( \"//img[@usemap='#karte']\", document, null, XPathResult. ANY_UNORDERED_NODE_TYPE, null );\r\n x = res.singleNodeValue;\r\n if (x != null) {\r\n pos = getPos(x);\r\n canvas=document.createElement(\"canvas\");\r\n canvas.style.position = \"absolute\";\r\n canvas.style.left = pos[0]+\"px\";\r\n canvas.style.top = pos[1]+\"px\";\r\n canvas.style.zIndex = 14;\r\n canvas.width = pos[2];\r\n canvas.height = pos[3];\r\n \r\n rdiv=document.createElement(\"div\");\r\n rdiv.style.position = \"absolute\";\r\n rdiv.style.left = \"315px\";\r\n rdiv.style.top = \"500px\";\r\n rdiv.style.border = \"solid 1px #000\";\r\n rdiv.style.background = \"#ffc\";\r\n rdiv.style.zIndex = 16;\r\n rdiv.style.padding = \"3px\";\r\n rdiv.style.MozBorderRadius = \"6px\";\r\n\r\n x.parentNode.insertBefore(canvas, x.nextSibling);\r\n document.body.appendChild(rdiv);\r\n \r\n var rx = document.evaluate( \"//input[@name='xp']\", document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null ); \r\n var ry = document.evaluate( \"//input[@name='yp']\", document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null ); \r\n\r\n posx = rx.singleNodeValue.value - 0;\r\n posy = ry.singleNodeValue.value - 0;\r\n\r\n function update() {\r\n x = GM_getValue(prefix(\"SPECIAL_LOCATIONS\")); \r\n if (x!==undefined && x!==\"\") {\r\n SPECIAL_LOCATIONS = eval(x);\r\n }\r\n\r\n var g = canvas.getContext(\"2d\");\r\n g.clearRect(0,0,pos[2],pos[3]);\r\n g.save()\r\n g.translate(pos[2]/2-1,pos[3]/2 + 5.5);\r\n \r\n function touch(x, y) {\r\n x -= posx;\r\n y -= posy;\r\n if (x<-400) x+=800;\r\n if (x> 400) x-=800;\r\n if (y<-400) y+=800;\r\n if (y> 400) y-=800;\r\n g.beginPath();\r\n px = 1.83*(x+y);\r\n py = 1.00*(x-y);\r\n px += py/50;\r\n px2 = px * 20;\r\n py2 = py * 20;\r\n g.moveTo(px,py);\r\n g.lineTo(px2,py2);\r\n if (x!=0 || y!=0) \r\n g.fillRect(px-2,py-2,4,4);\r\n g.stroke();\r\n\r\n if (x>=-3 && x<=3 && y>=-3 && y<=3) {\r\n if (x==0 && y==0) \r\n g.lineWidth = 2.5;\r\n g.beginPath();\r\n g.moveTo(px2+20,py2);\r\n g.arc(px2,py2,20,0,Math.PI*2,true);\r\n g.stroke();\r\n if (x==0 && y==0) \r\n g.lineWidth = 1;\r\n }\r\n }\r\n \r\n g.fillStyle = \"rgba(128,128,128,0.8)\";\r\n for (a in ally) {\r\n b = ally[a][2];\r\n if (a == USERNAME) {\r\n g.strokeStyle = \"rgba(128,64,0,1.0)\";\r\n } else {\r\n g.strokeStyle = \"rgba(0,128,255,0.4)\";\r\n }\r\n \r\n for (c in b) {\r\n touch(b[c][1],b[c][2]);\r\n }\r\n }\r\n\r\n g.strokeStyle = \"rgba(255,0,128,0.8)\";\r\n for (i=0; i<SPECIAL_LOCATIONS.length; i++) {\r\n p=SPECIAL_LOCATIONS[i];\r\n touch(p[0],p[1]);\r\n } \r\n g.restore();\r\n \r\n wasc = travian_world_analyzer_server_code;\r\n rdiv.innerHTML = \"<b>Analyze neighbourhood:</b><br/>Radius: \" +\r\n \"<a href=\\\"http://travian.ws/analyser.pl?s=\"+wasc+\"&q=\"+posx+\",\"+posy+\",5\\\" > 5</a>, \"+\r\n \"<a href=\\\"http://travian.ws/analyser.pl?s=\"+wasc+\"&q=\"+posx+\",\"+posy+\",10\\\">10</a>, \"+\r\n \"<a href=\\\"http://travian.ws/analyser.pl?s=\"+wasc+\"&q=\"+posx+\",\"+posy+\",15\\\">15</a>, \"+\r\n \"<a href=\\\"http://travian.ws/analyser.pl?s=\"+wasc+\"&q=\"+posx+\",\"+posy+\",20\\\">20</a>, \"+\r\n \"<a href=\\\"http://travian.ws/analyser.pl?s=\"+wasc+\"&q=\"+posx+\",\"+posy+\",25\\\">25</a>\";\r\n }\r\n \r\n update();\r\n \r\n function upd() {\r\n setTimeout(upd2,50);\r\n }\r\n \r\n function upd2(){\r\n z = unsafeWindow.m_c.z;\r\n try {\r\n if (z != null) {\r\n if (posx != z.x || posy != z.y) {\r\n posx = z.x - 0;\r\n posy = z.y - 0;\r\n update();\r\n }\r\n }\r\n } catch (e) {\r\n alert(e);\r\n }\r\n } \r\n\r\n document.addEventListener('click',upd,true);\r\n document.addEventListener('keydown',upd,true);\r\n document.addEventListener('keyup',upd,true);\r\n }\r\n \r\n // add a \"this location is special!\" button to the map's village view.\r\n if (location.href.indexOf(\"karte.php?d=\")>0) {\r\n res = document.evaluate( \"//div[@id='lmid2']//h1\", document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null );\r\n x = res.singleNodeValue;\r\n if (x) {\r\n l = x.textContent.match(\"\\\\((-?\\\\d+)\\\\|(-?\\\\d+)\\\\)\");\r\n insl = false;\r\n for (v in SPECIAL_LOCATIONS) {\r\n if (SPECIAL_LOCATIONS[v][0]==l[1] &&\r\n SPECIAL_LOCATIONS[v][1]==l[2]) {\r\n insl=true;\r\n break;\r\n }\r\n }\r\n addspecial = document.createElement(\"a\");\r\n addspecial.innerHTML = \"s\";\r\n addspecial.title = \"[timeline] Toggle (\"+l[1]+\"|\"+l[2]+\") as special location.\";\r\n addspecial.href=\"#\";\r\n addspecial.style.color = insl?\"#0f0\":\"#f00\";\r\n addspecial.className=l[1]+\",\"+l[2]+\",\"+(insl?1:0);\r\n function addsl(e){\r\n var el = e.target;\r\n var l = el.className.split(\",\");\r\n if (l[2]>0) {\r\n last = SPECIAL_LOCATIONS.pop();\r\n for (v in SPECIAL_LOCATIONS) {\r\n if (SPECIAL_LOCATIONS[v][0]==l[2] &&\r\n SPECIAL_LOCATIONS[v][1]==l[3]) {\r\n SPECIAL_LOCATIONS[v]=last;\r\n break;\r\n }\r\n }\r\n } else {\r\n SPECIAL_LOCATIONS.push([l[0]-0,l[1]-0]);\r\n }\r\n GM_setValue(prefix(\"SPECIAL_LOCATIONS\"), uneval(SPECIAL_LOCATIONS));\r\n el.style.color = l[2]<1?\"#0f0\":\"#f00\";\r\n el.className=l[0]+\",\"+l[1]+\",\"+(1-l[2]);\r\n }\r\n addspecial.addEventListener('click',addsl,true);\r\n x.appendChild(addspecial); \r\n x.parentNode.style.zIndex=5;\r\n }\r\n }\r\n }", "function boneAnimationL(bone) {\n // bones originate from the picture not the document sides\n var currentDoggo = document.getElementsByClassName(\"currentDoggo\");\n currentDoggo = currentDoggo[0];\n var cdImg = currentDoggo.children;\n cdImg = cdImg[0];\n var offsetLeft = cdImg.offsetLeft;\n var offsetTop = cdImg.offsetTop;\n var cdHeight = cdImg.offsetHeight;\n\n var maxY = offsetTop;\n var minY = offsetTop + cdHeight;\n var onTheLeft = offsetLeft;\n\n // animation on desktop - originates from the picture and flies to the edges\n if (screenWidth > 1001)\n {\n bone.keyframes = [\n {\n opacity: 1,\n transform: \"translate3d(\" + onTheLeft + \"px, \" + getRndInteger(minY, (minY - 50)) + \"px, 0px)\"\n },\n {\n opacity: 1,\n // first is left to right, second is bottom to top\n transform: \" translate3d(\" + getRndInteger((onTheLeft - 300), (onTheLeft - 30)) + \"px, \" + getRndInteger((minY - 60), (maxY - 200)) + \"px, 0px) rotate(\" + getRndInteger(0,540) + \"deg)\"\n }\n ];\n }\n // animation on mobile - originates from the top and flies to the bottom\n else\n {\n bone.keyframes = [\n {\n opacity: 1,\n // this is where they originate\n transform: \"translate3d(\" + getRndInteger(25, screenWidth / 2 - 25) + \"px, \" + 55 + \"px, 0px)\"\n },\n {\n opacity: 1,\n // this is where the bones fly to\n // first is left to right, second is bottom to top\n transform: \" translate3d(\" + getRndInteger(5, screenWidth / 2 - 5) + \"px, \" + getRndInteger(200, 400) + \"px, 0px) rotate(\" + getRndInteger(0,540) + \"deg)\"\n }\n ];\n }\n \n bone.animProps =\n {\n duration: 1000,\n easing: \"ease-out\",\n iterations: 1\n }\n \n  var animationPlayer = bone.animate(bone.keyframes, bone.animProps);\n}", "function tick() {\n\t\t\t\t if(thisEl.path)\n\t\t\t\t\tthisEl.path.attr(\"d\", linkArc);\n\t\t\t\tif(thisEl.circle)\n\t\t\t\t\tthisEl.circle.attr(\"transform\", transform); \n\t\t\t\t// nodeElems.attr(\"transform\",transform);\n\t\t\t\t// linkElems.attr(\"d\",linkArc);\n\t\t\t //text.attr(\"transform\", transform);\n\t\t\t}", "function createImage(source, blob) {\n var pastedImage = new Image();\n //clear gcode\n pastedImage.onload = function() {\n Potrace.loadImageFromFile(blob);\n Potrace.info.alphamax = getvalue(\"smooth\");\n Potrace.process(function() {\n //displayImg();\n //displaySVG(scale);\n text1 = Potrace.getSVG(1);//.toUpperCase();\n\n refreshgcode();\n\n });\n }\n pastedImage.src = source;\n}", "glitch() {\n gsap.killTweensOf(this.DOM.imgStack);\n\n gsap.timeline()\n .set(this.DOM.imgStack, {\n opacity: 0.2\n }, 0.04)\n .set(this.DOM.stackImages, {\n x: () => `+=${gsap.utils.random(-15,15)}%`,\n y: () => `+=${gsap.utils.random(-15,15)}%`,\n opacity: () => gsap.utils.random(1,10)/10\n }, 0.08)\n .set(this.DOM.imgStack, {\n opacity: 0.4\n }, '+=0.04')\n .set(this.DOM.stackImages, {\n y: () => `+=${gsap.utils.random(-8,8)}%`,\n rotation: () => gsap.utils.random(-2,2),\n opacity: () => gsap.utils.random(1,10)/10,\n scale: () => gsap.utils.random(75,95)/100\n }, '+=0.06')\n .set(this.DOM.imgStack, {\n opacity: 1\n }, '+=0.06')\n .set(this.DOM.stackImages, {\n x: (_, t) => t.dataset.tx,\n y: (_, t) => t.dataset.ty,\n rotation: (_, t) => t.dataset.r,\n opacity: 1,\n scale: 1\n }, '+=0.06')\n }", "animateLogo() {\n const imageLoad = new Image();\n imageLoad.src = this.imageSrc;\n imageLoad.onload = this.animatePattern();\n }", "constructor(x, y, img) {\n this.pos = createVector(random(x - 20, x + 20), y);\n let vx = randomGaussian() * 0.3;\n let vy = randomGaussian() * 0.5 - 1;\n this.vel = createVector(vx, vy);\n // this.acc = createVector(0.1, this.);\n\n this.life = round(random(50, 150));\n this.size = random(30, 50);\n this.alpha = 255;\n \n // let xDiff = abs(x - this.pos.x);\n let xDiff = log(map(abs(x - this.pos.x), 0, 20, 0.1, 10)) + 1;\n this.h = round(map(xDiff, 0, 2, 50, 0));\n this.s = floor(random(90, 100));\n this.l = round(map(xDiff, 0, 1, 70, 50));\n // this.flameColor = color('hsl(' + h + ', ' + s + '%, ' + l + '%)');\n \n this.texture = img;\n\n if (random(100) > 95) {\n this.life += 10;\n this.spark = true;\n }\n\n }", "function boneAnimationR(bone) {\n // bones originate from the picture not the document sides\n var currentDoggo = document.getElementsByClassName(\"currentDoggo\");\n currentDoggo = currentDoggo[0];\n var cdImg = currentDoggo.children;\n cdImg = cdImg[0];\n var offsetLeft = cdImg.offsetLeft;\n var offsetTop = cdImg.offsetTop;\n var cdWidth = cdImg.offsetWidth;\n var cdHeight = cdImg.offsetHeight;\n\n var maxY = offsetTop;\n var minY = offsetTop + cdHeight;\n var onTheRight = offsetLeft + cdWidth;\n\n // animation on desktop - originates from the picture and flies to the edges\n if (screenWidth > 1001)\n {\n bone.keyframes = [\n {\n opacity: 1,\n // this is where they originate\n transform: \"translate3d(\" + onTheRight + \"px, \" + getRndInteger(minY, (minY - 50)) + \"px, 0px)\"\n },\n {\n opacity: 1,\n // this is where the bones fly to\n // first is left to right, second is bottom to top\n transform: \" translate3d(\" + getRndInteger((onTheRight + 10), (onTheRight + 300)) + \"px, \" + getRndInteger((minY - 60), (maxY - 200)) + \"px, 0px) rotate(\" + getRndInteger(0,540) + \"deg)\"\n }\n ];\n }\n // animation on mobile - originates from the top and flies to the bottom\n else\n {\n bone.keyframes = [\n {\n opacity: 1,\n // this is where they originate\n transform: \"translate3d(\" + getRndInteger(screenWidth / 2, screenWidth - 25) + \"px, \" + 55 + \"px, 0px)\"\n },\n {\n opacity: 1,\n // this is where the bones fly to\n // first is left to right, second is bottom to top\n transform: \" translate3d(\" + getRndInteger(screenWidth / 2 , screenWidth - 5) + \"px, \" + getRndInteger(200, 400) + \"px, 0px) rotate(\" + getRndInteger(0,540) + \"deg)\"\n }\n ];\n }\n \n bone.animProps =\n {\n duration: 1000,\n easing: \"ease-out\",\n iterations: 1\n }\n \n  var animationPlayer = bone.animate(bone.keyframes, bone.animProps);\n}", "function replaceImg()\n{\n\tthis.src = \"https://i.creativecommons.org/l/by/4.0/88x31.png\";\n}", "function tick() {\n path.attr(\"d\", linkArc);\n circle.attr(\"transform\", transform);\n text.attr(\"transform\", transform);\n}", "draw(context) {\n this.element = this.random_facing_image(this.img_array)\n context.drawImage(this.element, this.x, this.y, this.width, this.height)\n }", "static transformPoint(m, dst, src) {\n const x = src[0];\n const y = src[1];\n dst[0] = m[0] * x + m[3] * y + m[6];\n dst[1] = m[1] * x + m[4] * y + m[7];\n return dst;\n }", "function tick() {\n\t\tpath.attr(\"d\", linkArc);\n\t\tcircle.attr(\"transform\", transform);\n\t\ttext.attr(\"transform\", transform);\n\t\tlabel\n\t\t\t.attr(\"x\", function(d) { return (d.source.x + d.target.x) / 2; }) \n\t\t\t.attr(\"y\", function(d) { return (d.source.y + d.target.y) / 2; });\n\t}", "function draw_ball(context){\n // ball\n context.beginPath();\n context.arc(ball_visual.centre_x, ball_visual.centre_y, ball_visual.radius, 0, 2 * Math.PI, false);\n context.fillStyle = \"#0a0a0a\";\n context.fill();\n}", "function luoPuput_taso3(palkkiJakoLkm) {\n var kohde = document.querySelector('body');\n var canvasV = document.createElement('canvas');\n var canvasO = document.createElement('canvas');\n var img = document.createElement('img');\n img.src = \"bunny.png\";\n img.setAttribute('class','imgPupu');\n canvasV.setAttribute('class','canvasPupuVasen');\n canvasV.style.zIndex = getZ(PUPUOFFSET);\n canvasO.setAttribute('class','canvasPupuOikea');\n canvasO.style.zIndex = getZ(PUPUOFFSET);\n kohde.appendChild(canvasV);\n kohde.appendChild(canvasO);\n\n // Animaatiolaskuri. Toivottavasti 64-bittia riittaa, ennen kuin ohjelma loppuu. Silloin tulee z-day.\n // Joku oikea kello olisi ollut parempi, varsinkin jos tehdaan monimutkaisempaa animaatiota, eika haluta \n // animaation tokkivan.\n var lkm = 0;\n\n var piirtoFunctioPupuV = () => {\n var ctx = canvasV.getContext('2d');\n var ctx2 = canvasO.getContext('2d');\n var palkinKorkeus = img.height/palkkiJakoLkm;\n\n // Tehdaan nyt animaatio piirtamalla pupu siivuittain ja venyttelemalla siivuja pystysuorassa.\n\n // Hahaa. Haskelia javascriptilla. Huonoa Haskelia siis :(.\n // Trigonometrista magiaa. En viitsi selittaa tata liikaa, muuten joku viela patentoi taman. Ehka silmukka olisi parempi kuin listojen \n // pyorittely, ainakin jos haluaa tehoa. Tassa se ei nyt haittaa.\n var sy = [...Array(palkkiJakoLkm).keys()].map(x => img.height/palkkiJakoLkm*x); \n var venytettysy = [...Array(palkkiJakoLkm).keys()].map(x=>x+lkm);\n venytettysy = venytettysy.map(x => palkinKorkeus/2.0 + (palkinKorkeus/4.0)*Math.sin(0.4*x/6.0)); \n lkm = lkm + 1;\n var sum = venytettysy.reduce((x,y) => x + y);\n venytettysy = venytettysy.map(x => Math.floor(x));\n\n // Imagen pituus puolitettuna.\n var oWidth = img.width/2.0;\n // Seuraavan piirrettavan y-koordinaatin kohta.\n var nextTargetY = 0;\n\n // Puhdistetaan canvakset.\n ctx.clearRect(0,0,canvasV.width, canvasV.height);\n ctx2.clearRect(0,0,canvasO.width, canvasO.height);\n\n // Piirretaan kumpikin pupun puoliskon palkit silmukassa.\n for (let x=0; x<sy.length; x++) {\n ctx.drawImage(img, 0, sy[x] , oWidth , palkinKorkeus, \n 0, nextTargetY, canvasV.width , venytettysy[x]); \n \t\t\t \n ctx2.drawImage(img, oWidth, sy[x], oWidth, palkinKorkeus, \n 0, nextTargetY, canvasV.width , venytettysy[x]);\n\n // Lasketaan seuraavan palkin y-koordinaatti (alkamiskohta).\n nextTargetY = nextTargetY + venytettysy[x];\n }\n // Halutaan etta tata piirretaan jatkossakin.\n requestAnimationFrame(piirtoFunctioPupuV);\n };\n requestAnimationFrame(piirtoFunctioPupuV);\n}", "draw() {\n\n const { scaleX, scaleY, ctx } = this.world;\n const w = Math.floor(this.img.width * this.scale);\n const h = Math.floor(this.img.height * this.scale);\n const px = this.position.x * scaleX.toPx;\n const py = this.position.y * scaleY.toPx;\n this.width = w * scaleX.toUnits;\n this.height = h * scaleY.toUnits;\n\n if (!this.loaded || !this.display) return;\n\n // Draw image.\n if (this.rotation !== 0) {\n ctx.save();\n ctx.translate(px, py);\n ctx.rotate(this.rotation);\n ctx.drawImage(this.img, -w * this.pivot.x, -h * this.pivot.y, w, h);\n ctx.restore();\n } else {\n ctx.drawImage(\n this.img,\n px - w * this.pivot.x,\n py - h * this.pivot.y,\n w,\n h\n );\n }\n \n }", "function drawImg(src, x, y) {}", "function tick() {\n path.attr(\"d\", linkArc);\n circle.attr(\"transform\", transform);\n text.attr(\"transform\", transform);\n}", "function tick() {\n path.attr(\"d\", linkArc);\n circle.attr(\"transform\", transform);\n text.attr(\"transform\", transform);\n}", "function tick() {\n path.attr(\"d\", linkArc);\n circle.attr(\"transform\", transform);\n text.attr(\"transform\", transform);\n}", "function putSvg(next) {\n if (next == VIEWS.DOT.hash) {\n goToDot(next + \"/\" + dot_top);\n return;\n }\n if (!next) next = dot_top;\n var root = d3.select(\"#svg_container\");\n d3.xml(\"lib/dot_svg/\" + next + \".svg\", function(error, documentFragment) {\n if (error) {console.log(error); return;}\n var svgNode = documentFragment.getElementsByTagName(\"svg\")[0];\n\n var w = $(root.node()).width();\n var h = $(root.node()).height();\n\n svgNode.setAttribute(\"viewBox\", \"0 0 \" + w + ' ' + h);\n svgNode.setAttribute(\"style\", \"width: \" + w + 'px;height:' + h + \"px;\");\n\n var d = d3.select(svgNode);\n\n if (root.node().childNodes.length > 0) {\n root.node().replaceChild(svgNode, root.node().childNodes[0]);\n } else {\n root.node().appendChild(svgNode);\n }\n var matrix = d.select(\"g\").node().transform.baseVal.consolidate().matrix;\n var X = matrix.e;\n var Y = matrix.f;\n var width = parseInt(svgNode.getAttribute(\"width\"), 10);\n var height = parseInt(svgNode.getAttribute(\"height\"), 10);\n var x_scale = w / width;\n var y_scale = h / height;\n var initial_scale = Math.min(x_scale, y_scale);\n initial_scale = Math.min(initial_scale, 1);\n\n var translate_x = ((w - width*initial_scale) / 2);\n var translate_y = ((h - height*initial_scale) / 2);\n\n // Setup event listeners for model nodes.\n root.selectAll(\"polygon\").each(function() {\n if (this.hasAttribute(\"fill\")) {\n // All model nodes should show the corresponding HDL, or the\n // corresponding DOT graph when clicked. dsdk::A_MODEL_NODEs\n // are magenta, dsdk::A_SCHEDULED_MODEL_NODEs are white, and\n // are not a direct descendant of the \"graph\" (the background\n // is also white, but is a direct descendant of the \"graph\".\n if (this.getAttribute(\"fill\") == \"magenta\" ||\n (this.getAttribute(\"fill\") == \"white\" && !this.parentNode.classList.contains(\"graph\"))) {\n var g = this.parentNode;\n var title = g.getElementsByTagName(\"title\")[0].innerHTML;\n g.addEventListener(\"click\", function(e){\n // Ctrl+Click opens source, plain click opens graph.\n var evt = window.event || e;\n if (evt.ctrlKey) {\n // TODO Eventually the filename will probably need\n // to include a kernel/component subdirectory.\n var filename = title.replace(/^\\d+_/, \"\")+\".vhd\";\n addHdlFileToEditor(\"lib/hdl/\" + filename);\n if (sideCollapsed) {\n collapseAceEditor();\n refreshAreaVisibility();\n adjustToWindowEvent();\n }\n } else {\n var new_hash = window.location.hash + \"/\" + title;\n VIEWS.DOT.hash = new_hash;\n goToDot(new_hash);\n }\n });\n }\n }\n });\n\n // Clickdown for edge highlighting.\n root.selectAll(\"g.edge path\")\n .on('click', function () {\n // TODO use parent\n if (dot_clickdown == this) {\n dot_clickdown = null;\n } else {\n dot_clickdown = this;\n }\n });\n\n // Edge/arrowhead highlighting.\n var highlightColor = \"#1d99c1\";\n root.selectAll(\"g.edge path\")\n .on('mouseover', function () {\n $(this).attr({\"stroke-width\":5, \"stroke\":highlightColor});\n $(this).siblings(\"polygon\").attr({\"fill\":highlightColor, \"stroke\":highlightColor, \"stroke-width\":3});\n })\n .on('mouseout', function () {\n if (dot_clickdown == this) return;\n $(this).attr({\"stroke-width\":1, \"stroke\":\"black\"});\n $(this).siblings(\"polygon\").attr({\"fill\":\"black\", \"stroke\":\"black\", \"stroke-width\":1});\n });\n root.selectAll(\"g.edge polygon\")\n .on('mouseover', function () {\n $(this).siblings(\"path\").attr({\"stroke-width\":5, \"stroke\":highlightColor});\n $(this).attr({\"fill\":highlightColor, \"stroke\":highlightColor, \"stroke-width\":3});\n })\n .on('mouseout', function () {\n if (dot_clickdown == this) return;\n $(this).siblings(\"path\").attr({\"stroke-width\":1, \"stroke\":\"black\"});\n $(this).attr({\"fill\":\"black\", \"stroke\":\"black\", \"stroke-width\":1});\n });\n\n\n // TODO use translateExtent() to prevent translating out of frame?\n //.translateExtent([10 - X, 10 - Y, 2 * X - 10, 2 * Y - 10])\n //.translateExtent([[0, 0], [2 * Y - 10]])\n\n var scaled_x = initial_scale * X;\n var scaled_y = initial_scale * Y;\n scaled_x += translate_x;\n scaled_y += translate_y;\n var zoom = d3.behavior.zoom()\n .scaleExtent([0, 1.5])\n .scale(initial_scale)\n .translate([scaled_x, scaled_y])\n .on(\"zoom\", zoomed);\n d.select(\"g\").attr(\"transform\",\"translate(\" + scaled_x + \",\" + scaled_y +\")scale(\" + initial_scale + \",\" + initial_scale + \")\");\n d.call(zoom);\n if (!$('#dot_edges_toggle').is(':checked')) {\n $(\"#svg_container\").find(\"g.edge\").toggle();\n }\n });\n updateDotHierarchy();\n}", "function fi(){this.X=L(\"g\",{},null);this.gg=L(\"path\",{\"class\":\"blocklyPathDark\",transform:\"translate(1, 1)\"},this.X);this.Bc=L(\"path\",{\"class\":\"blocklyPath\"},this.X);this.hg=L(\"path\",{\"class\":\"blocklyPathLight\"},this.X);this.Bc.ub=this;Rh(this.Bc);ji(this)}", "draw(ctx) {\n if (this.health > 18) this.health = 18;\n if (this.health < 1) this.health = 1;\n let sourceY = (18 - Math.floor(this.health)) * 21 + 2;\n //source x, y, source width, height, dest x, y, dest width, height\n ctx.drawImage(this.imagesheet, 2, sourceY, 205, 17, 2, 8, 200, 15);\n }", "function tick() {\n path.attr(\"d\", linkArc);\n circle.attr(\"transform\", transform);\n text.attr(\"transform\", transform);\n }", "function tick() {\n\t path.attr(\"d\", linkArc);\n\t circle.attr(\"transform\", transform);\n\t text.attr(\"transform\", transform);\n\t}", "function tick() {\n\t path.attr(\"d\", linkArc);\n\t circle.attr(\"transform\", transform);\n\t text.attr(\"transform\", transform);\n\t}", "draw(){\n push();\n translate(this.body.position.x, this.body.position.y);\n rotate(this.body.angle);\n\n image(\n this.image,\n -this.size.width/2,\n -this.size.height/2,\n this.size.width,\n this.size.height\n );\n pop();\n }", "function tick() {\n path.attr(\"d\", function (d) {\n //var distance = Math.sqrt(Math.pow(d.target.x - d.source.x, 2) + Math.pow(d.target.y - d.source.y, 2));\n var dr = 4000 / Math.pow(d.linknum, 0.85);\n var sweepFlag = d.linknum % 2;\n\n return sprintf(\"M %f,%f A %f,%f 0 0,%d %f,%f\",\n d.source.x, d.source.y, dr, dr, sweepFlag, d.target.x, d.target.y);\n });\n\n circle.attr(\"transform\", function (d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n\n text.attr(\"transform\", function (d) {\n return \"translate(\" + d.x + \",\" + d.y + \")\";\n });\n }", "draw() {\n\n spiel.ctx.drawImage(this.img, this.posX, this.posY, this.breite, this.height);\n }", "draw() {\n\n spiel.ctx.drawImage(this.img, this.posX, this.posY, this.breite, this.height);\n }", "update()\n {\n // adding 2 degrees every frame to the angle of the taijitu logo\n this.logo.angle += 2;\n }", "function changeImageShape(x,y){\n ctx.beginPath();\n ctx.arc(x+circleFixed,y+circleFixed, size/2, 0, 2*Math.PI);\n ctx.closePath(); \n ctx.lineWidth = \"5\";\n ctx.strokeStyle = \"white\";\n ctx.stroke(); \n}", "function main(mode) {\n\tvar code = \"\";\n\tvar Result;\n\tvar svgout = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\n\n\n\tvar Inobj = Cleanup(10);\n\tvar svgheader = '<?xml version=\"1.0\" standalone=\"no\"?> \\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"' + Inobj[0].cw + 'px\" height=\"' + Inobj[0].ch + 'px\"> \\n';\n\tif (Inobj != false) {\n\t\tvar pretext = document.getElementById(\"SVGCode\");\n\t\tvar picobj = document.getElementById(\"pic\");\n\t\tif (mode == 0) {\n\t\t\tcode = svgheader;\n\n\t\t\t//var oldsvg=document.getElementById(\"pic\");\n\t\t\tsvgout.setAttribute(\"xmlns:xlink\", \"http://www.w3.org/1999/xlink\");\n\t\t\tsvgout.setAttribute(\"width\", (Inobj[0].cw + \"px\"));\n\t\t\tsvgout.setAttribute(\"height\", (Inobj[0].ch + \"px\"));\n\t\t\tsvgout.setAttribute(\"version\", \"1.1\");\n\t\t\tsvgout.setAttribute(\"style\", \"display:inline\");\n\t\t\tsvgout.setAttribute(\"id\", \"pic\");\n\t\t} //mode 1 action\n\t\telse //mode 2 action\n\t\t{\n\t\t\tcode = pretext.value;\n\t\t\tcode = code.substring(0, (code.length - 6));\n\t\t\tvar oldsvg = document.getElementById(\"pic\");\n\t\t\tsvgout = oldsvg;\n\t\t}\n\n\t\tif (Inobj[0].bbon) {\n\t\t\tResult = DrawCircle(Inobj);\n\t\t\tcode += Result[0];\n\t\t\tsvgout.appendChild(Result[1]);\n\t\t} //draw backbone\n\t\tfor (var i = 1; i < Inobj.length; i++) //draw features\n\t\t{\n\t\t\tif (Inobj[i].visible) {\n\t\t\t\tif (Inobj[i].arrowon) {\n\t\t\t\t\tResult = DrawArrow(Inobj, i);\n\t\t\t\t\tcode += Result[0];\n\t\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t\t} else {\n\t\t\t\t\tResult = DrawBox(Inobj, i);\n\t\t\t\t\tcode += Result[0];\n\t\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (Inobj[0].txton) {\n\t\t\tif (Inobj[0].plasmidnameon) {\n\t\t\t\tResult = ShowPlasmidName(Inobj);\n\t\t\t\tcode += Result[0];\n\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t}\n\t\t\tif (Inobj[0].plasmidsizeon) {\n\t\t\t\tResult = DrawPlasmidSize(Inobj);\n\t\t\t\tcode += Result[0];\n\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t}\n\t\t\tfor (var j = 1; j < Inobj.length; j++) {\n\t\t\t\tif (Inobj[j].visible) {\n\t\t\t\t\tResult = ShowFeatureLabel(Inobj, j);\n\t\t\t\t\tcode += Result[0];\n\t\t\t\t\tif (Result.length == 2) {\n\t\t\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsvgout.appendChild(Result[2]);\n\t\t\t\t\t\tsvgout.appendChild(Result[1]);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcode += \"</svg>\";\n\t\tpretext.value = code;\n\t\tpicobj.parentNode.replaceChild(svgout, picobj);\n\t\t//alert(svgout.childNodes[5].nodeName+\" has childs: \"+svgout.childNodes[5].childNodes.length);\n\t\t//alert(svgout.childNodes[5].firstChild.nodeName);\n\t\t//alert(\"the ref link: \"+svgout.childNodes[5].firstChild.getAttribute(\"xlink:href\"));\n\t\t//alert(svgout.childNodes[5].firstChild.firstChild.nodeValue);\n\n\n\t}\n}", "function animDrawPointMove(xxa , yya , xxb , yyb , lerp){\t\r\n\tryy = xxb;//\t\tstore x position on second number line for displaying as text\r\n\t\r\n\t//\t\tconver to screen space. For yya, this is done in rotateNumberLine() right before this function is called.\r\n\tyyb = (-yyb + screeny) * screenScale;\r\n\r\n\t\r\n\t//\t\tmove coordinates to be on rotated number lines\r\n\tyya = yya-xxa*Math.sin(animLrot[animLnum]*0.0174532925199444)*screenScale;\r\n\txxa = (xxa*Math.cos(animLrot[animLnum]*0.0174532925199444)-screenx)*screenScale;\r\n\t\r\n\tyyb = yyb-xxb*Math.sin(animLrot[animLnum+1]*0.0174532925199444)*screenScale;\r\n\txxb = (xxb*Math.cos(animLrot[animLnum+1]*0.0174532925199444)-screenx)*screenScale;\r\n\t\r\n\t\r\n\tif(animGetsGraphed[animLnum]){//\t\tif transitioning points to their 2D locations\r\n\t\tctx.lineWidth = (1.05-animGraphyness[animLnum])*animTxtHight/7;//\t\tfade out arrows. 1.05 leaves a very faint arrow. If you want it to go completly blank, use 1.001. A line weight of 0 causes problems.\r\n\r\n\t\tctx.beginPath();//\t\tdraw arrow from left number line to points\r\n\t\tctx.moveTo(xxb , yyb);\r\n\r\n\t\txxb = xxa*animGraphyness[animLnum] + xxb*(1-animGraphyness[animLnum]);//\t\tmove second point from line to directly above point on first line\r\n\t\t\r\n\t\t//\t\tdraw arrow head\r\n\t\tctx.lineTo(xxb , yyb);\r\n\t\tctx.moveTo(xxb , yyb);\r\n\t\tctx.lineTo(xxb-animTxtHight*0.9 , yyb+animTxtHight*0.3);\r\n\t\tctx.moveTo(xxb , yyb);\r\n\t\tctx.lineTo(xxb-animTxtHight*0.9 , yyb+animTxtHight*-0.3);\r\n\t\tctx.stroke();\r\n\t}else{\r\n\t\tctx.lineWidth = animTxtHight/7;\r\n\t}\r\n\t\r\n\t//\t\t-----------------------------------------------------------------------\t\t[ Point at xxa on yya ]\t\t-----------------------------------------------------------------------\r\n\tctx.beginPath();\r\n\tctx.arc(xxa , yya , animTxtHight/8 , 0 , _piTimes2);\r\n\tctx.stroke();\r\n\tctx.closePath();\r\n\tctx.fill();\r\n\tctx.stroke();\r\n\t\r\n\t//\t\t-----------------------------------------------------------------------\t\t[ Point at xxb on yyb ]\t\t-----------------------------------------------------------------------\r\n\tif(lerp > 0.8){\r\n\t\tctx.beginPath();\r\n\t\tctx.arc(xxb , yyb , animTxtHight/8 , 0 , _piTimes2);\r\n\t\tctx.stroke();\r\n\t\tctx.closePath();\r\n\t\tctx.fill();\r\n\t\tctx.stroke();\r\n\t\tctx.fillText( (Math.round(ryy*100)/100).toString() , xxb , yyb - 10);\r\n\t}\r\n\t//\t\tslope of line joining points between number lines\r\n\tdx = xxb-xxa;\r\n\tdy = yyb-yya;\r\n\t\r\n\tftmp = Math.sqrt(dx*dx+dy*dy);//\t\tmagnitude of vector (dx,dy)\r\n\t\r\n\tctx.beginPath();\r\n\tctx.moveTo(xxa , yya);\r\n\r\n\txxb = xxa + lerp * dx;//\t\tlerp animates from 0 to 1 to animate the line being drawn from the first point to the second\r\n\tyyb = yya + lerp * dy;\r\n\t\r\n\tdx /= ftmp;//\t\tunit vectors for line slope\r\n\tdy /= ftmp;\r\n\t\r\n\t//\t\t-----------------------------------------------------------------------\t\t[ Line from (xxa,yya) to (xxb,yyb) ]\t\t-----------------------------------------------------------------------\r\n\tctx.lineTo(xxb , yyb);\r\n\tctx.moveTo(xxb , yyb);\r\n\tctx.lineTo(xxb+animTxtHight*(-dy*0.3-dx) , yyb+animTxtHight*(dx*0.3-dy));\r\n\tctx.moveTo(xxb , yyb);\r\n\tctx.lineTo(xxb+animTxtHight*(dy*0.3-dx) , yyb+animTxtHight*(-dx*0.3-dy));\r\n\tctx.stroke();\r\n}", "function tick () {\n path.attr('d', linkArc)\n circle.attr('transform', transform)\n text.attr('transform', transform)\n }", "function transform(d) {\n var dim = imgDimBySrc[d.src];\n var halfWidth = scaleImageLength(dim.width / 2);\n var halfHeight = scaleImageLength(dim.height / 2);\n var x;\n var y;\n var t;\n\n if (d.referencePoint === UPPER_LEFT) {\n x = d.x;\n y = d.y;\n } else {\n // center of object should be at (d.x, d.y), so upper left corner needs to be translated by\n // a half-width and a half-length less.\n x = d.x - halfWidth;\n y = d.y - halfHeight;\n }\n\n if (d.rotation === 0) {\n t = [\"translate(\", x, \", \", y, \")\"];\n } else {\n // invert sign of rotation so that rotations occur in standard (counterclockwise) direction\n t = [\"translate(\", x, \", \", y, \") rotate(\", -d.rotation, \",\", halfWidth, \",\", halfHeight, \")\"];\n }\n return t.join('');\n }", "updateDrawing(context) {\n if(!this.ded){\n context.drawImage(this.img, this.width * this.frameX, this.height * this.frameY, this.width, this.height, this.x, this.y, 50, 50)\n }\n }", "_transformedPoint(x, y) {\n let pt = this._svg.createSVGPoint()\n pt.x = x * this._pixelRatio()\n pt.y = y * this._pixelRatio()\n return pt.matrixTransform(this._transform.inverse())\n }", "function trackTransforms(ctx){\n let svg = document.createElementNS(\"http://www.w3.org/2000/svg\",'svg');\n let xform = svg.createSVGMatrix();\n ctx.getTransform = function(){ return xform; };\n\n let savedTransforms = [];\n let save = ctx.save;\n ctx.save = function(){\n savedTransforms.push(xform.translate(0,0));\n return save.call(ctx);\n };\n\n let restore = ctx.restore;\n ctx.restore = function(){\n xform = savedTransforms.pop();\n return restore.call(ctx);\n };\n\n let scale = ctx.scale;\n ctx.scale = function(sx,sy){\n xform = xform.scaleNonUniform(sx,sy);\n return scale.call(ctx,sx,sy);\n };\n\n let rotate = ctx.rotate;\n ctx.rotate = function(radians){\n xform = xform.rotate(radians*180/Math.PI);\n return rotate.call(ctx,radians);\n };\n\n let translate = ctx.translate;\n ctx.translate = function(dx,dy){\n xform = xform.translate(dx,dy);\n return translate.call(ctx,dx,dy);\n };\n\n let transform = ctx.transform;\n ctx.transform = function(a,b,c,d,e,f){\n var m2 = svg.createSVGMatrix();\n m2.a=a; m2.b=b; m2.c=c; m2.d=d; m2.e=e; m2.f=f;\n xform = xform.multiply(m2);\n return transform.call(ctx,a,b,c,d,e,f);\n };\n\n let setTransform = ctx.setTransform;\n ctx.setTransform = function(a,b,c,d,e,f){\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(ctx,a,b,c,d,e,f);\n };\n\n let pt = svg.createSVGPoint();\n ctx.transformedPoint = function(x,y){\n pt.x=x; pt.y=y;\n return pt.matrixTransform(xform.inverse());\n }\n}", "draw() {\r\n if(this.type === 'dog') {\r\n this.image.src = '../images/dog.png';\r\n } else {\r\n this.image.src = \"../images/banana.png\";\r\n }\r\n context.drawImage(this.image, this.x, this.y, this.width, this.height);\r\n }", "function mkNeoPixelPart(xy) {\n if (xy === void 0) { xy = [0, 0]; }\n var NP_PART_XOFF = -13.5;\n var NP_PART_YOFF = -11;\n var NP_PART_WIDTH = 87.5;\n var NP_PART_HEIGHT = 190;\n var NEOPIXEL_PART_IMG = \"<svg viewBox=\\\"-5 -1 53 112\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:bx=\\\"https://boxy-svg.com\\\">\\n <rect x=\\\"2.5\\\" width=\\\"38\\\" height=\\\"100\\\" style=\\\"fill: rgb(68, 68, 68);\\\"/>\\n <rect x=\\\"11.748\\\" y=\\\"3.2\\\" width=\\\"1.391\\\" height=\\\"2.553\\\" style=\\\"fill: none; stroke-linejoin: round; stroke-width: 3; stroke: rgb(165, 103, 52);\\\"/>\\n <rect x=\\\"20.75\\\" y=\\\"3.2\\\" width=\\\"1.391\\\" height=\\\"2.553\\\" style=\\\"fill: none; stroke-linejoin: round; stroke-width: 3; stroke: rgb(165, 103, 52);\\\"/>\\n <rect x=\\\"29.75\\\" y=\\\"3.2\\\" width=\\\"1.391\\\" height=\\\"2.553\\\" style=\\\"fill: none; stroke-linejoin: round; stroke-width: 3; stroke: rgb(165, 103, 52);\\\"/>\\n <g>\\n <rect x=\\\"9\\\" y=\\\"16.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"22.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"28.563\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"11.607\\\" y=\\\"14.833\\\" width=\\\"19.787\\\" height=\\\"18.697\\\" style=\\\"fill: rgb(0, 0, 0);\\\"/>\\n <ellipse style=\\\"fill: rgb(216, 216, 216);\\\" cx=\\\"21.5\\\" cy=\\\"24.181\\\" rx=\\\"7\\\" ry=\\\"7\\\"/>\\n </g>\\n <path d=\\\"M -7.25 -103.2 L -2.5 -100.003 L -12 -100.003 L -7.25 -103.2 Z\\\" style=\\\"fill: rgb(68, 68, 68);\\\" transform=\\\"matrix(-1, 0, 0, -1, 0, 0)\\\" bx:shape=\\\"triangle -12 -103.2 9.5 3.197 0.5 0 1@ad6f5cac\\\"/>\\n <path d=\\\"M -16.75 -103.197 L -12 -100 L -21.5 -100 L -16.75 -103.197 Z\\\" style=\\\"fill: rgb(68, 68, 68);\\\" transform=\\\"matrix(-1, 0, 0, -1, 0, 0)\\\" bx:shape=\\\"triangle -21.5 -103.197 9.5 3.197 0.5 0 1@07d73149\\\"/>\\n <path d=\\\"M -26.25 -103.2 L -21.5 -100.003 L -31 -100.003 L -26.25 -103.2 Z\\\" style=\\\"fill: rgb(68, 68, 68);\\\" transform=\\\"matrix(-1, 0, 0, -1, 0, 0)\\\" bx:shape=\\\"triangle -31 -103.2 9.5 3.197 0.5 0 1@54403e2d\\\"/>\\n <path d=\\\"M -35.75 -103.197 L -31 -100 L -40.5 -100 L -35.75 -103.197 Z\\\" style=\\\"fill: rgb(68, 68, 68);\\\" transform=\\\"matrix(-1, 0, 0, -1, 0, 0)\\\" bx:shape=\\\"triangle -40.5 -103.197 9.5 3.197 0.5 0 1@21c9b772\\\"/>\\n <g transform=\\\"matrix(1, 0, 0, 1, 0.000002, 29.999994)\\\">\\n <rect x=\\\"9\\\" y=\\\"16.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"22.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"28.563\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"11.607\\\" y=\\\"14.833\\\" width=\\\"19.787\\\" height=\\\"18.697\\\" style=\\\"fill: rgb(0, 0, 0);\\\"/>\\n <ellipse style=\\\"fill: rgb(216, 216, 216);\\\" cx=\\\"21.5\\\" cy=\\\"24.181\\\" rx=\\\"7\\\" ry=\\\"7\\\"/>\\n </g>\\n <g transform=\\\"matrix(1, 0, 0, 1, 0.000005, 59.999992)\\\">\\n <rect x=\\\"9\\\" y=\\\"16.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"22.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"28.563\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"11.607\\\" y=\\\"14.833\\\" width=\\\"19.787\\\" height=\\\"18.697\\\" style=\\\"fill: rgb(0, 0, 0);\\\"/>\\n <ellipse style=\\\"fill: rgb(216, 216, 216);\\\" cx=\\\"21.5\\\" cy=\\\"24.181\\\" rx=\\\"7\\\" ry=\\\"7\\\"/>\\n </g>\\n</svg>\";\n var x = xy[0], y = xy[1];\n var l = x + NP_PART_XOFF;\n var t = y + NP_PART_YOFF;\n var w = NP_PART_WIDTH;\n var h = NP_PART_HEIGHT;\n var img = pxsim.svg.elt(\"image\");\n pxsim.svg.hydrate(img, {\n class: \"sim-neopixel-strip\", x: l, y: t, width: w, height: h,\n href: pxsim.svg.toDataUri(NEOPIXEL_PART_IMG)\n });\n return { el: img, x: l, y: t, w: w, h: h };\n }", "updateGraphicPosition () {\n this.textGfx.setPosition(this.getPosition())\n this.textGfx.setMatrix(\n math.matrix.matmul(math.matrix.createTranslationMatrix(this.getX(), this.getY()),\n math.matrix.matmul(this.rotationMtx, math.matrix.createTranslationMatrix(-this.getX(), -this.getY()))))\n }", "render (){\n\tctx.drawImage(Resources.get(this.sprite), this.actualx, this.actualy);\n }", "function Teeth(src, x, y) {\n this.image = new Image();\n this.image.src = src;\n this.width = 75;\n this.height = 175;\n this.frame = 0;\n this.x = x;\n this.y = y;\n this.yDest = 200;\n this.steps = 40;\n this.yChange = (this.yDest - this.y) / this.steps;\n this.update = function () {\n ctx = hangmanGame.canvas.getContext(\"2d\");\n ctx.drawImage(this.image,\n this.x,\n this.y,\n this.width, this.height);\n }\n}", "function trackDrawBGimage()\r\n{\r\n\r\n if(ActiveElem==null&&EditBGimage==false && BGimageDeleted==false)\r\n {\r\n //DrawX.style(\"display\", \"inline\")\r\n // DrawX.attr(\"transform\", \"translate(\"+SVGx+\" \"+SVGy+\")\")\r\n\r\n }\r\n}", "function letgo(){\n\tif(position>278){\n\t\tposition=position-1;\n\t\ttracker=tracker-1;\n\n\t}\n\tb.setAttribute(\"x1\", position);\n\tt.setAttribute(\"x2\", position);\n\ta.transform.baseVal.getItem(0).setTranslate(tracker, 0);\n\tball.setAttribute(\"cx\", position);\n update();\n\t}", "function Yh(){this.g=E(\"g\",{},null);this.Uh=E(\"path\",{\"class\":\"blocklyPathDark\",transform:\"translate(1, 1)\"},this.g);this.Cb=E(\"path\",{\"class\":\"blocklyPath\"},this.g);this.rg=E(\"path\",{\"class\":\"blocklyPathLight\"},this.g);this.Cb.Aa=this;Jh(this.Cb);ci(this)}", "function trackDrawBGimage()\r\n{\r\n\r\n if(ActiveElem==null&&EditBGimage==false && BGimageDeleted==false)\r\n {\r\n DrawX.style(\"display\", \"inline\")\r\n DrawX.attr(\"transform\", \"translate(\"+SVGx+\" \"+SVGy+\")\")\r\n\r\n }\r\n}", "function happyEnd(ctx) {\n const imageName = require('../img/happy-buddy.png');\n const img = new Image();\n img.src = imageName;\n img.onload = () => {\n ctx.drawImage(img, 50, 50, 300, 300);\n };\n}", "function first(){\n ctx.drawImage(man[\"char\"], 0, 0, 32, 32, x_position, y_position, 32, 32)\n ctx.drawImage(robot, 0, 0, 400, 500, 30, 20, 48, 48)\n ctx.drawImage(garden, 995, 450, 48, 45, 250, 20, 25, 25)\n ctx.drawImage(garden, 995, 418, 48, 45, 250, 4, 25, 25)\n ctx.drawImage(object1, 32, 200, 32, 45, 150, 12, 32, 25)\n \n}", "function spritePointToSvg(point, sprite) {\n var x = point.x;\n var y = point.y;\n if (sprite) {\n while (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"hasValue\"](sprite.parent)) {\n var angle = sprite.rotation;\n x += sprite.pixelPaddingLeft + sprite.ex;\n y += sprite.pixelPaddingTop + sprite.ey;\n var scale = sprite.scale;\n // this handles nonscaling\n if (sprite.group) {\n scale = sprite.group.scale;\n }\n var relativeX = sprite.pixelX + ((x * _utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"cos\"](angle) - y * _utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"sin\"](angle))) * scale;\n var relativeY = sprite.pixelY + ((x * _utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"sin\"](angle) + y * _utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"cos\"](angle))) * scale;\n if (sprite.dx) {\n relativeX += sprite.dx;\n }\n if (sprite.dy) {\n relativeY += sprite.dy;\n }\n x = relativeX;\n y = relativeY;\n sprite = sprite.parent;\n }\n }\n return { x: x, y: y };\n}", "function init(){\n //new main.js file edited -- 04.10.2017\n var stage = new Stage(300,600,'Test Ad'); // our 'stage' instance\n var bg = new BG(); //bg class instance\n var logo = new Square({id:'logo',image:'logo.png'});\n var outline = new Outline(); // ad 'outline' overlay -- click area\n stage.add(bg);\n var imgs = stage.generateSquares(['road','van','cta','legal'], true, 'object');\n imgs.road.visible = true;\n var frame1 = stage.generateSquares(3, true, 'array', '.png', true);\n var frame2 = stage.generateSquares([4,5,6], true, 'array', '', true);\n stage.add(logo);\n stage.add(outline);\n \n var bubble = new Bubble();\n var ctahov = new CTAhover(imgs.cta);\n // var tmp = stage.template(['tmp0000','tmp0001','tmp0002','tmp0003'], '.jpg');\n \n imgs.van.attachedImage.width = 400;\n imgs.van.visible = true;\n imgs.van.x = -140;\n imgs.van.y = 330;\n \n // show template image\n //tmp.goto(3);\n //tmp.opacity = 0.25;\n \n /* ANIMATION */\n adstage.stage.animate = function (){\n var tl = stage.tl_from(frame1);\n imgs.van.from(8, {x:-500});\n \n U.d(3, function(){\n tl = stage.tl_to(frame1);\n });\n \n U.d(4, function(){\n tl = stage.tl_from(frame2);\n });\n \n U.d(5, function(){\n function ctaPop(){\n imgs.cta.from(0.75, {scale:0, transformOrigin:U.torg(300,528), ease:Back.easeOut, onComplete:function(){\n stage.add(bubble);\n stage.add(ctahov);\n stage.end();\n }});\n }\n imgs.legal.from(1, {alpha:0, onComplete:ctaPop});\n });\n \n };\n}", "function blueIn(x) {\n x.style.transform = \"scale(1.5)\";\n document.getElementById(\"myImage\").src =\"Images/shoe.png\"\n}", "function setup() {\n createCanvas(windowWidth, windowHeight, WEBGL);\n img = loadImage(\"assets/fishBall.jpg\");\n}", "function svgPointToSprite(point, sprite) {\n var x = point.x;\n var y = point.y;\n var sprites = [];\n if (sprite) {\n while (_utils_Type__WEBPACK_IMPORTED_MODULE_3__[\"hasValue\"](sprite.parent)) {\n sprites.push(sprite);\n sprite = sprite.parent;\n }\n sprites.reverse();\n for (var i = 0; i < sprites.length; i++) {\n var sprite_1 = sprites[i];\n var angle = sprite_1.rotation;\n var relativeX = x - sprite_1.pixelX - sprite_1.ex;\n var relativeY = y - sprite_1.pixelY - sprite_1.ey;\n if (sprite_1.dx) {\n x -= sprite_1.dx;\n }\n if (sprite_1.dy) {\n y -= sprite_1.dy;\n }\n var scale = sprite_1.scale;\n // this handles nonscaling\n if (sprite_1.group) {\n scale = sprite_1.group.scale;\n }\n x = (_utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"cos\"](-angle) * relativeX - _utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"sin\"](-angle) * relativeY) / scale - sprite_1.pixelPaddingLeft;\n y = (_utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"cos\"](-angle) * relativeY + _utils_Math__WEBPACK_IMPORTED_MODULE_2__[\"sin\"](-angle) * relativeX) / scale - sprite_1.pixelPaddingTop;\n }\n }\n return { x: x, y: y };\n}", "function render() {\n\t\t\tctx.beginPath();\n\t\t\tctx.arc(me.x, me.y, 10, 0, 2 * Math.PI);\n\t\t\tctx.closePath();\n\t\t\tctx.fillStyle = '#FF0000';\n\t\t\tctx.fill();\n\n\t\t\tphi=om*t; // from the non-inertial frame to the inertial one\n\n\t\t\tposx=0.5*cx;\n\t\t\tposy=0;\n\t\t\tctx2.beginPath();\n\t\t\tcosi=Math.cos(phi);\n\t\t\tsine=Math.sin(phi);\n\t\t\tctx2.arc(cx+posx*cosi-posy*sine, cy+posx*sine+posy*cosi, 20, 0, 2 * Math.PI);\n\t\t\tctx2.closePath();\n\t\t\tctx2.fillStyle = '#000000';\n\t\t\tctx2.fill();\n\t\t\tposx=-0.5*cx;\n\t\t\tctx2.arc(cx+posx*cosi-posy*sine, cy+posx*sine+posy*cosi, 20, 0, 2 * Math.PI);\n\t\t\tctx2.closePath();\n\t\t\tctx2.fillStyle = '#000000';\n\t\t\tctx2.fill();\n\n\t\t\tctx2.beginPath();\n\t\t\tposx=me.x-cx;\n\t\t\tposy=me.y-cy;\n\t\t\tctx2.arc(cx+posx*cosi-posy*sine, cy+posx*sine+posy*cosi, 10, 0, 2 * Math.PI);\n\t\t\tctx2.closePath();\n\t\t\tctx2.fillStyle = '#FF0000';\n\t\t\tctx2.fill();\n\n\t\t}", "render() {\n push();\n translate(this.pos.x + this.xOff, this.pos.y);\n rotate(this.angle);\n imageMode(CENTER);\n image(this.design, 0, 0, this.r, this.r);\n pop();\n }", "function Animation() { // A class. An example of a displayable object that our class GL_Context can manage. \n (function init( self ) {\n self.context = new GL_Context( \"gl-canvas\", Color( .6, .9, 1, .7 ) ); // Set your background color here\n\t\tself.context.register_display_object( self );\n\t\t\n shaders = { \"Default\": new Shader( \"vertex-shader-id\", \"fragment-shader-id\" ), \n \"Demo_Shader\": new Shader( \"vertex-shader-id\", \"demo-shader-id\" ) };\n \n\t\tfor( var i = 0; i < texture_filenames_to_load.length; i++ ) {\n\t\t\tinitTexture( texture_filenames_to_load[i], true );\n }\n\n self.mouse = { \"from_center\": vec2() };\n \n self.m_strip = new Old_Square(); // At the beginning of our program, instantiate all shapes we plan to use, \n self.m_tip = new Tip( 3, 10 ); // each with only one instance in the graphics card's memory.\n self.m_cylinder = new Cylindrical_Tube( 10, 10 ); // For example we'll only create one \"cube\" blueprint in the GPU, but we'll re-use \n self.m_torus = new Torus( 25, 25 ); // it many times per call to display to get multiple cubes in the scene.\n self.m_sphere = new Sphere( 10, 10 );\n self.poly = new N_Polygon( 7 );\n self.m_cone = new Cone( 10, 10 );\n self.m_capped = new Capped_Cylinder( 4, 12 );\n self.m_prism = new Prism( 8, 8 );\n self.m_cube = new Cube();\n self.m_obj = new Shape_From_File( \"teapot.obj\", scale( .1, .1, .1 ) );\n self.m_sub = new Subdivision_Sphere( 6, true );\n self.m_axis = new Axis();\n self.m_kite = new Kite();\n self.m_triangle = new Triangle();\n \n // 1st parameter is our starting camera matrix. 2nd parameter is the projection: The matrix that determines how depth is treated. It projects 3D points onto a plane.\n self.graphicsState = new GraphicsState( translation(0, 0,-25), perspective(45, canvas.width/canvas.height, .1, 1000), 0 );\n \n self.context.render();\t\n\t} ) ( this );\n\t\n // *** Mouse controls: ***\n var mouse_position = function( e ) { return vec2( e.clientX - canvas.width/2, e.clientY - canvas.height/2 ); }; // Measure mouse steering, for rotating the flyaround camera. \n canvas.addEventListener(\"mouseup\", ( function(self) { return function(e)\t{ e = e || window.event;\t\tself.mouse.anchor = undefined; } } ) (this), false );\n\tcanvas.addEventListener(\"mousedown\", ( function(self) { return function(e)\t{\te = e || window.event; self.mouse.anchor = mouse_position(e); } } ) (this), false );\n canvas.addEventListener(\"mousemove\", ( function(self) { return function(e)\t{ e = e || window.event; self.mouse.from_center = mouse_position(e); } } ) (this), false ); \n canvas.addEventListener(\"mouseout\", ( function(self) { return function(e)\t{ self.mouse.from_center = vec2(); }; } ) (this), false ); // Stop steering if the mouse leaves the canvas. \n}", "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) { \n if (typeof(imageURL(d))==\"undefined\" || radius(d) == 0)\n {return radiusScale(radius(d)); }\n else if (key(d) == \"Saturn+Rings\") { return size(d)*1.1; }\n else { return size(d); }\n })\n .attr(\"opacity\", function(d) {\n if (typeof(imageURL(d))==\"undefined\")\n { return 0.7; }\n else { return 1.0; }\n });\n }", "function drawLogo() {\n canvas.width = png.width * 5\n canvas.height = png.height * 5\n\n context.drawImage(png, 0, 0)\n\n let data = context.getImageData(0, 0, png.width, png.height)\n context.clearRect(0, 0, canvas.width, canvas.height)\n\n for (let y = 0; y < data.width; y++) {\n for (let x = 0; x < data.height; x++) {\n let pixel = (x + y * data.width) * 4\n if (data.data[pixel + 3] > 128) {\n let particle = {\n x0: x,\n y0: y,\n x1: png.width / 2,\n y1: png.height / 2,\n speed: Math.random() * 4 + 2\n }\n\n TweenMax.to(particle, particle.speed, {\n x1: particle.x0,\n y1: particle.y0,\n delay: y / 30,\n ease: Elastic.easeOut\n })\n particles.push(particle)\n }\n }\n }\n requestAnimationFrame(render)\n}", "injectCircularLoaderIndeterminate() {\n this.root.innerHTML = `<svg version=\"1.1\" id=\"L1\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" x=\"0px\" y=\"0px\" viewBox=\"0 0 100 100\" enable-background=\"new 0 0 100 100\" xml:space=\"preserve\">\n <circle fill=\"none\" stroke=\"currentColor\" stroke-width=\"6\" stroke-miterlimit=\"15\" stroke-dasharray=\"14.2472,14.2472\" cx=\"50\" cy=\"50\" r=\"47\" >\n <animateTransform \n attributeName=\"transform\" \n attributeType=\"XML\" \n type=\"rotate\"\n dur=\"5s\" \n from=\"0 50 50\"\n to=\"360 50 50\" \n repeatCount=\"indefinite\" />\n </circle>\n <circle fill=\"none\" stroke=\"currentColor\" stroke-width=\"1\" stroke-miterlimit=\"10\" stroke-dasharray=\"10,10\" cx=\"50\" cy=\"50\" r=\"39\">\n <animateTransform \n attributeName=\"transform\" \n attributeType=\"XML\" \n type=\"rotate\"\n dur=\"5s\" \n from=\"0 50 50\"\n to=\"-360 50 50\" \n repeatCount=\"indefinite\" />\n </circle>\n <g fill=\"currentColor\">\n <rect x=\"30\" y=\"35\" width=\"5\" height=\"30\">\n <animateTransform \n attributeName=\"transform\" \n dur=\"1s\" \n type=\"translate\" \n values=\"0 5 ; 0 -5; 0 5\" \n repeatCount=\"indefinite\" \n begin=\"0.1\"/>\n </rect>\n <rect x=\"40\" y=\"35\" width=\"5\" height=\"30\" >\n <animateTransform \n attributeName=\"transform\" \n dur=\"1s\" \n type=\"translate\" \n values=\"0 5 ; 0 -5; 0 5\" \n repeatCount=\"indefinite\" \n begin=\"0.2\"/>\n </rect>\n <rect x=\"50\" y=\"35\" width=\"5\" height=\"30\" >\n <animateTransform \n attributeName=\"transform\" \n dur=\"1s\" \n type=\"translate\" \n values=\"0 5 ; 0 -5; 0 5\" \n repeatCount=\"indefinite\" \n begin=\"0.3\"/>\n </rect>\n <rect x=\"60\" y=\"35\" width=\"5\" height=\"30\" >\n <animateTransform \n attributeName=\"transform\" \n dur=\"1s\" \n type=\"translate\" \n values=\"0 5 ; 0 -5; 0 5\" \n repeatCount=\"indefinite\" \n begin=\"0.4\"/>\n </rect>\n <rect x=\"70\" y=\"35\" width=\"5\" height=\"30\" >\n <animateTransform \n attributeName=\"transform\" \n dur=\"1s\" \n type=\"translate\" \n values=\"0 5 ; 0 -5; 0 5\" \n repeatCount=\"indefinite\" \n begin=\"0.5\"/>\n </rect>\n </g>\n </svg>`;\n }", "begin() {\n this.ctx.beginPath();\n this.ctx.moveTo(this.position[0], this.position[1]);\n }", "function setAnimationPoints(){\n var a = vec4(0, 0, 0, 1);\n var b = vec4(-5, -25, 0, 1);\n var c = vec4(5, -25, 0, 1);\n var d = vec4(0, 0, 0, 1);\n var bezier = new Bezier([a, b, c, d]);\n animationPoints = bezier.vertices;\n}", "function gxtkGraphics(){\r\n\tthis.game=BBHtml5Game.Html5Game();\r\n\tthis.canvas=this.game.GetCanvas()\r\n\tthis.width=this.canvas.width;\r\n\tthis.height=this.canvas.height;\r\n\tthis.gl=null;\r\n\tthis.gc=this.canvas.getContext( '2d' );\r\n\tthis.tmpCanvas=null;\r\n\tthis.r=255;\r\n\tthis.b=255;\r\n\tthis.g=255;\r\n\tthis.white=true;\r\n\tthis.color=\"rgb(255,255,255)\"\r\n\tthis.alpha=1;\r\n\tthis.blend=\"source-over\";\r\n\tthis.ix=1;this.iy=0;\r\n\tthis.jx=0;this.jy=1;\r\n\tthis.tx=0;this.ty=0;\r\n\tthis.tformed=false;\r\n\tthis.scissorX=0;\r\n\tthis.scissorY=0;\r\n\tthis.scissorWidth=0;\r\n\tthis.scissorHeight=0;\r\n\tthis.clipped=false;\r\n}", "function robotHead(){\n ctx.moveTo(800, 0);\n ctx.lineTo(800, 200);\n ctx.lineTo(1000, 200);\n ctx.moveTo(900, 100);\n ctx.arc(900, 100, 50, Math.PI, 2 * Math.PI, false);\n ctx.moveTo(850, 100);\n ctx.lineTo(950, 100);\n ctx.moveTo(900, 100);\n ctx.lineTo(950, 100);\n ctx.moveTo(852, 100);\n ctx.lineTo(900, 30);\n ctx.moveTo(948, 100);\n ctx.lineTo(900, 30);\n ctx.moveTo(890, 100);\n ctx.lineTo(890, 130);\n ctx.moveTo(910, 100);\n ctx.lineTo(910, 130);\n ctx.moveTo(890, 130);\n ctx.lineTo(910, 130);\n ctx.moveTo(870, 100);\n ctx.lineTo(870, 115);\n ctx.moveTo(870, 115);\n ctx.lineTo(890, 115);\n ctx.moveTo(930, 100);\n ctx.lineTo(930, 115);\n ctx.moveTo(930, 115);\n ctx.lineTo(910, 115);\n ctx.moveTo(890, 130);\n ctx.lineTo(870, 140);\n ctx.moveTo(870, 140);\n ctx.lineTo(860, 100);\n ctx.moveTo(910, 130);\n ctx.lineTo(930, 140);\n ctx.moveTo(930, 140);\n ctx.lineTo(940, 100);\n ctx.moveTo(930, 140);\n ctx.lineTo(930, 170);\n ctx.moveTo(870, 140);\n ctx.lineTo(870, 170);\n ctx.moveTo(870, 170);\n ctx.lineTo(930, 170);\n ctx.moveTo(885, 150);\n ctx.lineTo(885, 160);\n ctx.moveTo(915, 150);\n ctx.lineTo(915, 160);\n ctx.moveTo(885, 150);\n ctx.lineTo(915, 150);\n ctx.moveTo(885, 160);\n ctx.lineTo(915, 160);\n ctx.moveTo(850, 100);\n ctx.lineTo(850, 170);\n ctx.moveTo(850, 170);\n ctx.lineTo(870, 170);\n ctx.moveTo(950, 100);\n ctx.lineTo(950, 170);\n ctx.moveTo(950, 170);\n ctx.lineTo(930, 170);\n ctx.moveTo(850, 170);\n ctx.lineTo(870, 140);\n ctx.moveTo(950, 170);\n ctx.lineTo(930, 140);\n ctx.moveTo(850, 140);\n ctx.lineTo(815, 110);\n ctx.lineTo(815, 30);\n ctx.lineTo(835, 50);\n ctx.lineTo(835, 80);\n ctx.lineTo(850, 100);\n ctx.moveTo(950, 140);\n ctx.lineTo(985, 110);\n ctx.lineTo(985, 30);\n ctx.lineTo(965, 50);\n ctx.lineTo(965, 80);\n ctx.lineTo(950, 100);\n ctx.moveTo(800, 200);\n ctx.lineTo(800, 400);\n}", "render() {\n ctx.drawImage(Resources.get(this.image), this.x, this.y)\n }", "function iconCollectStar() {\n tlblink.pause();\n \n var tliconCollectStar = new TimelineMax();\n //Set transform Origins\n tliconCollectStar.set(mouthOpen, {transformOrigin:\"50% 20%\"})\n \n //Change from eyesOpen to eyesClosed\n tliconCollectStar.to(eyesOpen, .2, {opacity:0})\n tliconCollectStar.to(eyesClosed, .01, {opacity: 1},'-=.1')\n \n //Move eyesClosed and mouthClosed down and scale down\n tliconCollectStar.to([eyesClosed, mouthClosed, headmovement], .5, {y:2, scale:.95})\n \n //Move eyesClosed and mouthOpen up and scale up\n tliconCollectStar.to([eyesClosed, mouthClosed, mouthOpen, headmovement], 1, {y:-5, scale:1})\n \n //Change from mouthClosed to mouthOpen\n tliconCollectStar.to(mouthClosed, .1, {opacity:0}, '-=1')\n tliconCollectStar.to(mouthOpen, .01, {opacity: 1, scaleY:0},'-=1')\n tliconCollectStar.fromTo(mouthOpen, .5, {scaleY:0}, {scaleY:1}, '-=.8')\n \n //Make openMouth laugh with scaleY\n tliconCollectStar.fromTo(mouthOpen, .2, {scaleY:1}, {scaleY:.9, yoyo:true, repeat:8}, '-=.2')\n \n //Close mouth as head goes back down a bit lower than original\n tliconCollectStar.to([eyesClosed, mouthClosed, mouthOpen, headmovement], .7, {y:1, scale:.98}, '-=.5')\n \n //Open eyes back to original\n tliconCollectStar.to([eyesClosed, mouthClosed, mouthOpen, headmovement], .3, {y:0, scale:1})\n tliconCollectStar.to(mouthClosed, .2, {opacity:1}, '-=.1')\n tliconCollectStar.to(mouthOpen, .2, {scaleY:0}, '-=.2')\n tliconCollectStar.to(mouthOpen, .01, {opacity: 0})\n tliconCollectStar.to(eyesOpen, .2, {opacity:1}, '+=.3')\n tliconCollectStar.to(eyesClosed, .01, {opacity:0})\n \n //Return to blink setting\n}", "function runLogoAnimation() {\n for (const path of svgDrawingPaths) {\n path.style.strokeDashoffset = \"0px\";\n }\n for (const cPath of svgCirclePaths) {\n cPath.style.cssText = \"stroke-dashoffset: 0; transition-delay: 1200ms;\";\n }\n svgVerve.style.cssText =\n \"transform:translateX(0px); transition:transform 1s ease .8s;\";\n svg360.style.cssText =\n \"transform:translateX(0px);opacity:1;transition:all 1s ease .8s;\";\n document.getElementById(\"small-circle\").style.opacity = \"1\";\n setTimeout(firstPageLoaded, 2000);\n}", "onDrawFrame(ctx, frame, img) {\n ctx.globalCompositeOperation = 'source-over';\n ctx.imageSmoothingQuality = 'high';\n // frame.interlaced = true;\n ctx.beginPath();\n ctx.arc(ctx.canvas.width/2,(ctx.canvas.height/2)/2+250, 100, 0 , 2*Math.PI);\n ctx.fillStyle = 'red';\n ctx.strokeStyle = 'red';\n ctx.stroke();\n // ctx.fill();\n ctx.clip();\n // ctx.drawImage(frame.buffer,(ctx.canvas.width/2 - (frame.width/3)),(ctx.canvas.height/2)/2+150, 250, 200);\n if(img == 'img/Key.png'){\n ctx.drawImage(Resources.get(img), (ctx.canvas.width/2 - (frame.width/1)+50),(ctx.canvas.height/2)/2+150);\n }else{\n ctx.drawImage(Resources.get(img), (ctx.canvas.width/2 - (frame.width/1)), (ctx.canvas.height/2)/2+150, 250, 200);\n }\n ctx.closePath();\n }", "function tick() {\n\t path.attr(\"d\", function(d) {\n\t\tvar dx = d.target.x - d.source.x,\n\t\tdy = d.target.y - d.source.y,\n\t\tdr = Math.sqrt(dx * dx + dy * dy);\n\t\treturn \"M\" + d.source.x + \",\" + d.source.y + \"A\" + dr + \",\" + dr + \" 0 0,1 \" + d.target.x + \",\" + d.target.y;\n\t });\n\n\t circle.attr(\"transform\", function(d) {\n\t\treturn \"translate(\" + d.x + \",\" + d.y + \")\";\n\t });\n\n\t text.attr(\"transform\", function(d) {\n\t\treturn \"translate(\" + d.x + \",\" + d.y + \")\";\n\t });\n\t}", "function place(path,x,y) {\n game.canvas[1].drawImage(getImage(path),x ,y);\n }", "function drawTRex() {\n var tRex = new Image();\n tRex.src = \"trex.png\";\n tRex.onload = function() {\n ctx.drawImage(tRex,state.trex.x, 50,300,200);\n }\n}", "function head(headX, headY, Hscale, Headcolor, Horncolor){\r\n //horn\r\n stroke(0);\r\n strokeWeight(3);\r\n fill(Horncolor);\r\n triangle(headX - 105 * Hscale, headY, headX - 125 * Hscale, headY - 75 * Hscale, headX - 25 * Hscale, headY);\r\n triangle(headX - 50 * Hscale, headY - 75 * Hscale, headX - 50 * Hscale, headY - 130 * Hscale, headX - 5 * Hscale, headY - 75 * Hscale);\r\n //teeth\r\n var x;\r\n for(x = 0; x < 10; x ++){\r\n strokeWeight(3);\r\n stroke(0);\r\n fill(255);\r\n triangle(headX - 5 * Hscale + 10 * x * Hscale, headY + 25 * Hscale, headX - 5 * Hscale + 10 * (x+1) * Hscale, headY - 15 * Hscale, headX - 5 * Hscale + 10 * (x+2) * Hscale, headY + 25 * Hscale);\r\n triangle(headX - 5 * Hscale, headY - 95 * Hscale + 10 * x * Hscale, headX + 15 * Hscale, headY - 90 * Hscale + 10 * x * Hscale, headX - 5 * Hscale, headY - 80 * Hscale + 10 * x * Hscale);\r\n }\r\n //tongue\r\n fill(255, 102, 93);\r\n quad(headX - 25 * Hscale, headY, headX + 125 * Hscale, headY - 70 * Hscale, headX + 115 * Hscale, headY - 60 * Hscale, headX - 25 * Hscale, headY + 10 * Hscale);\r\n //head\r\n fill(Headcolor);\r\n arc(headX, headY, 225 * Hscale, 200 * Hscale, 0, PI+HALF_PI, PIE);\r\n //eye\r\n fill(255);\r\n ellipse(headX - 20 * Hscale, headY - 50 * Hscale, 30 * Hscale, 20 * Hscale);\r\n //pupil\r\n fill(0);\r\n ellipse(headX - 20 * Hscale, headY - 50 * Hscale, 9 * Hscale, 9 * Hscale);\r\n }", "placeMark(target, player) {\n let mark = player === DATA.human ? DATA.humanSVG : DATA.aiSVG;\n document.getElementById(target).innerHTML = mark;\n }", "constructor({\n x = 128,\n y = 128,\n vx = 0,\n vy = 0,\n w = 24,\n h = 24,\n color = \"white\",\n assetImg = new Image(),\n isPlayer = false,\n hp = 0,\n isCollectible = false,\n POSES = [\n { qmax: 8, pv: 12 },\n { qmax: 8, pv: 12 },\n { qmax: 8, pv: 12 },\n { qmax: 8, pv: 12 },\n ],\n } = {}) {\n this.x = x;\n this.y = y;\n this.vx = vx;\n this.vy = vy;\n this.w = w;\n this.h = h;\n this.color = color;\n this.cena = null;\n this.mx = null;\n this.my = null;\n this.isCollectible = isCollectible;\n this.isPlayer = isPlayer;\n this.collected = 0;\n this.assetImg = assetImg;\n this.SIZE = 64;\n this.hp = hp;\n this.pose = 0;\n this.quadro = 0;\n this.POSES = POSES;\n }", "function setup() {\r\n// r = random(255);\r\n// g = random(255);\r\n// b = random(255);\r\n var cnv = createCanvas(720, 400);\r\n cnv.style('display', 'block');\r\n cnv.parent('content');\r\n img = loadImage('bckgrnd.JPG'); \r\n}", "function draw(){\n ctx.drawImage(bg,0,0);\n for(var i = 0; i < pipe.length; i++){\n // gambar pipeSouth pada kanvas dengan dimulai dari titik ordinat (x, y)\n // e.g\n ctx.drawImage(pipeNorth,pipe[i].x,pipe[i].y);\n // gunakan variable constant untuk mengambil tinggi pipeNorth ditambah gap\n // gambar pipeSouth pada kanvas dengan dimulai dari titik ordinat (x, y+contant)\n constant = pipeNorth.height+gap;\n ctx.drawImage(pipeSouth,pipe[i].x,pipe[i].y+constant);\n\n // pada setiap kali animasi, e.g\n pipe[i].x--;\n // jika pipa mendekati aksis(x) 100,\n // maka push pipe baru dengan x di ujung canvas menggunakan acuan lebar kanvas\n // dan y menggunakan pembulatan angka random (0sampai1) dikalikan tinggi pipeNorth yang kemudian dikurangi tinggi pipeNorth\n // posisi y menentukan posisi awal pipeNorth\n if( pipe[i].x == 125 ){\n pipe.push({\n x : cvs.width,\n y : Math.floor(Math.random()*pipeNorth.height)-pipeNorth.height\n });\n }\n\n // JIKA\n // \n // tabrak pipa\n // bX ditambah lebar karakter lebih besar atau sama dengan aksis pipe &&\n // \n // bX lebih kecil atau sama dengan aksis pipe ditambah dengan lebar northPipe &&\n // tabrak atas bawah\n // bY lebih kecil atau sama dengan ordinat pipe ditambah dengan tinggi northPipe || bY lebih besar atau sama dengan ordinat pipe ditambah nilai constant yang dibuat\n // \n // tabrak tanah\n // atau kondisi terakhir, ordinat karakter ditambah tinggi karakter lebih besar daripada tinggi canvas dikurangi tinggi fg\n if( bX + bird.width >= pipe[i].x && bX <= pipe[i].x + pipeNorth.width && (bY <= pipe[i].y + pipeNorth.height || bY+bird.height >= pipe[i].y+constant) || bY + bird.height >= cvs.height - fg.height){\n // apabila salah satu kondisi di atas tercapai, brarti game harus direload\n // location.reload(); // reload the page\n }\n\n // jika aksis dari pipe mencapai nilai 5, maka skor bertambah\n if(pipe[i].x == 5){\n score++;\n scor.play();\n }\n }\n // gambar ground di kanvas dengan menggunakan gambar fg yang telah disediakan, dengan koordinat (0, mulai dari tinggi kanvas dikurangi tinggi fg), ingat perhitungan drawImage adalah dari kiri atas\n // https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/height\n // gambar objek karakter dengan menggunakan file bird yang telah disediakan dengan posisi awal menggunakan koordinat (bX, bY)\n ctx.drawImage(fg,0,cvs.height - fg.height);\n ctx.drawImage(bird,bX,bY);\n // pada setiap animasi, posisi ordinat bertambah sesuai gravity\n // bY += gravity;\n\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillStyle\n ctx.fillStyle = \"#000\";\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/font\n ctx.font = \"20px Verdana\";\n // https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/fillText\n ctx.fillText(\"Score : \"+score,10,cvs.height-20);\n requestAnimationFrame(draw);\n}", "function draw() {\n background(20);\n // orbitControl(); // allows user to drag the screen\n noFill();\n strokeWeight(0.5);\n translate(0,0,0);\n angleMode(DEGREES);\n rotateY(frameCount * 0.2);\n\n\n // sun (yellow)\n stroke(255,255,0);\n sphere(100);\n // texture(neptuneImg);\n\n // earth (green)\n translate(500, 0, 0);\n push();\n rotateY(frameCount * 1);\n // rotateY(frameCount * 0.05);\n stroke(0,255,0);\n sphere(50);\n pop();\n // texture(earthImg);\n\n // neptune (blue)\n translate(0,-200,600);\n rotateY(frameCount *0.01);\n stroke(0,0,255);\n sphere(90);\n // venus (red)\n\n\n\n\n\n\n\n}", "function processImageTag(line) {\n var imageId = tools.getAttrValue(line, \"id\");\n if (imageId !== null && imageId.indexOf(\"image\") === 0) {\n var newImgLine = \"\";\n var x = tools.getAttrValue(line, \"x\");\n var y = tools.getAttrValue(line, \"y\");\n var w = tools.getAttrValue(line, \"width\");\n var h = tools.getAttrValue(line, \"height\");\n var viewBox = \"0 0 \" + w + \" \" + h;\n // handle clip-path for image\n var clipPath = tools.getAttrValue(line, \"clip-path\");\n // console.log(clipPath);\n if (clipPath !== null) {\n newImgLine += \"<g clip-path=\\\"\" + clipPath + \"\\\" id=\\\"cp-layer\\\">\"\n }\n // console.log(\"viewBox:\"+viewBox);\n newImgLine += \"<svg version=\\\"1.1\\\" viewBox=\\\"\" + viewBox\n + \"\\\" x=\\\"\" + x + \"\\\" y=\\\"\" + y + \"\\\" width=\\\"\" + w + \"\\\" height=\\\"\" + h + \"\\\" preserveAspectRatio=\\\"xMidYMid meet\\\">\";\n var imgLine = line;\n imgLine = tools.removeAttr(imgLine, \"x\");\n imgLine = tools.removeAttr(imgLine, \"y\");\n imgLine = tools.removeAttr(imgLine, \"preserveAspectRatio\");\n if (clipPath !== null) {\n imgLine = tools.removeAttr(imgLine, \"clip-path\");\n }\n newImgLine += imgLine;\n newImgLine += \"</svg>\";\n if (clipPath !== null) {\n newImgLine += \"</g>\"\n }\n // newImgLine = tools.replaceAttrValue(newImgLine,\"xlink:href\",\"/designs/templates/\"+getAttrValue(newImgLine,\"xlink:href\"));\n // newImgLine = tools.replaceAttrValue(newImgLine,\"xlink:href\",\"../../\"+getAttrValue(newImgLine,\"xlink:href\"));\n // console.log(\"img:\"+newImgLine);\n return newImgLine + \"\\n\";\n }\n return line + \"\\n\";\n}" ]
[ "0.57145226", "0.55936563", "0.5480124", "0.54265463", "0.5383592", "0.5357276", "0.5333491", "0.53179806", "0.5276212", "0.5258207", "0.525569", "0.524423", "0.5243946", "0.52437055", "0.52372134", "0.5233655", "0.5183811", "0.5183225", "0.51782054", "0.51588917", "0.51490086", "0.51401865", "0.5136141", "0.5132126", "0.5129345", "0.51240844", "0.5123515", "0.5111886", "0.5110414", "0.51016736", "0.5098249", "0.5085675", "0.5065244", "0.50541383", "0.5046276", "0.50408167", "0.50360715", "0.5033691", "0.5032298", "0.5028865", "0.5028865", "0.5028865", "0.50232285", "0.50207776", "0.50207514", "0.501673", "0.5004507", "0.5004507", "0.50018454", "0.49985746", "0.49856943", "0.49856943", "0.49806416", "0.49799407", "0.49780166", "0.497361", "0.4961077", "0.4960704", "0.49600124", "0.4958018", "0.4955725", "0.49527493", "0.4952694", "0.49523768", "0.4950756", "0.49434614", "0.4942096", "0.49402836", "0.49381098", "0.49358645", "0.493459", "0.4933254", "0.493231", "0.49316216", "0.49270606", "0.4926361", "0.49215335", "0.49173555", "0.49137208", "0.4909837", "0.49023286", "0.49023175", "0.49007633", "0.48994285", "0.48982972", "0.48980775", "0.489689", "0.4895007", "0.4893281", "0.48914304", "0.48881918", "0.48876002", "0.48875356", "0.48838815", "0.4882988", "0.4882581", "0.48789325", "0.48783493", "0.48772976", "0.48728916", "0.48711368" ]
0.0
-1
CAN 2 var gkhead = new Image; var ball = new Image; gkhead.src = ' ball.src = ' Adds ctx2.getTransform() returns an SVGMatrix Adds ctx2.transformedPoint2(x,y) returns an SVGPoint
function trackTransforms2(ctx2){ var svg = document.createElementNS("http://www.w3.org/2000/svg",'svg'); var xform = svg.createSVGMatrix(); ctx2.getTransform = function(){ return xform; }; var savedTransforms = []; var save = ctx2.save; ctx2.save = function(){ savedTransforms.push(xform.translate(0,0)); return save.call(ctx2); }; var restore = ctx2.restore; ctx2.restore = function(){ xform = savedTransforms.pop(); return restore.call(ctx2); }; var scale = ctx2.scale; ctx2.scale = function(sx,sy){ xform = xform.scaleNonUniform(sx,sy); return scale.call(ctx2,sx,sy); }; var rotate = ctx2.rotate; ctx2.rotate = function(radians){ xform = xform.rotate(radians*180/Math.PI); return rotate.call(ctx2,radians); }; var translate = ctx2.translate; ctx2.translate = function(dx,dy){ xform = xform.translate(dx,dy); return translate.call(ctx2,dx,dy); }; var transform = ctx2.transform; ctx2.transform = function(a,b,c,d,e,f){ var m2 = svg.createSVGMatrix(); m2.a=a; m2.b=b; m2.c=c; m2.d=d; m2.e=e; m2.f=f; xform = xform.multiply(m2); return transform.call(ctx2,a,b,c,d,e,f); }; var setTransform = ctx2.setTransform; ctx2.setTransform = function(a,b,c,d,e,f){ xform.a = a; xform.b = b; xform.c = c; xform.d = d; xform.e = e; xform.f = f; return setTransform.call(ctx2,a,b,c,d,e,f); }; var pt = svg.createSVGPoint(); ctx2.transformedPoint2 = function(x,y){ pt.x=x; pt.y=y; return pt.matrixTransform(xform.inverse()); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createImage(source, blob) {\n var pastedImage = new Image();\n //clear gcode\n pastedImage.onload = function() {\n Potrace.loadImageFromFile(blob);\n Potrace.info.alphamax = getvalue(\"smooth\");\n Potrace.process(function() {\n //displayImg();\n //displaySVG(scale);\n text1 = Potrace.getSVG(1);//.toUpperCase();\n\n refreshgcode();\n\n });\n }\n pastedImage.src = source;\n}", "function initImage() {\n csImage.onload = function () {\n updateShape(new Point(model.x, model.y));\n };\n csImage.src = 'http://www.biobest.co.uk/assets/images/home/blood-samples-web.jpg';\n}", "function dc1(ob) {\r\n\tob.src = app_path_images+'balloon_left.png';\r\n}", "function al_main(){\r\n var res = document.evaluate( \"//img[@usemap='#karte']\", document, null, XPathResult. ANY_UNORDERED_NODE_TYPE, null );\r\n x = res.singleNodeValue;\r\n if (x != null) {\r\n pos = getPos(x);\r\n canvas=document.createElement(\"canvas\");\r\n canvas.style.position = \"absolute\";\r\n canvas.style.left = pos[0]+\"px\";\r\n canvas.style.top = pos[1]+\"px\";\r\n canvas.style.zIndex = 14;\r\n canvas.width = pos[2];\r\n canvas.height = pos[3];\r\n \r\n rdiv=document.createElement(\"div\");\r\n rdiv.style.position = \"absolute\";\r\n rdiv.style.left = \"315px\";\r\n rdiv.style.top = \"500px\";\r\n rdiv.style.border = \"solid 1px #000\";\r\n rdiv.style.background = \"#ffc\";\r\n rdiv.style.zIndex = 16;\r\n rdiv.style.padding = \"3px\";\r\n rdiv.style.MozBorderRadius = \"6px\";\r\n\r\n x.parentNode.insertBefore(canvas, x.nextSibling);\r\n document.body.appendChild(rdiv);\r\n \r\n var rx = document.evaluate( \"//input[@name='xp']\", document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null ); \r\n var ry = document.evaluate( \"//input[@name='yp']\", document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null ); \r\n\r\n posx = rx.singleNodeValue.value - 0;\r\n posy = ry.singleNodeValue.value - 0;\r\n\r\n function update() {\r\n x = GM_getValue(prefix(\"SPECIAL_LOCATIONS\")); \r\n if (x!==undefined && x!==\"\") {\r\n SPECIAL_LOCATIONS = eval(x);\r\n }\r\n\r\n var g = canvas.getContext(\"2d\");\r\n g.clearRect(0,0,pos[2],pos[3]);\r\n g.save()\r\n g.translate(pos[2]/2-1,pos[3]/2 + 5.5);\r\n \r\n function touch(x, y) {\r\n x -= posx;\r\n y -= posy;\r\n if (x<-400) x+=800;\r\n if (x> 400) x-=800;\r\n if (y<-400) y+=800;\r\n if (y> 400) y-=800;\r\n g.beginPath();\r\n px = 1.83*(x+y);\r\n py = 1.00*(x-y);\r\n px += py/50;\r\n px2 = px * 20;\r\n py2 = py * 20;\r\n g.moveTo(px,py);\r\n g.lineTo(px2,py2);\r\n if (x!=0 || y!=0) \r\n g.fillRect(px-2,py-2,4,4);\r\n g.stroke();\r\n\r\n if (x>=-3 && x<=3 && y>=-3 && y<=3) {\r\n if (x==0 && y==0) \r\n g.lineWidth = 2.5;\r\n g.beginPath();\r\n g.moveTo(px2+20,py2);\r\n g.arc(px2,py2,20,0,Math.PI*2,true);\r\n g.stroke();\r\n if (x==0 && y==0) \r\n g.lineWidth = 1;\r\n }\r\n }\r\n \r\n g.fillStyle = \"rgba(128,128,128,0.8)\";\r\n for (a in ally) {\r\n b = ally[a][2];\r\n if (a == USERNAME) {\r\n g.strokeStyle = \"rgba(128,64,0,1.0)\";\r\n } else {\r\n g.strokeStyle = \"rgba(0,128,255,0.4)\";\r\n }\r\n \r\n for (c in b) {\r\n touch(b[c][1],b[c][2]);\r\n }\r\n }\r\n\r\n g.strokeStyle = \"rgba(255,0,128,0.8)\";\r\n for (i=0; i<SPECIAL_LOCATIONS.length; i++) {\r\n p=SPECIAL_LOCATIONS[i];\r\n touch(p[0],p[1]);\r\n } \r\n g.restore();\r\n \r\n wasc = travian_world_analyzer_server_code;\r\n rdiv.innerHTML = \"<b>Analyze neighbourhood:</b><br/>Radius: \" +\r\n \"<a href=\\\"http://travian.ws/analyser.pl?s=\"+wasc+\"&q=\"+posx+\",\"+posy+\",5\\\" > 5</a>, \"+\r\n \"<a href=\\\"http://travian.ws/analyser.pl?s=\"+wasc+\"&q=\"+posx+\",\"+posy+\",10\\\">10</a>, \"+\r\n \"<a href=\\\"http://travian.ws/analyser.pl?s=\"+wasc+\"&q=\"+posx+\",\"+posy+\",15\\\">15</a>, \"+\r\n \"<a href=\\\"http://travian.ws/analyser.pl?s=\"+wasc+\"&q=\"+posx+\",\"+posy+\",20\\\">20</a>, \"+\r\n \"<a href=\\\"http://travian.ws/analyser.pl?s=\"+wasc+\"&q=\"+posx+\",\"+posy+\",25\\\">25</a>\";\r\n }\r\n \r\n update();\r\n \r\n function upd() {\r\n setTimeout(upd2,50);\r\n }\r\n \r\n function upd2(){\r\n z = unsafeWindow.m_c.z;\r\n try {\r\n if (z != null) {\r\n if (posx != z.x || posy != z.y) {\r\n posx = z.x - 0;\r\n posy = z.y - 0;\r\n update();\r\n }\r\n }\r\n } catch (e) {\r\n alert(e);\r\n }\r\n } \r\n\r\n document.addEventListener('click',upd,true);\r\n document.addEventListener('keydown',upd,true);\r\n document.addEventListener('keyup',upd,true);\r\n }\r\n \r\n // add a \"this location is special!\" button to the map's village view.\r\n if (location.href.indexOf(\"karte.php?d=\")>0) {\r\n res = document.evaluate( \"//div[@id='lmid2']//h1\", document, null, XPathResult.ANY_UNORDERED_NODE_TYPE, null );\r\n x = res.singleNodeValue;\r\n if (x) {\r\n l = x.textContent.match(\"\\\\((-?\\\\d+)\\\\|(-?\\\\d+)\\\\)\");\r\n insl = false;\r\n for (v in SPECIAL_LOCATIONS) {\r\n if (SPECIAL_LOCATIONS[v][0]==l[1] &&\r\n SPECIAL_LOCATIONS[v][1]==l[2]) {\r\n insl=true;\r\n break;\r\n }\r\n }\r\n addspecial = document.createElement(\"a\");\r\n addspecial.innerHTML = \"s\";\r\n addspecial.title = \"[timeline] Toggle (\"+l[1]+\"|\"+l[2]+\") as special location.\";\r\n addspecial.href=\"#\";\r\n addspecial.style.color = insl?\"#0f0\":\"#f00\";\r\n addspecial.className=l[1]+\",\"+l[2]+\",\"+(insl?1:0);\r\n function addsl(e){\r\n var el = e.target;\r\n var l = el.className.split(\",\");\r\n if (l[2]>0) {\r\n last = SPECIAL_LOCATIONS.pop();\r\n for (v in SPECIAL_LOCATIONS) {\r\n if (SPECIAL_LOCATIONS[v][0]==l[2] &&\r\n SPECIAL_LOCATIONS[v][1]==l[3]) {\r\n SPECIAL_LOCATIONS[v]=last;\r\n break;\r\n }\r\n }\r\n } else {\r\n SPECIAL_LOCATIONS.push([l[0]-0,l[1]-0]);\r\n }\r\n GM_setValue(prefix(\"SPECIAL_LOCATIONS\"), uneval(SPECIAL_LOCATIONS));\r\n el.style.color = l[2]<1?\"#0f0\":\"#f00\";\r\n el.className=l[0]+\",\"+l[1]+\",\"+(1-l[2]);\r\n }\r\n addspecial.addEventListener('click',addsl,true);\r\n x.appendChild(addspecial); \r\n x.parentNode.style.zIndex=5;\r\n }\r\n }\r\n }", "constructor(ctx, posX, img) {\n \n }", "function SnakeAndLadders() {\r\n \r\n var img = new Image();\r\n img.onload = function () {\r\n context.drawImage(img, 7, 23);\r\n };\r\n img.src = \"image/largeLadder.svg\";\r\n \r\n var img1 = new Image();\r\n img1.onload = function () {\r\n \r\n context.drawImage(img1, 9, 12);\r\n };\r\n img1.src = \"image/smallLadder.svg\";\r\n \r\n var img2 = new Image();\r\n img2.onload = function () {\r\n context.drawImage(img2, 9, 1);\r\n };\r\n img2.src = \"image/snake1.svg\";\r\n \r\n var img3 = new Image();\r\n img3.onload = function () \r\n {\r\n context.drawImage(img3, 29, 18);\r\n };\r\n img3.src = \"image/snake2.svg\"; \r\n\r\n var img4 = new Image();\r\n img4.onload = function () \r\n {\r\n context.drawImage(img4, 25, 27);\r\n };\r\n img4.src = \"image/mediumLadder.svg\"; \r\n\r\n\r\n}", "function replaceImg()\n{\n\tthis.src = \"https://i.creativecommons.org/l/by/4.0/88x31.png\";\n}", "function changePicture(){\r\n\tb1.style.opacity = '1'\r\n\torange.style.transform = \"translate(0, 0)\"\r\n\tblue.src = \"images/vegeta2.png\";\r\n}", "function updateShape(point) {\n model.context.clearRect(0, 0, model.cnv.width, model.cnv.height);\n model.cnv.width = model.cnv.width;\n\n var width = model.width;\n var height = model.height;\n\n model.context.setTransform(1, 0, 0, 1, 0, 0);\n\n let dx = point.xAxis + 0.5 * width;\n let dy = point.yAxis + 0.5 * height;\n model.context.translate(dx, dy);\n\tmodel.context.rotate(0.7931);\n // model.context.fillStyle = model.bgColor;\n // model.context.fillRect(-0.5 * width, -0.5 * height, width, height);\n model.context.drawImage(this.csImage, -0.5 * width, -0.5 * height, width, height);\n}", "exibe(){\n image(this.imagem, this.x1, 0, width, height); //exibe a imagem na tela\n image(this.imagem, this.x2, 0, width, height);\n }", "updateTransform() {\n this.transform = Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"toSVG\"])(Object(transformation_matrix__WEBPACK_IMPORTED_MODULE_9__[\"smoothMatrix\"])(this.transformationMatrix, 100));\n }", "draw(context)\n\t{\n\t\tif ( !this.visible )\n\t\t\treturn;\n\t\t\n\t\tcontext.setTransform(1,0, 0,1, this.position.x, this.position.y);\n\n\t\t// image, 4 source parameters, 4 destination parameters\n context.drawImage(this.texture.image, \n this.texture.region.position.x, this.texture.region.position.y, \n this.texture.region.width, this.texture.region.height,\n -this.rectangle.width/2, -this.rectangle.height/2, \n this.rectangle.width, this.rectangle.height);\n\t}", "function ImagePathing(CardNumber,SuitNumber) {\n var mapping_numbers = {\n Two : \"2\",\n Three : \"3\",\n Four : \"4\",\n Five : \"5\",\n Six : \"6\",\n Seven : \"7\",\n Eight : \"8\",\n Nine : \"9\",\n Ten : \"10\",\n Jack : \"jack\",\n Queen : \"queen\",\n King : \"king\",\n Ace : \"ace\",\n Red : \"red\",\n Black: \"black\"\n }\n var mapping_suits = {\n Clubs : \"clubs\",\n Diamonds : \"diamonds\",\n Spades : \"spades\",\n Hearts : \"hearts\",\n Jokers : \"joker\"\n }\n\n if(SuitNumber != \"Jokers\") {\n if(CardNumber == \"Jack\" || CardNumber == \"King\" || CardNumber ==\"Queen\") {\n var src = \"../assets/images/\"+mapping_numbers[CardNumber]+\"_of_\"+mapping_suits[SuitNumber]+\"2.png\"\n }\n else {\n var src = \"../assets/images/\"+mapping_numbers[CardNumber]+\"_of_\"+mapping_suits[SuitNumber]+\".png\"\n }\n }\n else {\n var src = \"../assets/images/\"+mapping_numbers[CardNumber]+\"_\"+mapping_suits[SuitNumber]+\".png\"\n }\n var srcImage = new Image();\n srcImage.src = src\n var rasterImage = new paper.Raster(srcImage);\n var cloneImage = new paper.Raster(srcImage);\n rasterImage.visible = false;\n rasterImage.scale(0.2);\n cloneImage.visible = false;\n cloneImage.scale(0.2);\n\n\n var imgObj = {\n srcImage : srcImage,\n rasterImage : rasterImage,\n cloneImage : cloneImage\n }\n return imgObj;\n}", "function first(){\n ctx.drawImage(man[\"char\"], 0, 0, 32, 32, x_position, y_position, 32, 32)\n ctx.drawImage(robot, 0, 0, 400, 500, 30, 20, 48, 48)\n ctx.drawImage(garden, 995, 450, 48, 45, 250, 20, 25, 25)\n ctx.drawImage(garden, 995, 418, 48, 45, 250, 4, 25, 25)\n ctx.drawImage(object1, 32, 200, 32, 45, 150, 12, 32, 25)\n \n}", "animate(x, y) {\n ctx.drawImage(this.driver, x, y);\n }", "function drawTank() {\r\n ctx.beginPath();\r\n var img = new Image();\r\n img.src = 'images/tank.png';\r\n ctx.drawImage(img, tank.get(\"X\"), tank.get(\"Y\"), tank_width, tank_height);\r\n ctx.closePath();\r\n}", "function main(mode) {\n\tvar code = \"\";\n\tvar Result;\n\tvar svgout = document.createElementNS(\"http://www.w3.org/2000/svg\", \"svg\");\n\n\n\n\tvar Inobj = Cleanup(10);\n\tvar svgheader = '<?xml version=\"1.0\" standalone=\"no\"?> \\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\" \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"' + Inobj[0].cw + 'px\" height=\"' + Inobj[0].ch + 'px\"> \\n';\n\tif (Inobj != false) {\n\t\tvar pretext = document.getElementById(\"SVGCode\");\n\t\tvar picobj = document.getElementById(\"pic\");\n\t\tif (mode == 0) {\n\t\t\tcode = svgheader;\n\n\t\t\t//var oldsvg=document.getElementById(\"pic\");\n\t\t\tsvgout.setAttribute(\"xmlns:xlink\", \"http://www.w3.org/1999/xlink\");\n\t\t\tsvgout.setAttribute(\"width\", (Inobj[0].cw + \"px\"));\n\t\t\tsvgout.setAttribute(\"height\", (Inobj[0].ch + \"px\"));\n\t\t\tsvgout.setAttribute(\"version\", \"1.1\");\n\t\t\tsvgout.setAttribute(\"style\", \"display:inline\");\n\t\t\tsvgout.setAttribute(\"id\", \"pic\");\n\t\t} //mode 1 action\n\t\telse //mode 2 action\n\t\t{\n\t\t\tcode = pretext.value;\n\t\t\tcode = code.substring(0, (code.length - 6));\n\t\t\tvar oldsvg = document.getElementById(\"pic\");\n\t\t\tsvgout = oldsvg;\n\t\t}\n\n\t\tif (Inobj[0].bbon) {\n\t\t\tResult = DrawCircle(Inobj);\n\t\t\tcode += Result[0];\n\t\t\tsvgout.appendChild(Result[1]);\n\t\t} //draw backbone\n\t\tfor (var i = 1; i < Inobj.length; i++) //draw features\n\t\t{\n\t\t\tif (Inobj[i].visible) {\n\t\t\t\tif (Inobj[i].arrowon) {\n\t\t\t\t\tResult = DrawArrow(Inobj, i);\n\t\t\t\t\tcode += Result[0];\n\t\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t\t} else {\n\t\t\t\t\tResult = DrawBox(Inobj, i);\n\t\t\t\t\tcode += Result[0];\n\t\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif (Inobj[0].txton) {\n\t\t\tif (Inobj[0].plasmidnameon) {\n\t\t\t\tResult = ShowPlasmidName(Inobj);\n\t\t\t\tcode += Result[0];\n\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t}\n\t\t\tif (Inobj[0].plasmidsizeon) {\n\t\t\t\tResult = DrawPlasmidSize(Inobj);\n\t\t\t\tcode += Result[0];\n\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t}\n\t\t\tfor (var j = 1; j < Inobj.length; j++) {\n\t\t\t\tif (Inobj[j].visible) {\n\t\t\t\t\tResult = ShowFeatureLabel(Inobj, j);\n\t\t\t\t\tcode += Result[0];\n\t\t\t\t\tif (Result.length == 2) {\n\t\t\t\t\t\tsvgout.appendChild(Result[1]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsvgout.appendChild(Result[2]);\n\t\t\t\t\t\tsvgout.appendChild(Result[1]);\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcode += \"</svg>\";\n\t\tpretext.value = code;\n\t\tpicobj.parentNode.replaceChild(svgout, picobj);\n\t\t//alert(svgout.childNodes[5].nodeName+\" has childs: \"+svgout.childNodes[5].childNodes.length);\n\t\t//alert(svgout.childNodes[5].firstChild.nodeName);\n\t\t//alert(\"the ref link: \"+svgout.childNodes[5].firstChild.getAttribute(\"xlink:href\"));\n\t\t//alert(svgout.childNodes[5].firstChild.firstChild.nodeValue);\n\n\n\t}\n}", "_alignObejctToBrahmnabhi() {\r\n // CLASS REFERENCE\r\n let that = this;\r\n\r\n d3.select('[name=\"align-center\"]').on('click', () => {\r\n if (d3.select('.svg-object.active[data-object]').node() != null) {\r\n\r\n let object = d3.select('.svg-object.active[data-object]');\r\n let id = object.attr('id');\r\n let wrapper = d3.select(`.sjx-svg-wrapper[data-id=\"${id}\"]`);\r\n\r\n\r\n let objectName = object.attr('data-object');\r\n let src = object.select('image').attr('href');\r\n let width = object.select('image').attr('width');\r\n let height = object.select('image').attr('height');\r\n let x = this.centroid.x - width / 2;\r\n let y = this.centroid.y - height / 2;\r\n\r\n object.remove();\r\n wrapper.remove();\r\n\r\n // console.log(\"x\",object.select('image').attr('x'),\"y\",object.select('image').attr('x'));\r\n\r\n let data = {\r\n src: src,\r\n width: width,\r\n height: height,\r\n x: x,\r\n y: y\r\n }\r\n let objectInstance = new Object({\r\n layer: that.canvas,\r\n data: data,\r\n canvasSize: that.canvasSize,\r\n objectName: objectName,\r\n attribute: that.attribute,\r\n });\r\n\r\n // object.select('image').attr('x', `${this.centroid.x - width / 2}`);\r\n // object.select('image').attr('y',`${this.centroid.y - height / 2}`);\r\n // console.log(this.centroid.x - width / 2,this.centroid.y - height / 2);\r\n // object.attr('transform',\"\").attr('data-cx',\"\").attr('data-cy',\"\");\r\n // wrapper.attr('transform',\"\");\r\n }\r\n\r\n })\r\n }", "function fromCanvasToSvg(sourceCanvas, targetSVG, x, y, width, height) {\n var imageData = sourceCanvas.getContext('2d').getImageData(\n x, y, width, height);\n var newCanvas = document.createElement(\"canvas\");\n var imgDataurl;\n newCanvas.width = width; newCanvas.height = height;\n newCanvas.getContext(\"2d\").putImageData(imageData, 0, 0);\n imgDataurl = newCanvas.toDataURL(\"image/png\");\n targetSVG.setAttributeNS(\"http://www.w3.org/1999/xlink\", \"xlink:href\", imgDataurl);\n }", "function drawImg(src, x, y) {}", "build(yPosition){\n const ref = this;\n ref.ctx.drawImage(ref.img, ref.xPosition, yPosition, 80, 80);\n ref.xPosition ++;\n requestAnimationFrame(function(){\n ref.build(yPosition);\n });\n }", "function Xf(){this.ha=E(\"g\",{},null);this.Zh=E(\"path\",{\"class\":\"blocklyPathDark\",transform:\"translate(1, 1)\"},this.ha);this.gd=E(\"path\",{\"class\":\"blocklyPath\"},this.ha);this.$h=E(\"path\",{\"class\":\"blocklyPathLight\"},this.ha);this.gd.gc=this;Gf(this.gd);bg(this)}", "constructor(img1, img2, xPos, yPos) {\n this.img1 = img1;\n this.img2 = img2;\n this.xPos = xPos;\n this.yPos = yPos;\n this.pic = 1;\n this.counter = 0;\n this.frames = 8;\n }", "render(svg, paddle1, paddle2) {\n this.x += this.vx;\n this.y += this.vy;\n\n //Ball =============================================================\n let ball = document.createElementNS(SVG_NS, \"circle\");\n ball.setAttributeNS(null, \"r\", this.radius);\n ball.setAttributeNS(null, \"cx\", this.x);\n ball.setAttributeNS(null, \"cy\", this.y);\n ball.setAttributeNS(null, \"fill\", \"white\");\n svg.appendChild(ball);\n\n this.wallCollision();\n this.paddleCollision(paddle1, paddle2);\n\n //Detect Goal ======================================================\n const rightGoal = this.x + this.radius >= this.boardWidth;\n const leftGoal = this.x - this.radius <= 0;\n\n if(rightGoal){\n this.goal(paddle1);\n this.direction = -1;\n this.chime.play();\n \n } else if(leftGoal){\n this.goal(paddle2);\n this.direction = 1;\n this.chime.play();\n }\n\n }", "function luoPuput_taso3(palkkiJakoLkm) {\n var kohde = document.querySelector('body');\n var canvasV = document.createElement('canvas');\n var canvasO = document.createElement('canvas');\n var img = document.createElement('img');\n img.src = \"bunny.png\";\n img.setAttribute('class','imgPupu');\n canvasV.setAttribute('class','canvasPupuVasen');\n canvasV.style.zIndex = getZ(PUPUOFFSET);\n canvasO.setAttribute('class','canvasPupuOikea');\n canvasO.style.zIndex = getZ(PUPUOFFSET);\n kohde.appendChild(canvasV);\n kohde.appendChild(canvasO);\n\n // Animaatiolaskuri. Toivottavasti 64-bittia riittaa, ennen kuin ohjelma loppuu. Silloin tulee z-day.\n // Joku oikea kello olisi ollut parempi, varsinkin jos tehdaan monimutkaisempaa animaatiota, eika haluta \n // animaation tokkivan.\n var lkm = 0;\n\n var piirtoFunctioPupuV = () => {\n var ctx = canvasV.getContext('2d');\n var ctx2 = canvasO.getContext('2d');\n var palkinKorkeus = img.height/palkkiJakoLkm;\n\n // Tehdaan nyt animaatio piirtamalla pupu siivuittain ja venyttelemalla siivuja pystysuorassa.\n\n // Hahaa. Haskelia javascriptilla. Huonoa Haskelia siis :(.\n // Trigonometrista magiaa. En viitsi selittaa tata liikaa, muuten joku viela patentoi taman. Ehka silmukka olisi parempi kuin listojen \n // pyorittely, ainakin jos haluaa tehoa. Tassa se ei nyt haittaa.\n var sy = [...Array(palkkiJakoLkm).keys()].map(x => img.height/palkkiJakoLkm*x); \n var venytettysy = [...Array(palkkiJakoLkm).keys()].map(x=>x+lkm);\n venytettysy = venytettysy.map(x => palkinKorkeus/2.0 + (palkinKorkeus/4.0)*Math.sin(0.4*x/6.0)); \n lkm = lkm + 1;\n var sum = venytettysy.reduce((x,y) => x + y);\n venytettysy = venytettysy.map(x => Math.floor(x));\n\n // Imagen pituus puolitettuna.\n var oWidth = img.width/2.0;\n // Seuraavan piirrettavan y-koordinaatin kohta.\n var nextTargetY = 0;\n\n // Puhdistetaan canvakset.\n ctx.clearRect(0,0,canvasV.width, canvasV.height);\n ctx2.clearRect(0,0,canvasO.width, canvasO.height);\n\n // Piirretaan kumpikin pupun puoliskon palkit silmukassa.\n for (let x=0; x<sy.length; x++) {\n ctx.drawImage(img, 0, sy[x] , oWidth , palkinKorkeus, \n 0, nextTargetY, canvasV.width , venytettysy[x]); \n \t\t\t \n ctx2.drawImage(img, oWidth, sy[x], oWidth, palkinKorkeus, \n 0, nextTargetY, canvasV.width , venytettysy[x]);\n\n // Lasketaan seuraavan palkin y-koordinaatti (alkamiskohta).\n nextTargetY = nextTargetY + venytettysy[x];\n }\n // Halutaan etta tata piirretaan jatkossakin.\n requestAnimationFrame(piirtoFunctioPupuV);\n };\n requestAnimationFrame(piirtoFunctioPupuV);\n}", "draw(context) {\n this.element = this.random_facing_image(this.img_array)\n context.drawImage(this.element, this.x, this.y, this.width, this.height)\n }", "function processImageTag(line) {\n var imageId = tools.getAttrValue(line, \"id\");\n if (imageId !== null && imageId.indexOf(\"image\") === 0) {\n var newImgLine = \"\";\n var x = tools.getAttrValue(line, \"x\");\n var y = tools.getAttrValue(line, \"y\");\n var w = tools.getAttrValue(line, \"width\");\n var h = tools.getAttrValue(line, \"height\");\n var viewBox = \"0 0 \" + w + \" \" + h;\n // handle clip-path for image\n var clipPath = tools.getAttrValue(line, \"clip-path\");\n // console.log(clipPath);\n if (clipPath !== null) {\n newImgLine += \"<g clip-path=\\\"\" + clipPath + \"\\\" id=\\\"cp-layer\\\">\"\n }\n // console.log(\"viewBox:\"+viewBox);\n newImgLine += \"<svg version=\\\"1.1\\\" viewBox=\\\"\" + viewBox\n + \"\\\" x=\\\"\" + x + \"\\\" y=\\\"\" + y + \"\\\" width=\\\"\" + w + \"\\\" height=\\\"\" + h + \"\\\" preserveAspectRatio=\\\"xMidYMid meet\\\">\";\n var imgLine = line;\n imgLine = tools.removeAttr(imgLine, \"x\");\n imgLine = tools.removeAttr(imgLine, \"y\");\n imgLine = tools.removeAttr(imgLine, \"preserveAspectRatio\");\n if (clipPath !== null) {\n imgLine = tools.removeAttr(imgLine, \"clip-path\");\n }\n newImgLine += imgLine;\n newImgLine += \"</svg>\";\n if (clipPath !== null) {\n newImgLine += \"</g>\"\n }\n // newImgLine = tools.replaceAttrValue(newImgLine,\"xlink:href\",\"/designs/templates/\"+getAttrValue(newImgLine,\"xlink:href\"));\n // newImgLine = tools.replaceAttrValue(newImgLine,\"xlink:href\",\"../../\"+getAttrValue(newImgLine,\"xlink:href\"));\n // console.log(\"img:\"+newImgLine);\n return newImgLine + \"\\n\";\n }\n return line + \"\\n\";\n}", "function getimagePosition2(d,i){\n let x1=-10;\n let y1 =-10;\n return \"translate(\"+x1+\",\"+y1+\") scale(0.40)\"\n\n}", "constructor(x, y, img) {\n this.pos = createVector(random(x - 20, x + 20), y);\n let vx = randomGaussian() * 0.3;\n let vy = randomGaussian() * 0.5 - 1;\n this.vel = createVector(vx, vy);\n // this.acc = createVector(0.1, this.);\n\n this.life = round(random(50, 150));\n this.size = random(30, 50);\n this.alpha = 255;\n \n // let xDiff = abs(x - this.pos.x);\n let xDiff = log(map(abs(x - this.pos.x), 0, 20, 0.1, 10)) + 1;\n this.h = round(map(xDiff, 0, 2, 50, 0));\n this.s = floor(random(90, 100));\n this.l = round(map(xDiff, 0, 1, 70, 50));\n // this.flameColor = color('hsl(' + h + ', ' + s + '%, ' + l + '%)');\n \n this.texture = img;\n\n if (random(100) > 95) {\n this.life += 10;\n this.spark = true;\n }\n\n }", "draw() {\r\n if(this.type === 'dog') {\r\n this.image.src = '../images/dog.png';\r\n } else {\r\n this.image.src = \"../images/banana.png\";\r\n }\r\n context.drawImage(this.image, this.x, this.y, this.width, this.height);\r\n }", "function draw() {\n\n // Move the felt image down by increasing its y position\n feltTextureImageY += 0.7;\n\n // Display the felt image\n image(feltTextureImage,feltTextureImageX,feltTextureImageY);\n\n // Move the clown by moving it 1/10th of its current distance from the mouse\n\n // Calculate the distance in X and in Y\n var xDistanceClown = mouseX - clownImageX;\n var yDistanceClown = mouseY - clownImageY;\n // Add 1/10th of the x and y distance to the clown's current (x,y) location\n clownImageX = clownImageX + xDistanceClown/10;\n clownImageY = clownImageY + yDistanceClown/10;\n\n // Display the clown image\n image(clownImage,clownImageX,clownImageY);\n\n // Move the yellow circle left to right by increasing its x position\n yellowCircleX += 1;\n // Set circle fill to yellow with no stroke\n noStroke();\n fill(253,231,85);\n\n // Display the yellow circle\n yellowCircle = ellipse(yellowCircleX,yellowCircleY,yellowCircleW,yellowCircleH);\n\n // Move the elephant image left to right by increasing its x position\n elephantImageX += 1;\n\n // Display the elephant image\n image(elephantImage,elephantImageX,elephantImageY);\n\n // Display the pigeon at current mouse position and move with mouse\n pigeonImageX = mouseX;\n pigeonImageY = mouseY;\n image(pigeonImage,pigeonImageX,pigeonImageY);\n\n // Move the nudibranch by moving it 1/80th of its current distance from the mouse\n\n // Calculate the distance in X and Y\n var xDistanceNudibranch = mouseX - nudibranchImageX;\n var yDistanceNudibranch = mouseY - nudibranchImageY;\n // Add 1/80th of the x and y distance to the clown's current (x,y) location\n nudibranchImageX = nudibranchImageX + xDistanceNudibranch/80;\n nudibranchImageY = nudibranchImageY + yDistanceNudibranch/80;\n\n // Display the nudibranch image\n image(nudibranchImage,nudibranchImageX,nudibranchImageY);\n\n\n}", "draw() {\r\n this.ctx.save()\r\n this.ctx.translate(this.x + (this.pSize / 2), this.y + (this.pSize / 2))\r\n this.ctx.rotate(this.angle)\r\n this.ctx.translate(-(this.x + (this.pSize / 2)), -(this.y + (this.pSize / 2)))\r\n this.ctx.drawImage(this.pl2, this.x, this.y, this.pSize, this.pSize)\r\n this.ctx.rotate(this.angle)\r\n this.ctx.restore()\r\n }", "function fi(){this.X=L(\"g\",{},null);this.gg=L(\"path\",{\"class\":\"blocklyPathDark\",transform:\"translate(1, 1)\"},this.X);this.Bc=L(\"path\",{\"class\":\"blocklyPath\"},this.X);this.hg=L(\"path\",{\"class\":\"blocklyPathLight\"},this.X);this.Bc.ub=this;Rh(this.Bc);ji(this)}", "function setup(){\n createCanvas(windowWidth, windowHeight);\n strokeWeight( 1 );\n frameRate(60);\n\n // Create the waypoints for the target dot to follow\n let w_op = [width/10, width/2, width*9/10];\n let h_op = [height/20, height/2, height*19/20];\n // // center,mid-right,topright,topleft, midleft, botleft, botright, mid-right again\n // nx_arr = [w_op[1], w_op[2], w_op[2], w_op[0], w_op[0], w_op[0], w_op[2], w_op[2]]\n // ny_arr = [h_op[1], h_op[1], h_op[0], h_op[0], h_op[1], h_op[2], h_op[2], h_op[1]];\n\n //center botmid, botleft, mid left, topleft, topright, midright, botright\n nx_arr = [w_op[1], w_op[1], w_op[0], w_op[0], w_op[0], w_op[2], w_op[2], w_op[2]]\n ny_arr = [h_op[1], h_op[2], h_op[2], h_op[1], h_op[0], h_op[0], h_op[1], h_op[2]]\n\n // Set initial target dot position\n X = nx_arr[calib_counter];\n Y = ny_arr[calib_counter];\n nX = nx_arr[(calib_counter+1) % 5];\n nY = ny_arr[(calib_counter+1) % 5];\n\n moveAmountPerFrame = [(nX-X)/numSteps , (nY-Y)/numSteps];\n\n // Start it in a stopped state\n stillsTaken = num_ims_still\n stopped = true;\n\n // Load instruction images\n instructions_imgs.push(\"static/headshot3.jpg\")\n\n}", "function setup() {\r\n// r = random(255);\r\n// g = random(255);\r\n// b = random(255);\r\n var cnv = createCanvas(720, 400);\r\n cnv.style('display', 'block');\r\n cnv.parent('content');\r\n img = loadImage('bckgrnd.JPG'); \r\n}", "function assembleShape() {\r\n\r\n\t\tvar spacing = 0,\r\n\t\t\tXoffset\t= offsetSVG,\r\n\t\t\tYoffset\t= 208,\r\n\t\t\tpixelCount = 0;\r\n\r\n\t\tfor (var i = 0; i < nodes.length; i++) {\r\n\t\t\tnodes[i].setTarget(Xoffset + Number(shapeSVG[i][0]), Yoffset + Number(shapeSVG[i][1]), Number(shapeSVG[i][2]));\r\n\t\t}\r\n\t}", "animateLogo() {\n const imageLoad = new Image();\n imageLoad.src = this.imageSrc;\n imageLoad.onload = this.animatePattern();\n }", "constructor(pic, x, y) {\n this.pic = pic; //string\n this.x = x;\n this.y = y;\n this.img = p.loadImage(this.pic);\n \n }", "constructor(x, y, destX, destY) {\r\n this.velocity = 600;\r\n this.damage = 5;\r\n this.x = x;\r\n this.y = y;\r\n this.live = true;\r\n let diffX = destX - this.x;\r\n let diffY = destY - this.y;\r\n if(Math.abs(diffX) > Math.abs(diffY)) {\r\n this.coeffX = diffX / Math.abs(diffX);\r\n this.coeffY = diffY / Math.abs(diffX);\r\n }\r\n else {\r\n this.coeffY = diffY / Math.abs(diffY);\r\n this.coeffX = diffX / Math.abs(diffY);\r\n }\r\n this.loadImage();\r\n }", "putImage() {\n this.ctx.drawImage(\n this.image,\n this.x - this.size(),\n this.y - this.size(),\n this.size() * 2,\n this.size() * 2\n );\n this.loaded = true;\n }", "updateDrawing(context) {\n if(!this.ded){\n context.drawImage(this.img, this.width * this.frameX, this.height * this.frameY, this.width, this.height, this.x, this.y, 50, 50)\n }\n }", "draw() {\r\n this.ctx.save()\r\n this.ctx.translate(this.x + (this.pSize / 2), this.y + (this.pSize / 2))\r\n this.ctx.rotate(this.angle)\r\n this.ctx.translate(-(this.x + (this.pSize / 2)), -(this.y + (this.pSize / 2)))\r\n this.ctx.drawImage(this.pl1, this.x, this.y, this.pSize, this.pSize)\r\n this.ctx.rotate(this.angle)\r\n this.ctx.restore()\r\n }", "constructor(sourceCanvas, resultCanvas) {\n this.source = sourceCanvas.getContext(\"2d\")\n this.result = resultCanvas.getContext(\"2d\")\n }", "function generatingSkull() {\n var creatingImg = document.createElement('img');\n var div = document.getElementById('another-result');\n creatingImg.src=\"https://media.giphy.com/media/jpbAaUG7cjkZy/giphy.gif\";\n div.appendChild(creatingImg);\n}", "function drawFrog(){\n\tctx.drawImage(frog, sx, sy, swidth, sheight, x, y, width, height);\n}", "constructor(stage,position){\n\t\tthis.stage = stage;\n\t\tthis.position = position;\n\t\tthis.myImage = new Image();\n\t\tthis.myImage.src = '/rotated_door.png';\n\t}", "function place(path,x,y) {\n game.canvas[1].drawImage(getImage(path),x ,y);\n }", "function initReels() {\n // iterate through all canvas elements, create context and new image\n canvases.forEach(function (canvas) {\n let ctx = canvas.getContext('2d');\n let img = new Image();\n img.src = 'images/Symbol_1.png';\n\n img.onload = function () {\n ctx.drawImage(\n img,\n spriteObject.sourceX, spriteObject.sourceY, spriteObject.sourceWidth, spriteObject.sourceHeight,\n spriteObject.x, spriteObject.y, spriteObject.width, spriteObject.height\n )\n };\n })\n }", "image(node, context) {\n const { origin, entering } = context;\n const result = origin();\n const httpRE = /^https?:\\/\\/|^data:/;\n if (httpRE.test(node.destination)){\n return result;\n }\n if (entering) {\n result.attributes.src = img_root + node.destination;\n }\n return result;\n }", "function LGraphMap2D()\r\n\t{\r\n\t\tthis.addInput(\"x\",\"number\");\r\n\t\tthis.addInput(\"y\",\"number\");\r\n\t\tthis.addOutput(\"[]\",\"array\");\r\n\t\tthis.addOutput(\"obj\",\"object\");\r\n\t\tthis.addOutput(\"img\",\"image\");\r\n\t\tthis.addProperty(\"circular\",false);\r\n\t\tthis.points = [];\r\n\t\tthis.weights = [];\r\n\t\tthis.weights_obj = {};\r\n\t\tthis.current_pos = new Float32Array([0.5,0.5]);\r\n\t\tthis.size = [200,200];\r\n\t\tthis.dragging = false;\r\n\t\tthis.show_names = true;\r\n\t\tthis.circle_center = [0,0];\r\n\t\tthis.circle_radius = 1;\r\n\t\tthis.margin = 20;\r\n\t\tthis._values_changed = true;\r\n\t\tthis._visualize_weights = false;\r\n\t\tthis._version = 0;\r\n\t\tthis._selected_point = null;\r\n\t}", "draw() {\n\n spiel.ctx.drawImage(this.img, this.posX, this.posY, this.breite, this.height);\n }", "draw() {\n\n spiel.ctx.drawImage(this.img, this.posX, this.posY, this.breite, this.height);\n }", "toSVG(x1, x2) {\n this.svg_element = $(document.createElementNS(\"http://www.w3.org/2000/svg\", 'path')).attr(\"d\", this.pathParameters(x1, x2)).addClass(\"parabola_svg\")\n .attr({style:this.style});\n return (this.svg_element);\n }", "function load_img() {\n fabric.Image.fromURL('golf-h.png', function (img) {\n hole = img;\n hole.scaleToWidth(60);\n hole.scaleToHeight(60);\n hole.set({\n top: holey,\n left: holex\n });\n canvas.add(hole);\n });\n\n fabric.Image.fromURL('ball.png', function (img) {\n ball = img;\n ball.scaleToWidth(ballw);\n ball.scaleToHeight(ballh);\n ball.set({\n top: bally,\n left: ballx\n });\n canvas.add(ball);\n });\n}", "constructor(x, y, image, scale) {\n this.x = x;\n this.y = y;\n this.image = image;\n this.scale = scale;\n }", "function InConstructionShape() {\n\tvar shape = this.shape;\n\tshape.addPoint(new Point2D(85, 0));\n\tshape.addPoint(new Point2D(101, 27));\n\tshape.addPoint(new Point2D(101, 37));\n\tshape.addPoint(new Point2D(139, 62));\n\tshape.addPoint(new Point2D(70, 107));\n\tshape.addPoint(new Point2D(0, 62));\n\tshape.addPoint(new Point2D(38, 37));\n\tshape.addPoint(new Point2D(38, 35));\n\tshape.addPoint(new Point2D(68, 15));\n\tshape.addPoint(new Point2D(68, 8));\n\n\tthis.image.src = \"canvas/images/Costruzione.png\";\n}", "constructor(x, y, srcImage, speedX, speedY) {\n this._x = x;\n this._y = y;\n this._image = new Image();\n this._image.src = srcImage;\n this._speedX = speedX || 0;\n this._speedY = speedY || 0;\n }", "function copySpriteGraphic() {\n return src(graphicSRC).pipe(dest(graphicURL));\n}", "function tgtDraw() {\r\n\t var w = $(\"#holder\").width();\r\n\r\n\t var pi = Math.PI;\r\n\r\n\t var center = Math.round(w / 3);\r\n\t var center2 = center * 1.25;\r\n\t var radius = (w / 3.25);\r\n\r\n\t var losRad = parseFloat(document.getElementById('LOS').value) * (pi / 180);\r\n\t var crsTRad = parseFloat(document.getElementById('tgtCRS').value) * (pi / 180);\r\n\r\n\t var taSin = Math.sin(crsTRad - losRad);\r\n\t var taCos = Math.cos(crsTRad - losRad);\r\n\r\n\t var nTX = center + (taSin * radius);\r\n\t var nTY = center2 + ((-1 * taCos) * radius);\r\n\r\n\t var tanim = Raphael.animation({\r\n\t cx: nTX,\r\n\t cy: nTY\r\n\t }, 1e1);\r\n\t tHandle.animate(tanim);\r\n\r\n\t tVectorArray[1][1] = nTX;\r\n\t tVectorArray[1][2] = nTY;\r\n\t tVector.attr({\r\n\t path: tVectorArray\r\n\t });\r\n\r\n\t}", "function creatNewFlyingObject(position){\n // raster_flyingObject.remove();\n // raster_flyingObject = new Raster({\n // source: cObj.imageName,\n // position: position\n // }); \n\n // raster_flyingObject = JSON.parse(JSON.stringify(raster_flyingObject_copy));\n // raster_flyingObject = Object.assign({}, raster_flyingObject_copy);\n\n\n raster_flyingObject.position = position;\n // raster_flyingObject.scale(cObj.imgScale*ratio);\n\n\n // raster_flyingObject.scale((cObj.imgScale + scaleByflyingObjectPerabola(position.length))*ratio);\n\n // raster_flyingObject.applyMatrix = false; // Does not work - SEE: https://github.com/paperjs/paper.js/issues/458\n\n // group.addChild(raster_flyingObject); // This does NOT add the plane below the black dot.\n // raster_flyingObject.insertBelow(path1); // This add the plane below the black dot.\n\n\n console.log('creatNewFlyingObject - cObj.worldAngle: ' + cObj.worldAngle);\n\n\n cObj.cannonBallFlightVector_2 = cObj.cannonAnglePath.position - cObj.cannonPath.position;\n\n if (typeof(cObj.oldAngle)==='undefined') {\n cObj.oldAngle = cObj.worldAngle + cObj.cannonBallFlightVector_2.angle + 90;\n }\n\n // cObj.cannonBallFlightVector_2 = cObj.cannonAnglePath.position - cObj.cannonPath.position;\n if (typeof(cObj.cannonBallFired)==='undefined'){ \n // raster_flyingObject.rotate(cObj.cannonBallFlightVector_2.angle + cObj.imgInitAngel);\n\n cObj.newAngle = cObj.cannonBallFlightVector_2.angle + cObj.imgInitAngel;\n raster_flyingObject.rotate(cObj.worldAngle - cObj.oldAngle + cObj.newAngle);\n cObj.oldAngle = cObj.newAngle;\n } else {\n if (typeof(cObj.constantFlightAngle)==='undefined') { // Define constantFlightAngle ONLY once...\n cObj.constantFlightAngle = cObj.cannonBallFlightVector_2.angle;\n }\n console.log('creatNewFlyingObject - cObj.constantFlightAngle: ' + cObj.constantFlightAngle);\n // raster_flyingObject.rotate(cObj.constantFlightAngle + cObj.imgInitAngel);\n \n cObj.newAngle = cObj.constantFlightAngle + cObj.imgInitAngel + cObj.worldAngle;\n raster_flyingObject.rotate(-cObj.oldAngle + cObj.newAngle);\n cObj.oldAngle = cObj.newAngle;\n\n }\n\n\n // // cObj.diffAngle\n // console.log('creatNewFlyingObject - cObj.diffAngle: ' + cObj.diffAngle);\n // // raster_flyingObject.remove();\n // raster_flyingObject.rotate(cObj.diffAngle);\n // // group.addChild(raster_flyingObject); \n\n}", "function drawPacman(x, y, r) {\n\tctx = document.getElementById('myCanvas').getContext('2d');\n\tvar pacman = new Image();\n\tpacman.src = \"pacman.gif\";\n\tctx.drawImage(pacman, x, y, r, r);\n}", "function load(e) {\n //console.log(e);\n //var tile = e.tile, g = tile.element;\n // var bigness = Math.pow(2, e.tile.zoom);\n // var smallness = 1.0 / bigness;\n // for (let x = 0; x < 255; x++) {\n // for (let y = 0; y < 255; y++) {\n //\n // //var q = doNoise(x * smallness, y * smallness, tile.row, tile.column, 1000000 * smallness, 1);\n // //if(x==0)\n // // console.log(q);\n // //console.log(q);\n // if ( Math.random() > 0.9999) {\n // var point = g.appendChild(po.svg(\"image\"));\n // point.setAttribute(\"width\", 0.0125 * bigness);\n // point.setAttribute(\"x\", Math.random() * 255);\n // point.setAttribute(\"y\", Math.random() * 255);\n // point.setAttribute(\"height\", 0.012g5 *bigness);\n // //var url = \"https://images.vexels.com/media/users/3/127601/isolated/lists/4874bc2389e71df4c479ad933b12226a-elliptical-tree-icon.png\";\n // //var url = \"https://cdn0.iconfinder.com/data/icons/simple-flat-colored-trees/100/Tree_green_circle_branches-512.png\";\n // var url = \"https://cdn0.iconfinder.com/data/icons/pixelo/32/tree.png\";\n // //var url = \"https://image.flaticon.com/icons/png/128/72/72223.png\";\n // point.setAttribute(\"href\", url);\n // }\n // }\n // }\n\n //point.setAttribute(\"fill\", \"url(\\\"https://d1nhio0ox7pgb.cloudfront.net/_img/g_collection_png/standard/64x64/tree.png\\\")\");\n //point.setAttribute(\"fill\", \"red\");\n\n}", "_transformedPoint(x, y) {\n let pt = this._svg.createSVGPoint()\n pt.x = x * this._pixelRatio()\n pt.y = y * this._pixelRatio()\n return pt.matrixTransform(this._transform.inverse())\n }", "function initGame()\n{\n load_bow_arrows(); //load ten\n load_ball_img(); //load img\n load_bow_archer();\n background = new Image(); //load img bg\n background.src = \"img/cutebg.gif\";\n background2 = new Image(); //load img bg\n background2.src = \"img/bg.png\";\n crossImage = new Image(); //load img\n crossImage.src = \"img/crosshair.png\";\n// crossImage = new Image(); //load img\n// crossImage.src = \"img/crosshair.png\";\n\n broad = new Image(); //load img\n broad.src = \"img/luotban.png\";\n f = document.getElementById(\"fpscontainer\"); //load id fps\n\n canvas = document.getElementById(\"myCanvas\");\n context = canvas.getContext(\"2d\");\n}", "draw(ctx) {\n const animating = (this.creationTime !== 0);\n let value = 1;\n if (animating) {\n const elapsedTime = Date.now() - this.creationTime;\n if (elapsedTime < 0) return; // still have some delay, first\n if (elapsedTime > BuildTime) this.creationTime = 0;\n value = houseBez(elapsedTime / BuildTime); // Goes between 0 and (greater than bc of bezier) 1'\n }\n\n const { x, y, flip, img, width, height } = this;\n ctx.translate(x, y - height);\n\n if (flip) { ctx.translate(width, 0); ctx.scale(-1, 1); }\n if (animating) {\n // Starting from a fixed scale like 0.6 looks nicer than appearing from nowhere.\n // const scale = 0.8 + (value * 0.2);\n // if scaling: this x value during animation ensures it animates from the center, not the left side as it scales up\n ctx.translate(/* (1 - scale) * (width / 2) */ 0, (height - (height * value)));\n // ctx.scale(scale, scale);\n }\n\n\n if (this.imgx) {\n ctx.drawImage(img, this.imgx, this.imgy, this.imgw, this.imgh, 0, 0, width, height);\n } else {\n ctx.drawImage(img, 0, 0, width, height); // NYI\n }\n\n ctx.resetTransform();\n // if (animating) {\n // ctx.scale(valfrac, valfrac);\n // ctx.translate(0, -(h - (h * value)));\n // }\n // if (flip) { ctx.scale(-1, 1); ctx.translate(-w, 0); }\n // ctx.translate(-x, -y);\n }", "function CanvasImage(x, y, source, width, height, btfe) {\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.img = document.createElement(\"img\");\n this.img.src = source;\n this.btfe = btfe;\n this.speed = 0;\n this.draw = function () {\n c.drawImage(this.img, this.x - this.width / 2, this.y - (5 * this.height / 8), this.width, this.height);\n }\n // this.update = function () {\n // if (this.x < innerWidth + 500 && this.x > 0) {\n // this.x = this.x - 5;\n // }\n // if (this.x < innerWidth * .2 && this.x > 0) {\n // cta.x = innerWidth / 2;\n // }\n // }\n this.update = function () {\n\n\n this.y += 15 * this.speed;\n if (this.y < canvas.height * .7) {\n this.speed *= -1;\n if(this.img.src.includes(\"2xBT.png\")){\n restock();\n } else {\n console.log(\"Not counted as Checkmark\");\n console.log(this.img.src);\n }\n \n } else if (this.y > innerHeight + innerWidth*.8 && this.speed > 0) {\n this.speed = 0;\n }\n\n }\n this.touch = function (touch, status) {\n if ((Math.abs(touch.clientX - this.x) <= this.width / 2) && (Math.abs(touch.clientY - this.y) <= this.height / 2)) {\n // switch(status) {\n // case \"start\":\n // console.log(\"got me!\");\n // phone.scale = phone.scale * 1.2;\n // break;\n // case \"move\":\n // phone.x = touch.clientX;\n // phone.y = touch.clientY;\n // checkScan();\n // break;\n // }\n //console.log(\"touched \"+this.img.src);\n //console.log(\"at \"+this.x+\",\"+this.y);\n\n //if btfe\n if (this.btfe) {\n //toast\n console.log(\"toast begins!\");\n brandIndex++;\n if(brandIndex >= brands.length){\n brandIndex = 0;\n }\n SuccessBox.speed = - 2;\n //raise walmart count\n earnings += 2;\n } else {\n FailureBox.speed = -2;\n }\n\n }\n }\n // this.bounce = function() {\n // if (this.width < innerWidth / 4 || this.width > innerWidth/3) {\n // direction = -direction;\n // }\n // this.width += 5 * direction;\n // this.height += 5 * direction;\n // }\n}", "function gxtkGraphics(){\r\n\tthis.game=BBHtml5Game.Html5Game();\r\n\tthis.canvas=this.game.GetCanvas()\r\n\tthis.width=this.canvas.width;\r\n\tthis.height=this.canvas.height;\r\n\tthis.gl=null;\r\n\tthis.gc=this.canvas.getContext( '2d' );\r\n\tthis.tmpCanvas=null;\r\n\tthis.r=255;\r\n\tthis.b=255;\r\n\tthis.g=255;\r\n\tthis.white=true;\r\n\tthis.color=\"rgb(255,255,255)\"\r\n\tthis.alpha=1;\r\n\tthis.blend=\"source-over\";\r\n\tthis.ix=1;this.iy=0;\r\n\tthis.jx=0;this.jy=1;\r\n\tthis.tx=0;this.ty=0;\r\n\tthis.tformed=false;\r\n\tthis.scissorX=0;\r\n\tthis.scissorY=0;\r\n\tthis.scissorWidth=0;\r\n\tthis.scissorHeight=0;\r\n\tthis.clipped=false;\r\n}", "function changeImageShape(x,y){\n ctx.beginPath();\n ctx.arc(x+circleFixed,y+circleFixed, size/2, 0, 2*Math.PI);\n ctx.closePath(); \n ctx.lineWidth = \"5\";\n ctx.strokeStyle = \"white\";\n ctx.stroke(); \n}", "function draw()\r\n {\r\n ctx.clearRect(0, 0, W, H);\r\n //////////////////////////////////////////////////////////////////////////////////////////\r\n // GELB\r\n //////////////////////////////////////////////////////////////////////////////////////////\r\n img = document.getElementById(\"gelbHütte1\");\r\n for (var i in gelbH1) {\r\n ctx.drawImage(img, gelbH1[i][0], gelbH1[i][1],img.width/2 ,img.height/2 );\r\n }\r\n img = document.getElementById(\"gelbHütte2\");\r\n for (var i in gelbH2) {\r\n ctx.drawImage(img, gelbH2[i][0], gelbH2[i][1],img.width/2 ,img.height/2 );\r\n }\r\n img = document.getElementById(\"gelbSchirm\");\r\n for (var i in gelbSchirm) {\r\n ctx.drawImage(img, gelbSchirm[i][0], gelbSchirm[i][1],img.width/2 ,img.height/2 );\r\n }\r\n var img2 = document.getElementById(\"gelbLift3\");\r\n for (var i in gelbLift3) {\r\n img = document.getElementById(\"gelbLift2\");\r\n ctx.drawImage(img, gelbLift3[i][2],gelbLift3[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(gelbLift3[i][2]+8-gelbLift3[i][0]-8);\r\n //y achse\r\n var vektor2=(gelbLift3[i][3]+10-gelbLift3[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*2;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n\r\n if (gelbLift3[i][5]){\r\n ctx.drawImage(img2,gelbLift3[i][2]-vektor1* gelbLift3[i][4],gelbLift3[i][3]+8-vektor2*gelbLift3[i][4],img2.width/2 ,img2.height/2);\r\n if (gelbLift3[i][4]>=einheitsfaktor){gelbLift3[i][5]=false}\r\n else{gelbLift3[i][4] +=1;}\r\n }\r\n else{\r\n ctx.drawImage(img2,gelbLift3[i][2]-vektor1* gelbLift3[i][4],gelbLift3[i][3]+8-vektor2*gelbLift3[i][4],img2.width/2 ,img2.height/2);\r\n if (gelbLift3[i][4]<=0){gelbLift3[i][5]=true}\r\n else{gelbLift3[i][4] -=1;}\r\n }\r\n\r\n if (gelbLift3[i][5]){\r\n ctx.drawImage(img2,gelbLift3[i][2]+12-vektor1* (einheitsfaktor-gelbLift3[i][4]),gelbLift3[i][3]+8-vektor2*(einheitsfaktor-gelbLift3[i][4]),img2.width/2 ,img2.height/2);\r\n if (gelbLift3[i][4]>=einheitsfaktor){gelbLift3[i][5]=false}\r\n else{gelbLift3[i][4] +=1;}\r\n }\r\n else{\r\n ctx.drawImage(img2,gelbLift3[i][2]+12-vektor1* (einheitsfaktor-gelbLift3[i][4]),gelbLift3[i][3]+8-vektor2*(einheitsfaktor-gelbLift3[i][4]),img2.width/2 ,img2.height/2);\r\n if (gelbLift3[i][4]<=0){gelbLift3[i][5]=true}\r\n else{gelbLift3[i][4] -=1;}\r\n }\r\n\r\n img = document.getElementById(\"gelbLift1\");\r\n ctx.drawImage(img, gelbLift3[i][0],gelbLift3[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift3[i][2]+8,gelbLift3[i][3]+10);\r\n ctx.lineTo(gelbLift3[i][0]+8,gelbLift3[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift3[i][2]+19,gelbLift3[i][3]+10);\r\n ctx.lineTo(gelbLift3[i][0]+19,gelbLift3[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(gelbLift3[i][4]);\r\n }\r\n var img2 = document.getElementById(\"gelbLift6\");\r\n for (var i in gelbLift6) {\r\n img = document.getElementById(\"gelbLift5\");\r\n ctx.drawImage(img, gelbLift6[i][2],gelbLift6[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(gelbLift6[i][2]+8-gelbLift6[i][0]-12);\r\n //y achse\r\n var vektor2=(gelbLift6[i][3]+10-gelbLift6[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*2;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/200; test++)\r\n {\r\n\r\n var delta_X=gelbLift6[i][4]*vektor1+test*vektor1*200;\r\n var delta_Y=gelbLift6[i][4]*vektor2+test*vektor2*200;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,gelbLift6[i][2]+7-delta_X,gelbLift6[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,gelbLift6[i][2]+17-vektor1*einheitsfaktor+delta_X,gelbLift6[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,gelbLift6[i][2]+7-delta_X+vektor1*einheitsfaktor,gelbLift6[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,gelbLift6[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,gelbLift6[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (gelbLift6[i][4]>=einheitsfaktor){gelbLift6[i][4]=0}\r\n else{gelbLift6[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"gelbLift4\");\r\n ctx.drawImage(img, gelbLift6[i][0],gelbLift6[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift6[i][2]+10,gelbLift6[i][3]+8);\r\n ctx.lineTo(gelbLift6[i][0]+16,gelbLift6[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift6[i][2]+20,gelbLift6[i][3]+8);\r\n ctx.lineTo(gelbLift6[i][0]+26,gelbLift6[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(gelbLift6[i][4]);\r\n }\r\n var img2 = document.getElementById(\"gelbLift7\");\r\n for (var i in gelbLift8) {\r\n img = document.getElementById(\"gelbLift5\");\r\n ctx.drawImage(img, gelbLift8[i][2],gelbLift8[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(gelbLift8[i][2]+8-gelbLift8[i][0]-15);\r\n //y achse\r\n var vektor2=(gelbLift8[i][3]+10-gelbLift8[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*5;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/150; test++)\r\n {\r\n\r\n var delta_X=gelbLift8[i][4]*vektor1+test*vektor1*150;\r\n var delta_Y=gelbLift8[i][4]*vektor2+test*vektor2*150;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,gelbLift8[i][2]+7-delta_X,gelbLift8[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,gelbLift8[i][2]+17-vektor1*einheitsfaktor+delta_X,gelbLift8[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,gelbLift8[i][2]+7-delta_X+vektor1*einheitsfaktor,gelbLift8[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,gelbLift8[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,gelbLift8[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (gelbLift8[i][4]>=einheitsfaktor){gelbLift8[i][4]=0}\r\n else{gelbLift8[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"gelbLift4\");\r\n ctx.drawImage(img, gelbLift8[i][0],gelbLift8[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift8[i][2]+10,gelbLift8[i][3]+8);\r\n ctx.lineTo(gelbLift8[i][0]+16,gelbLift8[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift8[i][2]+20,gelbLift8[i][3]+8);\r\n ctx.lineTo(gelbLift8[i][0]+26,gelbLift8[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(gelbLift8[i][4]);\r\n }\r\n var img2 = document.getElementById(\"gelbLift8\");\r\n for (var i in gelbLift10) {\r\n img = document.getElementById(\"gelbLift5\");\r\n ctx.drawImage(img, gelbLift10[i][2],gelbLift10[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(gelbLift10[i][2]+8-gelbLift10[i][0]-15);\r\n //y achse\r\n var vektor2=(gelbLift10[i][3]+10-gelbLift10[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*10;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/300; test++)\r\n {\r\n\r\n var delta_X=gelbLift10[i][4]*vektor1+test*vektor1*300;\r\n var delta_Y=gelbLift10[i][4]*vektor2+test*vektor2*300;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,gelbLift10[i][2]+7-delta_X,gelbLift10[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,gelbLift10[i][2]+17-vektor1*einheitsfaktor+delta_X,gelbLift10[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,gelbLift10[i][2]+7-delta_X+vektor1*einheitsfaktor,gelbLift10[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,gelbLift10[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,gelbLift10[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (gelbLift10[i][4]>=einheitsfaktor){gelbLift10[i][4]=0}\r\n else{gelbLift10[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"gelbLift4\");\r\n ctx.drawImage(img, gelbLift10[i][0],gelbLift10[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift10[i][2]+10,gelbLift10[i][3]+8);\r\n ctx.lineTo(gelbLift10[i][0]+16,gelbLift10[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift10[i][2]+20,gelbLift10[i][3]+8);\r\n ctx.lineTo(gelbLift10[i][0]+26,gelbLift10[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(gelbLift10[i][4]);\r\n }\r\n //////////////////////////////////////////// Schlepper\r\n var img2 = document.getElementById(\"gelbLift11\");\r\n for (var i in gelbLift12) {\r\n img = document.getElementById(\"gelbLift10\");\r\n ctx.drawImage(img, gelbLift12[i][2],gelbLift12[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(gelbLift12[i][2]+1-gelbLift12[i][0]+1);\r\n //y achse\r\n var vektor2=(gelbLift12[i][3]+1-gelbLift12[i][1]+1);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*20; //Anzahl gondeln\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/400; test++)\r\n {\r\n\r\n var delta_X=gelbLift12[i][4]*vektor1+test*vektor1*400;\r\n var delta_Y=gelbLift12[i][4]*vektor2+test*vektor2*400;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,gelbLift12[i][2]-delta_X,gelbLift12[i][3]-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,gelbLift12[i][2]+10-vektor1*einheitsfaktor+delta_X,gelbLift12[i][3]-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,gelbLift12[i][2]+0-delta_X+vektor1*einheitsfaktor,gelbLift12[i][3]-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,gelbLift12[i][2]+10-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,gelbLift12[i][3]-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (gelbLift12[i][4]>=einheitsfaktor){gelbLift12[i][4]=0}\r\n else{gelbLift12[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"gelbLift10\");\r\n ctx.drawImage(img, gelbLift12[i][0],gelbLift12[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift12[i][2],gelbLift12[i][3]+1);\r\n ctx.lineTo(gelbLift12[i][0],gelbLift12[i][1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift12[i][2]+10,gelbLift12[i][3]+1);\r\n ctx.lineTo(gelbLift12[i][0]+10,gelbLift12[i][1]+1);\r\n ctx.stroke();\r\n\r\n\r\n\r\n //console.log(gelbLift10[i][4]);\r\n }\r\n //////////////////////////////////////////// kleiner Schlepper\r\n var img2 = document.getElementById(\"gelbLift12\");\r\n for (var i in gelbLift14) {\r\n img = document.getElementById(\"gelbLift9\");\r\n ctx.drawImage(img, gelbLift14[i][2],gelbLift14[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(gelbLift14[i][2]-gelbLift14[i][0]);\r\n //y achse\r\n var vektor2=(gelbLift14[i][3]-gelbLift14[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*25; //Anzahl gondeln\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/500; test++)\r\n {\r\n\r\n var delta_X=gelbLift14[i][4]*vektor1+test*vektor1*500;\r\n var delta_Y=gelbLift14[i][4]*vektor2+test*vektor2*500;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,gelbLift14[i][2]-delta_X,gelbLift14[i][3]-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,gelbLift14[i][2]+10-vektor1*einheitsfaktor+delta_X,gelbLift14[i][3]-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,gelbLift14[i][2]+0-delta_X+vektor1*einheitsfaktor,gelbLift14[i][3]-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,gelbLift14[i][2]+10-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,gelbLift14[i][3]-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (gelbLift14[i][4]>=einheitsfaktor){gelbLift14[i][4]=0}\r\n else{gelbLift14[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"gelbLift9\");\r\n ctx.drawImage(img, gelbLift14[i][0],gelbLift14[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift14[i][2],gelbLift14[i][3]);\r\n ctx.lineTo(gelbLift14[i][0],gelbLift14[i][1]);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(gelbLift14[i][2]+10,gelbLift14[i][3]);\r\n ctx.lineTo(gelbLift14[i][0]+10,gelbLift14[i][1]);\r\n ctx.stroke();\r\n }\r\n //////////////////////////////////////////////////////////////////////////////////////////\r\n // ROT\r\n //////////////////////////////////////////////////////////////////////////////////////////\r\n img = document.getElementById(\"rotHütte1\");\r\n for (var i in rotH1) {\r\n ctx.drawImage(img, rotH1[i][0], rotH1[i][1],img.width/2 ,img.height/2 );\r\n }\r\n img = document.getElementById(\"rotHütte2\");\r\n for (var i in rotH2) {\r\n ctx.drawImage(img, rotH2[i][0], rotH2[i][1],img.width/2 ,img.height/2 );\r\n }\r\n img = document.getElementById(\"rotSchirm\");\r\n for (var i in rotSchirm) {\r\n ctx.drawImage(img, rotSchirm[i][0], rotSchirm[i][1],img.width/2 ,img.height/2 );\r\n }\r\n var img2 = document.getElementById(\"rotLift3\");\r\n for (var i in rotLift3) {\r\n img = document.getElementById(\"rotLift2\");\r\n ctx.drawImage(img, rotLift3[i][2],rotLift3[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(rotLift3[i][2]+8-rotLift3[i][0]-8);\r\n //y achse\r\n var vektor2=(rotLift3[i][3]+10-rotLift3[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*2;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n\r\n if (rotLift3[i][5]){\r\n ctx.drawImage(img2,rotLift3[i][2]-vektor1* rotLift3[i][4],rotLift3[i][3]+8-vektor2*rotLift3[i][4],img2.width/2 ,img2.height/2);\r\n if (rotLift3[i][4]>=einheitsfaktor){rotLift3[i][5]=false}\r\n else{rotLift3[i][4] +=1;}\r\n }\r\n else{\r\n ctx.drawImage(img2,rotLift3[i][2]-vektor1* rotLift3[i][4],rotLift3[i][3]+8-vektor2*rotLift3[i][4],img2.width/2 ,img2.height/2);\r\n if (rotLift3[i][4]<=0){rotLift3[i][5]=true}\r\n else{rotLift3[i][4] -=1;}\r\n }\r\n\r\n if (rotLift3[i][5]){\r\n ctx.drawImage(img2,rotLift3[i][2]+12-vektor1* (einheitsfaktor-rotLift3[i][4]),rotLift3[i][3]+8-vektor2*(einheitsfaktor-rotLift3[i][4]),img2.width/2 ,img2.height/2);\r\n if (rotLift3[i][4]>=einheitsfaktor){rotLift3[i][5]=false}\r\n else{rotLift3[i][4] +=1;}\r\n }\r\n else{\r\n ctx.drawImage(img2,rotLift3[i][2]+12-vektor1* (einheitsfaktor-rotLift3[i][4]),rotLift3[i][3]+8-vektor2*(einheitsfaktor-rotLift3[i][4]),img2.width/2 ,img2.height/2);\r\n if (rotLift3[i][4]<=0){rotLift3[i][5]=true}\r\n else{rotLift3[i][4] -=1;}\r\n }\r\n\r\n img = document.getElementById(\"rotLift1\");\r\n ctx.drawImage(img, rotLift3[i][0],rotLift3[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift3[i][2]+8,rotLift3[i][3]+10);\r\n ctx.lineTo(rotLift3[i][0]+8,rotLift3[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift3[i][2]+19,rotLift3[i][3]+10);\r\n ctx.lineTo(rotLift3[i][0]+19,rotLift3[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(rotLift3[i][4]);\r\n }\r\n var img2 = document.getElementById(\"rotLift6\");\r\n for (var i in rotLift6) {\r\n img = document.getElementById(\"rotLift5\");\r\n ctx.drawImage(img, rotLift6[i][2],rotLift6[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(rotLift6[i][2]+8-rotLift6[i][0]-12);\r\n //y achse\r\n var vektor2=(rotLift6[i][3]+10-rotLift6[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*2;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/200; test++)\r\n {\r\n\r\n var delta_X=rotLift6[i][4]*vektor1+test*vektor1*200;\r\n var delta_Y=rotLift6[i][4]*vektor2+test*vektor2*200;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,rotLift6[i][2]+7-delta_X,rotLift6[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,rotLift6[i][2]+17-vektor1*einheitsfaktor+delta_X,rotLift6[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,rotLift6[i][2]+7-delta_X+vektor1*einheitsfaktor,rotLift6[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,rotLift6[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,rotLift6[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (rotLift6[i][4]>=einheitsfaktor){rotLift6[i][4]=0}\r\n else{rotLift6[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"rotLift4\");\r\n ctx.drawImage(img, rotLift6[i][0],rotLift6[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift6[i][2]+10,rotLift6[i][3]+8);\r\n ctx.lineTo(rotLift6[i][0]+16,rotLift6[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift6[i][2]+20,rotLift6[i][3]+8);\r\n ctx.lineTo(rotLift6[i][0]+26,rotLift6[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(rotLift6[i][4]);\r\n }\r\n var img2 = document.getElementById(\"rotLift7\");\r\n for (var i in rotLift8) {\r\n img = document.getElementById(\"rotLift5\");\r\n ctx.drawImage(img, rotLift8[i][2],rotLift8[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(rotLift8[i][2]+8-rotLift8[i][0]-15);\r\n //y achse\r\n var vektor2=(rotLift8[i][3]+10-rotLift8[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*5;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/150; test++)\r\n {\r\n\r\n var delta_X=rotLift8[i][4]*vektor1+test*vektor1*150;\r\n var delta_Y=rotLift8[i][4]*vektor2+test*vektor2*150;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,rotLift8[i][2]+7-delta_X,rotLift8[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,rotLift8[i][2]+17-vektor1*einheitsfaktor+delta_X,rotLift8[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,rotLift8[i][2]+7-delta_X+vektor1*einheitsfaktor,rotLift8[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,rotLift8[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,rotLift8[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (rotLift8[i][4]>=einheitsfaktor){rotLift8[i][4]=0}\r\n else{rotLift8[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"rotLift4\");\r\n ctx.drawImage(img, rotLift8[i][0],rotLift8[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift8[i][2]+10,rotLift8[i][3]+8);\r\n ctx.lineTo(rotLift8[i][0]+16,rotLift8[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift8[i][2]+20,rotLift8[i][3]+8);\r\n ctx.lineTo(rotLift8[i][0]+26,rotLift8[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(rotLift8[i][4]);\r\n }\r\n var img2 = document.getElementById(\"rotLift8\");\r\n for (var i in rotLift10) {\r\n img = document.getElementById(\"rotLift5\");\r\n ctx.drawImage(img, rotLift10[i][2],rotLift10[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(rotLift10[i][2]+8-rotLift10[i][0]-15);\r\n //y achse\r\n var vektor2=(rotLift10[i][3]+10-rotLift10[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*10;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/300; test++)\r\n {\r\n\r\n var delta_X=rotLift10[i][4]*vektor1+test*vektor1*300;\r\n var delta_Y=rotLift10[i][4]*vektor2+test*vektor2*300;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,rotLift10[i][2]+7-delta_X,rotLift10[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,rotLift10[i][2]+17-vektor1*einheitsfaktor+delta_X,rotLift10[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,rotLift10[i][2]+7-delta_X+vektor1*einheitsfaktor,rotLift10[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,rotLift10[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,rotLift10[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (rotLift10[i][4]>=einheitsfaktor){rotLift10[i][4]=0}\r\n else{rotLift10[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"rotLift4\");\r\n ctx.drawImage(img, rotLift10[i][0],rotLift10[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift10[i][2]+10,rotLift10[i][3]+8);\r\n ctx.lineTo(rotLift10[i][0]+16,rotLift10[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift10[i][2]+20,rotLift10[i][3]+8);\r\n ctx.lineTo(rotLift10[i][0]+26,rotLift10[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(rotLift10[i][4]);\r\n }\r\n //////////////////////////////////////////// Schlepper\r\n var img2 = document.getElementById(\"rotLift11\");\r\n for (var i in rotLift12) {\r\n img = document.getElementById(\"rotLift10\");\r\n ctx.drawImage(img, rotLift12[i][2],rotLift12[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(rotLift12[i][2]+1-rotLift12[i][0]+1);\r\n //y achse\r\n var vektor2=(rotLift12[i][3]+1-rotLift12[i][1]+1);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*20; //Anzahl gondeln\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/400; test++)\r\n {\r\n\r\n var delta_X=rotLift12[i][4]*vektor1+test*vektor1*400;\r\n var delta_Y=rotLift12[i][4]*vektor2+test*vektor2*400;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,rotLift12[i][2]-delta_X,rotLift12[i][3]-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,rotLift12[i][2]+10-vektor1*einheitsfaktor+delta_X,rotLift12[i][3]-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,rotLift12[i][2]+0-delta_X+vektor1*einheitsfaktor,rotLift12[i][3]-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,rotLift12[i][2]+10-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,rotLift12[i][3]-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (rotLift12[i][4]>=einheitsfaktor){rotLift12[i][4]=0}\r\n else{rotLift12[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"rotLift10\");\r\n ctx.drawImage(img, rotLift12[i][0],rotLift12[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift12[i][2],rotLift12[i][3]+1);\r\n ctx.lineTo(rotLift12[i][0],rotLift12[i][1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift12[i][2]+10,rotLift12[i][3]+1);\r\n ctx.lineTo(rotLift12[i][0]+10,rotLift12[i][1]+1);\r\n ctx.stroke();\r\n }\r\n //////////////////////////////////////////// kleiner Schlepper\r\n var img2 = document.getElementById(\"rotLift12\");\r\n for (var i in rotLift14) {\r\n img = document.getElementById(\"rotLift9\");\r\n ctx.drawImage(img, rotLift14[i][2],rotLift14[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(rotLift14[i][2]-rotLift14[i][0]);\r\n //y achse\r\n var vektor2=(rotLift14[i][3]-rotLift14[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*25; //Anzahl gondeln\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/500; test++)\r\n {\r\n\r\n var delta_X=rotLift14[i][4]*vektor1+test*vektor1*500;\r\n var delta_Y=rotLift14[i][4]*vektor2+test*vektor2*500;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,rotLift14[i][2]-delta_X,rotLift14[i][3]-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,rotLift14[i][2]+10-vektor1*einheitsfaktor+delta_X,rotLift14[i][3]-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,rotLift14[i][2]+0-delta_X+vektor1*einheitsfaktor,rotLift14[i][3]-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,rotLift14[i][2]+10-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,rotLift14[i][3]-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (rotLift14[i][4]>=einheitsfaktor){rotLift14[i][4]=0}\r\n else{rotLift14[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"rotLift9\");\r\n ctx.drawImage(img, rotLift14[i][0],rotLift14[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift14[i][2],rotLift14[i][3]);\r\n ctx.lineTo(rotLift14[i][0],rotLift14[i][1]);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(rotLift14[i][2]+10,rotLift14[i][3]);\r\n ctx.lineTo(rotLift14[i][0]+10,rotLift14[i][1]);\r\n ctx.stroke();\r\n }\r\n\r\n //////////////////////////////////////////////////////////////////////////////////////////\r\n // Blau\r\n //////////////////////////////////////////////////////////////////////////////////////////\r\n img = document.getElementById(\"blauHütte1\");\r\n for (var i in blauH1) {\r\n ctx.drawImage(img, blauH1[i][0], blauH1[i][1],img.width/2 ,img.height/2 );\r\n }\r\n img = document.getElementById(\"blauHütte2\");\r\n for (var i in blauH2) {\r\n ctx.drawImage(img, blauH2[i][0], blauH2[i][1],img.width/2 ,img.height/2 );\r\n }\r\n img = document.getElementById(\"blauSchirm\");\r\n for (var i in blauSchirm) {\r\n ctx.drawImage(img, blauSchirm[i][0], blauSchirm[i][1],img.width/2 ,img.height/2 );\r\n }\r\n var img2 = document.getElementById(\"blauLift3\");\r\n for (var i in blauLift3) {\r\n img = document.getElementById(\"blauLift2\");\r\n ctx.drawImage(img, blauLift3[i][2],blauLift3[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(blauLift3[i][2]+8-blauLift3[i][0]-8);\r\n //y achse\r\n var vektor2=(blauLift3[i][3]+10-blauLift3[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*2;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n\r\n if (blauLift3[i][5]){\r\n ctx.drawImage(img2,blauLift3[i][2]-vektor1* blauLift3[i][4],blauLift3[i][3]+8-vektor2*blauLift3[i][4],img2.width/2 ,img2.height/2);\r\n if (blauLift3[i][4]>=einheitsfaktor){blauLift3[i][5]=false}\r\n else{blauLift3[i][4] +=1;}\r\n }\r\n else{\r\n ctx.drawImage(img2,blauLift3[i][2]-vektor1* blauLift3[i][4],blauLift3[i][3]+8-vektor2*blauLift3[i][4],img2.width/2 ,img2.height/2);\r\n if (blauLift3[i][4]<=0){blauLift3[i][5]=true}\r\n else{blauLift3[i][4] -=1;}\r\n }\r\n\r\n if (blauLift3[i][5]){\r\n ctx.drawImage(img2,blauLift3[i][2]+12-vektor1* (einheitsfaktor-blauLift3[i][4]),blauLift3[i][3]+8-vektor2*(einheitsfaktor-blauLift3[i][4]),img2.width/2 ,img2.height/2);\r\n if (blauLift3[i][4]>=einheitsfaktor){blauLift3[i][5]=false}\r\n else{blauLift3[i][4] +=1;}\r\n }\r\n else{\r\n ctx.drawImage(img2,blauLift3[i][2]+12-vektor1* (einheitsfaktor-blauLift3[i][4]),blauLift3[i][3]+8-vektor2*(einheitsfaktor-blauLift3[i][4]),img2.width/2 ,img2.height/2);\r\n if (blauLift3[i][4]<=0){blauLift3[i][5]=true}\r\n else{blauLift3[i][4] -=1;}\r\n }\r\n\r\n img = document.getElementById(\"blauLift1\");\r\n ctx.drawImage(img, blauLift3[i][0],blauLift3[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift3[i][2]+8,blauLift3[i][3]+10);\r\n ctx.lineTo(blauLift3[i][0]+8,blauLift3[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift3[i][2]+19,blauLift3[i][3]+10);\r\n ctx.lineTo(blauLift3[i][0]+19,blauLift3[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(blauLift3[i][4]);\r\n }\r\n var img2 = document.getElementById(\"blauLift6\");\r\n for (var i in blauLift6) {\r\n img = document.getElementById(\"blauLift5\");\r\n ctx.drawImage(img, blauLift6[i][2],blauLift6[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(blauLift6[i][2]+8-blauLift6[i][0]-12);\r\n //y achse\r\n var vektor2=(blauLift6[i][3]+10-blauLift6[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*2;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/200; test++)\r\n {\r\n\r\n var delta_X=blauLift6[i][4]*vektor1+test*vektor1*200;\r\n var delta_Y=blauLift6[i][4]*vektor2+test*vektor2*200;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,blauLift6[i][2]+7-delta_X,blauLift6[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,blauLift6[i][2]+17-vektor1*einheitsfaktor+delta_X,blauLift6[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,blauLift6[i][2]+7-delta_X+vektor1*einheitsfaktor,blauLift6[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,blauLift6[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,blauLift6[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (blauLift6[i][4]>=einheitsfaktor){blauLift6[i][4]=0}\r\n else{blauLift6[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"blauLift4\");\r\n ctx.drawImage(img, blauLift6[i][0],blauLift6[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift6[i][2]+10,blauLift6[i][3]+8);\r\n ctx.lineTo(blauLift6[i][0]+16,blauLift6[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift6[i][2]+20,blauLift6[i][3]+8);\r\n ctx.lineTo(blauLift6[i][0]+26,blauLift6[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(blauLift6[i][4]);\r\n }\r\n var img2 = document.getElementById(\"blauLift7\");\r\n for (var i in blauLift8) {\r\n img = document.getElementById(\"blauLift5\");\r\n ctx.drawImage(img, blauLift8[i][2],blauLift8[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(blauLift8[i][2]+8-blauLift8[i][0]-15);\r\n //y achse\r\n var vektor2=(blauLift8[i][3]+10-blauLift8[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*5;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/150; test++)\r\n {\r\n\r\n var delta_X=blauLift8[i][4]*vektor1+test*vektor1*150;\r\n var delta_Y=blauLift8[i][4]*vektor2+test*vektor2*150;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,blauLift8[i][2]+7-delta_X,blauLift8[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,blauLift8[i][2]+17-vektor1*einheitsfaktor+delta_X,blauLift8[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,blauLift8[i][2]+7-delta_X+vektor1*einheitsfaktor,blauLift8[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,blauLift8[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,blauLift8[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (blauLift8[i][4]>=einheitsfaktor){blauLift8[i][4]=0}\r\n else{blauLift8[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"blauLift4\");\r\n ctx.drawImage(img, blauLift8[i][0],blauLift8[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift8[i][2]+10,blauLift8[i][3]+8);\r\n ctx.lineTo(blauLift8[i][0]+16,blauLift8[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift8[i][2]+20,blauLift8[i][3]+8);\r\n ctx.lineTo(blauLift8[i][0]+26,blauLift8[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(blauLift8[i][4]);\r\n }\r\n var img2 = document.getElementById(\"blauLift8\");\r\n for (var i in blauLift10) {\r\n img = document.getElementById(\"blauLift5\");\r\n ctx.drawImage(img, blauLift10[i][2],blauLift10[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(blauLift10[i][2]+8-blauLift10[i][0]-15);\r\n //y achse\r\n var vektor2=(blauLift10[i][3]+10-blauLift10[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*10;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/300; test++)\r\n {\r\n\r\n var delta_X=blauLift10[i][4]*vektor1+test*vektor1*300;\r\n var delta_Y=blauLift10[i][4]*vektor2+test*vektor2*300;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,blauLift10[i][2]+7-delta_X,blauLift10[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,blauLift10[i][2]+17-vektor1*einheitsfaktor+delta_X,blauLift10[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,blauLift10[i][2]+7-delta_X+vektor1*einheitsfaktor,blauLift10[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,blauLift10[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,blauLift10[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (blauLift10[i][4]>=einheitsfaktor){blauLift10[i][4]=0}\r\n else{blauLift10[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"blauLift4\");\r\n ctx.drawImage(img, blauLift10[i][0],blauLift10[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift10[i][2]+10,blauLift10[i][3]+8);\r\n ctx.lineTo(blauLift10[i][0]+16,blauLift10[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift10[i][2]+20,blauLift10[i][3]+8);\r\n ctx.lineTo(blauLift10[i][0]+26,blauLift10[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(blauLift10[i][4]);\r\n }\r\n //////////////////////////////////////////// Schlepper\r\n var img2 = document.getElementById(\"blauLift11\");\r\n for (var i in blauLift12) {\r\n img = document.getElementById(\"blauLift10\");\r\n ctx.drawImage(img, blauLift12[i][2],blauLift12[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(blauLift12[i][2]+1-blauLift12[i][0]+1);\r\n //y achse\r\n var vektor2=(blauLift12[i][3]+1-blauLift12[i][1]+1);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*20; //Anzahl gondeln\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/400; test++)\r\n {\r\n\r\n var delta_X=blauLift12[i][4]*vektor1+test*vektor1*400;\r\n var delta_Y=blauLift12[i][4]*vektor2+test*vektor2*400;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,blauLift12[i][2]-delta_X,blauLift12[i][3]-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,blauLift12[i][2]+10-vektor1*einheitsfaktor+delta_X,blauLift12[i][3]-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,blauLift12[i][2]+0-delta_X+vektor1*einheitsfaktor,blauLift12[i][3]-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,blauLift12[i][2]+10-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,blauLift12[i][3]-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (blauLift12[i][4]>=einheitsfaktor){blauLift12[i][4]=0}\r\n else{blauLift12[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"blauLift10\");\r\n ctx.drawImage(img, blauLift12[i][0],blauLift12[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift12[i][2],blauLift12[i][3]+1);\r\n ctx.lineTo(blauLift12[i][0],blauLift12[i][1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift12[i][2]+10,blauLift12[i][3]+1);\r\n ctx.lineTo(blauLift12[i][0]+10,blauLift12[i][1]+1);\r\n ctx.stroke();\r\n\r\n\r\n\r\n //console.log(blauLift10[i][4]);\r\n }\r\n //////////////////////////////////////////// kleiner Schlepper\r\n var img2 = document.getElementById(\"blauLift12\");\r\n for (var i in blauLift14) {\r\n img = document.getElementById(\"blauLift9\");\r\n ctx.drawImage(img, blauLift14[i][2],blauLift14[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(blauLift14[i][2]-blauLift14[i][0]);\r\n //y achse\r\n var vektor2=(blauLift14[i][3]-blauLift14[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*25; //Anzahl gondeln\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/500; test++)\r\n {\r\n\r\n var delta_X=blauLift14[i][4]*vektor1+test*vektor1*500;\r\n var delta_Y=blauLift14[i][4]*vektor2+test*vektor2*500;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,blauLift14[i][2]-delta_X,blauLift14[i][3]-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,blauLift14[i][2]+10-vektor1*einheitsfaktor+delta_X,blauLift14[i][3]-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,blauLift14[i][2]+0-delta_X+vektor1*einheitsfaktor,blauLift14[i][3]-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,blauLift14[i][2]+10-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,blauLift14[i][3]-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (blauLift14[i][4]>=einheitsfaktor){blauLift14[i][4]=0}\r\n else{blauLift14[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"blauLift9\");\r\n ctx.drawImage(img, blauLift14[i][0],blauLift14[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift14[i][2],blauLift14[i][3]);\r\n ctx.lineTo(blauLift14[i][0],blauLift14[i][1]);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(blauLift14[i][2]+10,blauLift14[i][3]);\r\n ctx.lineTo(blauLift14[i][0]+10,blauLift14[i][1]);\r\n ctx.stroke();\r\n }\r\n\r\n //////////////////////////////////////////////////////////////////////////////////////////\r\n // Grün\r\n //////////////////////////////////////////////////////////////////////////////////////////\r\n img = document.getElementById(\"grünHütte1\");\r\n for (var i in grünH1) {\r\n ctx.drawImage(img, grünH1[i][0], grünH1[i][1],img.width/2 ,img.height/2 );\r\n }\r\n img = document.getElementById(\"grünHütte2\");\r\n for (var i in grünH2) {\r\n ctx.drawImage(img, grünH2[i][0], grünH2[i][1],img.width/2 ,img.height/2 );\r\n }\r\n img = document.getElementById(\"grünSchirm\");\r\n for (var i in grünSchirm) {\r\n ctx.drawImage(img, grünSchirm[i][0], grünSchirm[i][1],img.width/2 ,img.height/2 );\r\n }\r\n var img2 = document.getElementById(\"grünLift3\");\r\n for (var i in grünLift3) {\r\n img = document.getElementById(\"grünLift2\");\r\n ctx.drawImage(img, grünLift3[i][2],grünLift3[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(grünLift3[i][2]+8-grünLift3[i][0]-8);\r\n //y achse\r\n var vektor2=(grünLift3[i][3]+10-grünLift3[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*2;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n\r\n if (grünLift3[i][5]){\r\n ctx.drawImage(img2,grünLift3[i][2]-vektor1* grünLift3[i][4],grünLift3[i][3]+8-vektor2*grünLift3[i][4],img2.width/2 ,img2.height/2);\r\n if (grünLift3[i][4]>=einheitsfaktor){grünLift3[i][5]=false}\r\n else{grünLift3[i][4] +=1;}\r\n }\r\n else{\r\n ctx.drawImage(img2,grünLift3[i][2]-vektor1* grünLift3[i][4],grünLift3[i][3]+8-vektor2*grünLift3[i][4],img2.width/2 ,img2.height/2);\r\n if (grünLift3[i][4]<=0){grünLift3[i][5]=true}\r\n else{grünLift3[i][4] -=1;}\r\n }\r\n\r\n if (grünLift3[i][5]){\r\n ctx.drawImage(img2,grünLift3[i][2]+12-vektor1* (einheitsfaktor-grünLift3[i][4]),grünLift3[i][3]+8-vektor2*(einheitsfaktor-grünLift3[i][4]),img2.width/2 ,img2.height/2);\r\n if (grünLift3[i][4]>=einheitsfaktor){grünLift3[i][5]=false}\r\n else{grünLift3[i][4] +=1;}\r\n }\r\n else{\r\n ctx.drawImage(img2,grünLift3[i][2]+12-vektor1* (einheitsfaktor-grünLift3[i][4]),grünLift3[i][3]+8-vektor2*(einheitsfaktor-grünLift3[i][4]),img2.width/2 ,img2.height/2);\r\n if (grünLift3[i][4]<=0){grünLift3[i][5]=true}\r\n else{grünLift3[i][4] -=1;}\r\n }\r\n\r\n img = document.getElementById(\"grünLift1\");\r\n ctx.drawImage(img, grünLift3[i][0],grünLift3[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift3[i][2]+8,grünLift3[i][3]+10);\r\n ctx.lineTo(grünLift3[i][0]+8,grünLift3[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift3[i][2]+19,grünLift3[i][3]+10);\r\n ctx.lineTo(grünLift3[i][0]+19,grünLift3[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(grünLift3[i][4]);\r\n }\r\n var img2 = document.getElementById(\"grünLift6\");\r\n for (var i in grünLift6) {\r\n img = document.getElementById(\"grünLift5\");\r\n ctx.drawImage(img, grünLift6[i][2],grünLift6[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(grünLift6[i][2]+8-grünLift6[i][0]-12);\r\n //y achse\r\n var vektor2=(grünLift6[i][3]+10-grünLift6[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*2;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/200; test++)\r\n {\r\n\r\n var delta_X=grünLift6[i][4]*vektor1+test*vektor1*200;\r\n var delta_Y=grünLift6[i][4]*vektor2+test*vektor2*200;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,grünLift6[i][2]+7-delta_X,grünLift6[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,grünLift6[i][2]+17-vektor1*einheitsfaktor+delta_X,grünLift6[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,grünLift6[i][2]+7-delta_X+vektor1*einheitsfaktor,grünLift6[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,grünLift6[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,grünLift6[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (grünLift6[i][4]>=einheitsfaktor){grünLift6[i][4]=0}\r\n else{grünLift6[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"grünLift4\");\r\n ctx.drawImage(img, grünLift6[i][0],grünLift6[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift6[i][2]+10,grünLift6[i][3]+8);\r\n ctx.lineTo(grünLift6[i][0]+16,grünLift6[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift6[i][2]+20,grünLift6[i][3]+8);\r\n ctx.lineTo(grünLift6[i][0]+26,grünLift6[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(grünLift6[i][4]);\r\n }\r\n var img2 = document.getElementById(\"grünLift7\");\r\n for (var i in grünLift8) {\r\n img = document.getElementById(\"grünLift5\");\r\n ctx.drawImage(img, grünLift8[i][2],grünLift8[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(grünLift8[i][2]+8-grünLift8[i][0]-15);\r\n //y achse\r\n var vektor2=(grünLift8[i][3]+10-grünLift8[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*5;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/150; test++)\r\n {\r\n\r\n var delta_X=grünLift8[i][4]*vektor1+test*vektor1*150;\r\n var delta_Y=grünLift8[i][4]*vektor2+test*vektor2*150;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,grünLift8[i][2]+7-delta_X,grünLift8[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,grünLift8[i][2]+17-vektor1*einheitsfaktor+delta_X,grünLift8[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,grünLift8[i][2]+7-delta_X+vektor1*einheitsfaktor,grünLift8[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,grünLift8[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,grünLift8[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (grünLift8[i][4]>=einheitsfaktor){grünLift8[i][4]=0}\r\n else{grünLift8[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"grünLift4\");\r\n ctx.drawImage(img, grünLift8[i][0],grünLift8[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift8[i][2]+10,grünLift8[i][3]+8);\r\n ctx.lineTo(grünLift8[i][0]+16,grünLift8[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift8[i][2]+20,grünLift8[i][3]+8);\r\n ctx.lineTo(grünLift8[i][0]+26,grünLift8[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(grünLift8[i][4]);\r\n }\r\n var img2 = document.getElementById(\"grünLift8\");\r\n for (var i in grünLift10) {\r\n img = document.getElementById(\"grünLift5\");\r\n ctx.drawImage(img, grünLift10[i][2],grünLift10[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(grünLift10[i][2]+8-grünLift10[i][0]-15);\r\n //y achse\r\n var vektor2=(grünLift10[i][3]+10-grünLift10[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*10;\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/300; test++)\r\n {\r\n\r\n var delta_X=grünLift10[i][4]*vektor1+test*vektor1*300;\r\n var delta_Y=grünLift10[i][4]*vektor2+test*vektor2*300;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,grünLift10[i][2]+7-delta_X,grünLift10[i][3]+8-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,grünLift10[i][2]+17-vektor1*einheitsfaktor+delta_X,grünLift10[i][3]+8-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,grünLift10[i][2]+7-delta_X+vektor1*einheitsfaktor,grünLift10[i][3]+8-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,grünLift10[i][2]+17-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,grünLift10[i][3]+8-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (grünLift10[i][4]>=einheitsfaktor){grünLift10[i][4]=0}\r\n else{grünLift10[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"grünLift4\");\r\n ctx.drawImage(img, grünLift10[i][0],grünLift10[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift10[i][2]+10,grünLift10[i][3]+8);\r\n ctx.lineTo(grünLift10[i][0]+16,grünLift10[i][1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift10[i][2]+20,grünLift10[i][3]+8);\r\n ctx.lineTo(grünLift10[i][0]+26,grünLift10[i][1]+0);\r\n ctx.stroke();\r\n\r\n //console.log(grünLift10[i][4]);\r\n }\r\n //////////////////////////////////////////// Schlepper\r\n var img2 = document.getElementById(\"grünLift11\");\r\n for (var i in grünLift12) {\r\n img = document.getElementById(\"grünLift10\");\r\n ctx.drawImage(img, grünLift12[i][2],grünLift12[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(grünLift12[i][2]+1-grünLift12[i][0]+1);\r\n //y achse\r\n var vektor2=(grünLift12[i][3]+1-grünLift12[i][1]+1);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*20; //Anzahl gondeln\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/400; test++)\r\n {\r\n\r\n var delta_X=grünLift12[i][4]*vektor1+test*vektor1*400;\r\n var delta_Y=grünLift12[i][4]*vektor2+test*vektor2*400;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,grünLift12[i][2]-delta_X,grünLift12[i][3]-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,grünLift12[i][2]+10-vektor1*einheitsfaktor+delta_X,grünLift12[i][3]-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,grünLift12[i][2]+0-delta_X+vektor1*einheitsfaktor,grünLift12[i][3]-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,grünLift12[i][2]+10-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,grünLift12[i][3]-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (grünLift12[i][4]>=einheitsfaktor){grünLift12[i][4]=0}\r\n else{grünLift12[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"grünLift10\");\r\n ctx.drawImage(img, grünLift12[i][0],grünLift12[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift12[i][2],grünLift12[i][3]+1);\r\n ctx.lineTo(grünLift12[i][0],grünLift12[i][1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift12[i][2]+10,grünLift12[i][3]+1);\r\n ctx.lineTo(grünLift12[i][0]+10,grünLift12[i][1]+1);\r\n ctx.stroke();\r\n\r\n\r\n\r\n //console.log(grünLift10[i][4]);\r\n }\r\n //////////////////////////////////////////// kleiner Schlepper\r\n var img2 = document.getElementById(\"grünLift12\");\r\n for (var i in grünLift14) {\r\n img = document.getElementById(\"grünLift9\");\r\n ctx.drawImage(img, grünLift14[i][2],grünLift14[i][3],img.width/2 ,img.height/2 );\r\n\r\n\r\n //x achse\r\n var vektor1=(grünLift14[i][2]-grünLift14[i][0]);\r\n //y achse\r\n var vektor2=(grünLift14[i][3]-grünLift14[i][1]);\r\n\r\n var einheitsfaktor=Math.sqrt(vektor1*vektor1+vektor2*vektor2)*25; //Anzahl gondeln\r\n vektor1=vektor1/einheitsfaktor;\r\n vektor2=vektor2/einheitsfaktor;\r\n //Gondel runter\r\n for (var test = 0; test <= einheitsfaktor/500; test++)\r\n {\r\n\r\n var delta_X=grünLift14[i][4]*vektor1+test*vektor1*500;\r\n var delta_Y=grünLift14[i][4]*vektor2+test*vektor2*500;\r\n\r\n if (delta_Y>=vektor2*einheitsfaktor)\r\n {\r\n ctx.drawImage(img2,grünLift14[i][2]-delta_X,grünLift14[i][3]-delta_Y,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,grünLift14[i][2]+10-vektor1*einheitsfaktor+delta_X,grünLift14[i][3]-vektor2*einheitsfaktor+delta_Y,img2.width/2 ,img2.height/2);\r\n }\r\n else{\r\n ctx.drawImage(img2,grünLift14[i][2]+0-delta_X+vektor1*einheitsfaktor,grünLift14[i][3]-delta_Y+vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n ctx.drawImage(img2,grünLift14[i][2]+10-vektor1*einheitsfaktor+delta_X-vektor1*einheitsfaktor,grünLift14[i][3]-vektor2*einheitsfaktor+delta_Y-vektor2*einheitsfaktor,img2.width/2 ,img2.height/2);\r\n }\r\n }\r\n\r\n if (grünLift14[i][4]>=einheitsfaktor){grünLift14[i][4]=0}\r\n else{grünLift14[i][4] +=1;}\r\n\r\n\r\n img = document.getElementById(\"grünLift9\");\r\n ctx.drawImage(img, grünLift14[i][0],grünLift14[i][1],img.width/2 ,img.height/2 );\r\n ctx.strokeStyle=\"#A9A9A9\";\r\n\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift14[i][2],grünLift14[i][3]);\r\n ctx.lineTo(grünLift14[i][0],grünLift14[i][1]);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(grünLift14[i][2]+10,grünLift14[i][3]);\r\n ctx.lineTo(grünLift14[i][0]+10,grünLift14[i][1]);\r\n ctx.stroke();\r\n }\r\n\r\n //////////////////////////////////////////////////////////////\r\n //cursor\r\n ctx.globalAlpha = 0.5;\r\n if (color==\"gelb\")\r\n {\r\n if (Element==1){\r\n img = document.getElementById(\"gelbHütte1\");\r\n ctx.drawImage(img, mousex-39,mousey-50,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==2){\r\n img = document.getElementById(\"gelbHütte2\");\r\n ctx.drawImage(img, mousex-34,mousey-40,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==3){\r\n img = document.getElementById(\"gelbSchirm\");\r\n ctx.drawImage(img, mousex-30,mousey-43,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==4){\r\n img = document.getElementById(\"gelbLift1\");\r\n ctx.drawImage(img, mousex-12,mousey-26,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==5){\r\n img = document.getElementById(\"gelbLift2\");\r\n ctx.drawImage(img, mousex-12,mousey-26,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"gelbLift1\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+8,mousey-26+10);\r\n ctx.lineTo(templist[0]+8,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+18,mousey-26+10);\r\n ctx.lineTo(templist[0]+18,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=4;\r\n }\r\n if (Element==6){\r\n img = document.getElementById(\"gelbLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==7){\r\n img = document.getElementById(\"gelbLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"gelbLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=6;\r\n }\r\n if (Element==8){\r\n img = document.getElementById(\"gelbLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==9){\r\n img = document.getElementById(\"gelbLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"gelbLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=8;\r\n }\r\n if (Element==10){\r\n img = document.getElementById(\"gelbLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==11){\r\n img = document.getElementById(\"gelbLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"gelbLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=10;\r\n }\r\n if (Element==12){\r\n img = document.getElementById(\"gelbLift10\");\r\n ctx.drawImage(img, mousex-5,mousey-18,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==13){\r\n img = document.getElementById(\"gelbLift10\");\r\n ctx.drawImage(img, mousex-5,mousey-18,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"gelbLift10\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-5,mousey-15);\r\n ctx.lineTo(templist[0],templist[1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex+5,mousey-15);\r\n ctx.lineTo(templist[0]+10,templist[1]+1);\r\n ctx.stroke();\r\n }\r\n else Element=12;\r\n }\r\n if (Element==14){\r\n img = document.getElementById(\"gelbLift9\");\r\n ctx.drawImage(img, mousex-5,mousey-11,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==15){\r\n img = document.getElementById(\"gelbLift9\");\r\n ctx.drawImage(img, mousex-5,mousey-11,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"gelbLift9\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-5,mousey-10);\r\n ctx.lineTo(templist[0],templist[1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex+5,mousey-10);\r\n ctx.lineTo(templist[0]+10,templist[1]+1);\r\n ctx.stroke();\r\n }\r\n else Element=14;\r\n }\r\n }\r\n if (color==\"rot\")\r\n {\r\n if (Element==1){\r\n img = document.getElementById(\"rotHütte1\");\r\n ctx.drawImage(img, mousex-39,mousey-50,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==2){\r\n img = document.getElementById(\"rotHütte2\");\r\n ctx.drawImage(img, mousex-34,mousey-40,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==3){\r\n img = document.getElementById(\"rotSchirm\");\r\n ctx.drawImage(img, mousex-30,mousey-43,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==4){\r\n img = document.getElementById(\"rotLift1\");\r\n ctx.drawImage(img, mousex-12,mousey-26,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==5){\r\n img = document.getElementById(\"rotLift2\");\r\n ctx.drawImage(img, mousex-12,mousey-26,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"rotLift1\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+8,mousey-26+10);\r\n ctx.lineTo(templist[0]+8,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+18,mousey-26+10);\r\n ctx.lineTo(templist[0]+18,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=4;\r\n }\r\n if (Element==6){\r\n img = document.getElementById(\"rotLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==7){\r\n img = document.getElementById(\"rotLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"rotLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=6;\r\n }\r\n if (Element==8){\r\n img = document.getElementById(\"rotLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==9){\r\n img = document.getElementById(\"rotLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"rotLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=8;\r\n }\r\n if (Element==10){\r\n img = document.getElementById(\"rotLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==11){\r\n img = document.getElementById(\"rotLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"rotLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=10;\r\n }\r\n if (Element==12){\r\n img = document.getElementById(\"rotLift10\");\r\n ctx.drawImage(img, mousex-5,mousey-18,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==13){\r\n img = document.getElementById(\"rotLift10\");\r\n ctx.drawImage(img, mousex-5,mousey-18,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"rotLift10\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-5,mousey-15);\r\n ctx.lineTo(templist[0],templist[1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex+5,mousey-15);\r\n ctx.lineTo(templist[0]+10,templist[1]+1);\r\n ctx.stroke();\r\n }\r\n else Element=12;\r\n }\r\n if (Element==14){\r\n img = document.getElementById(\"rotLift9\");\r\n ctx.drawImage(img, mousex-5,mousey-11,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==15){\r\n img = document.getElementById(\"rotLift9\");\r\n ctx.drawImage(img, mousex-5,mousey-11,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"rotLift9\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-5,mousey-10);\r\n ctx.lineTo(templist[0],templist[1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex+5,mousey-10);\r\n ctx.lineTo(templist[0]+10,templist[1]+1);\r\n ctx.stroke();\r\n }\r\n else Element=14;\r\n }\r\n }\r\n if (color==\"blau\")\r\n {\r\n if (Element==1){\r\n img = document.getElementById(\"blauHütte1\");\r\n ctx.drawImage(img, mousex-39,mousey-50,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==2){\r\n img = document.getElementById(\"blauHütte2\");\r\n ctx.drawImage(img, mousex-34,mousey-40,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==3){\r\n img = document.getElementById(\"blauSchirm\");\r\n ctx.drawImage(img, mousex-30,mousey-43,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==4){\r\n img = document.getElementById(\"blauLift1\");\r\n ctx.drawImage(img, mousex-12,mousey-26,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==5){\r\n img = document.getElementById(\"blauLift2\");\r\n ctx.drawImage(img, mousex-12,mousey-26,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"blauLift1\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+8,mousey-26+10);\r\n ctx.lineTo(templist[0]+8,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+18,mousey-26+10);\r\n ctx.lineTo(templist[0]+18,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=4;\r\n }\r\n if (Element==6){\r\n img = document.getElementById(\"blauLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==7){\r\n img = document.getElementById(\"blauLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"blauLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=6;\r\n }\r\n if (Element==8){\r\n img = document.getElementById(\"blauLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==9){\r\n img = document.getElementById(\"blauLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"blauLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=8;\r\n }\r\n if (Element==10){\r\n img = document.getElementById(\"blauLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==11){\r\n img = document.getElementById(\"blauLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"blauLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=10;\r\n }\r\n if (Element==12){\r\n img = document.getElementById(\"blauLift10\");\r\n ctx.drawImage(img, mousex-5,mousey-18,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==13){\r\n img = document.getElementById(\"blauLift10\");\r\n ctx.drawImage(img, mousex-5,mousey-18,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"blauLift10\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-5,mousey-15);\r\n ctx.lineTo(templist[0],templist[1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex+5,mousey-15);\r\n ctx.lineTo(templist[0]+10,templist[1]+1);\r\n ctx.stroke();\r\n }\r\n else Element=12;\r\n }\r\n if (Element==14){\r\n img = document.getElementById(\"blauLift9\");\r\n ctx.drawImage(img, mousex-5,mousey-11,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==15){\r\n img = document.getElementById(\"blauLift9\");\r\n ctx.drawImage(img, mousex-5,mousey-11,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"blauLift9\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-5,mousey-10);\r\n ctx.lineTo(templist[0],templist[1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex+5,mousey-10);\r\n ctx.lineTo(templist[0]+10,templist[1]+1);\r\n ctx.stroke();\r\n }\r\n else Element=14;\r\n }\r\n }\r\n if (color==\"grün\")\r\n {\r\n if (Element==1){\r\n img = document.getElementById(\"grünHütte1\");\r\n ctx.drawImage(img, mousex-39,mousey-50,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==2){\r\n img = document.getElementById(\"grünHütte2\");\r\n ctx.drawImage(img, mousex-34,mousey-40,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==3){\r\n img = document.getElementById(\"grünSchirm\");\r\n ctx.drawImage(img, mousex-30,mousey-43,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==4){\r\n img = document.getElementById(\"grünLift1\");\r\n ctx.drawImage(img, mousex-12,mousey-26,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==5){\r\n img = document.getElementById(\"grünLift2\");\r\n ctx.drawImage(img, mousex-12,mousey-26,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"grünLift1\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+8,mousey-26+10);\r\n ctx.lineTo(templist[0]+8,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+18,mousey-26+10);\r\n ctx.lineTo(templist[0]+18,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=4;\r\n }\r\n if (Element==6){\r\n img = document.getElementById(\"grünLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==7){\r\n img = document.getElementById(\"grünLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"grünLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=6;\r\n }\r\n if (Element==8){\r\n img = document.getElementById(\"grünLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==9){\r\n img = document.getElementById(\"grünLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"grünLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=8;\r\n }\r\n if (Element==10){\r\n img = document.getElementById(\"grünLift4\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==11){\r\n img = document.getElementById(\"grünLift5\");\r\n ctx.drawImage(img, mousex-20,mousey-15,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"grünLift4\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+5,mousey-26+20);\r\n ctx.lineTo(templist[0]+16,templist[1]+0);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-12+15,mousey-26+20);\r\n ctx.lineTo(templist[0]+26,templist[1]+0);\r\n ctx.stroke();\r\n }\r\n else Element=10;\r\n }\r\n if (Element==12){\r\n img = document.getElementById(\"grünLift10\");\r\n ctx.drawImage(img, mousex-5,mousey-18,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==13){\r\n img = document.getElementById(\"grünLift10\");\r\n ctx.drawImage(img, mousex-5,mousey-18,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"grünLift10\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-5,mousey-15);\r\n ctx.lineTo(templist[0],templist[1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex+5,mousey-15);\r\n ctx.lineTo(templist[0]+10,templist[1]+1);\r\n ctx.stroke();\r\n }\r\n else Element=12;\r\n }\r\n if (Element==14){\r\n img = document.getElementById(\"grünLift9\");\r\n ctx.drawImage(img, mousex-5,mousey-11,img.width/2 ,img.height/2 );\r\n }\r\n if (Element==15){\r\n img = document.getElementById(\"grünLift9\");\r\n ctx.drawImage(img, mousex-5,mousey-11,img.width/2 ,img.height/2 );\r\n if (templist!=null){\r\n img = document.getElementById(\"grünLift9\");\r\n ctx.drawImage(img, templist[0],templist[1],img.width/2 ,img.height/2 );\r\n ctx.beginPath();\r\n ctx.moveTo(mousex-5,mousey-10);\r\n ctx.lineTo(templist[0],templist[1]+1);\r\n ctx.stroke();\r\n ctx.beginPath();\r\n ctx.moveTo(mousex+5,mousey-10);\r\n ctx.lineTo(templist[0]+10,templist[1]+1);\r\n ctx.stroke();\r\n }\r\n else Element=14;\r\n }\r\n }\r\n ctx.globalAlpha = 1;\r\n\r\n ctx.fillStyle = \"rgba(255, 255, 255, 0.8)\";\r\n ctx.beginPath();\r\n for(var i = 0; i < mp; i++)\r\n {\r\n var p = particles[i];\r\n ctx.moveTo(p.x, p.y);\r\n ctx.arc(p.x, p.y, p.r, 0, Math.PI*2, true);\r\n }\r\n\r\n\r\n ctx.fill();\r\n update();\r\n }", "function setup() {\n createCanvas(windowWidth, windowHeight, WEBGL);\n img = loadImage(\"assets/fishBall.jpg\");\n}", "render() {\n ctx.drawImage(Resources.get(this.image), this.x, this.y)\n }", "function drawRoberta(){\n\t\n\tcanvas = document.getElementById(\"robertaCanvas\");\n\tctx = canvas.getContext(\"2d\");\n\t\n\timage = document.createElement(\"img\");\n\t\n\timage.onload = function() {\n\t ctx.drawImage(image,canvas.width/2-image.width/2,canvas.height/2-image.width/2);\n };\n\t\n image.src = '../css/img/simulator/dummy_up.png';\n}", "function planets1(Px, Py) {\n\tpush();\n\ttranslate(Px, Py);\n\trotate(start1);\n\timage(plan1, 210, 210, 90, 90);\n\tstart1 += addR;\n\tpop();\n\t//console.log(rotation);\n}", "function addMarkerPoints(x,y){\n\tvar marker = new Image();\n\tmarker.src = './images/marker.png';\n\tvar canvas = document.getElementById('map'),\n\tcontext = canvas.getContext('2d');\n\tcontext.drawImage(marker,x,y,30,30);\n}", "function setup() {\n createCanvas(400, 400);\n img = createImg('https://img.purch.com/rc/696x392/aHR0cDovL3d3dy5saXZlc2NpZW5jZS5jb20vaW1hZ2VzL2kvMDAwLzAzMC85NzIvb3JpZ2luYWwvc2h1dHRlcnN0b2NrXzkzNDA0Mjg3LmpwZw==');\n img.hide();\n\t//This is the image of the desert, to represents the Sahara\n\timg2 = createImg('http://www.pngmart.com/files/3/Sun-PNG-Photos.png');\n\timg2.hide();\n\t//Here, I have an image of the sun to represent the solar energy in the Sahara\n\timg3 = createImg('http://bestjobineurope.com/wp-content/uploads/2016/08/nevezetessegek_szines-2.png');\n\timg3.hide();\n\t//My last image is of Europe, which shows what the .3% of the Sahara Deserts solar energy could possibly power. \n background(100);\n}", "draw(){\n push();\n translate(this.body.position.x, this.body.position.y);\n rotate(this.body.angle);\n\n image(\n this.image,\n -this.size.width/2,\n -this.size.height/2,\n this.size.width,\n this.size.height\n );\n pop();\n }", "function drawinst(){\r\n\tctx.drawImage(imgft,0,0,948,535,0,0,800,400);\r\n}", "function go(){\n canv.fill('#000000');\n\n // Circle movement\n pos_x = 200*Math.cos(angle);\n pos_y = 200*Math.sin(angle);\n angle = (angle + angle_step) % (2*Math.PI);\n console.log(angle);\n\n // Draw some lines\n canv.line(pos_x,pos_y,pos_x*1.5+640,pos_y*1.5+480,1,'#FF0000');\n canv.line(pos_x,pos_y+480,pos_x*3+640,pos_y*3,5,'#00FF00');\n\n // Draw some triangles\n canv.triangle(pos_x*2+150,pos_y+150,pos_x*2+250,pos_y+250,pos_x*2+50,pos_y+250,'#FF0000');\n canv.triangle(pos_x*2+250,pos_y+350,pos_x*2+450,pos_y+350,pos_x*2+350,pos_y+450,'#00FF00');\n\n // Draw some quadrants\n canv.quad(pos_x*2,pos_y*2+150,pos_x+300,pos_y*3+150,pos_x+250,pos_y*3+250,pos_x+50,pos_y+250,'#FF0000');\n canv.quad(pos_x+50,50,pos_x+70,100,'#00FF00');\n\n // And our image...\n myimage.draw(canv,pos_x,pos_y,0.8);\n // myimage.draw(canv,320,10,1,45);\n // myimage.draw(canv,50,300,1,0,2,1.5);\n // setTimeout(arguments.callee, 100);\n\n // Start loop\n requestAnimFrame( go );\n}", "function setupObstacles() {\r\n path[0] = new imageLib(backgroundImg.canvasName, 0, 0, 0, 0);\r\n path[0].endX = 0,\r\n path[0].endY = 0;\r\n path[0].slopeX = 16/13;\r\n path[0].slopeY = 3410/13;\r\n path[0].drawLine();\r\n\r\n path[1] = new imageLib(backgroundImg.canvasName, 0, 0, 0, 0);\r\n path[1].endX = 0; \r\n path[1].endY = 0;\r\n path[1].slopeX = -16/13;\r\n path[1].slopeY = 3410/13;\r\n path[1].drawLine();\r\n}", "function mkNeoPixelPart(xy) {\n if (xy === void 0) { xy = [0, 0]; }\n var NP_PART_XOFF = -13.5;\n var NP_PART_YOFF = -11;\n var NP_PART_WIDTH = 87.5;\n var NP_PART_HEIGHT = 190;\n var NEOPIXEL_PART_IMG = \"<svg viewBox=\\\"-5 -1 53 112\\\" xmlns=\\\"http://www.w3.org/2000/svg\\\" xmlns:bx=\\\"https://boxy-svg.com\\\">\\n <rect x=\\\"2.5\\\" width=\\\"38\\\" height=\\\"100\\\" style=\\\"fill: rgb(68, 68, 68);\\\"/>\\n <rect x=\\\"11.748\\\" y=\\\"3.2\\\" width=\\\"1.391\\\" height=\\\"2.553\\\" style=\\\"fill: none; stroke-linejoin: round; stroke-width: 3; stroke: rgb(165, 103, 52);\\\"/>\\n <rect x=\\\"20.75\\\" y=\\\"3.2\\\" width=\\\"1.391\\\" height=\\\"2.553\\\" style=\\\"fill: none; stroke-linejoin: round; stroke-width: 3; stroke: rgb(165, 103, 52);\\\"/>\\n <rect x=\\\"29.75\\\" y=\\\"3.2\\\" width=\\\"1.391\\\" height=\\\"2.553\\\" style=\\\"fill: none; stroke-linejoin: round; stroke-width: 3; stroke: rgb(165, 103, 52);\\\"/>\\n <g>\\n <rect x=\\\"9\\\" y=\\\"16.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"22.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"28.563\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"11.607\\\" y=\\\"14.833\\\" width=\\\"19.787\\\" height=\\\"18.697\\\" style=\\\"fill: rgb(0, 0, 0);\\\"/>\\n <ellipse style=\\\"fill: rgb(216, 216, 216);\\\" cx=\\\"21.5\\\" cy=\\\"24.181\\\" rx=\\\"7\\\" ry=\\\"7\\\"/>\\n </g>\\n <path d=\\\"M -7.25 -103.2 L -2.5 -100.003 L -12 -100.003 L -7.25 -103.2 Z\\\" style=\\\"fill: rgb(68, 68, 68);\\\" transform=\\\"matrix(-1, 0, 0, -1, 0, 0)\\\" bx:shape=\\\"triangle -12 -103.2 9.5 3.197 0.5 0 1@ad6f5cac\\\"/>\\n <path d=\\\"M -16.75 -103.197 L -12 -100 L -21.5 -100 L -16.75 -103.197 Z\\\" style=\\\"fill: rgb(68, 68, 68);\\\" transform=\\\"matrix(-1, 0, 0, -1, 0, 0)\\\" bx:shape=\\\"triangle -21.5 -103.197 9.5 3.197 0.5 0 1@07d73149\\\"/>\\n <path d=\\\"M -26.25 -103.2 L -21.5 -100.003 L -31 -100.003 L -26.25 -103.2 Z\\\" style=\\\"fill: rgb(68, 68, 68);\\\" transform=\\\"matrix(-1, 0, 0, -1, 0, 0)\\\" bx:shape=\\\"triangle -31 -103.2 9.5 3.197 0.5 0 1@54403e2d\\\"/>\\n <path d=\\\"M -35.75 -103.197 L -31 -100 L -40.5 -100 L -35.75 -103.197 Z\\\" style=\\\"fill: rgb(68, 68, 68);\\\" transform=\\\"matrix(-1, 0, 0, -1, 0, 0)\\\" bx:shape=\\\"triangle -40.5 -103.197 9.5 3.197 0.5 0 1@21c9b772\\\"/>\\n <g transform=\\\"matrix(1, 0, 0, 1, 0.000002, 29.999994)\\\">\\n <rect x=\\\"9\\\" y=\\\"16.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"22.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"28.563\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"11.607\\\" y=\\\"14.833\\\" width=\\\"19.787\\\" height=\\\"18.697\\\" style=\\\"fill: rgb(0, 0, 0);\\\"/>\\n <ellipse style=\\\"fill: rgb(216, 216, 216);\\\" cx=\\\"21.5\\\" cy=\\\"24.181\\\" rx=\\\"7\\\" ry=\\\"7\\\"/>\\n </g>\\n <g transform=\\\"matrix(1, 0, 0, 1, 0.000005, 59.999992)\\\">\\n <rect x=\\\"9\\\" y=\\\"16.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"22.562\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"9\\\" y=\\\"28.563\\\" width=\\\"25\\\" height=\\\"3.238\\\" style=\\\"fill: rgb(216, 216, 216);\\\"/>\\n <rect x=\\\"11.607\\\" y=\\\"14.833\\\" width=\\\"19.787\\\" height=\\\"18.697\\\" style=\\\"fill: rgb(0, 0, 0);\\\"/>\\n <ellipse style=\\\"fill: rgb(216, 216, 216);\\\" cx=\\\"21.5\\\" cy=\\\"24.181\\\" rx=\\\"7\\\" ry=\\\"7\\\"/>\\n </g>\\n</svg>\";\n var x = xy[0], y = xy[1];\n var l = x + NP_PART_XOFF;\n var t = y + NP_PART_YOFF;\n var w = NP_PART_WIDTH;\n var h = NP_PART_HEIGHT;\n var img = pxsim.svg.elt(\"image\");\n pxsim.svg.hydrate(img, {\n class: \"sim-neopixel-strip\", x: l, y: t, width: w, height: h,\n href: pxsim.svg.toDataUri(NEOPIXEL_PART_IMG)\n });\n return { el: img, x: l, y: t, w: w, h: h };\n }", "function setup() {\n // Create our canvas\n createCanvas(640,640);\n\n // Start the clown image at the centre of the canvas\n clownImageX = width/2;\n clownImageY = height/2;\n\n // Start the felt image perfectly off screen above the canvas\n feltTextureImageX = width/2;\n feltTextureImageY = 0 - feltTextureImage.height/2;\n\n // Start the rect off screen to the left\n rectX = 0 - width/5;\n rectY = 0;\n\n //Start the added img 2 exactly where the mouse is\n imgAdded2X = mouseX;\n imgAdded2Y = mouseY;\n imgAdded2.height = 120;\n imgAdded2.width = 120;\n\n\n // Start the sin img off screen to the left\n imgSin.height = 100;\n imgSin.width = 100;\n imgSinX = 0 - imgSin.width/2;\n imgSinY = height/2;\n\n\n // We'll use imageMode CENTER for this script\n imageMode(CENTER);\n\n\n}", "glitch() {\n gsap.killTweensOf(this.DOM.imgStack);\n\n gsap.timeline()\n .set(this.DOM.imgStack, {\n opacity: 0.2\n }, 0.04)\n .set(this.DOM.stackImages, {\n x: () => `+=${gsap.utils.random(-15,15)}%`,\n y: () => `+=${gsap.utils.random(-15,15)}%`,\n opacity: () => gsap.utils.random(1,10)/10\n }, 0.08)\n .set(this.DOM.imgStack, {\n opacity: 0.4\n }, '+=0.04')\n .set(this.DOM.stackImages, {\n y: () => `+=${gsap.utils.random(-8,8)}%`,\n rotation: () => gsap.utils.random(-2,2),\n opacity: () => gsap.utils.random(1,10)/10,\n scale: () => gsap.utils.random(75,95)/100\n }, '+=0.06')\n .set(this.DOM.imgStack, {\n opacity: 1\n }, '+=0.06')\n .set(this.DOM.stackImages, {\n x: (_, t) => t.dataset.tx,\n y: (_, t) => t.dataset.ty,\n rotation: (_, t) => t.dataset.r,\n opacity: 1,\n scale: 1\n }, '+=0.06')\n }", "function preload() {\n\n // Load initial image\n gImage = loadImage('F.svg');\n\n}", "function Interpolation(gs1, gs2)\n{\n var s1 = stn(gs1);\n var s2 = stn(gs2);\n var i1 = [ s1[0], s1[1], s1[2], s1[3], s1[5], s1[6], s1[8], s1[9], s1[11], s1[12] ];\n var i2 = [], i3 = [], i4 = [], i5 = [], i6 = [], i7 = [], i8 = [], i9 = [], i10 = [];\n \n //ball positive on X\n if (s2[0] > s1[0])\n {\n i2.push(s1[0] + 1);\n i3.push(s1[0] + 2);\n i4.push(s1[0] + 3);\n i5.push(s1[0] + 4);\n }\n else\n {\n i2.push(s1[0] - 1);\n i3.push(s1[0] - 2);\n i4.push(s1[0] - 3);\n i5.push(s1[0] - 4);\n }\n \n //ball positive on Y\n if (s2[1] > s1[1])\n {\n \ti2.push(s1[1] + 1);\n \ti3.push(s1[1] + 2);\n \ti4.push(s1[1] + 3);\n \ti5.push(s1[1] + 4);\n }\n else\n {\n \ti2.push(s1[1] - 1);\n \ti3.push(s1[1] - 2);\n \ti4.push(s1[1] - 3);\n \ti5.push(s1[1] - 4);\n }\n \n for (var i = 0; i<4; ++i)\n {\n if (i == 0)\n var iX = 2; //2, 5, 8, 11\n else if (i == 1)\n var iX = 5;\n else if (i == 2)\n var iX = 8;\n else if (i == 3)\n var iX = 11;\n var iY = iX+1; //3, 6, 9, 12\n var xDelta = s2[iX] - s1[iX];\n var xAct = Math.floor(xDelta/5);\n var yDelta = s2[iY] - s2[iY];\n var yAct = Math.floor(yDelta/5);\n \n if (xDelta >= 0)\n {\n i2.push(s1[iX] + xAct);\n i3.push(s1[iX] + 2*xAct);\n i4.push(s1[iX] + 3*xAct);\n i5.push(s1[iX] + 4 * xAct);\n }\n else\n {\n \ti2.push(s1[iX] - xAct);\n \ti3.push(s1[iX] - 2 * xAct);\n \ti4.push(s1[iX] - 3 * xAct);\n \ti5.push(s1[iX] - 4 * xAct);\n }\n \n if (yDelta >= 0)\n {\n i2.push(s1[iY] + yAct);\n i3.push(s1[iY] + 2*yAct);\n i4.push(s1[iY] + 3*yAct);\n i5.push(s1[iY] + 4 * yAct);\n }\n else\n {\n \ti2.push(s1[iY] - yAct);\n \ti3.push(s1[iY] - 2 * yAct);\n \ti4.push(s1[iY] - 3 * yAct);\n \ti5.push(s1[iY] - 4 * yAct);\n }\n }\n \n var i11 = [ s2[0], s2[1], s2[2], s2[3], s2[5], s2[6], s2[8], s2[9], s2[11], s2[12] ];\n \n var result = new Array();\n result.push(i1);\n result.push(i2);\n result.push(i3);\n result.push(i4);\n result.push(i5);\n result.push(i11);\n \n return result;\n}", "function createBackingImage(ctx, svg, uuid) {\n // clear canvas\n ctx.fillStyle = '#fff';\n ctx.fillRect(0, 0, 431, 241);\n\n // add backing image + qr text\n ctx.fillStyle = '#000'\n ctx.font = \"20px Overpass Mono\";\n ctx.drawImage(svg, 0, 0);\n ctx.font = \"20px Overpass Mono\";\n ctx.fillText(uuid.substr(uuid.length-6), 71, 216)\n}", "render(cam){\n let width = this.x2-this.x1;\n let height = this.y2-this.y1;\n\n //draw the wall\n c.translate(this.x1+width/2,this.y1+height/2);\n c.rotate(this.img_rotation);\n c.translate(-(this.x1+width/2),-(this.y1+height/2));\n c.drawImage(this.image,this.x1,this.y1,width,height);\n c.setTransform(1,0,0,1,0,0)\n }", "updateLogo(step) {\n\t\tthis.logo.x -= this.skier.xv * step;\n\t\tthis.logo.y -= this.skier.yv * step;\n\t}", "drawImage(image, sx, sy, sw, sh, dx, dy, dw, dh) {\n console.warn(\"drawImage::Now implemented.\");\n // CanvasManager.rotate(findNodeHandle(this), m11, m12, m21, m22, dx, dy)\n }", "function gxtkGraphics(){\n\tthis.game=BBHtml5Game.Html5Game();\n\tthis.canvas=this.game.GetCanvas()\n\tthis.width=this.canvas.width;\n\tthis.height=this.canvas.height;\n\tthis.gl=null;\n\tthis.gc=this.canvas.getContext( '2d' );\n\tthis.tmpCanvas=null;\n\tthis.r=255;\n\tthis.b=255;\n\tthis.g=255;\n\tthis.white=true;\n\tthis.color=\"rgb(255,255,255)\"\n\tthis.alpha=1;\n\tthis.blend=\"source-over\";\n\tthis.ix=1;this.iy=0;\n\tthis.jx=0;this.jy=1;\n\tthis.tx=0;this.ty=0;\n\tthis.tformed=false;\n\tthis.scissorX=0;\n\tthis.scissorY=0;\n\tthis.scissorWidth=0;\n\tthis.scissorHeight=0;\n\tthis.clipped=false;\n}", "function main() {\n\n // TODO: implement dynamic canvas elements to boost performance\n canvas = document.getElementById('canvas');\n/* canvasWidth = canvas.width;\n canvasHeight = canvas.height;*/\n ctx = canvas.getContext('2d');\n\n\n // initiate graphics\n var img = new Image();\n img.onload = function() {\n initTextureAtlases(this); // this refers to img variable\n run();\n }\n img.src = 'texture-atlases.png';\n}", "draw(ctx) {\n if (this.health > 18) this.health = 18;\n if (this.health < 1) this.health = 1;\n let sourceY = (18 - Math.floor(this.health)) * 21 + 2;\n //source x, y, source width, height, dest x, y, dest width, height\n ctx.drawImage(this.imagesheet, 2, sourceY, 205, 17, 2, 8, 200, 15);\n }", "function boneAnimationL(bone) {\n // bones originate from the picture not the document sides\n var currentDoggo = document.getElementsByClassName(\"currentDoggo\");\n currentDoggo = currentDoggo[0];\n var cdImg = currentDoggo.children;\n cdImg = cdImg[0];\n var offsetLeft = cdImg.offsetLeft;\n var offsetTop = cdImg.offsetTop;\n var cdHeight = cdImg.offsetHeight;\n\n var maxY = offsetTop;\n var minY = offsetTop + cdHeight;\n var onTheLeft = offsetLeft;\n\n // animation on desktop - originates from the picture and flies to the edges\n if (screenWidth > 1001)\n {\n bone.keyframes = [\n {\n opacity: 1,\n transform: \"translate3d(\" + onTheLeft + \"px, \" + getRndInteger(minY, (minY - 50)) + \"px, 0px)\"\n },\n {\n opacity: 1,\n // first is left to right, second is bottom to top\n transform: \" translate3d(\" + getRndInteger((onTheLeft - 300), (onTheLeft - 30)) + \"px, \" + getRndInteger((minY - 60), (maxY - 200)) + \"px, 0px) rotate(\" + getRndInteger(0,540) + \"deg)\"\n }\n ];\n }\n // animation on mobile - originates from the top and flies to the bottom\n else\n {\n bone.keyframes = [\n {\n opacity: 1,\n // this is where they originate\n transform: \"translate3d(\" + getRndInteger(25, screenWidth / 2 - 25) + \"px, \" + 55 + \"px, 0px)\"\n },\n {\n opacity: 1,\n // this is where the bones fly to\n // first is left to right, second is bottom to top\n transform: \" translate3d(\" + getRndInteger(5, screenWidth / 2 - 5) + \"px, \" + getRndInteger(200, 400) + \"px, 0px) rotate(\" + getRndInteger(0,540) + \"deg)\"\n }\n ];\n }\n \n bone.animProps =\n {\n duration: 1000,\n easing: \"ease-out\",\n iterations: 1\n }\n \n  var animationPlayer = bone.animate(bone.keyframes, bone.animProps);\n}", "static transformPoint(m, dst, src) {\n const x = src[0];\n const y = src[1];\n dst[0] = m[0] * x + m[3] * y + m[6];\n dst[1] = m[1] * x + m[4] * y + m[7];\n return dst;\n }", "function drawGirlStill() {\n var girlStill = new Image();\n girlStill.src = \"girl-static-2.png\";\n girlStill.onload = function() {\n ctx.drawImage(girlStill, state.girl.x,state.girl.y,400,400);\n }\n}", "function draw() {\n\n // Move the felt image down by increasing its y position\n feltTextureImageY += 1;\n\n // Display the felt image\n image(feltTextureImage,feltTextureImageX,feltTextureImageY);\n\n // Move the clown by moving it 1/10th of its current distance from the mouse\n\n // Calculate the distance in X and in Y\n var xDistance = mouseX - clownImageX;\n var yDistance = mouseY - clownImageY;\n // Add 1/10th of the x and y distance to the clown's current (x,y) location\n clownImageX = clownImageX + xDistance/10;\n clownImageY = clownImageY + yDistance/10;\n\n // Display the clown image\nimage(clownImage,clownImageX,clownImageY);\n\n //move the rat image across the canvas by increasing its x position\n fuzziRatImgX += 1;\n\n// display the fuzzi rat!\nimage(fuzziRatImg,fuzziRatImgX,fuzziRatImgY);\n\n//the peace sign goes waaaving across the canvas\n\npceYoY = (2*(height/3)) + (30*sin(pceYoX/15));\npceYoX += 1;\n\n//display the sign of peace!\nimage(pceYo,pceYoX,pceYoY);\n\n//display ellipse at mouse position- i know you said image (rather than image or shape),\n//i'm sorry, i made a shape before i went back to look at the instructions!\n\nvoidRingX = mouseX;\nvoidRingY = mouseY;\n\nstrokeWeight(10);\nstroke(10,50);\nnoFill()\nellipse(voidRingX,voidRingY,voidRingSize);\n\n//display text ever straggling to catch up with the mouse\n\nslowTextX = 100 + mouseX;\nslowTextY = mouseY - 100;\nfill(219, 252, 255);\nstrokeWeight(1);\ntext(slowText,slowTextX,slowTextY);\n\n}", "function trackTransforms(ctx){\n let svg = document.createElementNS(\"http://www.w3.org/2000/svg\",'svg');\n let xform = svg.createSVGMatrix();\n ctx.getTransform = function(){ return xform; };\n\n let savedTransforms = [];\n let save = ctx.save;\n ctx.save = function(){\n savedTransforms.push(xform.translate(0,0));\n return save.call(ctx);\n };\n\n let restore = ctx.restore;\n ctx.restore = function(){\n xform = savedTransforms.pop();\n return restore.call(ctx);\n };\n\n let scale = ctx.scale;\n ctx.scale = function(sx,sy){\n xform = xform.scaleNonUniform(sx,sy);\n return scale.call(ctx,sx,sy);\n };\n\n let rotate = ctx.rotate;\n ctx.rotate = function(radians){\n xform = xform.rotate(radians*180/Math.PI);\n return rotate.call(ctx,radians);\n };\n\n let translate = ctx.translate;\n ctx.translate = function(dx,dy){\n xform = xform.translate(dx,dy);\n return translate.call(ctx,dx,dy);\n };\n\n let transform = ctx.transform;\n ctx.transform = function(a,b,c,d,e,f){\n var m2 = svg.createSVGMatrix();\n m2.a=a; m2.b=b; m2.c=c; m2.d=d; m2.e=e; m2.f=f;\n xform = xform.multiply(m2);\n return transform.call(ctx,a,b,c,d,e,f);\n };\n\n let setTransform = ctx.setTransform;\n ctx.setTransform = function(a,b,c,d,e,f){\n xform.a = a;\n xform.b = b;\n xform.c = c;\n xform.d = d;\n xform.e = e;\n xform.f = f;\n return setTransform.call(ctx,a,b,c,d,e,f);\n };\n\n let pt = svg.createSVGPoint();\n ctx.transformedPoint = function(x,y){\n pt.x=x; pt.y=y;\n return pt.matrixTransform(xform.inverse());\n }\n}", "function setup() {\n createCanvas(250,400);\n\n carImage = loadCarImage();\n}", "function boneAnimationR(bone) {\n // bones originate from the picture not the document sides\n var currentDoggo = document.getElementsByClassName(\"currentDoggo\");\n currentDoggo = currentDoggo[0];\n var cdImg = currentDoggo.children;\n cdImg = cdImg[0];\n var offsetLeft = cdImg.offsetLeft;\n var offsetTop = cdImg.offsetTop;\n var cdWidth = cdImg.offsetWidth;\n var cdHeight = cdImg.offsetHeight;\n\n var maxY = offsetTop;\n var minY = offsetTop + cdHeight;\n var onTheRight = offsetLeft + cdWidth;\n\n // animation on desktop - originates from the picture and flies to the edges\n if (screenWidth > 1001)\n {\n bone.keyframes = [\n {\n opacity: 1,\n // this is where they originate\n transform: \"translate3d(\" + onTheRight + \"px, \" + getRndInteger(minY, (minY - 50)) + \"px, 0px)\"\n },\n {\n opacity: 1,\n // this is where the bones fly to\n // first is left to right, second is bottom to top\n transform: \" translate3d(\" + getRndInteger((onTheRight + 10), (onTheRight + 300)) + \"px, \" + getRndInteger((minY - 60), (maxY - 200)) + \"px, 0px) rotate(\" + getRndInteger(0,540) + \"deg)\"\n }\n ];\n }\n // animation on mobile - originates from the top and flies to the bottom\n else\n {\n bone.keyframes = [\n {\n opacity: 1,\n // this is where they originate\n transform: \"translate3d(\" + getRndInteger(screenWidth / 2, screenWidth - 25) + \"px, \" + 55 + \"px, 0px)\"\n },\n {\n opacity: 1,\n // this is where the bones fly to\n // first is left to right, second is bottom to top\n transform: \" translate3d(\" + getRndInteger(screenWidth / 2 , screenWidth - 5) + \"px, \" + getRndInteger(200, 400) + \"px, 0px) rotate(\" + getRndInteger(0,540) + \"deg)\"\n }\n ];\n }\n \n bone.animProps =\n {\n duration: 1000,\n easing: \"ease-out\",\n iterations: 1\n }\n \n  var animationPlayer = bone.animate(bone.keyframes, bone.animProps);\n}", "render() {\n ctx.beginPath();\n ctx.fillStyle = \"red\";\n ctx.drawImage(AMMO_IMAGE,((laneWidth - this.width) / 2 ) + laneWidth * (this.currentLane - 1), this.y , this.width, this.height )\n ctx.closePath();\n }", "draw() {\n\n const { scaleX, scaleY, ctx } = this.world;\n const w = Math.floor(this.img.width * this.scale);\n const h = Math.floor(this.img.height * this.scale);\n const px = this.position.x * scaleX.toPx;\n const py = this.position.y * scaleY.toPx;\n this.width = w * scaleX.toUnits;\n this.height = h * scaleY.toUnits;\n\n if (!this.loaded || !this.display) return;\n\n // Draw image.\n if (this.rotation !== 0) {\n ctx.save();\n ctx.translate(px, py);\n ctx.rotate(this.rotation);\n ctx.drawImage(this.img, -w * this.pivot.x, -h * this.pivot.y, w, h);\n ctx.restore();\n } else {\n ctx.drawImage(\n this.img,\n px - w * this.pivot.x,\n py - h * this.pivot.y,\n w,\n h\n );\n }\n \n }" ]
[ "0.5820746", "0.58085644", "0.57708234", "0.56357783", "0.5591145", "0.5534578", "0.5527548", "0.55242527", "0.5520508", "0.54811585", "0.5479532", "0.54640794", "0.545736", "0.54514194", "0.54355514", "0.543411", "0.5372253", "0.5359912", "0.53531057", "0.53495383", "0.53492254", "0.5338104", "0.5332942", "0.5327408", "0.530818", "0.5300488", "0.5295131", "0.5295122", "0.52873045", "0.52872425", "0.5283824", "0.5279171", "0.52769285", "0.5275336", "0.5268403", "0.5259799", "0.5259745", "0.52550983", "0.5250987", "0.5246926", "0.5241936", "0.5241273", "0.5236111", "0.52296644", "0.5225834", "0.52183855", "0.5217623", "0.52138466", "0.52127033", "0.5199073", "0.5195926", "0.5195926", "0.5192252", "0.51880515", "0.51837605", "0.5178458", "0.5176807", "0.51749957", "0.5172089", "0.51630336", "0.5162716", "0.5158021", "0.5155636", "0.51542956", "0.5153944", "0.5150725", "0.51465607", "0.51441264", "0.51393944", "0.513805", "0.51310813", "0.51268727", "0.511984", "0.51113373", "0.51106447", "0.51093894", "0.51093304", "0.51073754", "0.51070684", "0.51025367", "0.5089167", "0.50883204", "0.50818336", "0.5077436", "0.5075975", "0.5070658", "0.5068997", "0.5064856", "0.5064418", "0.50630975", "0.5062265", "0.5062177", "0.5052934", "0.5052418", "0.5052407", "0.5049409", "0.50480205", "0.5047871", "0.5044884", "0.50426054" ]
0.5571364
5
import BeeBackground from "../images/BeeBackground.png"
function FunFacts() { return ( <Layout> <SEO title="Fun Facts" /> <HeroHeader img={EducationBee} text={"fun facts"} /> <FunBeeFacts backgroundImage="BeeBackground"/> </Layout> ) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "constructor() {\n super(...arguments)\n this.bgURL = \"static/assets/images/bg.png\"\n this.groundURL = \"static/assets/images/ground.png\"\n this.avatarURL = \"static/assets/images/avatar.png\"\n this.squircleURL = \"static/assets/images/squircle.png\"\n this.squircleFillURL = \"static/assets/images/squircle_fill.png\"\n }", "loadImages () {\n this.load.image('ground', ground)\n }", "loadSpriteSheet(){\n this.spriteSheet = loadImage('assets/sprites.png');\n }", "function OjoBot() {\n // Import result is the URL of your image\n return <img src={logo} alt=\"Logo\" />;\n}", "function App() {\n return (\n <div className=\"App\">\n <h1>LIGHTS <span>OUT</span><img src={lightsout}></img></h1>\n <Board />\n \n </div>\n );\n}", "function preload() {\n img = loadImage(\"../assets/Earth.png\");\n}", "makeImagePath1(product) {\n return require(`../assets/images/${product.images[1]}`);\n }", "function preload()\n{\n game.load.image(\"spaceship\", \"../assets/proto_spaceship.png\");\n}", "preload() {\n this.load.image('over', 'assets/game-over-bg.png');\n }", "makeImagePath2(product) {\n return require(`../assets/images/${product.images[2]}`);\n }", "function TwitterRedesignHeader() {\n return (\n <>\n <div\n className=\"page-header page-header-small\"\n style={{\n backgroundImage:\n \"url(\" + require(\"assets/img/rihanna_cover.jpg\").default + \")\",\n }}\n >\n <div className=\"filter\" />\n </div>\n </>\n );\n}", "render(){\n return (\n <div>\n . <img src=\"./login_images/login_background.jpeg\" id=\"login_background\" />\n <div id=\"login_component\">\n <img src=\"./login_images/cc_logo.png\" id=\"login_image\" />\n <LoginButton />\n </div>\n </div>\n );\n }", "function ItemImage(path) {\n this.path = '../lab/assets/' + path;\n this.clicked = 0;\n}", "renderBox(name, imgSrc){\n return(\n '<img src={require(' + imgSrc + ')} className=\"image\" alt=\"Img\" />'\n );\n }", "makeImagePath(product) {\n return require(`../assets/images/${product.images[0]}`);\n }", "function Image() {\n return (\n <div className=\"Image\">\n <img src={'/isa.JPG'} className=\"profile-pic\" alt=\"logo\" />\n \n </div>\n );\n }", "function image(relativePath) {\n\treturn \"img/core-img/\" + relativePath;\n}", "function loadAssets() {\n PIXI.loader\n .add([\n \"./assets/tileset10.png\",\n ])\n .load(gameCreate);\n}", "function preload() {\n img = loadImage('./img/bg.jpg');\n}", "function preload() {\n \n bgImage = loadImage(\"assets/swamp.jpg\");\n bgImage2 = loadImage(\"assets/forest.jpg\");\n}", "function changeImageUmbrellaBack() {\n document.images['white-duck-umbrella'].src ='./assets/images/white-duck-umbrella.png'\n }", "function HomeBackground() {\n return (\n <div className=\"container-fluid homeBackgroundContainer p-0\">\n <div className=\"homeBackground d-flex w-100\" style={{ backgroundImage: `url(${StardustImage})` }}>\n <div className=\"homeBackground__slide homeBackground__slide-post \"\n style={{ backgroundImage: `url(${CityImage})` }}>\n </div>\n <div className=\"homeBackground__slide homeBackground__slide-pre\"\n style={{ backgroundImage: `url(${CityImage})` }}>\n </div>\n </div>\n </div>\n\n )\n}", "static imageRootUrl() {\r\n return (`/dist/img/`);\r\n }", "function Header() {\n const [logoUrl] = useState('./logo-creasume.png');\n\n return(\n <Container>\n <img src={logoUrl} alt=\"Crea-Sume\"/>\n </Container>\n )\n}", "function preload() {\n bg = loadImage(\"assets/space.png\");\n ship = loadImage(\"assets/ship.png\");\n ship.r = 30;\n}", "function JumboImage() {\n\n const styles = {\n jumboImg: {\n backgroundPosition: 'center',\n backgroundSize: 'cover',\n width: '100%',\n }\n };\n\n return(\n <div>\n <Image src=\"../../assets/UpickJumbo.png\" fluid style={styles.jumboImg} />\n </div>\n );\n}", "render() {\n const titleStyle = {\n color: '#0e9e71',\n textDecoration: 'underline',\n fontWeight: 'bold',\n marginTop: '20px',\n };\n\n const textStyle = {\n fontSize: '22px',\n };\n\n const backgroundStyle = {\n backgroundImage: `url(${'/images/pattern.jpg'})`,\n backgroundSize: 'fit',\n };\n return (\n <div style={backgroundStyle}>\n <Container>\n <Header as=\"h1\" textAlign=\"center\" style={titleStyle}>Reporting an Item</Header>\n\n <Header as=\"h2\" textAlign=\"center\" style={titleStyle}>Posting</Header>\n <p style={textStyle}>To report an item, you can click the \"Report this item\" button on an item's page.\n You would be redirected to the reporting page for that item, where you can fill a reporting form.\n <Image src=\"/images/ReportPage.png\" centered/>\n </p>\n </Container>\n </div>\n );\n }", "icons () {\n return require('@packages/icons')\n }", "render () {\n let {src, alt, ...props} = this.props;\n src = src?.src || src; // image passed through import will return an object\n return <img {...props} src={addBasePath(src)} alt={alt}/>\n }", "preload()\r\n {\r\n this.load.image('ball', 'assets/images/ball.png');\r\n this.load.image('leftspike', 'assets/images/leftspike.png');\r\n this.load.image('wall', 'assets/images/wall.png');\r\n this.load.image('rightspike', 'assets/images/rightspike.png');\r\n }", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n}", "constructor() {\n super({\n key: 'SplashScreen',\n\n // Splash screen and progress bar textures.\n pack: {\n files: [{\n key: 'splash-screen',\n type: 'image'\n }, {\n key: 'progress-bar',\n type: 'image'\n }]\n }\n });\n }", "function imageUrl(path) {\n try {\n return require('text!gcli/ui/' + path);\n }\n catch (ex) {\n var filename = module.id.split('/').pop() + '.js';\n var imagePath;\n\n if (module.uri.substr(-filename.length) !== filename) {\n console.error('Can\\'t work out path from module.uri/module.id');\n return path;\n }\n\n if (module.uri) {\n var end = module.uri.length - filename.length - 1;\n return module.uri.substr(0, end) + '/' + path;\n }\n\n return filename + '/' + path;\n }\n}", "static preload(scene) {\n scene.load.image('fireball', 'assets/img/Items/fireball.png');\n }", "function preload()\n{\nhelicopterIMG=loadImage(\"helicopter.png\")\npackageIMG=loadImage(\"package.png\")\n}", "function backgroundImages() {\n tint(255, 140); // Reduces the image's opacity\n image(cherryblossom1, 990, 110);\n image(cherryblossom2, -20, 20);\n image(dragon, -50, 340);\n}", "function loadImages() {\n floor = new Image();\n background = new Image();\n ring = new Image();\n platform = new Image();\n\n floor.src = './tile-images/floorpath.png';\n background.src = './tile-images/plainbackgroundtile.png';\n ring.src = './tile-images/ring.png';\n platform.src = './tile-images/platform.png';\n}", "function create() {\n game.add.image(0,0,'background');\n \n \n}", "preload() {\n this.load.image('wideBarrier', 'SpriteFolder\\\\wideBarrier.png');\n this.load.image('wideBarrierNew', 'SpriteFolder\\\\wideBarrierNew.png');\n this.load.image('wideBarrierNewRed', 'SpriteFolder\\\\wideBarrierNewRed.png');\n this.load.image('bullet', 'SpriteFolder\\\\newBullet.png');\n this.load.image('ship', 'SpriteFolder\\\\ship.png');\n this.load.image('shipOutline', 'SpriteFolder\\\\shipOutline.png');\n this.load.image('squareBlock', 'SpriteFolder\\\\squareBlock.png');\n }", "function Intro (){\n var introStyle = {\n // contentAlign: 'center',\n backgroundImage:`url(${MissionTesla})`\n }\n return(\n \n <div style = {introStyle}>\n\n {/* <img src= {MissionTesla}/> */}\n <body style={introStyle}>\n \n \n <h3>Careers</h3>\n <Link to=\"/\">About</Link>\n <Link to=\"/\">Careers</Link>\n <Link to=\"/\">Contact</Link>\n <Link to=\"/\">Legal</Link>\n <Link to=\"/\">Investors</Link>\n <Link to=\"/\">Suppliers</Link>\n <hr/>\n </body>\n </div>\n );\n}", "constructor() {\n this.icon = 'images/favicon-32x32.png';\n }", "function HomePage() {\n return (\n <div className=\"home\">\n <img className=\"home-pic\" src={require(\"../../assets/img/deshaun-home.png\")} width=\"1000px\" alt=\" Deshaun\" />\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <br>\n </br> <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n <br>\n </br>\n {/* <MDBBtn className=\"text-align:center\" href=\"/about\" gradient=\"default\">Welcome</MDBBtn> */}\n <Button className=\"home-btn\" variant=\"default\" href=\"/about\">Welcome</Button>\n\n </div>\n )\n}", "function AdminHeader() {\n return (\n <div>\n <header className=\"admin-header\">\n <div className=\"admin-logo\">\n <img \n className=\"admin_bark_logo\"\n src=\"./images/Barktique-and-meow-logo-final-color.png\" \n />\n </div>\n </header>\n </div>\n )\n} // end AdminHeader", "function TemplatePicture() {\n return (\n <div style={{ backgroundImage: \"url(\" + template + \")\"}}>\n </div>\n );\n}", "render() {\n return (\n <ImageBackground\n source={require(\"../img/background-image.jpg\")}\n style={styles.container}\n >\n <View style={styles.inner}>\n <Image style={styles.image} source={require(\"../img/sunshine.png\")} />\n <Text style={styles.texto}>\n Sunshine, diferente dos projetos climáticos padrões, fornece\n informações adicionais sobre o microclima onde você vive. Aqui você\n não encontrará apenas dados de temperatura ou chuva, mas também dos\n gases e da atuação do sol sobre sua cidade.\n </Text>\n <Button\n title=\"Começar\"\n onPress={this.props.navigation.openDrawer}\n style={styles.botao}\n />\n </View>\n </ImageBackground>\n );\n }", "function preload() {\n imgFish = loadImage('assets/images/fish.png');\n imgShark = loadImage('assets/images/shark.png');\n}", "getBackgroundImage(){return this.__background.image}", "function preload(){\n img = loadImage(\"/8bitGrass.png\");\n}", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n alienFace = loadImage(\"assets/images/alien.png\");\n skullFace = loadImage(\"assets/images/skull.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n}", "get backgroundStyle() { \n return `background-image:url(${this.boat.Picture__c})`;\n\n }", "function preload() {\n turboImage = loadImage(\"TurboImage.png\");\n enzoImage = loadImage(\"EnzoImage.png\");\n gallardoImage = loadImage(\"GallardoImage.png\");\n viperImage = loadImage(\"ViperImage.png\");\n}", "function LogoTitle() {\n return(\n <Image\n style={{ width: 47, resizeMode: 'contain'}}\n source={require(\"../Images/croissant-only.png\")}\n />\n );\n}", "function preload() {\n tigerImage = loadImage(\"assets/images/tiger_emoji.png\");\n leopardImage = loadImage(\"assets/images/leopard_emoji.png\");\n bearImage = loadImage(\"assets/images/teddy_bear_emoji.png\");\n antelopeImage = loadImage(\"assets/images/antelope_toy.png\");\n zebraImage = loadImage(\"assets/images/zebra_toy.png\");\n beeImage = loadImage(\"assets/images/bee_toy.png\");\n backdrop = loadImage(\"assets/images/background_image_bedtop.jpg\");\n quicksand = loadFont(\"assets/Quicksand/Quicksand-Regular.otf\");\n}", "function preload ()\r\n{\r\n this.load.image('bg', 'assets/bg.png');\r\n this.load.image('ball', 'assets/ball.png');\r\n this.load.image('wall', 'assets/wall.png');\r\n this.load.image('goal', 'assets/goal.png');\r\n this.load.image('cursor','assets/cursor.png');\r\n}", "function image(relativePath) {\n return \"/static/editablegrid-2.0.1/images/\" + relativePath;\n}", "function App() {\n \n return (\n <div className=\"App\">\n <GifFinder />\n </div>\n );\n}", "function preload() {\n doveImg = loadImage('./assets/images/dove.png');\n clefImg = loadImage('./assets/images/clef.png');\n}", "function Hero({children, name, backgroundImg}) {\n return(\n <div className={name} style={backgroundImg && {backgroundImage: `url(${backgroundImg})`}}>\n {/* children refers to banner */}\n {children}\n </div>\n );\n}", "function ImageHelper() { }", "function changeImageMonocleBack() {\n document.images['white-duck-monocle'].src ='./assets/images/white-duck-monocle.png'\n }", "pickLogo () {\n\n\t\t/**\n\t\t * You have to call require in each call otherwise it breaks for some reason\n\t\t */\n\t\t\n\t\tlet url = require('../../images/logo_white.png');\n\n\t\tswitch(this.props.route.toString()){\n\t\t\tcase 'Default':\n\t\t\t\turl = require('../../images/logo_bart.png');\n\t\t\tbreak;\n\t\t\tcase 'Meeting':\n\t\t\t\turl = require('../../images/logo_patrick.png');\n\t\t\tbreak;\n\t\t\tcase 'Delivery':\n\t\t\t\turl = require('../../images/logo_stitch.png');\n\t\t\tbreak;\n\t\t\tcase null:\n\t\t\tcase 'Welcome':\n\t\t\tdefault:\n\t\t\t\turl = require('../../images/logo_white.png');\n\t\t\tbreak; \n\t\t}\n\n\t\treturn (\n\t\t\t<Image source={ url } style={ {\n\t\t\t\twidth: 150,\n\t\t\t\theight: 21,\n\t\t\t\tmarginTop: 1,\n\t\t\t\tmarginRight: 10\n\t\t\t} } />\n\t\t)\n\t}", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n dogImage = loadImage(\"assets/images/dog-image.png\");\n ballImage = loadImage(\"assets/images/ball.png\");\n candyImage = loadImage(\"assets/images/candy.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n}", "function preload() {\n clownImage = loadImage(\"assets/images/clown.png\");\n feltTextureImage = loadImage(\"assets/images/black-felt-texture.png\");\n elephantImage = loadImage(\"assets/images/elephant.png\");\n pigeonImage = loadImage(\"assets/images/pigeon.png\");\n nudibranchImage = loadImage(\"assets/images/nudibranch.png\");\n}", "preload() {\n this._scene.load.spritesheet('dude',\n 'assets/dude.png',\n { frameWidth: 32, frameHeight: 48 }\n );\n }", "function App() {\n return (\n // <div style={{ background: `url(${backgroundimg})`}}>\n <Router >\n <NavTabs />\n <Route exact path=\"/\" component={Home} />\n <Route exact path=\"/portfolio\" component={Portfolio} />\n {/* <Route exact path=\"/project\" component={Project} /> */}\n <Route exact path=\"/contact\" component={Contact} />\n <Footer />\n </Router>\n // </div>\n );\n}", "function preload() {\n bg = loadImage(\"addons/woodgrain.jpg\");\n myFont = loadFont(\"addons/Rye/Rye-Regular.ttf\");\n qFont = loadFont(\"addons/Indie_Flower/IndieFlower.ttf\");\n}", "preload(){\n this.load.image('player', 'assets/player.png'); //load player.png as 'player'\n this.load.image('pipe', 'assets/pipe.png'); //load pipe.png as 'pipe'\n this.serverURL = 'http://localhost:8080';\n\n }", "getImageSource(){\n return `assets/images/cards/${this.rank}_of_${this.suit}.png`;\n }", "main() {\n setup_pixi_stage(600, 400);\n const loader = PIXI.Loader.shared;\n loader.add(\"Resources/meteor2.png\");\n loader.add(\"Resources/dinosaur.png\");\n loader.load(this.load_done.bind(this));\n }", "preload(){\n this.load.spritesheet(\"avatar\", \"/assets/avatar.png\", {\n frameWidth: 48,\n frameHeight: 48\n });\n this.load.spritesheet(\"bird\", \"/assets/bird.png\", {\n frameWidth: 48,\n frameHeight: 48\n })\n\n this.load.image(\"shit\", \"/assets/shit.png\")\n this.load.image(\"bg\", \"/assets/background.png\")\n }", "function loadPiecesPng(){\n wPawn = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_plt60.png\")\n wBishop = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_blt60.png\")\n wRook = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_rlt60.png\")\n wKnight = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_nlt60.png\")\n wQueen = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_qlt60.png\")\n wKing = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_klt60.png\") \n \n bPawn = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_pdt60.png\")\n bBishop = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_bdt60.png\")\n bRook = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_rdt60.png\")\n bKnight = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_ndt60.png\")\n bQueen = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_qdt60.png\")\n bKing = loadImage(\"/Project-Archive/FreeTime/Assets/PiecesPng/Chess_kdt60.png\")\n}", "constructor() {\n this.x = 202;\n this.y = 395;\n this.sprite = 'images/char-boy.png';\n }", "function load_img() {\n fabric.Image.fromURL('golf-h.png', function (img) {\n hole = img;\n hole.scaleToWidth(60);\n hole.scaleToHeight(60);\n hole.set({\n top: holey,\n left: holex\n });\n canvas.add(hole);\n });\n\n fabric.Image.fromURL('ball.png', function (img) {\n ball = img;\n ball.scaleToWidth(ballw);\n ball.scaleToHeight(ballh);\n ball.set({\n top: bally,\n left: ballx\n });\n canvas.add(ball);\n });\n}", "function preload () {\n game.load.spritesheet('bean', 'images/red_bean.png', 82, 82);\n game.load.image('background', 'images/desert_background.png');\n}", "preload() {\n\n // loading assets\n this.load.image(\"wheel\", Utils.UrlRoot + \"minigame/wheel/wheel.png\");\n this.load.image(\"pin\", Utils.UrlRoot + \"minigame/wheel/pin.png\");\n }", "function preload() {\n game.load.image(\"logo\", \"assets/phaser.png\");\n }", "precargar(){\r\n this.gif = this.app.createImg('./Recursos/Balon.gif');\r\n this.gif.size(95, 95);\r\n }", "function preload() {\r\n\r\n backgroundImg = loadImage(\"https://ik.imagekit.io/slashit/1024px-Graph-paper.svg_AwS8xTkgv.png\");\r\n doodlerLeftImg = loadImage(\"https://ik.imagekit.io/slashit/doodle-jump-doodler__kz0Y7-FQ.png\");\r\n doodlerRightImg = loadImage(\"https://ik.imagekit.io/slashit/doodle-jump-doodler-right_Cti6O6Ulp.png\");\r\n platformImg = loadImage(\"https://ik.imagekit.io/slashit/doodle-jump-platform_8TbJA5M84.png\");\r\n}", "function preload() {\n shipImage = loadImage(\"assets/images/face.png\");\n bulletImage = loadImage(\"assets/images/heart.png\");\n}", "@api\n get backgroundStyle() {\n return \"background-image:url(${this.boat.Picture__c})\";\n }", "function changeImageLeavesBack() {\n document.images['white-duck-leaves'].src ='./assets/images/white-duck-leaves.png'\n }", "preload() {\n this.load.spritesheet(\"tree\", \"assets/tree.png\", { frameWidth: 60, frameHeight: 95 });\n this.load.image('platform', 'assets/platform.png');\n this.load.image('background', 'assets/background.png');\n this.load.spritesheet('dude', 'assets/mike-running.png', { frameWidth: 84, frameHeight: 93 });\n }", "function preload() {\n\n//preload = called once at the very beginning it uploads resources e.g images and sounds\n // resources can be given a name here\n\n game.load.image(\"playerImg\", \"../assets/kitten.png\");\n // this loads the image into the program\n game.load.audio(\"score\", \"../assets/point.ogg\");\n\n game.load.image(\"pipe\", \"../assets/pipe.png\");\n\n game.load.image(\"pipeEnd\", \"../assets/pipe-end.png\");\n\n game.load.image(\"yarn\", \"../assets/yarn1.png\");\n //game.load.image(\"\" , \"../assets/png\");\n}", "function createBackgroundSheet()\n{\n let sheet = new PIXI.BaseTexture.from(app.loader.resources[\"background\"].url);\n let w = 600;\n let h = 600;\n \n backgroundSheet[\"background\"] = [\n new PIXI.Texture(sheet, new PIXI.Rectangle(0, 0, w, h))\n ];\n}", "function TabBarIcon({ source }) {\n return <Image source={source} style={{ height: 30, width: 30 }} />;\n}", "getImage(){\n if(this.color == 'white'){\n return './img/pawn_white.svg';\n }\n else{\n return '../img/pawn_black.svg';\n }\n }", "function ImageWeather() {\n return <img src={imageWeather} alt=\"Logo\" style={{width: '200px', height: '170px'}} />;\n}", "function preload(){\n\tcowimg = loadImage('assets/cow.png');\n}", "function preload() {\n customFont = loadFont(\"../assets/Suisse Bold.otf\");\n escargot = loadImage('img/Escargot.gif');\n soleil = loadImage('img/Soleil.png');\n lune = loadImage('img/Lune.png');\n Lapin = loadImage('img/Lapin.gif');\n}", "function changeImageAppleBack() {\n document.images['white-duck-apple'].src ='./assets/images/white-duck-apple.png'\n }", "function BackgroundImg(props) {\n return (\n <div>\n <div className=\"background\">\n {props.children}\n </div>\n </div>\n );\n}", "preload() {\n this.load.setPath('assets/');\n this.load.atlas('hero', 'hero_8_4_41_62.png', 'hero_8_4_41_62.json');\n }", "if (!this._loadImage) {\n this._loadImage = import('blueimp-load-image');\n }", "function preload()\n{\n this.load.image('nebula', 'assets/nebula.jpg');\n this.load.image('bullet', 'assets/bullet.png');\n this.load.image('player', 'assets/thrust_ship.png');\n this.load.image('baddie', 'assets/baddie.png');\n this.load.image('baddie2', 'assets/space-baddie.png');\n this.load.image('bossbaddie', 'assets/baddie2.png');\n this.load.image('baddiebullet', 'assets/bbullet.png');\n}", "function preload() {\n // loading the image to be displayed\n game.load.image(\"playerImg\", \"../assets/pokeball.png\");\n game.load.image(\"backgroundImg\", \"../assets/cave_background.png\");\n game.load.image(\"playerImg2\", \"../assets/charizard.png\");\n game.load.image(\"pipeBlock\", \"../assets/articuno.png\");\n game.load.audio(\"roar\", \"../assets/charizard_roar.ogg\");\n game.load.image(\"pika\", \"../assets/flying_pika.png\");\n game.load.image(\"stone\", \"../assets/Firestone.png\");\n}", "function preload(){\r\n\tBg = loadImage(\"BG.jpg\");\r\n\tboy = loadImage(\"boy.png\");\r\n }", "image(src) {\n\t\tthis.el = document.createElement('img')\n\t\tthis.el.src = `assets/${src}`\n\t\tthis.el.classList.add('actor')\n\t\tthis.el.draggable = false\n\t}", "function App() {\n\n return (\n <Router>\n <div style={{backgroundImage: `url( ${MyWorkImage} )`, backgroundSize: \"cover\",\n position: \"relative\", height:\"100vh\", backgroundColor: \"#101446\"}}>\n <Wrapper>\n <Route exact path=\"/\" component={About} />\n <Route exact path=\"/about\" component={About} />\n <Route exact path=\"/mywork\" component={MyWork} />\n </Wrapper>\n </div>\n </Router>\n );\n}", "function preload() {\n\n\t//Loaded an image inside the variable\n\thelicopterIMG = loadImage(\"helicopter.png\")\n\n\t//Loaded an image inside the variable\n\tpackageIMG = loadImage(\"package.png\")\n\n}", "function enterLoadGame()\n{\n\t_canvas.style.backgroundImage = \"url(images/background.png\";\n}" ]
[ "0.6361169", "0.63168746", "0.62622833", "0.6197714", "0.60879225", "0.60377544", "0.60124695", "0.60029346", "0.5992274", "0.59776103", "0.59751046", "0.59337294", "0.5919151", "0.59070796", "0.5904742", "0.5903038", "0.58848983", "0.587727", "0.58322966", "0.5831913", "0.580528", "0.579814", "0.5789307", "0.57880825", "0.57776415", "0.5776112", "0.5774711", "0.57706034", "0.5761283", "0.57530147", "0.57524484", "0.57395333", "0.57271624", "0.5720343", "0.5717634", "0.5716228", "0.57086074", "0.57085484", "0.570639", "0.5697586", "0.5695642", "0.56862795", "0.56819725", "0.567662", "0.56745565", "0.5666589", "0.56658", "0.5658304", "0.5658116", "0.5657191", "0.5647703", "0.56429654", "0.56395435", "0.5634903", "0.5632028", "0.5625739", "0.56243134", "0.5623179", "0.56228715", "0.5619421", "0.5607082", "0.5605585", "0.5593418", "0.5584636", "0.55799323", "0.5574657", "0.5571613", "0.5570529", "0.556708", "0.556447", "0.5561697", "0.55613977", "0.5558531", "0.55578864", "0.5556379", "0.5552235", "0.55521655", "0.554244", "0.5540902", "0.5537373", "0.5535892", "0.55320036", "0.5531706", "0.55310774", "0.55281514", "0.5525938", "0.5525471", "0.5522856", "0.55219334", "0.55153054", "0.5514498", "0.55135745", "0.55098045", "0.5507112", "0.550684", "0.55057317", "0.55056995", "0.54997605", "0.5495681", "0.5495245" ]
0.5610486
60
Initialize visualization (static content, e.g. SVG area or axes)
initVis() { let vis = this; vis.margin = {top: 20, right: 50, bottom: 20, left: 50}; vis.width = $("#" + vis.parentElement).width() - vis.margin.left - vis.margin.right; vis.height = $("#" + vis.parentElement).height() - vis.margin.top - vis.margin.bottom; vis.marginLegend = {top: 0, right: 0, bottom: 100, left: 0}; vis.widthLegend = $("#" + vis.legendElement).width() - vis.marginLegend.left - vis.marginLegend.right; vis.heightLegend = $("#" + vis.legendElement).height() - vis.marginLegend.top - vis.marginLegend.bottom; vis.svg = d3.select("#" + vis.parentElement).append("svg") .attr("width", vis.width + vis.margin.left + vis.margin.right) .attr("height", vis.height + vis.margin.top + vis.margin.bottom) .append("g") .attr("transform", "translate(" + vis.margin.left + "," + vis.margin.top + ")") .style("overflow", "visible"); vis.svg2 = d3.select("#" + vis.legendElement).append("svg") .attr("width", vis.widthLegend + vis.marginLegend.left + vis.marginLegend.right) .attr("height", vis.heightLegend + vis.marginLegend.top + vis.marginLegend.bottom) .append('g') vis.svg3 = d3.select("#" + vis.textElement).append("svg") .attr("width", vis.widthLegend + vis.marginLegend.left + vis.marginLegend.right) .attr("height", vis.heightLegend + vis.marginLegend.top + vis.marginLegend.bottom) .append('g') vis.svg.append("g") .attr("fill", "none") .attr("stroke", "steelblue") .attr("stroke-width", 1.5) .attr("stroke-linejoin", "round") .attr("stroke-linecap", "round") vis.xScale = d3.scaleLinear() //.domain([d3.min(vis.data,d=>d.date), d3.max(vis.data,d=>d.date)]) //.domain(d3.extent(vis.data, d=> d.date.getFullYear())) .range([0,vis.width]); vis.xAxis = d3.axisBottom() .scale(vis.xScale); vis.yScale = d3.scaleLinear() //vis.yScale = d3.scaleLog() .range([vis.height, 0]); vis.yAxis = d3.axisLeft() .scale(vis.yScale) vis.svg.append("text") //.attr("transform", "rotate(-90)") .attr("y",-5) .attr("x",20) .attr("dy", "1em") .style("text-anchor", "left") .text("Cumulative Flights"); vis.svg.append("g") .attr("class", "axis axis--x") //.call(vis.xAxis.tickFormat(d3.format("d"))) vis.yAxis_Pointer = vis.svg.append("g") .attr("class", "axis y-axis"); vis.xAxis_Pointer = vis.svg.append("g") .attr("class", "axis x-axis"); // Save master data vis.master = vis.data; vis.myCountries = ["USA", "China", "Russia", "Japan", "Israel", "New Zealand", "Iran", "France", "India", "Mexico", "Kazakhstan", "North Korea", "Brazil", "Kenya", "Australia"] //console.log(vis.master) // create legend item vis.legend = vis.svg2.append("g") .attr("class", "FlightLegend") vis.textbox = vis.svg3.append("g") .attr("class", "TextBox") vis.legendData = []; // (Filter, aggregate, modify data) vis.wrangleData(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function initialize() {\n\t\t\n\t\tsvg = scope.selection.append(\"svg\").attr(\"id\", scope.id).style(\"overflow\", \"visible\").attr(\"class\", \"vizuly\");\n\t\tbackground = svg.append(\"rect\").attr(\"class\", \"vz-background\");\n\t\tdefs = vizuly2.util.getDefs(viz);\n\t\tplot = svg.append('g');\n\t\t\n\t\tscope.dispatch.apply('initialized', viz);\n\t}", "function initVisualization() {\n var svg = d3.select(\"#simulation\")\n .append(\"svg\")\n .attr(\"width\", w)\n .attr(\"height\", h);\n}", "init() {\n // Add label\n $sel.append('text')\n .text(d => `${d.key}`)\n\n const container = $sel.append('div.container')\n\n // Add svg for front pockets\n\t\t\t\t$svgFront = container.append('svg.area-front');\n\t\t\t\tconst $gFront = $svgFront.append('g');\n\n\t\t\t\t// setup viz group\n\t\t\t\t$visFront = $gFront.append('g.g-vis');\n\n // Add svg for back pockets\n $svgBack = container.append('svg.area-back');\n const $gBack = $svgBack.append('g');\n\n // setup viz group\n $visBack = $gBack.append('g.g-vis');\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "init() {\n\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function init() {\n\n // AXIS LABELS\n // Set yAxis label to class 'yAxis-label'\n graph\n .append('text')\n .attr('class','yAxis-label')\n \n // Set xAxis label to class 'xAxis-label'\n graph\n .append('text')\n .attr('class','xAxis-label')\n\n // AXIS GROUPS\n // Create axisX group with class 'axisX'\n graph\n .append('g')\n .attr('class','axisX')\n .attr('id','axisX')\n \n // Create axisY group with class 'axisY'\n graph\n .append('g')\n .attr('class','axisY')\n .attr('id','axisY')\n\n\n // add event listner for any resizes (listener is debounced)\n window.addEventListener(\"resize\", debounce(resize, 200));\n drawChart(rawData, props);\n }", "init()\n { this.animated_children.push( this.axes_viewer = new Axes_Viewer( { uniforms: this.uniforms } ) );\n // Scene defaults:\n this.shapes = { box: new defs.Cube() };\n const phong = new defs.Phong_Shader();\n this.material = { shader: phong, color: color( .8,.4,.8,1 ) };\n }", "function init() {\n\n svg = d3\n .select(\"#d3-container-1\")\n .append(\"svg\")\n\n draw(); // calls the draw function\n }", "function initVis() {\r\n\r\n createMapChart();\r\n populateTable();\r\n createLineCharts();\r\n}", "constructor() { \n \n JsonAnalysisVisualization.initialize(this);\n }", "function initialize() {\n\tinitialColorScale(imageData);\n\tloadIconImages(imageData);\n\tdrawBarChart(imageData);\n\tdrawSliderBar(imageData);\n\tdrawTreemap(imageData);\n}", "init() {\n $svg = $chart\n .select(\".figure__chart\")\n .append(\"svg\")\n .attr(\"class\", \"pudding-chart\");\n\n // create axis\n $axis = $svg.append(\"g\").attr(\"class\", \"g-axis\");\n\n // setup viz group\n $vis = $svg.append(\"g\").attr(\"class\", \"g-vis\");\n\n $vis.append(\"g\").attr(\"class\", \"arc\");\n $vis.append(\"g\").attr(\"class\", \"hist\");\n\n const extentX = d3.extent(data, d => d.distance);\n scaleArcX.domain(extentX).nice();\n scaleArcY.domain(extentX).nice();\n\n const binX = d3.range(0, scaleArcX.domain()[1], binSize);\n scaleHistX.domain(binX);\n }", "init() {\n const bar = d3.select(this.element);\n // Called when the application knows all needed information to create plots.\n document.addEventListener('setupFinished', (e) => {\n bar.style('opacity', '1');\n });\n // Create PlotTool menu tile\n const plotTileID = 'plotTile';\n const plotTileElement = bar.append('div').attr('id', plotTileID).node();\n const zoomTile = new PlotToolsTile(plotTileElement, '#'+plotTileID, {});\n }", "function initializeVisualization(createStaticElements) {\n d3.json(\"data/\" + global.dataset.file, function(data) {\n // Cache the dataset\n global.papers = data.papers;\n\n // Initialize some global parameters\n global.computeOldestLatestPublicationYears();\n global.computeMedianMaximalNormalizedCitationCountsPerYear();\n\n // Restore data from previous session\n sessionManager.loadPreviousSession();\n\n // If no seed papers, won't do anything\n algorithm.updateFringe();\n view.initializeView(createStaticElements);\n\n // setup autocomplete popup\n $('#dialog .typeahead').typeahead({\n hint: true,\n highlight: true,\n minLength: 3\n }, {\n name: 'titles',\n displayKey: 'value',\n source: substringMatcher(Object.keys(global.papers)\n .map(function(doi) {\n return global.papers[doi].title;\n }))\n });\n });\n}", "function initialize() {\r\n if (TypeUtils.isEmptyObject(config))\r\n Functions.error('Container configuration missing');\r\n\r\n initializedModules = 0;\r\n\r\n initAxis('xAxis');\r\n initAxis('yAxis');\r\n initAxis('zAxis');\r\n initAxis('background');\r\n\r\n var plotConfig = config.modules.plot;\r\n if (!plotConfig)\r\n return;\r\n var plot = modules.plot = ignite(plotConfig.id, ctx, \"plot\");\r\n var dataHandler = new SingleChartDataHandler(data);\r\n plot.data(dataHandler.getDataAdapter());\r\n\r\n var props;\r\n if (plotConfig.configure) {\r\n props = resolveProperties(plotConfig.configure);\r\n plot.properties(props);\r\n }\r\n\r\n if (plot.dispatch) {\r\n var dis = plot.dispatch();\r\n if (dis.initialized) {\r\n initializedModules++;\r\n dis.on('initialized.xycontainer', initialized);\r\n }\r\n ;\r\n if (dis.showTooltip)\r\n dis.on('showTooltip.xycontainer', showTooltip);\r\n if (dis.hideTooltip)\r\n dis.on('hideTooltip.xycontainer', hideTooltip);\r\n }\r\n\r\n var dataLabelConfig = config.modules.dataLabel;\r\n if (TypeUtils.isExist(dataLabelConfig)\r\n && TypeUtils.isExist(plot.dataLabel)) {\r\n var dataLabel = modules.dataLabel = ignite(dataLabelConfig.id, ctx);\r\n plot.dataLabel(dataLabel);\r\n dataLabel.plot(plot);\r\n if (dataLabelConfig.configure) {\r\n props = resolveProperties(dataLabelConfig.configure);\r\n dataLabel.properties(props);\r\n }\r\n }\r\n\r\n if (modules.xAxis && !selections.xAxis)\r\n selections.xAxis = parent.append('g').attr('class', 'v-m-xAxis');\r\n if (modules.yAxis && !selections.yAxis)\r\n selections.yAxis = parent.append('g').attr('class', 'v-m-yAxis');\r\n if (modules.zAxis && !selections.zAxis)\r\n selections.zAxis = parent.append('g').attr('class', 'v-m-zAxis');\r\n if (modules.plot && !selections.plot)\r\n selections.plot = parent.append('g').attr('class', 'v-m-plot');\r\n if (modules.background && !selections.background)\r\n selections.background = parent.insert('g', ':first-child').attr(\r\n 'class', 'background');\r\n }", "init() {\n $svg = $chart.append('svg').attr('class', 'pudding-chart');\n\n // create axis\n $axis = $svg.append('g').attr('class', 'g-axis');\n // setup viz group\n $vis = $svg.append('g').attr('class', 'g-vis');\n\n $label = $svg.append('g').attr('class', 'g-label');\n\n $axis.append('g').attr('class', 'axis--y axis--y--bg');\n $axis.append('g').attr('class', 'axis--y axis--y--fg');\n\n $label\n .append('text')\n .attr('class', 'text-comp text-comp--bg')\n .text(comp)\n .attr('x', -LABEL_SIZE / 2)\n .attr('y', -LABEL_SIZE / 2)\n .attr('text-anchor', 'end')\n .style('font-size', LABEL_SIZE);\n\n $label\n .append('text')\n .attr('class', 'text-comp text-comp--fg')\n .text(comp)\n .attr('x', -LABEL_SIZE / 2)\n .attr('y', -LABEL_SIZE / 2)\n .attr('text-anchor', 'end')\n .style('font-size', LABEL_SIZE);\n\n $label\n .append('text')\n .attr('class', 'text-label')\n .text(label)\n .attr('x', 0)\n .attr('y', -LABEL_SIZE / 2)\n .attr('text-anchor', endLabel ? 'end' : 'start')\n .style('font-size', LABEL_SIZE);\n }", "init() {\n // Add label\n $sel.append('text.tk-atlas.text-menWomen')\n .text(d => `${d.key}'s`)\n\n const container = $sel.append('div.container')\n\n // Add svg for front pockets\n\t\t\t\tbrands = container.selectAll('.fit-brand')\n .data(d => d.values)\n .enter()\n .append('div.area-front')\n .attr('class', 'fit-brand visible')\n\n display = brands.append('div.display')\n let tooltip = brands.append('div.tooltip')\n\n $svg = display.append('svg.fit-canvas')\n const text = display.append('div.text')\n text.append('text.brand.tk-atlas').text(d => d.brand)\n text.append('text.style.tk-atlas').text(d => d.updatedStyle)\n\n let toolText = tooltip.append('div.tooltip-text')\n const dollars = d3.format(\"$.2f\")\n\n toolText.append('text.tk-atlas').text(d => d.name)\n toolText.append('text.tk-atlas').text(d => `${dollars(d.price)}`)\n toolText.append('text.tk-atlas').text(d => d.fabric)\n\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g.g-vis');\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "initVis() {\n let vis = this;\n\n // areas\n vis.width = vis.config.containerWidth;\n vis.height = vis.config.containerHeight;\n vis.center = { x: 312, y: 312 };\n vis.svg = d3\n .select(vis.config.parentElement)\n .append(\"svg\")\n .attr(\"class\", \"chart\")\n .attr(\"width\", vis.config.containerWidth)\n .attr(\"height\", vis.config.containerHeight)\n .append(\"g\")\n .attr(\"transform\", `translate(${vis.center.x}, ${vis.center.y})`);\n\n // scales\n vis.radiusScale = d3\n .scalePow()\n .exponent(0.5)\n .range([15, 95])\n .domain([\n d3.min(vis.data, (d) => d.total_emissions),\n d3.max(vis.data, (d) => d.total_emissions),\n ]);\n vis.colorScale = d3\n .scaleOrdinal()\n .domain([\n \"Farm\",\n \"Land use change\",\n \"Transport\",\n \"Retail\",\n \"Packaging\",\n \"Animal feed\",\n \"Processing\",\n ])\n .range([\"#e1874b\", \"#1f78b4\", \"#bfc27d\", \"#446276\", \"#fccde5\", \"#b4de68\", \"#668fff\"]);\n // simulation\n vis.sim = d3\n .forceSimulation()\n .force(\"x\", d3.forceX(0).strength(0.0001))\n .force(\"y\", d3.forceY(0).strength(0.0001))\n .force(\n \"collision\",\n d3.forceCollide((d) => vis.radiusScale(d.total_emissions) + 1)\n );\n // defs\n var defs = vis.svg.append(\"defs\");\n vis.drawIcon = function (id) {\n defs.append(\"pattern\")\n .attr(\"id\", id)\n .attr(\"height\", \"100%\")\n .attr(\"width\", \"100%\")\n .attr(\"patternContentUnits\", \"objectBoundingBox\")\n .append(\"image\")\n .attr(\"height\", 1)\n .attr(\"width\", 1)\n .attr(\"preserveAspectRatio\", \"none\")\n .attr(\"xlink:href\", `icon/${id}.png`);\n return `url(#${id})`;\n };\n\n // defs\n (vis.glow = vis.svg.append(\"defs\").append(\"filter\").attr(\"id\", \"glow\")),\n vis.glow\n .append(\"feGaussianBlur\")\n .attr(\"stdDeviation\", \"0.5\")\n .attr(\"result\", \"coloredBlur\")\n .append(\"feMerge\");\n (vis.feMerge = vis.glow.append(\"feMerge\")),\n vis.feMerge.append(\"feMergeNode\").attr(\"in\", \"coloredBlur\"),\n vis.feMerge.append(\"feMergeNode\").attr(\"in\", \"SourceGraphic\");\n\n // background circle\n vis.svg\n .append(\"circle\")\n .transition()\n .duration(200)\n .attr(\"r\", 310)\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"#999999\")\n .attr(\"stroke-width\", \"3px\");\n\n // color legend\n vis.legend_color = vis.svg\n .append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", `translate(${vis.height / 2},${-vis.height / 2 + 20} )`);\n vis.legend_color\n .append(\"text\")\n .text(\"Most Emission Stage\")\n .attr(\"font-size\", \"20px\")\n .attr(\"alignment-baseline\", \"central\")\n .attr(\"font-family\", \"Marker Felt\")\n .attr(\"transform\", `translate(0, 10)`);\n const stages = [\n \"farm\",\n \"land_use_change\",\n \"animal_feed\",\n \"processing\",\n \"packaging\",\n \"transport\",\n \"retail\",\n ];\n const stages_names = [\n \"Farm\",\n \"Land use change\",\n \"Animal feed\",\n \"Processing\",\n \"Packaging\",\n \"Transport\",\n \"Retail\",\n ];\n for (let i = 0; i < stages.length; i++) {\n vis.legend_color\n .append(\"rect\")\n .attr(\"width\", 15)\n .attr(\"height\", 15)\n .attr(\"fill\", vis.colorScale(stages_names[i]))\n .attr(\"opacity\", 0.6)\n .attr(\"transform\", `translate(0, ${20 + i * 20})`);\n\n vis.legend_color\n .append(\"text\")\n .text(stages_names[i])\n .attr(\"transform\", `translate(18, ${27 + i * 20})`)\n .attr(\"fill\", \"#5a5a5a\")\n .attr(\"font-size\", \"13px\")\n .attr(\"alignment-baseline\", \"central\");\n }\n\n // size legend\n vis.legend_size = vis.svg\n .append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", `translate(${vis.center.x}, ${vis.center.y - 200})`);\n vis.legend_size\n .append(\"text\")\n .text(\"Total Emission\")\n .attr(\"font-size\", \"20px\")\n .attr(\"alignment-baseline\", \"central\")\n .attr(\"font-family\", \"Marker Felt\")\n .attr(\"transform\", `translate(0, 10)`);\n vis.legend_size\n .append(\"text\")\n .text(\"(kg CO₂ / kg product)\")\n .attr(\"font-size\", \"20px\")\n .attr(\"alignment-baseline\", \"central\")\n .attr(\"font-family\", \"Marker Felt\")\n .attr(\"transform\", `translate(0, 35)`);\n vis.legend_size\n .append(\"circle\")\n .attr(\"r\", vis.radiusScale(30))\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"#999999\")\n .attr(\"stroke-width\", \"3px\")\n .attr(\n \"transform\",\n `translate(${vis.radiusScale(30) - 10}, ${vis.radiusScale(30) + 55})`\n );\n vis.legend_size\n .append(\"circle\")\n .attr(\"r\", vis.radiusScale(10))\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"#999999\")\n .attr(\"stroke-width\", \"3px\")\n .attr(\n \"transform\",\n `translate(${vis.radiusScale(30) - 10}, ${\n vis.radiusScale(30) + vis.radiusScale(2) + 55\n })`\n );\n vis.legend_size\n .append(\"circle\")\n .attr(\"r\", vis.radiusScale(1))\n .attr(\"fill\", \"none\")\n .attr(\"stroke\", \"#999999\")\n .attr(\"stroke-width\", \"3px\")\n .attr(\n \"transform\",\n `translate(${vis.radiusScale(30) - 10}, ${\n vis.radiusScale(30) + vis.radiusScale(12.5) + 55\n })`\n );\n vis.legend_size\n .append(\"line\")\n .attr(\"x1\", vis.radiusScale(30) - 10)\n .attr(\"x2\", vis.radiusScale(30) + 110)\n .attr(\"y1\", 55)\n .attr(\"y2\", 55)\n .attr(\"stroke-width\", \"3px\")\n .attr(\"stroke\", \"#999999\");\n vis.legend_size\n .append(\"text\")\n .text(\"30\")\n .attr(\"fill\", \"#5a5a5a\")\n .attr(\"font-size\", \"15px\")\n .attr(\"alignment-baseline\", \"central\")\n .attr(\"transform\", `translate(${vis.radiusScale(30) + 85}, 65)`);\n vis.legend_size\n .append(\"line\")\n .attr(\"x1\", vis.radiusScale(30) - 10)\n .attr(\"x2\", vis.radiusScale(30) + 110)\n .attr(\"y1\", vis.radiusScale(30) + 35.7)\n .attr(\"y2\", vis.radiusScale(30) + 35.7)\n .attr(\"stroke-width\", \"3px\")\n .attr(\"stroke\", \"#999999\");\n vis.legend_size\n .append(\"text\")\n .text(\"10\")\n .attr(\"fill\", \"#5a5a5a\")\n .attr(\"font-size\", \"15px\")\n .attr(\"alignment-baseline\", \"central\")\n .attr(\n \"transform\",\n `translate(${vis.radiusScale(30) + 85}, ${vis.radiusScale(30) + 45.7})`\n );\n vis.legend_size\n .append(\"line\")\n .attr(\"x1\", vis.radiusScale(30) - 10)\n .attr(\"x2\", vis.radiusScale(30) + 110)\n .attr(\"y1\", vis.radiusScale(30) + 82.8)\n .attr(\"y2\", vis.radiusScale(30) + 82.8)\n .attr(\"stroke-width\", \"3px\")\n .attr(\"stroke\", \"#999999\");\n vis.legend_size\n .append(\"text\")\n .text(\"1\")\n .attr(\"fill\", \"#5a5a5a\")\n .attr(\"font-size\", \"15px\")\n .attr(\"alignment-baseline\", \"central\")\n .attr(\n \"transform\",\n `translate(${vis.radiusScale(30) + 93}, ${vis.radiusScale(30) + 92.8})`\n );\n\n // icon legend\n vis.legend_icon = vis.svg\n .append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", `translate(${vis.center.x}, ${vis.center.y - 280})`);\n vis.legend_icon\n .append(\"circle\")\n .attr(\"fill\", vis.drawIcon(\"Icon\"))\n .attr(\"r\", 20)\n .attr(\"stroke\", \"#5a5a5a\")\n .attr(\"stroke-width\", \"3px\")\n .attr(\"transform\", \"translate(20,20)\");\n vis.legend_icon\n .append(\"text\")\n .text(\"icon indicates the\")\n .attr(\"fill\", \"#5a5a5a\")\n .attr(\"font-size\", \"15px\")\n .attr(\"transform\", \"translate(45, 40)\");\n vis.legend_icon\n .append(\"text\")\n .text(\"emission of CO₂ > 1.5 kg\")\n .attr(\"fill\", \"#5a5a5a\")\n .attr(\"font-size\", \"15px\")\n .attr(\"transform\", \"translate(0, 60)\");\n vis.svg\n .append(\"g\")\n .attr(\"transform\", `translate(500, ${vis.center.y - 1000})`)\n .append(\"line\")\n .attr(\"x1\", 0)\n .attr(\"x2\", 0)\n .attr(\"y1\", 0)\n .attr(\"y2\", 1100)\n .attr(\"stroke-width\", \"3px\")\n .attr(\"stroke\", \"#999999\");\n\n // page button\n vis.button = vis.svg\n .append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", `translate(${-vis.center.x + 80}, ${vis.center.y - 6})`);\n vis.button\n .append(\"circle\")\n .attr(\"class\", \"pagebtn\")\n .classed(\"one\", true)\n .attr(\"r\", 30)\n .attr(\"stroke\", \"#5a5a5a\")\n .attr(\"stroke-width\", \"3px\")\n .attr(\"fill\", vis.drawIcon(\"One\"))\n .on(\"click\", function (event) {\n let page = 1;\n if (d3.select(this).classed(\"two\")) {\n page = 2;\n }\n if (d3.select(this).classed(\"three\")) {\n page = 3;\n }\n switch (page) {\n case 1:\n d3.select(this)\n .classed(\"one\", false)\n .classed(\"two\", true)\n .attr(\"fill\", vis.drawIcon(\"Two\"));\n vis.dispatcher.call(\"toP2\", event);\n break;\n case 2:\n d3.select(this)\n .classed(\"two\", false)\n .classed(\"three\", true)\n .attr(\"fill\", vis.drawIcon(\"Three\"));\n vis.dispatcher.call(\"toP3\", event);\n break;\n case 3:\n d3.select(this)\n .classed(\"three\", false)\n .classed(\"one\", true)\n .attr(\"fill\", vis.drawIcon(\"One\"));\n vis.dispatcher.call(\"toP1\", event);\n break;\n }\n });\n vis.buttonlabel = vis.svg\n .append(\"g\")\n .attr(\"class\", \"legend\")\n .attr(\"transform\", `translate(${-vis.center.x + 120}, ${vis.center.y})`);\n vis.buttonlabel\n .append(\"text\")\n .text(\"Switch Page\")\n .attr(\"font-size\", \"20px\")\n .attr(\"fill\", \"#5a5a5a\")\n .attr(\"alignment-baseline\", \"central\");\n d3.select(\".page\").append(\"div\").attr(\"id\", \"tooltip1\");\n }", "function init() {\n\t\tbuildBar();\n\t\tbuildBubble();\n\t\tbuildGauge();\n\t\t//buildMeta();\n\t}", "constructor() {\r\n // Svg of left chart\r\n this.svgLeft = d3.select(\"#dashboard-svg-left\");\r\n this.wLeft = this.svgLeft._groups[0][0].clientWidth;\r\n this.hLeft = this.svgLeft._groups[0][0].clientHeight;\r\n // Svg of right chart\r\n this.svgRight = d3.select(\"#dashboard-svg-right\");\r\n this.wRight = this.svgRight._groups[0][0].clientWidth;\r\n this.hRight = this.svgRight._groups[0][0].clientHeight;\r\n // Initialize drop-down menu of state\r\n this.initDashboardSelect();\r\n // Initialize chart\r\n this.initChart();\r\n }", "init() {\n var me = this,\n svg = document.createElementNS(this.xmlns, 'svg');\n svg.setAttribute('id', this.id);\n svg.setAttribute('width', this.coorWidth);\n svg.setAttribute('height', this.coorHeight);\n svg.setAttribute('zoomAndPan', this.zoomAndPan);\n if (this.style) {\n svg.setAttribute('style', this.style);\n }\n if (this.onload) {\n svg.setAttribute('onload', this.onLoad);\n }\n me._docElementNS = svg;\n if (this.children.length > 0) {\n for (var i = 0; i < this.children.length; i++) {\n var child = this.children[i];\n child.parent = this;\n if (child.docElementNS) {\n this.docElementNS.appendChild(child.docElementNS);\n }\n }\n }\n if (me.autoBind) {\n me.bind();\n }\n }", "function initViz() {\n viz = new tableau.Viz(vizContainer, url, options);\n}", "function initialize() {\n if ( TypeUtils.isEmptyObject(config) ) Functions.error('Container configuration missing');\n \n initializedModules = 0;\n \n initAxis('xAxis');\n initAxis('yAxis');\n initAxis('xAxis2');\n initAxis('yAxis2');\n initAxis('background');\n \n var plotConfig = config.modules.plot;\n if ( !plotConfig ) return;\n var plot = modules.plot = load(plotConfig.id);\n var dataHandler = new SingleChartDataHandler(data); \n plot.data(dataHandler.getDataAdapter());\n \n var props;\n if ( plotConfig.configure ) {\n props = resolveProperties(plotConfig.configure);\n plot.properties(props);\n }\n \n if(plot.dispatch){\n var dis = plot.dispatch();\n if(dis.initialized) { initializedModules++; dis.on('initialized.xycontainer', initialized);};\n if(dis.showTooltip) dis.on('showTooltip.xycontainer', showTooltip);\n if(dis.hideTooltip) dis.on('hideTooltip.xycontainer', hideTooltip);\n }\n \n var dataLabelConfig = config.modules.dataLabel;\n if(TypeUtils.isExist(dataLabelConfig) && TypeUtils.isExist(plot.dataLabel)){\n var dataLabel = modules.dataLabel = load(dataLabelConfig.id);\n plot.dataLabel(dataLabel);\n dataLabel.plot(plot);\n if ( dataLabelConfig.configure ) {\n props = resolveProperties(dataLabelConfig.configure);\n dataLabel.properties(props);\n }\n }\n \n if ( modules.xAxis && !selections.xAxis )\n selections.xAxis = parent.append('g').attr('class', 'xAxis');\n if ( modules.xAxis2 && !selections.xAxis2 )\n selections.xAxis2 = parent.append('g').attr('class', 'xAxis2');\n if ( modules.yAxis && !selections.yAxis ) \n selections.yAxis = parent.append('g').attr('class', 'yAxis');\n if ( modules.yAxis2 && !selections.yAxis2 ) \n selections.yAxis2 = parent.append('g').attr('class', 'yAxis2');\n if ( modules.plot && !selections.plot ) \n selections.plot = parent.append('g').attr('class', 'plot');\n if ( modules.background && !selections.background ) \n selections.background = parent.insert('g', ':first-child').attr('class', 'background'); \n }", "function setupGraph() {\n graphImg = d3\n .select(\"#plotarea\")\n .append(\"svg\")\n .attr(\"width\", displayWidth)\n .attr(\"height\", displayHeight)\n .attr(\"class\", \"chart\");\n\n // X - Axis\n // We create a group element to nest our bottom axes labels.\n graphImg.append(\"g\").attr(\"class\", \"xText\");\n graphImg.append(\"g\").attr(\"class\", \"yText\");\n}", "function init() {\n d3.select(\"#more_info\").node().value = \"\";\n buildPlot(data);\n}", "function initDashboard() {\n \n tempGauge(city);\n percipGauge(city);\n generateChart();\n generate_prcp();\n addParagraph(city) \n}", "function initViz() {\n console.log(\"loadingviz\");\n viz = new tableau.Viz(vizContainer, url, options);\n}", "function initViz() {\n var containerDiv = document.getElementById(\"vizContainer\"),\n // define url to a Overview view from the Superstore workbook on my tableau dev site\n url = \"https://10ax.online.tableau.com/t/loicplaygrounddev353480/views/Superstore/Overview?:showAppBanner=false&:display_count=n&:showVizHome=n\";\n options = {\n hideTabs: true,\n onFirstInteractive: function () {\n var worksheets = getWorksheets(viz);\n // process all filters used on the dashboard initially and subscribe to any filtering event comming out of the dashboard to recompute the filters on the webpage.\n processFilters(worksheets);\n viz.addEventListener('filterchange', (filterEvent) => {\n var worksheets = getWorksheets(filterEvent.getViz());\n processFilters(worksheets);\n });\n viz.addEventListener(tableau.TableauEventName.MARKS_SELECTION, (marksEvent) => {\n var worksheets = getWorksheets(marksEvent.getViz());\n processFilters(worksheets);\n });\n }\n };\n\n viz = new tableau.Viz(containerDiv, url, options);\n}", "function setUpVisual() {\n\n var container = d3.select('#visual').node().getBoundingClientRect();\n\n var margin = { top: 30 , right: 30 , bottom: 30 , left: 30 },\n width = container.width - margin.left - margin.right,\n height = container.height - margin.top - margin.bottom;\n\n var svg = d3.select('#visual')\n .append('svg')\n .attr('width', '100%')\n .attr('height', '100%')\n .attr('viewBox', '0 0 ' + container.width + ' ' + container.height)\n .append('g').attr('transform', 'translate(' + margin.left + ', ' + margin.top + ')') // to translate\n .append('g').attr('class', 'chart-g'); // to base zoom on a 0, 0 coordinate system\n\n // Add to global\n vis.dims = { width: width, height: height, margin: margin };\n vis.elements = { svg: svg };\n\n} // setUpVisual()", "_loadVisualization(){\n const filePath = './src/assets/data/hospital/hospitalData.json'\n this._visualizationManager = new VisualizationManager(this.scene, this.earth);\n this._visualizationManager\n .createLayer(\n VisualizationLayerType.PointLayer, \n filePath\n );\n this._visualizationManager\n .createLayer(\n VisualizationLayerType.ArcLayer,\n filePath\n );\n }", "initVis(){\n var vis = this;\n\n // SVG drawing area\n vis.svg = d3.select(\"#\" + vis.parentElement).append(\"svg\")\n .attr(\"width\", vis.width + vis.margin.left + vis.margin.right)\n .attr(\"height\", vis.height + vis.margin.top + vis.margin.bottom)\n vis.g = vis.svg.append(\"g\")\n .attr(\"transform\", \"translate(\" + vis.margin.left + \",\" + vis.margin.top + \")\");\n \n\n\n // Scales and axes\n vis.x = d3.scaleLinear()\n .range([0,vis.width]);\n\n vis.countryScale = d3.scaleBand()\n .rangeRound([0, vis.width])\n .paddingInner(0.2);\n\n\n vis.y = d3.scaleLinear()\n .range([vis.height,0]);\n\n vis.xAxis = d3.axisBottom()\n .scale(vis.x);\n\n vis.yAxis = d3.axisLeft()\n .scale(vis.y);\n\n vis.g.append(\"g\")\n .attr(\"class\", \"x-axis axis\")\n .attr(\"transform\", \"translate(0,\" + vis.height + \")\");\n\n vis.g.append(\"g\")\n .attr(\"class\", \"y-axis axis\");\n\n // Axis title\n vis.g.append(\"text\")\n .attr(\"x\", -50)\n .attr(\"y\", -8)\n .text(vis.yAttr);\n\n // Axis title\n vis.g.append(\"text\")\n .attr('class', 'xlabel')\n .attr(\"x\", vis.width/2)\n .attr(\"y\", vis.height + 40)\n .style('text-anchor','middle')\n .text(vis.xAttr);\n\n\n // (Filter, aggregate, modify data)\n vis.wrangleData();\n }", "preRender() {\n // draw the container svg for the chart\n this.dom.svg = d3.select(this.dom.graphContainer).append('svg')\n .attr('width', this.width + this.margin.left + this.margin.right)\n .attr('height', this.height + this.margin.top + this.margin.bottom)\n .append('g')\n .attr('transform', `translate(${this.margin.left}, ${this.margin.top})`);\n\n this.dom.svg.append('g')\n .attr('class', 'data');\n\n this.setupAxis('xAxis');\n this.setupLegend();\n }", "function initViz() {\n console.log(\"Hello!\");\n // no const with viz as it has been assigned by let at the top\n viz = new tableau.Viz(vizContainer, url, options);\n}", "function init() {\n // Load and style highCharts library. https://www.highCharts.com/docs.\n highchartsExport( Highcharts );\n applyThemeTo( Highcharts );\n\n _containerDom = document.querySelector( '#chart-section' );\n _resultAlertDom = _containerDom.querySelector( '#chart-result-alert' );\n _failAlertDom = _containerDom.querySelector( '#chart-fail-alert' );\n _chartDom = _containerDom.querySelector( '#chart' );\n _dataLoadedDom = _containerDom.querySelector( '.data-enabled' );\n\n startLoading();\n }", "function init() {\n // console.log( new filter() );\n // config.data = (data.data) ? data.filter({\"regulation\": \"CAIR\"}) : null;\n config.data = ( data.data ) ? filter.filter( data.data ) : null;\n config.width = ( ui.components.chartSVG[ 0 ][ 0 ].width.animVal.value * 0.9 );\n config.height = ( ui.components.chartSVG[ 0 ][ 0 ].height.animVal.value * 0.9 ) / config.lines;\n }", "initVis() {\n let vis = this;\n // Define size of SVG drawing area\n vis.svg = d3\n .select(vis.config.parentElement)\n .append(\"svg\")\n .attr(\"width\", vis.config.containerWidth)\n .attr(\"height\", vis.config.containerHeight);\n\n // Calculate inner chart size. Margin specifies the space around the actual chart.\n vis.width =\n vis.config.containerWidth -\n vis.config.margin.left -\n vis.config.margin.right;\n vis.height =\n vis.config.containerHeight -\n vis.config.margin.top -\n vis.config.margin.bottom;\n\n // Append group element that will contain our actual chart\n // and position it according to the given margin config\n vis.chartArea = vis.svg\n .append(\"g\")\n .attr(\n \"transform\",\n `translate(${vis.config.margin.left},${vis.config.margin.top})`\n );\n\n vis.popScale = d3.scaleLinear().range([1, 10]);\n\n vis.chart = vis.chartArea.append(\"g\");\n\n // Axes titles and descriptors\n vis.svg\n .append(\"text\")\n .attr(\"class\", \"chart-title\")\n .attr(\"x\", vis.config.containerWidth / 2)\n .attr(\"y\", 0)\n .attr(\"dy\", \".71em\")\n .style(\"font-size\", \"20px\")\n .style(\"text-anchor\", \"middle\")\n .text(\"World Map\");\n\n vis.svg\n .append(\"text\")\n .attr(\"class\", \"legend\")\n .attr(\"x\", vis.config.containerWidth / 2)\n .attr(\"y\", 20)\n .attr(\"dy\", \".71em\")\n .style(\"font-size\", \"16px\")\n .style(\"text-anchor\", \"middle\")\n .text(\"Width of bar = magnitude of incoming PRs\");\n\n vis.projection = d3\n .geoMercator()\n .scale(130)\n .translate([vis.width / 2, (vis.height / 2) * 1.4]);\n\n // Draw the map\n vis.svg\n .append(\"g\")\n .selectAll(\".map\")\n .data(vis.mapData.features)\n .enter()\n .append(\"path\")\n .attr(\"fill\", \"#b8b8b8\")\n .attr(\"d\", d3.geoPath().projection(vis.projection))\n .style(\"stroke\", \"#fff\")\n .style(\"stroke-width\", 0);\n\n vis.updateVis();\n }", "function svgInit(svg){\n // Set the SVG size\n svg\n .attr('width', width)\n .attr('height', height);\n\n // Create and translate the container group\n var g = svg.append('g')\n .attr('class', 'chart-content')\n .attr('transform', 'translate(' + [margin.top, margin.left] + ')');\n\n // Add a background rectangle\n g.append('rect')\n .attr('width', width - margin.left - margin.right)\n .attr('height', height - margin.top - margin.bottom)\n .attr('fill', 'white');\n\n\n // Other Version\n // Compute the width and height of the charting area\n var margin = chart.margin(),\n width = chart.width() - margin.left - margin.right,\n height = chart.height() - margin.top - margin.bottom,\n translate = windmill.svg.translate;\n\n // Set the size of the svg element\n svg\n .attr('width', chart.width())\n .attr('height', chart.height());\n\n // Chart Container\n svg.append('g')\n .attr('class', 'chart')\n .attr('transform', translate(margin.left, margin.top));\n\n // X Axis Container\n svg.append('g')\n .attr('class', 'axis xaxis')\n .attr('transform', translate(margin.left, margin.top + height));\n\n // Y Axis Container\n svg.append('g')\n .attr('class', 'axis yaxis')\n .attr('transform', translate(margin.left, margin.top));\n}", "function init(){\n var $ = go.GraphObject.make; // for conciseness in defining templates\n\n myDiagram =\n $(go.Diagram, \"myDiagramDiv\", // must name or refer to the DIV HTML element\n { allowDrop: true }); // must be true to accept drops from the Palette\n\n\n\n\n\n\n\n\n}", "function init() {\n console.log('state', state)\n // + DEFINE SCALES\nconst xScale = d3.scaleLinear()\n.domain(d3.extent(state.data, d=> d.ideologyScore2020))\n.range([])\n\n // + DEFINE AXES\n\n // + UI ELEMENT SETUP\n // + add dropdown options\n // + add event listener for 'change'\n\n // + CREATE SVG ELEMENT\n\n // + CREATE AXES\n\n // draw(); // calls the draw function\n}", "init () {\n this.renderPieCharts(40,100,300,300);\n }", "init() {\n\t\t\t\tstructureData()\n\n\t\t\t\t$tooltip = d3.selectAll('.chart figure').append('div').attr('class', 'tooltip')\n\t\t\t\t$vertical = d3.selectAll('.chart figure').append('div').attr('class', 'vertical')\n\n\t\t\t\t$svg = $sel.append('svg').attr('class', 'pudding-chart');\n\t\t\t\t$axis = $svg.append('g').attr('class', 'g-axis');\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// offset chart for margins\n\t\t\t\t$g.attr('transform', `translate(${marginLeft}, ${marginTop})`);\n\n\t\t\t\t// create axis\n\t\t\t\txAxisGroup = $axis.append('g')\n\t\t\t\t\t.attr('class', 'x axis')\n\n\t\t\t\tyAxisGroup = $axis.append('g')\n\t\t\t\t\t.attr('class', 'y axis')\n\n\t\t\t\t$fLabel = $g.append('text').attr('class', 'f-label').text('Women')\n\t\t\t\t$mLabel = $g.append('text').attr('class', 'm-label').text('Men')\n\n\t\t\t\t$biggerLabelGroup = $svg.append('g')\n\t\t\t\t$smallerLabelGroup = $svg.append('g')\n\n\t\t\t\t$biggerLabel = $biggerLabelGroup.append('text')\n\t\t\t\t\t\t.text('Bigger median hair')\n\t\t\t\t\t\t.attr('class', 'axis-label bigger-axis-label')\n\n\t\t\t\t$smallerLabel = $smallerLabelGroup.append('text')\n\t\t\t\t\t\t.text('Smaller median hair')\n\t\t\t\t\t\t.attr('class', 'axis-label smaller-axis-label')\n\n\t\t\t\t$upArrow = $biggerLabelGroup.append('svg:image')\n\t\t\t\t\t\t.attr('xlink:href', `assets/images/arrow-up.svg`)\n\t\t\t\t\t\t.attr('width', '20px')\n\t\t\t\t\t\t.attr('height', '20px')\n\n\t\t\t\t$downArrow = $smallerLabelGroup.append('svg:image')\n\t\t\t\t\t\t.attr('xlink:href', `assets/images/arrow-down.svg`)\n\t\t\t\t\t\t.attr('width', '20px')\n\t\t\t\t\t\t.attr('height', '20px')\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g').attr('class', 'g-vis');\n\n\t\t\t\tlineGroup = $svg.select('.g-vis')\n\n\t\t\t\tfemaleLine = lineGroup.append('path')\n\t\t\t\t\t.datum(femaleData)\n\t\t\t\t\t.attr('class', 'Female')\n\n\t\t\t\tmaleLine = lineGroup.append('path')\n\t\t\t\t\t.datum(maleData)\n\t\t\t\t\t.attr('class', 'Male')\n\n\t\t\t\tdrawArea = $vis.append('path')\n\t\t\t\t\t.datum(dataByYear)\n\t\t\t\t\t.attr('class', 'area')\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function initSVG() {\n \t\tsvg = d3.select('body')\n \t\t.append('svg')\n \t\t.attr('viewBox', '0 0 600 600')\n \t\t.attr('style', 'width: 300px; height: 300px;');\n \t}", "_setGraphContent () {\n const bb = this._boundingBox;\n const height = bb.offsetHeight;\n const width = bb.offsetWidth;\n\n let svg = d3.select(bb).append(\"svg\")\n .attr(\"width\", width)\n .attr(\"height\", height)\n .append(\"g\")\n .attr(\"transform\", \"translate(50,0)\");\n\n this._setSVG(svg);\n }", "initializeVizSpace() {\n this.svg = d3.select(this.node)\n .attrs({\n viewBox: `0 0 ${this.getSvgOuterWidth()} ${this.getSvgOuterHeight()}`,\n preserveAspectRatio: `xMidYMid meet`\n })\n ;\n\n this.svg = this.svg.append(\"g\")\n .attrs({\n \"transform\": `translate(${this.props.svgSize.margin.left}, ${this.props.svgSize.margin.top})`,\n })\n ;\n }", "function init() {\n // Used for computing centroids in coordinate space\n identityProjection = d3.geo.path()\n .projection({stream: function(d) { return d; }});\n\n\td3.json('data/geodata.json', function(error, data) {\n // Extract topojson features\n for (var key in data['objects']) {\n topoData[key] = topojson.feature(data, data['objects'][key]);\n }\n\n render();\n $(window).resize(utils.throttle(onResize, 250));\n });\n}", "setUp() {\n this.g = d3\n .select(this.root)\n .append(\"g\");\n this.update();\n }", "_initializeChart() {\n const {\n element,\n rootNode,\n zoomBehaviour,\n selectedProcessId\n } = this.getProperties('element', 'rootNode', 'zoomBehaviour', 'selectedProcessId');\n const el = select(element);\n\n // Needed for zooming\n this.centeringElement = el.select('.centering-element');\n\n const parent = el.select('svg');\n parent.call(zoomBehaviour);\n\n this.parent = parent;\n if (rootNode) {\n // Reset Zoom\n const transform = zoomIdentity\n .scale(1)\n .translate(0, 0);\n zoomBehaviour.transform(parent, transform);\n\n this._buildChart(rootNode);\n addSelectedClass(selectedProcessId);\n }\n }", "init() {\n // Define this vis\n const vis = this;\n\n // Init topCounter from target\n vis.topCounterEl = d3.select(`#${vis.target}`);\n\n // Call wrangle\n vis.wrangle();\n }", "function init() {\n\n rendererStats.domElement.style.position = 'absolute';\n rendererStats.domElement.style.left = '0px';\n rendererStats.domElement.style.bottom = '0px';\n document.body.appendChild(rendererStats.domElement);\n\n graphYPoint = 0;\n buildScene();\n initGraph();\n updateGraph();\n setInterval(function() {\n getMem();\n updateGraph();\n }, 1000);\n render();\n}", "initVis() {\n let vis = this;\n\n // Define size of SVG drawing area\n vis.svg = d3.select(vis.config.parentElement)\n .attr('width', vis.config.containerWidth)\n .attr('height', vis.config.containerHeight)\n .attr(\"rx\", 20).attr(\"ry\", 20);\n\n // add a lightgray outline for the rect of lexis svg\n vis.svg\n .append(\"rect\")\n .attr(\"width\", vis.config.containerWidth)\n .attr(\"height\", vis.config.containerHeight)\n .attr(\"stroke\", \"lightgray\")\n .attr(\"fill\", \"none\");\n\n\n // Append group element that will contain our actual chart \n // and position it according to the given margin config\n vis.chartArea = vis.svg.append('g')\n .attr('transform', `translate(${vis.config.margin.left},${vis.config.margin.top})`);\n\n\n\n // define inner box size\n vis.innerHeight =\n vis.config.containerHeight -\n vis.config.margin.top -\n vis.config.margin.bottom;\n\n vis.innerWidth =\n vis.config.containerWidth -\n vis.config.margin.left -\n vis.config.margin.right;\n\n vis.chart = vis.chartArea.append('g');\n\n\n /**\n * Have implemented this part in HTML file\n */\n // Create default arrow head\n // Can be applied to SVG lines using: `marker-end`\n // vis.chart.append('defs').append('marker')\n // .attr('id', 'arrow-head')\n // .attr('markerUnits', 'strokeWidth')\n // .attr('refX', '2')\n // .attr('refY', '2')\n // .attr('markerWidth', '10')\n // .attr('markerHeight', '10')\n // .attr('orient', 'auto')\n // .append('path')\n // .attr('d', 'M0,0 L2,2 L 0,4')\n // .attr('stroke', '#ddd')\n // .attr('fill', 'none');\n\n\n // apply clipping mask to 'vis.chart', restricting the region at the very beginning and end of a year\n vis.chart\n .append(\"defs\")\n .append(\"clipPath\")\n .attr(\"id\", \"chart-mask\")\n .append(\"rect\")\n .attr(\"width\", vis.config.containerWidth)\n .attr(\"height\", vis.config.containerHeight);\n vis.chart.attr(\"clip-path\", \"url(#chart-mask)\");\n\n // text label for lexischart\n vis.svg\n .append(\"text\")\n .attr(\"y\", 25)\n .attr(\"x\", 10)\n .attr(\"class\", \"text-label\")\n .text(\"Age\");\n\n // Todo: initialize scales, axes, static elements, etc.\n\n // define x-axis scale\n vis.yearScale = d3\n .scaleLinear()\n .domain([1950, 2021])\n .range([0, vis.innerWidth]);\n\n // define y-axis scale\n vis.ageScale = d3\n .scaleLinear()\n .domain([25, 95])\n .range([vis.innerHeight, 0]);\n\n //define y-axis\n vis.chartArea\n .append(\"g\")\n .call(d3.axisLeft(vis.ageScale).tickValues([40, 50, 60, 70, 80, 90]));\n\n // define x-axis\n vis.chartArea\n .append(\"g\")\n .attr(\"transform\", `translate(0,${vis.innerHeight})`)\n .call(d3.axisBottom(vis.yearScale).tickFormat(d3.format(\"\"))); // tickFormat can make x-axis tick's label without comma, like 1,950\n\n // remove path on the axis\n vis.chartArea.selectAll(\"path\").remove();\n\n // define tooltip\n d3.select(\"body\")\n .append(\"div\")\n .attr(\"class\", \"tip\")\n .attr(\"visible\", \"hidden\")\n .style(\"position\", \"absolute\");\n }", "function initializeViz() {\n var container = document.getElementById(\"vizcontainer\");\n var url = \"https://public.tableau.com/views/WorldIndicators/GDPpercapita\";\n var options = {\n width: container.offsetWidth,\n height: container.offsetHeight,\n onFirstInteractive: function () {\n workbook = viz.getWorkbook();\n activeSheet = workbook.getActiveSheet();\n publishedSheets = workbook.getPublishedSheetsInfo();\n annyangInit();\n var options = {\n maxRows: 0, // 0 is returning all rows\n ignoreAliases: false,\n ignoreSelection: true\n };\n //activeSheet.getUnderlyingDataAsync(options).then(function(d) {dataFunc(d)});\n //activeSheet.getSummaryDataAsync(options).then(function(t) {sumFunc(t)});\n //getFilters(activeSheet);\n buildSelectFilterCountryCmd();\n buildSelectFilterRegionCmd();\n buildFuzzyCmds();\n }\n };\n viz = new tableau.Viz(container, url, options);\n }", "function createVisualization(sequenceArray) {\r\n\r\n // Basic setup of page elements.\r\n initializeBreadcrumbTrail();\r\n\r\n updateBreadcrumbs(sequenceArray;\r\n\r\n // // For efficiency, filter nodes to keep only those large enough to see.\r\n // var nodes = partition.nodes(json)\r\n // .filter(function(d) {\r\n // return (d.dx > 0.005); // 0.005 radians = 0.29 degrees\r\n // });\r\n\r\n // var path = vis.data([json]).selectAll(\"path\")\r\n // .data(nodes)\r\n // .enter().append(\"path\")\r\n // .attr(\"display\", function(d) { return d.depth ? null : \"none\"; })\r\n // .attr(\"d\", arc)\r\n // .attr(\"fill-rule\", \"evenodd\")\r\n // .style(\"fill\", function(d) { return colors(d.label); })\r\n // .style(\"opacity\", 1)\r\n // .on(\"mouseover\", mouseover)\r\n // .on(\"click\", click);\r\n\r\n // // Add the mouseleave handler to the bounding circle.\r\n // d3.select(el).select(\"#\"+ el.id + \"-container\").on(\"mouseleave\", mouseleave);\r\n\r\n // // Get total size of the tree = value of root node from partition.\r\n // totalSize = path.node().__data__.value;\r\n\r\n // drawLegend();\r\n // d3.select(el).select(\".sunburst-togglelegend\").on(\"click\", toggleLegend);\r\n\r\n }", "function init() {\n\t\tvar defaultLayer = properties.tickerData.layers[0].value;\n\t\tactiveLayer=defaultLayer;\n\t\tdata = prepareDataSet(defaultLayer);\n\n\t\tvar subDomain = _subDomain;\n\n\t\tsvgDomain = subDomain.append(\"svg\")\n\t\t\t.attr(\"width\", 140 + \"px\")\n\t\t\t.attr(\"height\", 140 + \"px\")\n\t\t\t.style(\"position\", \"absolute\")\n\t\t\t.style(\"left\", 14 + \"em\")\n\t\t\t.style(\"top\", -1 + \"em\")\n\t\t//.attr(\"transform\", \"translate(\" + 0 + \",\" + 240 + \")\")\n\t\t.append(\"g\")\n\n\t\tpack = d3.layout.pack()\n\t\t\t.size([circlePackSize, circlePackSize])\n\t\t\t.value(function(d) {\n\t\t\t\treturn d.value\n\t\t\t})\n\n\t\tupdateGraph(data);\n\n\t}", "function chart(){\n\t\tthis.init();\n\t}", "constructor(main, climateData)\n {\n\n // ------------------------------------------------------------------------\n // Call super class for setting up the div container and climate data\n // ------------------------------------------------------------------------\n\n super(main, 'distribution-chart', climateData)\n }", "_initializeComponent() {\n //Heade\n this.elements.header = document.createElement(\"div\");\n this.elements.title = document.createElement(\"span\");\n this.elements.range = document.createElement(\"span\");\n\n this.elements.header.className = \"chart-header\";\n this.elements.title.className = \"chart-title\";\n this.elements.range.className = \"chart-range\";\n\n this.elements.header.appendChild(this.elements.title);\n this.elements.header.appendChild(this.elements.range);\n\n //Tooltip\n this.elements.tooltip = document.createElement(\"div\");\n this.elements.date = document.createElement(\"span\");\n this.elements.values = document.createElement(\"div\");\n\n this.elements.tooltip.className = \"chart-tooltip\";\n this.elements.date.className = \"chart-tooltip-date\";\n this.elements.values.className = \"chart-tooltip-values\";\n\n this.elements.tooltip.appendChild(this.elements.date);\n this.elements.tooltip.appendChild(this.elements.values);\n\n //Render\n this.elements.render = document.createElement(\"div\");\n this.elements.chart = document.createElement(\"canvas\");\n this.elements.layout = document.createElement(\"canvas\");\n\n this.elements.render.className = \"chart-render\";\n this.elements.chart.className = \"chart-render-chart\";\n this.elements.layout.className = \"chart-render-layout\";\n\n this.elements.render.appendChild(this.elements.chart);\n this.elements.render.appendChild(this.elements.layout);\n\n //Preview\n this.elements.control = document.createElement(\"div\");\n this.elements.preview = document.createElement(\"canvas\");\n this.elements.select = document.createElement(\"div\");\n this.elements.draggerLeft = document.createElement(\"div\");\n this.elements.draggerRight = document.createElement(\"div\");\n this.elements.coverLeft = document.createElement(\"div\");\n this.elements.coverRight = document.createElement(\"div\");\n\n this.elements.control.className = \"chart-control\";\n this.elements.preview.className = \"chart-preview\";\n this.elements.select.className = \"chart-select\";\n this.elements.draggerLeft.className = \"chart-dragger chart-dragger-left\";\n this.elements.draggerRight.className = \"chart-dragger chart-dragger-right\";\n this.elements.coverLeft.className = \"chart-cover chart-cover-left\";\n this.elements.coverRight.className = \"chart-cover chart-cover-right\";\n\n this.elements.control.appendChild(this.elements.preview);\n this.elements.control.appendChild(this.elements.coverLeft);\n this.elements.control.appendChild(this.elements.select);\n this.elements.select.appendChild(this.elements.draggerLeft);\n this.elements.select.appendChild(this.elements.draggerRight);\n this.elements.control.appendChild(this.elements.coverRight);\n\n //Graph buttons container\n this.elements.graphs = document.createElement(\"div\");\n\n this.elements.graphs.className = \"chart-graphs\";\n\n //Main container\n this.elements.container.className += \" chart-container\";\n\n this.elements.container.appendChild(this.elements.header);\n this.elements.container.appendChild(this.elements.tooltip);\n this.elements.container.appendChild(this.elements.render);\n this.elements.container.appendChild(this.elements.control);\n this.elements.container.appendChild(this.elements.graphs);\n }", "function render() {\n if (window._env === 'development') console.debug('RENDER');\n initDynamicSentence();\n initMapChart();\n initHighcharts();\n initBubbleChart();\n initSankeyChart();\n initBubbleChart();\n initTableBody();\n }", "function init() {\n //Creating instances for each visualization\n \n d3.csv(\"data/timesMergedData.csv\", function (error, schoolData) {\n \n var filterChart = new FilterChart(schoolData);\n });\n }", "init() {\n let svg = '<path' +\n ' id=\"' + this.id +'\"';\n\n if (this.stroke) {\n svg += ' stroke=\"' + this.stroke + '\"';\n }\n if (this.strokeWidth) {\n svg += ' stroke-width=\"' + this.strokeWidth + '\"';\n }\n if (this.opacity) {\n svg += ' opacity=\"' + this.opacity + '\"';\n }\n if (this.data) {\n svg += ' d=\"' + this.data + '\"';\n }\n svg+= '></path>'\n this.innerHTML = svg;\n }", "function drawVisualization() {\n // Create and populate a data table.\n var data = new vis.DataSet();\n\n $.getJSON('/rawstars', function(stars) { \n for (i in stars) {\n var x = stars[i].x,\n y = stars[i].y,\n z = stars[i].z;\n starMemos[getKey(stars[i])] = stars[i];\n data.add({\n x: x,\n y: y,\n z: z,\n style: stars[i].lum\n });\n }\n\n // specify options\n var options = {\n width: '100%',\n height: '100%',\n style: 'dot-color',\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5,\n legendLabel: \"Luminosity\",\n tooltip: function(star) {return generateTooltip(star);}\n };\n\n // create a graph3d\n var container = document.getElementById('mygraph');\n graph3d = new vis.Graph3d(container, data, options);\n });\n}", "constructor (config) {\n super(config)\n this.svg.height = this.svg.width * (204/114)\n this.svg.svgRoot = document.createElementNS(this.NS, 'svg')\n this.svg.svgRoot.setAttribute('width', this.svg.width)\n this.svg.svgRoot.setAttribute('height', this.svg.height)\n this.svg.snapRoot = Snap(this.svg.svgRoot)\n }", "function setup(){\n loadData(\"life_expectancy_data_csv.csv\", \"fertility_rate_data_csv.csv\", \"africa_scatterplot.csv\");\n _vis = document.getElementById(\"vis\");\n _vis = d3.select(\"#vis\");\n // grab our container's dimension\n _vis_width = d3.select(\"#vis\").node().getBoundingClientRect().width;\n _vis_height = d3.select(\"#vis\").node().getBoundingClientRect().height;\n\n _vis2 = document.getElementById(\"vis2\");\n _vis2 = d3.select(\"#vis2\");\n // grab our container's dimension\n _vis2_width = d3.select(\"#vis2\").node().getBoundingClientRect().width;\n _vis2_height = d3.select(\"#vis2\").node().getBoundingClientRect().height;\n}", "init() {\n\n\t\t\t\t$svg = $svgContainer.append('svg').at('class', d => `word-cloud__chart ${d.key}`)\n\t\t\t\t$wordcloud = $svg.append(\"g\").at('class', d => `word-cloud ${d.key}`)\n\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// offset chart for margins\n\t\t\t\t$g.at('transform', `translate(${marginLeft}, ${marginTop})`);\n\n\t\t\t\t// create axis\n\t\t\t\t$axis = $svg.append('g.g-axis');\n\n\t\t\t\tChart.resize();\n\n\t\t\t\tconst initWord = d3.selectAll(`[data-attribute=\"boer\"]`)\n\t\t\t\tinitWord.classed('clickedWord', true)\n\n\t\t\t\tChart.render();\n\t\t\t}", "function init() {\r\n initBars();\r\n bindResizeEvents();\r\n bindMouseMove();\r\n }", "function init() {\n d3.json(\"samples.json\").then(function(data){\n buildPlots(data.names[0]);\n buildDemo(data.names[0]);\n })}", "function init() {\n initVisualization();\n \n addSimulationControls(play, pause, step, stop_movement);\n \n addParamControls(\"#sliders\", params, update_params); \n}", "init() {\n // setting up metadata section\n $meta = $sel.append('div')\n .attr('class', 'meta__container')\n\n const $title = $meta.append('h3')\n .attr('class', 'letters-title')\n .text(position === 'first' ? 'Names that start with...' : 'Names that end with...')\n\n\n\t\t\t\t// setting up viz section\n $vizCont = $sel.append('div')\n .attr('class', 'chart__container')\n\n\t\t\t\t// setting up legend\n\t\t\t\t$legend = $sel.append('div')\n\t\t\t\t\t.attr('class', 'letters-legend')\n\n\n\n\t\t\t\tconst $legendScale = $legend.append('div')\n\t\t\t\t\t.attr('class', 'letters-legend-scale')\n\n\t\t\t\tconst $legendLeft = $legendScale.append('div')\n\t\t\t\t\t.attr('class', 'legend-left')\n\n\t\t\t\tconst $legendSpace = $legendScale.append('div')\n\t\t\t\t\t.attr('class', 'legend-space')\n\n\t\t\t\tconst $legendRight = $legendScale.append('div')\n\t\t\t\t\t.attr('class', 'legend-right')\n\n\t\t\t\tconst scale = [0, 4, 8]\n\n\t\t\t\tconst $gLeft = $legendLeft.selectAll('tick')\n\t\t\t\t\t.data(scale)\n\t\t\t\t\t.enter()\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr('class', 'tick')\n\n\t\t\t\t$gLeft.append('span')\n\t\t\t\t\t.text(d => `${d}%`)\n\n\t\t\t\tconst $gRight = $legendRight.selectAll('tick')\n\t\t\t\t\t.data(scale)\n\t\t\t\t\t.enter()\n\t\t\t\t\t.append('div')\n\t\t\t\t\t.attr('class', 'tick')\n\n\t\t\t\t$gRight.append('span')\n\t\t\t\t\t.text(d => `${d}%`)\n\n\t\t\t\tconst $legendLabels = $legend.append('div')\n\t\t\t\t\t.attr('class', 'legend-labels')\n\n\t\t\t\t$legendLabels.append('p')\n\t\t\t\t\t.attr('class', 'letters-legend letters-legend-society')\n\t\t\t\t\t.text('More common in society')\n\n\t\t\t\t$legendLabels.append('p')\n\t\t\t\t\t.attr('class', 'letters-legend letters-legend-song')\n\t\t\t\t\t.text('More common in songs')\n\n\n\n\n\n\t\t\t\tChart.resize();\n\t\t\t\tChart.render();\n\t\t\t}", "function initVis() {\n var eventHandlers = {};\n\n var mapSelectionChanged = function () {\n queue().defer(updateChildViews);\n };\n\n var activitySelectionChanged = function () {\n queue().defer(updateActivitiesVis);\n };\n\n var activitiesParkSelectionChanged = function (_newSelection)\n {\n ActivitiesPark = _newSelection;\n queue().defer(selectedParkChanged)\n }\n\n mapVis = new MapVis(\"#parks\", usStateData, dataloaded, allData, mapSelectionChanged);\n mapVis.updateVis();\n\n barVis = new barVis(\"#barVis\", allData, activitiesParkSelectionChanged, mapSelectionChanged,reset);\n BubbleVis = new BubbleVis(\"#bubble\", allData, activitySelectionChanged);\n // listVis = new listVis(\"#title\", allData, dataloaded, eventHandlers);\n infoVis = new InfoVis(\"#information\", dataloaded, mapSelectionChanged, eventHandlers);\n ActivitiesVis = new ActivitiesVis(\"#activityChart\",allData,activitiesParkSelectionChanged);\n }", "function init() {\n\t// register event handlers for control buttons (start, pause, reset, help)\n\t$(\"#startButton\").on('click', startMelting);\n\t$(\"#resetButton\").on('click', resetExperiment);\n\t//$(\"#helpButton\").on('click', showHelp);\n\t//$(\"#infoButton\").on('click', displayAboutInfo);\n\t$(\"input[name='whichGraph']\").click(function() {\n\t\tshowWhichGraph = $(\"input[name='whichGraph']:checked\").val();\n\t\twindowResized();\n\t });\n\tshowWhichGraph = $(\"input[name='whichGraph']:checked\").val();\n\t// some CSS adjustments as well\n\t$(\"#stirBar1\").hide();\n\t$(\"#stirBar2\").hide();\n\n\tgetAreas();\n\tgetNumBlocks();\n}", "function init() {\n\n getCourses(program);\n getPreqs(courses);\n drawGraph();\n\n //set zoom view level\n zoomOut();\n\n //loading done\n $('#spin1').hide();\n}", "init() {\n\t\t\t\tstructureData()\n\t\t\t\ttyper.prepare($trendText1);\n\t\t\t\ttyper.prepare($trendText2);\n\t\t\t\ttyper.prepare($outro1);\n\n\t\t\t\twidth = $sel.node().offsetWidth - marginLeft - marginRight;\n\t\t\t\theight = $sel.node().offsetHeight - marginTop - marginBottom;\n\n\t\t\t\t$svg = $sel.append('svg')\n\t\t\t\t\t.attr('class', 'pudding-chart')\n\t\t\t\t\t.attr('width', width + marginLeft + marginRight)\n\t\t\t\t\t.attr('height', height + marginTop + marginBottom);\n\n\t\t\t\tconst $g = $svg.append('g');\n\n\t\t\t\t// offset chart for margins\n\t\t\t\t$g.attr('transform', `translate(${marginLeft}, ${marginTop})`);\n\n\t\t\t\t// create axis\n\t\t\t\t$axis = $svg.append('g').attr('class', 'g-axis');\n\n\t\t\t\txAxisGroup = $axis.append('g')\n\t\t\t\t\t.attr('class', 'x axis')\n\t\t\t\t\t.attr('transform', `translate(${marginLeft},${height})`)\n\n\t\t\t\tyAxisGroup = $axis.append('g')\n\t\t\t\t\t.attr('class', 'y axis')\n\n\t\t\t\txScale\n\t\t\t\t\t.domain([minX, maxX])\n\t\t\t\t\t.range([0, width])\n\n\t\t\t\tyScale\n\t\t\t\t\t.domain([0, maxY])\n\t\t\t\t\t.range([height, 0])\n\n\t\t\t\txAxis = d3\n\t\t\t\t\t.axisBottom(xScale)\n\t\t\t\t\t.tickPadding(8)\n\t\t\t\t\t.ticks(10)\n\t\t\t\t\t.tickFormat(d3.format('d'))\n\n\t\t\t\tyAxis = d3\n\t\t\t\t\t.axisLeft(yScale)\n\t\t\t\t\t.tickPadding(8)\n\t\t\t\t\t.tickSize(-width)\n\t\t\t\t\t.ticks(8)\n\n\t\t\t\t$axis.select('.x')\n\t\t\t\t\t.attr('transform', `translate(${marginLeft},510)`)\n\t\t\t\t\t.call(xAxis);\n\n\t\t\t\t$axis.select('.y')\n\t\t\t\t\t.attr('transform', `translate(${marginLeft + 20},0)`)\n\t\t\t\t\t.call(yAxis);\n\n\t\t\t\t// setup viz group\n\t\t\t\t$vis = $g.append('g').attr('class', 'g-vis');\n\n\t\t\t\tgenderLines = d3.line()\n\t\t\t\t\t.x(d => xScale(d.year))\n\t\t\t\t\t.y(d => yScale(d.flat))\n\n\t\t\t\tgenderArea = d3.area()\n\t\t\t\t\t.x(d => xScale(d.key))\n\t\t\t\t\t.y0(d => yScale(d.value.female))\n\t\t\t\t\t.y1(d => yScale(d.value.male))\n\n\t\t\t\tdrawArea = $vis.append('path')\n\t\t\t\t\t.datum(dataByYear)\n\t\t\t\t\t.attr('class', 'area')\n\t\t\t\t\t.attr('d', genderArea)\n\n\t\t\t\tlineGroup = $svg.select('.g-vis')\n\n\t\t\t\tfemaleLine = lineGroup.append('path')\n\t\t\t\t\t.datum(femaleData)\n\t\t\t\t\t.attr('class', 'Female')\n\t\t\t\t\t.attr('d', genderLines)\n\n\t\t\t\tmaleLine = lineGroup.append('path')\n\t\t\t\t\t.datum(maleData)\n\t\t\t\t\t.attr('class', 'Male')\n\t\t\t\t\t.attr('d', genderLines)\n\n\t\t\t\tconst xTicks = d3.selectAll('.x.axis text')\n\n\t\t\t\txTicks.attr('transform', `translate(32,0)`)\n\n\t\t\t}", "function drawVisualization() {\n // create the data table.\n data = new vis.DataSet();\n\n // create the animation data\n for (var i = 0; i < field1.length; i++) {\n x = field1[i];\n y = field2[i];\n z = field3[i];\n var style = clusters[i] == 0 ? \"#FFA500\" : clusters[i] == 1 ? \"#0000FF\" : clusters[i] == 2 ? \"#008000\" : clusters[i] == 3 ? \"#FFFF00\" : clusters[i] == 4 ? \"#4B0082\" : \"#000000\";\n\n data.add({ x: x, y: y, z: z, style: style });\n }\n\n // specify options\n var options = {\n width: \"100%\",\n height: \"100%\",\n style: \"dot-color\",\n showPerspective: true,\n showGrid: true,\n keepAspectRatio: true,\n verticalRatio: 1.0,\n showLegend: false,\n tooltip: {\n color: \"red\",\n },\n cameraPosition: {\n horizontal: -0.35,\n vertical: 0.22,\n distance: 1.8,\n },\n xLabel: field1Name,\n yLabel: field2Name,\n zLabel: field3Name\n };\n\n // create our graph\n var container = document.getElementById(\"mygraph\");\n graph = new vis.Graph3d(container, data, options);\n graph.on(\"click\", onclick);\n }", "async function makeVisualization(){\n {\n console.log(\"loading local data\");\n data = await getData('dataSelection.json');\n }\n console.log({ data });\n \n setupScales();\n setupAxes(group);\n drawBars(group);\n setupInput();\n }", "function createVisualization(json) {\n\n // Basic setup of page elements.\n initializeBreadcrumbTrail();\n //drawLegend();\n //drawwans();\n// d3.select(\"#toggleanswer\").on(\"click\", showans);\n\n // Bounding circle underneath the sunburst, to make it easier to detect\n // when the mouse leaves the parent g.\n vis.append(\"svg:circle\")\n .attr(\"r\", radius)\n .style(\"opacity\", 0);\n\n // For efficiency, filter nodes to keep only those large enough to see.\n var nodes = partition.nodes(json)\n .filter(function(d) {\n return (d.dx > 0.001); // 0.005 radians = 0.29 degrees\n });\n\n var path = vis.data([json]).selectAll(\"path\")\n .data(nodes)\n .enter().append(\"svg:path\")\n .attr(\"display\", function(d) { return d.depth ? null : \"none\"; })\n .attr(\"d\", arc)\n .attr(\"fill-rule\", \"evenodd\")\n .style(\"fill\", function(d) { return getColor(colors, d.name);})\n .style(\"opacity\", 0.5)\n .on(\"mouseover\", mouseover)\n .on(\"click\", click);\n\n // Add the mouseleave handler to the bounding circle.\n d3.select(\"#chart-container\").on(\"mouseleave\", mouseleave);\n\n // Get total size of the tree = value of root node from partition.\n totalSize = path.node().__data__.value;\n }", "function setVisualStructure() {\n // Get contexts.\n const contextnames = [\n 'scape',\n 'glassBottle',\n 'bottleText',\n 'bottleWave',\n 'chart',\n 'blackBox',\n 'globe',\n ];\n\n updateContexts(contextnames);\n setRoughCanvases();\n}", "function setVisualStructure() {\n // Get contexts.\n const contextnames = [\n 'scape',\n 'glassBottle',\n 'bottleText',\n 'bottleWave',\n 'chart',\n 'blackBox',\n 'globe',\n ];\n\n updateContexts(contextnames);\n setRoughCanvases();\n}", "function init() {\n if (!buttons || !graph || !container || !infoQuantity || !infoDuration) {\n console.error('could not find all necessary elements');\n return;\n }\n\n buttons.forEach((button) => {\n button.addEventListener('click', _handleButtonClick);\n });\n\n CHART_CONTEXT = graph.getContext('2d');\n}", "function init(){\n // initialize global variables and button actions\n prev_btnj = $('#prev_btn')\n next_btnj = $('#next_btn')\n scale_btnj = $('#scale_btn')\n titlej = $('#title')\n svgj = $('svg')\n svg = svgj[0]\n svgimg = document.createElementNS('http://www.w3.org/2000/svg','image')\n\n svgj.append(svgimg)\n $('#open_btn').click(openHandler)\n $('#zoomin_btn').click(zoominHandler)\n $('#zoomout_btn').click(zoomoutHandler)\n $('#actual_btn').click(actualHandler)\n $('#fit_btn').click(fitHandler)\n prev_btnj.click(prevHandler)\n next_btnj.click(nextHandler)\n $(window).resize(_.throttle(resizeHandler, 100))\n}", "function init() {\n\td3.csv('data/indicators.csv', function(error, data) {\n\t\tindicatorData = data;\n\n\t\trender();\n\t\t$(window).resize(utils.throttle(onResize, 250));\n\t});\n}", "function initializeVisualization(campaign, state, board) {\n\n initHintModal(board)\n\n drawBoardContainer(board)\n drawCells(board)\n drawInitMarkers(board)\n drawTraps(board)\n\n // TODO: refactor so that you pass board as a param\n drawCoins()\n drawBots()\n drawBlocks()\n}", "function drawVisualization() {\n // Create and populate a data table.\n formArrayFromObj(satData);\n\n\n // specify options\n var options = {\n width: '600px',\n height: '600px',\n style: 'dot',\n showPerspective: true,\n showGrid: true,\n showShadow: false,\n keepAspectRatio: true,\n verticalRatio: 0.5,\n tooltip: getName\n };\n\n // Instantiate our graph object.\n var container = document.getElementById('myGraph');\n graph = new vis.Graph3d(container, data, options);\n\n}", "initialize() {\n this.render();\n }", "function init() {\n // Grab Dropdown menu and add choices from the dataset\n var dropdown = d3.select(\"#selDataset\"); \n // create list of datasets for the dropdown\n d3.json(\"static/Data/samples.json\").then((data)=> { \n data.names.forEach(function(name) {\n dropdown.append(\"option\").text(name).property(\"value\");\n });\n // initialize the plots with data from the first dataset\n optionChanged(data.names[0]);\n });\n}", "function init() {\n for(let i = K; i <= 5 * N; i += delta) {\n M.push(i);\n }\n drawSvgContainer(svgWidth, svgHeight, svgMargin);\n drawAxes(xAxisLength, yAxisLength, startPoint, scale);\n task1();\n}", "function initChartObjects() {\n console.log(\"initChartObjects\");\n\n // == display object properties: name, yearsMenu, schoolsMenu, studentsMenu, buildingsMenu, geographyMenu\n chartObject = new Chart(\"chart1\");\n }", "draw() {\n this.plot = this.svg.append('g')\n .classed(\"plot\", true)\n .attr('transform', `translate(${this.margin.left},${this.margin.top})`);\n\n // Add the background\n this.plot.append(\"rect\")\n .attrs({\n fill: \"white\",\n x: 0,\n y: 0,\n height: this.innerHeight,\n width: this.innerWidth\n });\n\n if ( this.opts.nav !== false ) {\n this.drawNav();\n }\n\n // Add the title\n this.svg.append('text')\n .attr('transform', `translate(${this.width / 2},${this.margin.top / 2})`)\n .attr(\"class\", \"chart-title\")\n .attr('x', 0)\n .attr('y', 0)\n .text(this.title);\n }", "init() {\n this.render();\n }", "init() {\n this.render();\n }", "function init() {\n\tinitalizeGrid();\n\tupdateCanvasGrid();\n\tdrawPalette();\n\tdrawCurrentColor();\n\tdecodeOnFirstLoad();\n}", "function init() {\n cashElements();\n attachEvents();\n render();\n }", "function init() {\n charts(\"940\");\n}", "initVis() {\n let vis = this;\n\n // Define Main Countries and Exceptions, Energy Types\n vis.mainCountries = ['Central America', 'Canada', 'US', 'Brazil', 'Russian Federation', 'India', 'Australia', 'China'];\n vis.combinedLocales = ['Western Africa', 'Eastern Africa', 'Middle Africa', 'Central America'];\n vis.energyTypes = ['Oil', 'Gas', 'Coal', 'Nuclear', 'Hydro', 'Renewables', 'Solar', 'Wind', 'Geo', 'No Data'];\n\n // Calculate inner chart size. Margin specifies the space around the actual chart.\n vis.width = vis.config.containerWidth - vis.config.margin.left - vis.config.margin.right;\n vis.height = vis.config.containerHeight - vis.config.margin.top - vis.config.margin.bottom;\n\n // Define size of SVG drawing area\n vis.svg = d3.select(vis.config.parentElement)\n .attr('width', vis.config.containerWidth)\n .attr('height', vis.config.containerHeight);\n\n // Append group element that will contain our actual chart \n // and position it according to the given margin config\n vis.chart = vis.svg.append('g')\n .attr('transform', `translate(${vis.config.margin.left},${vis.config.margin.top})`);\n\n // Defines the scale and translate of the projection so that the geometry fits within the SVG area\n // We crop Antartica because it takes up a lot of space that is not needed for our data\n vis.projection = d3.geoEquirectangular()\n .center([0, 15]) // set centre to further North\n .scale([vis.width / (2 * Math.PI)]) // scale to fit size of svg group\n .translate([vis.width / 2, vis.height / 2]); // ensure centered within svg group\n\n // Set projection\n vis.geoPath = d3.geoPath().projection(vis.projection);\n\n // Define color scale for all energy types\n vis.colorScale = d3.scaleOrdinal()\n // OIL GAS COAL NUCLEAR HYDRO RENEWABLES SOLAR WIND GEO\n .range(['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6'])\n .domain(['Oil', 'Gas', 'Coal', 'Nuclear', 'Hydro', 'Renewables', 'Solar', 'Wind', 'Geo']);\n\n vis.indexColorScale = d3.scaleOrdinal()\n // OIL GAS COAL NUCLEAR HYDRO RENEWABLES SOLAR WIND GEO\n .range(['#a6cee3', '#1f78b4', '#b2df8a', '#33a02c', '#fb9a99', '#e31a1c', '#fdbf6f', '#ff7f00', '#cab2d6'])\n .domain(d3.range([0, 8]));\n\n\n // Add Legend\n vis.chart.selectAll('legendDots')\n .data(vis.energyTypes)\n .join('circle')\n .attr('class', 'legendCircle')\n .attr('cx', 50)\n .attr('cy', (d, i) => 200 + i * 20)\n .attr('r', 7)\n .style('fill', d => {\n if (d === 'No Data') return '#c5cacb';\n return vis.colorScale(d);\n });\n\n vis.chart.selectAll('legendText')\n .data(vis.energyTypes)\n .join('text')\n .text(d => d)\n .attr('transform', (d, i) => `translate(60, ${205 + i * 20})`)\n .attr('fill', 9)\n .attr('');\n\n // Set Linechart tooltip\n vis.linechart = d3.select('#mapchart-tooltip')\n .attr('width', vis.tooltipWidth)\n .attr('height', vis.tooltipHeight)\n .append('g');\n\n // Append axes groups for Linechart\n vis.xAxisG = vis.linechart.append('g')\n .attr('class', 'axis x-axis')\n .attr('transform', `translate(0,${vis.tooltipHeight * 0.9})`);\n\n vis.yAxisG = vis.linechart.append('g')\n .attr('class', 'axis y-axis')\n .attr('transform', `translate(40, 0)`);\n\n // Set Linechart tooltip scales and axes\n vis.xScale = d3.scaleTime();\n vis.yScale = d3.scaleLinear();\n\n vis.xScale.range([40, vis.tooltipWidth - 30]);\n vis.yScale.range([vis.tooltipHeight * .9, vis.tooltipHeight * .15]);\n\n // Initialize axes\n vis.xAxis = d3.axisBottom(vis.xScale)\n .ticks(10)\n .tickFormat(d3.format('y'))\n .tickSizeOuter(0)\n .tickPadding(10);\n\n vis.yAxis = d3.axisLeft(vis.yScale)\n .ticks(5, '.1f')\n .tickSize(-vis.width)\n .tickSizeOuter(0)\n .tickPadding(10);\n\n // Set tooltip title and axis labels\n vis.tooltipTitle = d3.select('#mapchart-tooltip')\n .append('text')\n .attr('class', 'title')\n .attr('x', vis.tooltipWidth / 2)\n .attr('y', 25)\n .attr('font-size', 16)\n .style('text-anchor', 'middle');\n\n vis.tooltipAxis = d3.select('#mapchart-tooltip')\n .append('text')\n .attr('class', 'axis-title')\n .attr('x', 25)\n .attr('y', 50)\n .attr('font-size', 10)\n .text('Energy Consumption (exJ)');\n\n vis.updateVis();\n }", "function plotInit(container){\n var brd = JXG.JSXGraph.initBoard(container, {boundingbox: [-2, 4, 6, -4], axis:true, grid:false, showCopyright:false});\n return brd;\n}", "function init(vis, esResponse) {\n vis.aggs.forEach(function (agg, i) { agg.id = 'agg_' + (i + 1); });\n\n $rootScope.vis = vis;\n $rootScope.esResponse = esResponse;\n $rootScope.uiState = require('fixtures/mock_ui_state');\n $el = $('<visualize vis=\"vis\" es-resp=\"esResponse\" ui-state=\"uiState\">');\n $compile($el)($rootScope);\n $rootScope.$apply();\n }", "function initialize(ved) {\n //TODO: reset flags\n\n // Extract the data from the scenegraph.\n context = ved;\n extractScenegraph(context.root);\n computeDescendants();\n computeTreeStructure();\n updateTreeSize();\n // Draw the scenegraph.\n drawScenegraph(root);\n drawLegend();\n initialized = true;\n} // end initialize", "function init() {\n clearCanvas()\n drawBackgroundColor()\n drawOrigin()\n }", "onLoad() {\n this.svg = this.createSvg();\n this._bg.appendChild(this.svg);\n this.setShaderProperties();\n this.randomize();\n this.createPolygons();\n this.refresh();\n }", "initVis() {\n let vis = this;\n\n /*vis.margin = {top: 30, right: 80, bottom: 30, left: 80};\n\n vis.width = $(\"#\" + vis.parentElement).width() - vis.margin.left - vis.margin.right,\n vis.height = 700 - vis.margin.top - vis.margin.bottom;\n\n // SVG drawing area\n vis.svg = d3.select(\"#\" + vis.parentElement).append(\"svg\")\n .attr(\"width\", vis.width + vis.margin.left + vis.margin.right)\n .attr(\"height\", vis.height + vis.margin.top + vis.margin.bottom)\n .append(\"g\")\n .attr(\"transform\", \"translate(\" + vis.margin.left + \",\" + vis.margin.top + \")\");*/\n\n vis.boxPlotDiv = document.getElementById(vis.parentElement)\n vis.boxPlotDiv.style.height = '650px'\n\n vis.colors = {\n 'navy': '#010D26',\n 'blue': '#024059',\n 'paleOrange': '#D98E04',\n 'orange': '#F28705',\n 'darkOrange': '#BF4904',\n 'purp': '#8F2051',\n 'tan': '#F2E1C9',\n }\n\n vis.filter = \"mean_vote\"\n\n vis.layout = {\n title: 'Distribution of Movie Ratings by Genre',\n yaxis: {\n // autorange: true,\n showgrid: true,\n zeroline: true,\n range: [0,10],\n // dtick: 0,\n gridcolor: 'rgb(255, 255, 255)',\n gridwidth: 1,\n zerolinecolor: 'rgb(255, 255, 255)',\n zerolinewidth: 2\n },\n margin: {\n l: 60,\n r: 50,\n b: 80,\n t: 100\n },\n paper_bgcolor: vis.colors.tan,\n plot_bgcolor: vis.colors.tan,\n showlegend: false\n };\n\n /*vis.pieChartGroup = vis.svg\n .append('g')\n .attr('class', 'pie-chart')\n .attr(\"transform\", \"translate(\" + vis.width / 2 + \",\" + vis.height / 2 + \")\");\n\n // Pie chart settings\n let outerRadius = vis.width / 2;\n let innerRadius = 20;\n\n // Path generator for the pie segments\n vis.arc = d3.arc()\n .innerRadius(innerRadius)\n .outerRadius(outerRadius);\n\n // Pie Layout\n vis.pie = d3.pie()\n .value(function(d){\n return d.value\n });*/\n\n vis.wrangleData()\n }", "function initialize() {\n\n //Here we set our <code>viz</code> variable by instantiating the <code>vizuly.viz.corona</code> function.\n //All vizuly components require a parent DOM element at initialization so they know where to inject their display elements.\n viz = vizuly.viz.corona(document.getElementById(\"viz_container\"));\n\n //Using the function chain syntax we can now set various properties of the bar chart.\n //\n //Both the <code>x</code> and <code>y</code> properties are used to map the data values\n //to the corresponding x and y axis within the chart.\n viz.data(data)\n .margin({top: \"15%\", left: \"0%\", right: \"0%\", bottom: \"10%\"})\n .outerRadius(350)\n .y(function (d, i) {\n return d.views; //Value to use for the radius (y)\n })\n .x(function (d, i) {\n return d.hour; //Value to use fo the angle (x)\n })\n .interpolate(\"cardinal-closed\") //Vertex type for line and area paths\n .on(\"validate\", onValidate) //Called when all public properties have been set\n .on(\"mouseover\", onMouseOver) //Called on each datatip mouseover\n .on(\"mouseout\", onMouseOut) //Called on each datatip mouseout\n .on(\"measure\", onMeasure); //Called each time viz measures itself prior to update\n\n\n //** Themes and skins ** play a big role in vizuly, and are designed to make it easy to make subtle or drastic changes\n //to the look and feel of any component. Here we choose a theme and skin to use for our bar chart.\n // *See this <a href=''>guide</a> for understanding the details of themes and skins.*\n theme = vizuly.theme.radial_linearea(viz)\n .skin(vizuly.skin.LINEAREA_OCEAN);\n\n\n //The <code>viz.selection()</code> property refers to the parent\n //container that was used at the object construction. With this <code>selection</code> property we can use D3\n //add, remove, or manipulate elements within the component. In this case we add a title label and heading to our chart.\n viz_title = viz.selection().select(\"svg\").append(\"text\").attr(\"class\", \"title\")\n .attr(\"y\", 35).attr(\"text-anchor\", \"middle\")\n .text(\"WWW.BRIGHTPOINTINC.COM - PAGE VIEWS BY HOUR\");\n viz_heading = viz.selection().select(\"svg\").append(\"text\").attr(\"class\", \"heading\")\n .attr(\"y\", 55).attr(\"text-anchor\", \"middle\")\n .text(\"Google Analytics - Dec 01, 2015\");\n\n\n // Set the viz size based on the container\n changeSize(d3.select(\"#currentDisplay\").attr(\"item_value\"));\n\n\n\n /*\n // This code is for the purposes of the demo and simply cycles through the various skins\n // The user can stop this by clicking anywhere on the page.\n var reel = vizuly.showreel(theme, ['Sunset', 'Neon', 'Ocean'], 2000).start();\n d3.select(\"body\").on(\"mousedown.reel\", function () {\n //Stop show reel\n reel.stop();\n //Remove event listener\n d3.select(\"body\").on(\"mousedown.reel\", null);\n })\n */\n}", "viewMode() {\n this.initChart();\n }", "_initSvgEls() {\n const _this = this;\n\n this.svgEls = {\n panel: document.createElementNS(this.SVG_NS, \"rect\"),\n sliders: [],\n sliderPanels: []\n };\n\n this._appendSvgEls();\n this._update();\n }", "initialiseCanvas(){\n let canvas = document.querySelector(\".genetic-art .canvas_container .result\");\n canvas.width = this.modelData.width;\n canvas.height = this.modelData.height;\n }" ]
[ "0.7639817", "0.7542079", "0.72371054", "0.7231575", "0.7094303", "0.699649", "0.69529426", "0.693976", "0.68060863", "0.67857355", "0.674591", "0.6708347", "0.6640099", "0.66310173", "0.6592338", "0.6517857", "0.6500487", "0.6497647", "0.64901495", "0.6443745", "0.6397952", "0.63899136", "0.63367707", "0.6333711", "0.63288575", "0.6316423", "0.63059247", "0.6295817", "0.62878996", "0.6282984", "0.62648445", "0.62585515", "0.62557805", "0.6249174", "0.62276196", "0.62268746", "0.6209533", "0.6199787", "0.6192413", "0.6189408", "0.61750007", "0.6159559", "0.6155246", "0.61477894", "0.61424315", "0.6136414", "0.6131274", "0.61228126", "0.61157304", "0.611435", "0.61065614", "0.6089907", "0.6086473", "0.6084894", "0.6080317", "0.60791916", "0.6079062", "0.6077074", "0.6076301", "0.60720325", "0.6069045", "0.6065117", "0.60632163", "0.60599273", "0.60556597", "0.60480183", "0.6046137", "0.60429937", "0.60410255", "0.60398656", "0.60277843", "0.60161483", "0.6013641", "0.60075265", "0.60075265", "0.600415", "0.60027957", "0.6000591", "0.59968674", "0.59908634", "0.59832567", "0.5982657", "0.597264", "0.59710574", "0.59700096", "0.5965997", "0.5965997", "0.59642404", "0.5960031", "0.59583044", "0.59504884", "0.5945298", "0.5940543", "0.59339315", "0.5932173", "0.5924666", "0.5914931", "0.59088993", "0.5899737", "0.5896199", "0.589024" ]
0.0
-1
This condition will checks the prime numbers.
checkPrime(s1, s2) { var count = 0, flag = 0, k = 0; var array = []; for (var i = s1; i <= s2; i++) { for (var j = 2; j < i; j++) { if (i % j == 0) { flag = 0; count++; break; } else { flag = 1; } } if (flag == 1) { array[k++] = i; } } return array; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function primeChecker (num) {\n \n if (num < 1) return false;\n \n var newNum = Math.floor(Math.sqrt(num));\n \n for (var i = 2; i <= newNum; i++)\n {\n if (num % i === 0)\n {\n return false;\n }\n }\n \n return true;\n }", "function isPrime(num){\n\n // if any of the values between 2 and the num\n // var can evenly go into num then return false\n for(let i = 2; i < num; i++){\n if(num % i === 0){\n return false;\n }\n }\n return true;\n}", "function primeTests() {\n console.log(isPrime(1), \" -> false\");\n console.log(isPrime(2), \" -> true\");\n console.log(isPrime(3), \" -> true\");\n console.log(isPrime(4), \" -> false\");\n}", "function isPrime(num) {\n for(var i = 2; i < num; i++){\n if(num % i === 0){ \n return false;\n }\n }\n //return num !== 1;\n return true;\n }", "function checkPrime(number) {\n \n for (var i = 2; i < number; i++){\n if (number % i === 0) {\n return false\n }\n }\n \n return true;\n}", "function isPrime(num) {\n return [...Array(num + 1).keys()].filter(el => num % el === 0).length === 2;\n}", "function isPrime(num) {\n //TODO\n for (var i = 2; i < num; i++){\n if(num % i == 0){\n return false;\n }\n \n }\n return num >= 2\n}", "function isPrime(number){\n //determine if number is 1\n if(number === 1){\n return false;\n }\n//0 gives you NaN and all the numbers are divisible by 1. Therefore, you\n//start at 2.\n for(var i = 2; i < number; i++){\n if(number % i === 0){ //if the statement is true, then return false\n return false;\n }\n }\n return true;\n}", "function isPrime(num) {\n for(var i = 2; i < num; i++) {\n if(num % i === 0) \n }\n\n }", "function prime(num){\n if(num==2 || num==3){\n return true;\n }\n if(num%2==0 || num%3==0)\n return false;\n for(var i=2;i<Math.sqrt(num);i++){\n if(num%i===0){\n return false;\n }\n }\n return true;\n}", "function isPrime(num) {\n if(num < 2) return false;\n \n for (let i = 2; i < num; i++){\n if( num % i === 0){\n return false;\n }\n }\n return true;\n }", "function test_prime(n)\n{ \n if (n===1) {return false; }\n else if(n === 2)\n{ return true; }\nelse {\nfor(var x = 2; x < n; x++) {\n if(n % x === 0) \n{ return false; } \n}\n return true; \n }\n}", "function isPrime(num) {\nwhile ( num < 0){\n return false\n }\nwhile(num <= 3){\n if(num !=1 && num % 1 == 0 && num % Number(num) ==0){\n return true;\n } else {\n return false;\n }\n }\n\nwhile( num >3){\n if(num != 1 && num % 1 == 0 && num % Number(num) ==0 && num % 2 != 0 && num % 3 != 0 ){\n return true;\n } else {\n return false\n }\n }\n}", "function isPrime(num){\r\n if (num === 1 || num ===2 || num===3){\r\n return true;\r\n }\r\n for(var i =2 ; i<=num/2 ; i++){\r\n if (num%i === 0){\r\n return false;\r\n }\r\n } \r\n return true;\r\n}", "function primeNumber(number) {\n if (number == 1) {\n return false;\n }else if(number===2){\n return true\n }\n for(var i=2; i<number;i++){\n if(number%i===0){\n return false\n }\n }\n return true\n}", "function testPrimeNum(num){\n for(var i=2; i<num; i++){\n if(num%i===0){\n return false;\n }\n return num>1;\n }\n}", "function isPrime(num) {\n if(num===1) {\n return false\n }\n else if (num === 2) {\n return true\n }\n \n for(var i = 3; i < num-1; i++)\n if(num % i === 0) {\n return false\n }\n return true\n}", "function isPrime(v)\n{ let count=0;\n for(i=1;i<=v/2;i++)\n {\n if(v%i==0)\n count++\n }\n if(count>1)\n return false;\n else \n return true;\n}", "function checkForPrime(number) {\n let count = 0;\n for (let factor = 2; factor < number; factor++) {\n if (number % factor == 0)\n count++;\n }\n if (count == 0)\n return true;\n else\n return false;\n }", "function isprime(num){\n if(num === 0 || num === 1){\n return false;\n }\n\n var limit = Math.ceil(Math.pow(num, 1/2));\n if(num !== 2){\n for (var i = 2; i <= limit; i++){\n if(num % i == 0){\n return false\n }\n }\n }\n return true;\n}", "function isPrimeNumber(number) {\n    if (number <= 0) {\n        return false;\n    }\n    for (var i = 2; i < number; i++) {\n        if (number % i === 0) {\n            return false;\n        }\n    }\n    return true;\n}", "function isPrime(num) {\n num = Math.abs (num);\nif (num < 2) {return false;}\nfor (let i=2;i<num;i++) { \n if (num%i === 0){ \n return false;}\n}\nreturn true;\n}", "isPrime(number)\n{\n if(number==0 || number == 1)\n {\n return false;\n }\n else\n {\n for (let index = 2; index < number; index++)\n {\n if (number % index == 0) \n {\n return false;\n }\n }\n return true;\n }\n}", "function checkIsPrime(number){\n if (number <= 1) {\n return false;\n } else {\n for (i = 2; i < number; i++) {\n if (number % i == 0) {\n return false;\n }\n }\n return true;\n }\n}", "isPrime(number) {\n\n }", "isPrime(number) {\n if (number == 0 || number == 1) {\n return false;\n }\n for (let index = 2; index < number; index++) {\n if (number % index == 0) {\n return false;\n }\n\n }\n return true;\n}", "function isPrime(num) {\n let counter = 0;\n for (let i = 1; i <= num; i++) {\n if ((num % i) == 0) {\n counter++;\n if (counter > 2) {\n return false;\n }\n }\n }\n return true;\n}", "function isPrime(number) {\n return false;\n}", "function primeNumber(number) {\n for (let i = 2; i < number; i++) {\n if (number % i === 0) {\n return false;\n }\n }\n return true;\n}", "function check(num) {\r\n if (num == 1) {\r\n console.log('Not a Prime Number');\r\n } else {\r\n for (let i = 2; i <= Math.sqrt(num); i++) {\r\n if (num % i == 0) {\r\n console.log(\"Not a Prime Number\");\r\n return;\r\n }\r\n }\r\n console.log(\"is Prime\");\r\n }\r\n}", "function prime(number) {\n for (var i = 2; i < number; i++) {\n if (number % i === 0) {\n return false;\n }\n\n }\n return true;\n}", "function isPrime(num)\n{\n\tvar count=0;\n\tfor(var i=2;i<Math.sqrt(num)+1;i++){\n\t\tif(num%i ==0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t}\n\treturn true;\n}", "function checkPrime(x) {\n if (x <= 1) {\n return false;\n }\n for (let i = 2; i < x; i++) {\n if (x % i === 0) {\n return false;\n }\n }\n return true;\n}", "function checkPrime(number){\n var pom = true\n for (var i = 2; i <= number; i++){\n if ((number %i ) === 0 && number !== i){\n pom = false;\n }\n }\n return pom;\n}", "function test_prime(n) {\n console.log(\"prime clicked\");\n console.log(n);\n\n if (n <= 1) {\n return false;\n } else if (n === 2 || n == 3) {\n return true;\n } else {\n for (var x = 2; x <= Math.floor(Math.sqrt(n)); x++) {\n if (n % x === 0) {\n console.log(x);\n return false;\n }\n }\n return true;\n }\n}", "function isPrime(n) {\n let counter = 2;\n let len = Math.floor(Math.sqrt(n));\n while (counter <= len) {\n if (n%counter == 0){ return false;}\n counter += 1;\n}\n return true;\n}", "function test_prime(n)\r\n{\r\n\r\n if (n===1)\r\n {\r\n return false;\r\n }\r\n else if(n === 2)\r\n {\r\n return true;\r\n }else\r\n {\r\n for(var x = 2; x < n; x++)\r\n {\r\n if(n % x === 0)\r\n {\r\n return false;\r\n }\r\n }\r\n return true; \r\n }\r\n}", "function isPrime(num) {\n if(num < 2) return false;\n for(let i=2; i < num; i++){\n if(num%i===0) return false;\n }\n return true;\n}", "function prime ( number ) {\n if ( number < 2 ) {\n return false;\n }\n\n for ( let i = 2; i < number; i++ ) {\n if ( number % i === 0 ) {\n return false;\n }\n }\n return true;\n}", "function isPrime(num) {\n for(var i = 2; i < num; i++)\n if(num % i === 0) return false;\n return num !== 1;\n }", "function isPrime(number) { \n if (number === 1) return false\n else if (number === 2) return true\n else if (number % 2 === 0) return false\n for (let j = 3; j <= Math.floor(Math.sqrt(number)); j+=2) {\n if (!(number % j)) return false\n }\n return true\n}", "function checkPrime(number){\n //var faktor = [];\n var jumlahFaktor = 0;\n for(let i=1; i<=number; i++){\n if(number%i === 0){\n //faktor.push(i);\n jumlahFaktor++;\n }\n }\n if(jumlahFaktor === 2){\n return true;\n } else {\n return false;\n }\n }", "function isPrime(num) {\r\n if(!isSafeInt(num)) {\r\n throw new TypeError(\"expected a finite integer\");\r\n }\r\n if(num < 2) {\r\n return false;\r\n }\r\n if(num < 4) {\r\n return true;\r\n }\r\n if(num % 2 == 0 || num % 3 == 0) {\r\n return false;\r\n }\r\n for(var max = parseInt(Math.sqrt(num)) + 2, check = 6; check <= max; check += 6) {\r\n if(num % (check - 1) == 0 || num % (check + 1) == 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "function primenum(){\n var num=+prompt('Enter a number');\n if(num<3){\n console.log('Not a prime number');\n } else {\n checkPrimenum();\n }\n\n function checkPrimenum() {\n for (var a=2;a<num;a++) {\n for (var b=2;b<a;b++) {\n if (a%b == 0) break;\n }\n if (b == a){\n console.log(a);\n }\n }\n } \n}", "function isPrime(num){\n if (num < 2){\n return false;\n }\n if (num === 2){\n return true;\n }\n\n for(let i = 2; i < num; i++){\n if (num % i === 0){\n return false;\n }\n }\n\n return true;\n}", "function isPrime(val){\n\n //test if number is prime\n for(var i=2; i < val; i++){\n if(val % i === 0){\n return false;\n }\n }\n return true;\n}", "function isPrime(number){\n\tif(number <= 1){return false;}\n\tif(number == 2){return true;}\n\tif(!(number%2)){return false;}\n\tvar maxCheck = Math.floor(Math.sqrt(number));\n\tfor(var i = 3; i <= maxCheck; i+=2){\n\t\tif(!(number%i)){return false;}\n\t}\n\treturn true;\n}", "function test_prime(n)\n{\n if (n===1)\n {\n return false;\n }\n else if(n === 2)\n {\n return true;\n }else\n {\n for(var x = 2; x < n; x++)\n {\n if(n % x === 0)\n {\n return false;\n }\n }\n return true; \n }\n}", "function test_prime(n)\n{\n\n if (n===1)\n {\n return false;\n }\n else if(n === 2)\n {\n return true;\n }else\n {\n for(var x = 2; x < n; x++)\n {\n if(n % x === 0)\n {\n return false;\n }\n }\n return true; \n }\n}", "function isPrime(n){\n var divisor = 2;\n \n while (n > divisor){\n if(n % divisor == 0){\n return false; \n }\n else\n divisor++;\n }\n return true;\n }", "function isPrime(n) {\n\t// TODO:\n}", "function isPrime(testNo){\n \n var result = false;\n for(var n = testNo - 1; n > 1; n--){\n result = (testNo % n === 0) + result;\n }\n \n if(result === 0 && testNo > 1){\n return true;\n }return false;\n }", "function isPrime(number) {\n for (let j = number - 1; j > 1; j-- ) {\n if (number % j === 0) {\n return false;\n }\n }\n return number > 1;\n }", "function isPrime(num) {\n for (let i = 2; i < num; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n return num !== 1;\n}", "function isPrime(prime) {\n for(var i=2; i<prime; i++) {\n if(prime%i === 0)\n return false;\n }\n return true;\n}", "function is_prime(num){\n if(num <= 1){\n return false\n }\n for(let i = 2; i < Math.floor(Math.sqrt(num)) + 1 ; i++){\n if(parseInt(num % i) === 0 ){\n return false\n }\n\n }\n return true\n}", "function isPrime(num){\n for (var i = 2; i < num; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n return true;\n}", "function isPrime(number) {\n if (number <= 1) {\n return false;\n }\n\n for (let currentNumber = 2; currentNumber < number; currentNumber++) {\n if (number % currentNumber === 0) {\n return false;\n }\n }\n\n return true;\n}", "function isPrime(num) {\r\n for (let i = 2; num > i; i++) {\r\n if (num % i == 0) {\r\n return false;\r\n }\r\n }\r\n return num > 1;\r\n}", "function isPrime(n)\r\n{\r\n var flag=0;\r\n for(let i=2 ; i < n/2 ; i++) {\r\n if(n%i === 0) {\r\n flag = 1;\r\n break;\r\n }\r\n }\r\n if(flag == 0) {\r\n return true;\r\n }\r\n}", "function isPrime(number) {\n for (let i=2; i < number; i++) {\n // check that the correct thing is targeted \n // console.log(i);\n if (number % i === 0) {\n // return number, not prime\n return false \n }\n } \n return true\n // return controls flow of the function (rest of the function is ignored)\n\n // divide the number by all the numbers leading up to it\n // if any of those return a whole number, not it is not prime\n // if we get this far without a NO, then YES \n}", "function prime(num) {\n for(i = 2; i < num; i++) {\n if(num % i === 0) {\n return false\n }\n }\n return num > 1\n}", "function isPrime(number) {\n if (number % 2 == 0)\n return false;\n for (var i = 3;(i * i) <= number; i += 2) {\n if (number % i == 0)\n return false;\n }\n return true;\n}", "function isPrime(num) {\r\n if (num < 2) return false;\r\n var comp = Math.floor(Math.sqrt(num));\r\n\r\n for (var i = 2; i <= comp; i++) {\r\n if (num % i === 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}//end of isPrime function", "function isPrime(num) {\r\n if (num < 2) return false;\r\n var comp = Math.floor(Math.sqrt(num));\r\n\r\n for (var i = 2; i <= comp; i++) {\r\n if (num % i === 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n}//end of isPrime function", "function primeNum(p) {\nvar isPrime = true;\nfor (var i = 2; i < 10; i++){\nif (p % i === 0 && p !== i) {\n isPrime = false;\n break;\n }\n }\n return isPrime;\n}", "function isPrime(num) {\n for (let i = 2; i < num; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n\n return true;\n}", "function isPrime(number) {\n if (number === 1) {\n return false;\n }\n for (let i = 2; i * i <= number; i++) {\n if (number % i === 0) {\n console.log(number + ' - the number is not prime');\n return false;\n }\n }\n console.log(number + ' - the number is prime');\n return true;\n }", "function isPrime(num) {\n for (var i = 2; i < num; i++) {\n if (num % i == 0) {\n return false\n }\n }\n return true\n}", "function isPrime(num) {\n if (num === 2) {\n return true;\n } else if (num > 1) {\n for (let i = 2; i < num; i++) {\n if (num % i !== 0) {\n return true;\n } else if (num === i * i) {\n return false;\n } else {\n return false;\n }\n }\n } else {\n return false;\n }\n}", "function isPrime(n)\r\n{\r\n\tfor(let k=2;k<n;k++){\r\n\t\tif(!(n%k))\r\n\t\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isPrime(n)\r\n{\r\n\tfor(let k=2;k<n;k++){\r\n\t\tif(!(n%k))\r\n\t\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isPrime(n)\r\n{\r\n if(n%2!==0){\r\n return true\r\n \r\n }\r\n}", "function testPrime(num) {\n\tif (num === 1) {\n\t\treturn false;\n\t}\n\tfor (var i = 2; i < num/2; i++) {\n\t\tif (num % i === 0) {\n\t\t\treturn false;\n\t\t}\n\t}\n\treturn true;\n}", "function isPrime(num) {\n if (num === 1) return false;\n if (num % num === 0 && num % 1 === 0) {\n for (let i = 2; i < num; i++) {\n if (num % i === 0) return false;\n }\n return true;\n } else return false;\n}", "function testPrimeNum(n){\n if(n===1){\n return false;\n }else if(n===2){\n return true;\n }else{\n for(var i=2; i<n;i++){\n if(n%i===0){\n return false;\n }\n }\n return true;\n }\n}", "function isPrime(num) {\n for (var i = 2; i < num; i++)\n if (num % i === 0) return false;\n return num !== 1 && num !== 0;\n}", "function br_isPrime(num) \n{\n // 1 is not prime\n if(PCmode == PC_PRIME_MODE) {\n for(var i = 0; i < br_primes.length; i++) {\n if(br_primes[i] == num) {\n return true;\n }\n }\n }else if(PCmode == PC_EVEN_MODE) {\n return (num%2 == 0);\n }else{\n return (num%PCmultiplier == 0);\n }\n return false;\n}", "function br_isPrime(num) \n{\n // 1 is not prime\n if(PCmode == PC_PRIME_MODE) {\n for(var i = 0; i < br_primes.length; i++) {\n if(br_primes[i] == num) {\n return true;\n }\n }\n }else if(PCmode == PC_EVEN_MODE) {\n return (num%2 == 0);\n }else{\n return (num%PCmultiplier == 0);\n }\n return false;\n}", "function isPrime(num) {\n let divisor = 2;\n while (num > divisor) {\n if (num % divisor === 0) return false;\n divisor++;\n }\n return true;\n}", "function isPrime(num) {\n for (var i = 2; i < num; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n return true;\n}", "function isPrime(n){\n //define variable named divisor with value 2\n var divisor = 2;\n\n // while n > divisor, keep running code inside the while loop\n //n = 137, divisor = 2\n while (n > divisor){\n if(n % divisor == 0){\n return false; \n }\n else {\n divisor++;\n }\n }\n return true;\n}", "function isPrime(num) {\n if (num < 2) {\n return false;\n }\n for (let i = 2; i < num; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n return true;\n}", "function isPrime(num){\n if (num != 2 && num % 2 === 0) return false;\n for (let i = 3; i <= Math.sqrt(num); i += 2) {\n if(num % i === 0) {\n return false;\n }\n }\n return true;\n}", "function isPrime(num) {\n if (num === 2 || num === 3 || num === 5 || num === 7) {\n return true;\n }\n if (num < 2) {\n return false;\n } else if (num % 2 === 0) {\n return false;\n } else if (num % 3 === 0) {\n return false;\n } else if (num % 5 === 0) {\n return false;\n } else if (num % 7 === 0) {\n return false\n } else {\n return true;\n }\n}", "function isPrime(num) {\n let result = false;\n \n for(let i = 2; i <= Math.floor(Math.sqrt(num)); i++) {\n if(num % i === 0){\n result = false;\n break;\n } \n result = true;\n }\n return result;\n }", "function prim(x) {\n if (x < 2) return false;\n\n for (let i = 2; i < x; i++) {\n if (x % i === 0) {\n return false;\n }\n }\n return true;\n}", "function isPrime(num){\n // let prime = true;\n if (num<=1){\n return false;\n }\n}", "function isPrime(num) {\n if (num <= 1)\n return false;\n else if (num === 2)\n return true;\n else {\n for (let i = 2; i < num; i++)\n if (num % i === 0)\n return false;\n return true;\n }\n}", "function isPrime(num) {\n for ( var i = 2; i < num; i++ ) {\n if ( num % i === 0 ) {\n return false;\n }\n }\n return num > 1;\n}", "function isPrime(num) {\n if (num < 2) {\n return false;\n }\n\n for (let i = 2; i < num; i++) {\n if (num % i === 0) {\n return false;\n }\n }\n return true;\n}", "function isPrime(n){\n if (n<=1){\n return false //number isnt prime \n }\n for (let i= 2; i< n; i++){\n if ( (n % i) ==0){\n false /*number isnt prime // we \n cant do i<= n coz that would definately \n return 0 when the \n value of n== i ;and test would end \n without answering any questions */\n }\n }\nreturn true /*the number is indeed prime \ncoz(i) it is either less than or equal to 1\nand (ii) there was a number less than it that coul\nreturn a remainder of 0 on division */\n}", "function isPrime(pNum)\r\n{\r\n for (i = 2; i < pNum; i++)\r\n {\r\n const result = pNum % i;\r\n\r\n if (result === 0)\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n //in this case returning pNum if it's greather than 1, as 1 would skip the for loop as well as a negative number\r\n return pNum > 1;\r\n\r\n}", "function isPrime(n) {\n var divisor = 2;\n while (n > divisor){\n if(n % divisor == 0) {\n return false;\n } else {\n divisor++;\n }\n }\n return true;\n}", "function isPrime(n){\n for (let a = 2; a < n; a++){\n if (n%a === 0){\n return false;\n }\n }\n return true;\n }", "function isPrime(number){\n\tif(number < 2){\n\t\treturn false;\n\t}else if(number === 2){\n\t\treturn true;\n\t}\n\t\n\tfor(var i = 2; i < number; i++){\n\t\tif(number % 1 === 0){\n\t\t\treturn false;\n\t\t\tbreak;\n\t\t}\n\t}\n\treturn true;\n}", "function isPrime(num) {\n\t// determine if the number is greater than 1\n\t//run a for loop\n\t//if (statement) the number is divisible by i, we know it is not prime\nif (num <= 1) {\n\treturn false;\n}\n\n\t\tfor (var i = 2; i < num; i++) {\n\t\t\tif (num !== 2 && num % i === 0) {\n\t\t\t\treturn false;\n\t\t\t} \n\t\t\t\n\t\t}\n\t\treturn true;\n}", "function isPrime(num) {\n if(num < 2) return false;\n for (var i = 2; i < num; i++) {\n if(num%i==0)\n return false;\n }\n return true;\n}", "function IsPrime(n){\n var divisor = 2;\n\n while(n > divisor){\n if (n % divisor == 0){\n return false;\n }\n else divisor++;\n }\n return true;\n}", "function isPrime2(num) {\n for(var i = 2; i < num; i++){\n if(num % i === 0) {return false;}\n }\n return num !== 1;\n}", "function isPrime(num) {\n for (let i = 2; i <= Math.sqrt(num); i++) {\n if (num % i == 0)\n return false;\n }\n return true;\n }" ]
[ "0.78270507", "0.7769947", "0.7639214", "0.761437", "0.7585566", "0.7584158", "0.7576208", "0.75541", "0.75500673", "0.75442046", "0.75348085", "0.7533379", "0.75116426", "0.75111496", "0.75037444", "0.75028056", "0.7493262", "0.7489319", "0.7480578", "0.74717724", "0.7470428", "0.7468904", "0.74668384", "0.74588925", "0.745714", "0.7456641", "0.74492544", "0.7448324", "0.7445039", "0.7436947", "0.7429879", "0.74298257", "0.7429003", "0.742886", "0.7426156", "0.7421648", "0.74132574", "0.7401921", "0.7400353", "0.73992467", "0.73986816", "0.7393157", "0.7389618", "0.7388861", "0.73846424", "0.7383651", "0.73820937", "0.7381122", "0.7375778", "0.7372894", "0.7368702", "0.7365172", "0.73627734", "0.7361838", "0.7361582", "0.73596066", "0.7358865", "0.73550767", "0.7350692", "0.73505116", "0.7349824", "0.73456883", "0.7344911", "0.7343493", "0.7343493", "0.7340501", "0.7339972", "0.733964", "0.73380005", "0.7332073", "0.7314425", "0.7314425", "0.7314394", "0.73099023", "0.7308709", "0.7304897", "0.7301253", "0.7301013", "0.7301013", "0.7299144", "0.72936654", "0.7290894", "0.7290026", "0.7289951", "0.7285478", "0.72688043", "0.726761", "0.7263802", "0.7261245", "0.725776", "0.72565943", "0.7256113", "0.7252832", "0.7243425", "0.7228786", "0.72249275", "0.72120523", "0.7206485", "0.7203175", "0.71962965", "0.71914095" ]
0.0
-1
It will used to find the Anagram numbers in Prime Numbers
findAnaPrime(ii, jj) { var primes = this.findPrime(ii, jj); var n = primes.length; var anaPrimes = []; var h = 0; for (let i = 0; i < n - 1; i++) { for (let j = i + 1; j < n - 1; j++) { if (this.checkAnagram2(primes[i], primes[j])) { anaPrimes[h++] = primes[i]; anaPrimes[h++] = primes[j]; } } } return anaPrimes; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "findAnaPrime(x, y) {\n var prime = this.findPrime(x, y);\n var n = prime.length;\n\n var anaPrime = [];\n\n for (let i = 0; i < n ; i++) {\n for (let j = i + 1; j < n ; j++) {\n if (this.isAnagram(prime[i].toString(), prime[j].toString())) {\n anaPrime.push(prime[i]);\n anaPrime.push(prime[j]);\n }\n }\n }\n return anaPrime;\n }", "isAnagramPalindrome(primes){\n var arr = []; \n arr = primes;\n console.log('Anagrams that are palindromes');\n \n for (let i = 0; i < arr.length; i++) {\n for (let j = i+1; j < arr.length; j++) {\n if (this.anagramDetection(arr[i].toString(),arr[j].toString())) {\n if (this.isPalindrome(arr[i].toString(),arr[j].toString())) {\n console.log(arr[i]+' '+arr[j]);\n }\n }\n }\n }\n \n }", "function checkAnagram() {\t\n\t\tvar first_str, second_str, first_temp, second_temp;\n\t\tfirst_str = $(\"#anagram-a\").val();\n\t\tfirst_temp = first_str;\n\t\tsecond_str = $(\"#anagram-b\").val();\n\t\tsecond_temp = second_str\n\t\tif(first_str.length != second_str.length) {\n\t\t\t$(\"#anagram-output\").append(\"<p>\\\"\" + first_str + \"\\\" and \\\"\" \n\t\t\t\t+ second_str + \"\\\" are not anagrams for each other</p>\");\n\t\t\treturn;\n\t\t}\n\t\tfirst_str = first_str.split(\"\").sort().join(\"\");\n\t\tsecond_str = second_str.split(\"\").sort().join(\"\");\n\t\tfor(var i = 0; i < first_str.length; i++) {\n\t\t\tif(first_str[i] != second_str[i]) {\n\t\t\t\t$(\"#anagram-output\").append(\"<p>\\\"\" + first_temp + \"\\\" and \\\"\" \n\t\t\t\t+ second_temp + \"\\\" are not anagrams for each other</p>\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t$(\"#anagram-output\").append(\"<p>\\\"\" + first_temp + \"\\\" and \\\"\" \n\t\t\t\t+ second_temp + \"\\\" are anagrams for each other</p>\");\n\t}", "function checkAnagram(a = '', b = '') {\n var array = {};\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n let res = a.charCodeAt(i) - 97;\n console.log('res', res);\n array[res] = (array[res] || 0) + 1;\n }\n console.log('array', array);\n\n for (let j = 0; j < b.length; j++) {\n let res = b.charCodeAt(j) - 97;\n if (!array[res]) {\n return false;\n }\n array[res]--;\n }\n return true;\n}", "isAnagram(a, b) {\n\n var x = a.toLowerCase();\n var y = b.toLowerCase();\n if (x.length != y.length) {\n return false;\n //console.log(\"Given string is not Anagram.\");\n }\n else {\n var m = [], n = [];\n m = x.split(\"\");\n n = y.split(\"\");\n m = m.sort();\n n = n.sort();\n if (m.length == n.length) {\n for (let i = 0; i < m.length; i++) {\n if (m[i] != n[i]) {\n return false;\n }\n\n }\n return true;\n }\n }\n }", "function anagram(s) {\n const sL = s.length;\n if ((sL & 1) === 0) {\n const mid = sL / 2;\n let firstSlice = s.slice(0, mid).split('');\n let secondSlice = s.slice(mid).split('');\n return sumUp(firstSlice, secondSlice);\n }\n return -1;\n\n}", "algoanagram(s1, s2) {\n\n var l1 = s1.length\n var l2 = s2.length\n var flag = true\n if (l1 != l2) {\n flag = false\n }\n else {\n var s3 = s1.toLowerCase()\n var s4 = s2.toLowerCase()\n\n s3 = s3.split('').sort().join('');\n s4 = s4.split('').sort().join('');\n\n // console.log(s3);\n // console.log(s4);\n flag = s3 === s4;\n // var c=a.split(\" \")\n // var c=b.split(\" \")\n\n\n //console.log(c)\n // console.log(d)\n\n\n\n\n\n }\n if (flag == true) {\n console.log(s1 + \" and \" + s2 + \" are anagram\")\n }\n else {\n console.log(s1 + \" and \" + s2 + \" are not anagram\")\n }\n }", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function anagram(arr, size) {\n var flag;\n var x = 0;\n\n for (i = 0; i < size; i++) {\n if (arr[i] > 10) {\n var no1 = arr[i];\n var a = Math.floor(no1 / 10);\n var b = no1 - a * 10;\n for (j = i + 1; j < size; j++) {\n var no2 = arr[j];\n var c = Math.floor(no2 / 10);\n var d = no2 - c * 10;\n if (a == d && b == c) {\n agram[x] = arr[j];\n x++;\n break;\n\n } else {\n continue;\n }\n }\n }\n if (arr[i] > 100) {\n var no1 = arr[i];\n var a = Math.floor(no1 / 100);\n var b = no1 - a * 100;\n var c = Math.floor(b / 10);\n var d = b - c * 10;\n for (j = i + 1; j < size; j++) {\n\n var no2 = arr[j];\n var e = Math.floor(no2 / 100);\n var f = no2 - e * 100;\n var g = Math.floor(f / 10);\n var h = f - g * 10;\n arr2.push(e);\n arr2.push(g);\n arr2.push(h);\n arr2.sort();\n\n var a1 = arr2[0];\n var a2 = arr2[1];\n var a3 = arr2[2];\n arr2 = [];\n if ((a == a1) && (c == a2) && (d == a3)) {\n agram[x] = arr[j];\n x++;\n break;\n } else {\n continue;\n }\n }\n }\n }\n}", "isAnagram(string1, string2) {\n string1=string1+\"\";\n string2=string2+\"\";\n if (string1.length != string2.length) {\n return false;\n }\n var arr = [];\n for (let index = 0; index < 36; index++) {\n arr[index] = 0;\n\n }\n for (let index = 0; index < string1.length; index++) {\n var ch = string1.charAt(index);\n if (ch >= 'a' && ch <= 'z') {\n var code = ch.charCodeAt(0);\n\n arr[code - 97]++;\n } else if (ch >= 'A' && ch <= 'Z') {\n var code = ch.charCodeAt(0);\n arr[code - 65]++;\n } else {\n var code = ch.charCodeAt(0);\n arr[code - 22]++;\n }\n ch = string2.charAt(index);\n if (ch >= 'a' && ch <= 'z') {\n var code = ch.charCodeAt(0);\n\n arr[code - 97]--;\n } else if (ch >= 'A' && ch <= 'Z') {\n var code = ch.charCodeAt(0);\n arr[code - 65]--;\n } else {\n var code = ch.charCodeAt(0);\n arr[code - 22]--;\n }\n\n\n }\n for (let index = 0; index < 36; index++) {\n if (arr[index] != 0) {\n return false;\n }\n }\n return true;\n}", "function anagramStr(str, input){\n if(str.length != input.length){\n return false;\n }\n let loopData = {};\n str = str.toLowerCase().trim();\n for (let index = 0; index < str.length; index++) {\n let element = str[index];\n loopData[element] = element && loopData[element] ? loopData[element] + 1 : 1;\n }\n console.log(loopData);\n input = input.toLowerCase().trim();\n for (let index = 0; index < input.length; index++) {\n const element = input[index];\n if(!loopData[element]){\n return false;\n }\n loopData[element]--;\n }\n console.log(loopData);\n return true;\n}", "function isAnagram(stgOne, stgTwo) {\n \n \n}", "function anagrams(s1, s2) { }", "anagram(string1, string2) {\n try {\n var format = /[a-zA-Z0-9]/;\n var result = false;\n /*\n *checks if strings are within the given format\n */\n if (format.test(string1) && format.test(string2)) {\n /*\n *checks if both strings are of equal length\n */\n if (string1.length == string2.length) {\n /*\n *splits the given strings and sorts them\n */\n var sort1 = string1.toString().split(\"\").sort().join(\"\");\n var sort2 = string2.toString().split(\"\").sort().join(\"\");\n result = sort1 == sort2;\n }\n else {\n console.log(\"Strings length must be of equal length\");\n }\n\n /*\n *checks if one string is an anagram of another\n */\n if (result == true) {\n // console.log(string1 + \" \" + string2);\n return true;\n }\n else {\n return false;\n }\n }\n else {\n console.log(\"Enter only string\");\n\n }\n }\n catch (error) {\n console.log(error.message);\n }\n}", "function makeAnagram(a, b) {\n let counter = {};\n let total = 0;\n Array.from(a).forEach((c) => {\n counter[c] = counter[c] || 0;\n counter[c] += 1;\n });\n Array.from(b).forEach((c) => {\n counter[c] = counter[c] || 0;\n counter[c] -= 1;\n });\n Object.keys(counter).forEach((k) => {\n if (counter[k] !== 0) total += Math.abs(counter[k]);\n });\n return total;\n}", "function is_anagram (str1, str2) {\n return formatStr(str1) === formatStr(str2);\n}", "function anagram(s1, s2) {\n\ts1 = s1.replace(/\\W/g,'').toLowerCase();\n\ts2 = s2.replace(/\\W/g,'').toLowerCase();\n\t//does not remove numbers\n\tconsole.log(s1);\n\tif (s1.length != s2.length) return false;\n\treturn s1.split('').sort().join('') == s2.split('').sort().join('');\n}", "function sherlockAndAnagrams(s) {\n let count = 0;\n //글자 수\n for (let i = 1; i < s.length; i++) {\n for (let j = 0; j < s.length - i; j++) {\n const target = s.substring(j, j + i, j);\n // console.log(\"-------\");\n for (let k = 1 + j; k < s.length - i + 1; k++) {\n let compared = s.substring(k, k + i);\n if (isAnagram(target, compared)) {\n count++;\n }\n }\n }\n }\n return count;\n}", "function countingAnagrams(str) {\n // Your code here\n counter = 0;\n words = str.split(' ')\n console.log(words)\n for (var i = 0; i < words.length; i++) {\n for (var j=0;j<words.length;j++){\n if (words[i]!==words[j] && isAnagram(words[i],words[j])){\n console.log(isAnagram(words[i],words[j]))\n counter++\n }\n }\n return counter\n }\n}", "function makeAnagram(a, b) {\n\tconst charCounts = {};\n\n\tfor (const char of a) {\n\t\tif (charCounts[char]) {\n\t\t\tcharCounts[char] += 1;\n\t\t} else {\n\t\t\tcharCounts[char] = 1;\n\t\t}\n\t}\n\tfor (const char of b) {\n\t\tif (charCounts[char]) {\n\t\t\tcharCounts[char] -= 1;\n\t\t} else {\n\t\t\tcharCounts[char] = -1;\n\t\t}\n\t}\n\n\treturn Object.values(charCounts).reduce(\n\t\t(accu, val) => accu + Math.abs(val),\n\t\t0\n\t);\n}", "function anagramCheck (str1, str2) {\n\n // ---------- Your Code Here ----------\n\n // gets rid of all the spaces and makes them lowercase to produce a string of all the letters lumped together, making comparison easier\n str1 = str1.replace(/\\s/g, \"\");\n str1 = str1.toLowerCase();\n str2 = str2.replace(/\\s/g, \"\");\n str2 = str2.toLowerCase();\n\n\n // if (str1.length !== str2.length) {\n // return false;\n // }\n \n str1 = str1.split(\"\").sort().join(\"\");\n str2 = str2.split(\"\").sort().join(\"\");\n \n return (str1 == str2);\n\n // ----------- End Code Area -----------\n\n}", "function annagram(word1, word2) {\n let clean1 = word1.replace(/[.,\\/#№?\\d@!$%\\^&\\*;:{}=\\-_`~()]/g, \"\").replace(/\\s{2,}/g, \" \").toLowerCase().split(' ').join('').trim();\n let clean2 = word2.replace(/[.,\\/#№?\\d@!$%\\^&\\*;:{}=\\-_`~()]/g, \"\").replace(/\\s{2,}/g, \" \").toLowerCase().split(' ').join('').trim();\n console.log(clean1, clean2)\n\n let newStr1 = clean1.split('').sort().join('')\n let newStr2 = clean2.split('').sort().join('')\n console.log(newStr1, newStr2)\n\n if (newStr1.length === newStr2.length) {\n return newStr1 === newStr2 ? true : false\n } else {\n return false\n }\n}", "function anagrams(str1, str2) {\n let resultsHash = {};\n\n str1.split('').forEach( char => {\n if (!resultsHash[char]) resultsHash[char] = 0;\n resultsHash[char] += 1;\n })\n\n str2.split('').forEach( char => {\n if (!resultsHash[char]) resultsHash[char] = 0;\n resultsHash[char] -= 1;\n })\n\n // console.log(resultsHash)\n return Object.values(resultsHash).every( value => value == 0);\n}", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n if (str1.length !== str2.length ) {\n return false\n }\n\n let strObj = {};\n\n for (let val in str1 ) {\n // for strings you need to do strObj[str1[val]]\n // if key exists add to it if not create it\n strObj[str1[val]] = (strObj[str1[val]] || 0) + 1;\n }\n\n for (let val in str2) {\n strObj[str2[val]] = (strObj[str2[val]] || 0) + 1;\n }\n\n // now loop over the to see if the values are even\n for (let key in strObj) {\n if (strObj[key] % 2 !== 0) {\n return false\n }\n }\n\n return true\n\n}", "function validAnagram(first,second){\n if(first.length!== second.length){\n return false;\n }\n \n //Create an object \n const lookup = {};\n\n //Loop through first string\n for(let i =0;i<first.length;i++){\n let letter = first[i];\n //If letter exists increment otherwise set to 1\n lookup[letter]?lookup[letter]+=1:lookup[letter]=1;\n }\n console.log(lookup)\n\n //Loop through the second string \n for (let i = 0;i<second.length;i++){\n let letter =second[i];\n //If we can't find a letter or letter is zero , then its not an anagram\n if(!lookup[letter]){\n return false;\n }\n else{\n lookup[letter]-=1;\n }\n }\n\n return true;\n\n}", "function anagramsAlt(string) {\n let arr = string.split('')\n let arr2 = []\n let n = arr.length\n let count = 0;\n\n //Populate arr2\n for (let i = 0; i < n; i++) {\n arr2.push(0)\n }\n\n count ++\n console.log(arr, count)\n\n let e = 0;\n while (e < n) {\n if (arr2[e] < e) {\n if (e % 2 === 0) {\n let placeholder = arr[0]\n arr[0] = arr[e]\n arr[e] = placeholder\n } else {\n // arr[arr2[e]], arr[e]\n let placeholder = arr[arr2[e]]\n arr[arr2[e]] = arr[e]\n arr[e] = placeholder\n }\n count ++\n console.log(arr, count)\n arr2[e]++\n e = 0\n } else {\n arr2[e] = 0\n e++\n }\n }\n}", "function anagram(arr){\n let hash = new HashMap();\n for(let i=0; i < arr.length; i++){\n let key = arr[i].split('')\n .sort()\n .join('');\n try{\n let val = hash.get(key);\n val.push(arr[i]);\n }\n catch(err){\n hash.set(key, [arr[i]]) \n }\n }\n let arrayResults;\n \n arrayResults = hash._slots\n .filter(_slot => _slot !== undefined)\n .map(_slot => _slot.value);\n console.log(arrayResults);\n \n}", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n // check if str1 has the same length as str2 & same characters\n if(str1.length !== str2.length){\n return false\n }\n // create an object call lookup\n let lookup = {}\n// construct the object first\n for (let i = 0; i < str1.length; i++){\n letter = str1[i]\n //if letter exits, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n console.log(lookup)\n for (let i = 0; i < str2.length; i++){\n let letter = second[i];\n // can't find letter of letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1;\n }\n return true;\n }\n}", "function anagrams(string, arr=string.split(''), n = arr.length) {\n\n if (n === 1) {\n count ++\n console.log(arr, count)\n }\n else {\n for (let i = 0; i < n - 1; i++) {\n anagrams(string, arr, n-1, count)\n if (n % 2 === 0) {\n let placeholder = arr[i]\n arr[i] = arr[n-1]\n arr[n-1] = placeholder\n } else {\n let placeholder = arr[0]\n arr[0] = arr[n-1]\n arr[n-1] = placeholder\n }\n }\n anagrams(string, arr, n - 1, count)\n }\n}", "function printAnagram(word){\n console.log(`The word for which we will find an anagram is ${word}`);\n anagrams(' ', word);\n\n}", "function isAnagram(s1, s2) {\n var i = 0\n //sortChars :: String -> String\n , sortChars = function (s) {\n return s.toLowerCase().split('').sort().join('');\n }\n ;\n if (s1.length !== s2.length){ return false; }\n if (sortChars(s1) !== sortChars(s2)) { return false; }\n return true;\n}", "function findAnagrams(s, p) {\n // create the character counter for p {a:1, b:1, c:1}\n const arr = [];\n let uniqueChars = 0;\n const charCache = {};\n for (let i = 0; i < p.length; i++) {\n if (charCache[p[i]]) {\n charCache[p[i]]++;\n } else {\n uniqueChars++;\n charCache[p[i]] = 1;\n }\n }\n // loop iterating through s\n for (let i = 0; i < s.length - p.length + 1; i++) {\n const currentCache = { ...charCache };\n for (let j = i; j < i + p.length; j++) {\n if (currentCache[s[j]]) {\n currentCache[s[j]]--;\n }\n if (currentCache[s[j]] === 0) {\n uniqueChars--;\n }\n if (!uniqueChars) {\n arr.push(i);\n }\n }\n }\n return arr;\n}", "function anagram (str1, str2) {\n\tvar letterCount = { };\n\n\tletterCount = countWords(str1, letterCount, 1) // pass to do positive count of letters in str1\n\tletterCount = countWords(str2, letterCount, -1) // pass to do negative count of letters in str2\n\t\n\t/* If the strings are anagrams, we expect every entry in the dictionary to \n\t * be equal to 0. Otherwise there will be some entry with a negative or positive count. */\n\tfor (key in letterCount) {\n\t\tif (letterCount[key] != 0)\n\t\t\treturn false\n\t}\n\n\treturn true\n}", "function anagram(str1,str2){\n\n //2. Check to see if input1 & input2 are strings, if not return error/false\n if (typeof(str1, str2) !== 'string'){\n return false;\n }\n\n //3. Check to see if input1 & input2 are the same length, if not return error/false\n if (str1.length !== str2.length){\n return false;\n }\n\n //4. Create objects for both inputs\n let stringBox1 = {};\n let stringBox2 = {};\n\n //5. For each value in string1, if does not exist, create key and set value to 1 in Object1.\n //6. If value exists in Object1, increment value by 1.\n for(let val of str1){\n stringBox1[val] = stringBox1[val] + 1 || 1;\n\n }\n console.log(stringBox1);\n //7. For each value in string2, if does not exist, create key and set value to 1 in Object2.\n //8. If value exists in Object2, increment value by 1.\n for(let val of str2){\n stringBox2[val] = stringBox2[val] + 1 || 1;\n\n }\n console.log(stringBox2)\n\n //9. For each key in Object1, compare to each key in Object2.\n for(let key in stringBox1){\n // If does not exist, return false.\n if(!(key in stringBox2)){\n console.log('step 9')\n return false;\n }\n //10. Compare value of that key to each value of every key in Object2.\n if(stringBox1[key] !== stringBox2[key]){\n console.log('step 10')\n return false;\n }\n //11. Return true.\n console.log('Step 11')\n return true;\n\n }\n\n\n}", "function anagram(prefix, word) {\n if (word.length === 1) {\n console.log(prefix + word);\n }\n\n for (let i = 0; i < word.length; i++) {\n const firstChar = word.charAt(i);\n const remainder = word.substring(0, i) + word.substring(i + 1);\n anagram(prefix + firstChar, remainder);\n }\n}", "function thirdAnagram(str1, str2) {\n // Complexity (n + m) - time | space - 2 ==> 1\nlet obj = {}\nlet obj2 = {}\n\nfor (let i = 0; i < str1.length || i < str2.length; i++){\n const str1Key = str1[i], str2Key = str2[i];\n if(obj[str1Key]){\n obj[str1Key]++\n }else {\n obj[str1Key] = 1\n }\n if(obj2[str2Key]){\n obj2[str2Key]++\n }else {\n obj2[str2Key] = 1\n }\n}\n// const val1Array = Object.entries(obj);\n// const val2Array = Object.entries(obj2);\n\nfor (let key1 in obj) {\n if (obj[key1] !== obj2[key1]){\n return false;\n }\n}\nfor (let key2 in obj) {\n if (obj2[key2] !== obj1[key2]){\n return false;\n }\n}\nreturn true;\n\n// if (val1Array.sort().join('') === val2Array.sort().join('')){\n// return true\n// }else return false\n// console.log(val1Array)\n// console.log(val2Array)\n}", "function anagram(string) {\n const results = {}\n function buildCombos(combos, letters) {\n if(!letters.length) {\n return results[combos] = '';\n }\n for (var i = 0; i < letters.length; i++) {\n buildCombos(combos + letters.charAt(i), letters.slice(0, i) + letters.slice(i + 1));\n }\n}\n buildCombos('', string);\n return Object.keys(results);\n\n}", "function validAnagram(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < first.length; i++) {\n let letter = first[i];\n // if letter exists, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n // console.log(lookup)\n\n for (let i = 0; i < second.length; i++) {\n let letter = second[i];\n // can't find letter or letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1;\n }\n }\n console.log(lookup)\n return true;\n}", "function validAnagram(str1, str2) {\n if(str1.length !== str2.length) {\n return false;\n }\n \n let lookup = {};\n \n for(i = 0; i < str1.length; i++){\n let letter = str1[i]\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n \n for(let j = 0; j < str2.length; j++) {\n let letter = str2[j]\n if(!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1\n }\n }\n return true;;\n}", "checkAnagram2(str1, str2) {\n let unsortedStr1 = \"\" + str1;\n let unsortedStr2 = \"\" + str2;\n if (unsortedStr1.length != unsortedStr2.length) {\n return false;\n }\n sortedStr1 = this.sort1(unsortedStr1);\n sortedStr2 = this.sort1(unsortedStr2);\n let b = this.check(sortedStr1, sortedStr2);\n if (b == true) {\n return true;\n }\n else {\n return false;\n }\n }", "function anagrams(string1, string2){\n let obj = {};\n\n string1.split(\"\").forEach((char) => {\n if (!obj[char]) {\n obj[char] = 1;\n } else {\n obj[char] += 1;\n }\n });\n\n string2.split(\"\").forEach((char) => {\n if (!obj[char]) {\n obj[char] = 1;\n } else {\n obj[char] -= 1;\n }\n });\n\n return Object.values(obj).every(char => char === 0);\n}", "function validAnagram(str1, str2) {\n if (str1 === '' && str2 === '') {\n return true;\n }\n\n if (str1 === str2) {\n return true;\n }\n\n if (str1.length !== str2.length) {\n return false;\n }\n\n let anagram1 = {};\n\n for (let char of str1) {\n anagram1[char] = ++anagram1[char] || 1;\n }\n\n console.log('obj: ', anagram1);\n\n for (let char of str2) {\n if (!anagram1[char]) {\n return false;\n } else {\n anagram1[char] -= 1;\n }\n }\n return true;\n}", "function validAnaram2(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n //Initalize object\n const lookup = {};\n\n for (let i = 0; i < first.length; i++) {\n let letter = first[i];\n //if letter exists, incremnt, otherwise set to 1\n lookup[letter] ? (lookup[letter] += 1) : (lookup[letter] = 1);\n }\n\n for (let i = 0; i < second.length; i++) {\n let letter = second[i];\n //Cant find letter or letter is zero then its not an anagram\n //Because zero is falsey\n if (!lookup[letter]) {\n return false;\n } else {\n //If letter exists, subtract one, one is truthy\n lookup[letter] -= 1;\n }\n }\n return true;\n}", "function validAnagram (str1, str2) {\n let obj = {};\n if (str1.length !== str2.length) return false;\n for (let char of str1) {\n obj[char] = obj[char] ? obj[char] + 1 : 1;\n }\n for (let char of str2) {\n if (!obj[char]) {\n return false;\n } else {\n obj[char]--;\n }\n }\n return true;\n}", "function makeAnagram(a, b) {\n var aChars = a.split(\"\");\n var bChars = b.split(\"\");\n \n // determin what is the larger array and make it outer\n if (aChars.length > bChars.length) {\n var outer = aChars;\n var inner = bChars;\n } else {\n var outer = bChars;\n var inner = aChars;\n }\n // starting at the back, last index, of the larger array\n var outerIndex = outer.length-1;\n while (inner.length > 0 && outer.length > 0 && outerIndex >= 0) {\n //this will look for a charcter that is the same as the last in outer\n let innerIndex = inner.indexOf(outer[outerIndex]);\n //if the charcter is found endter statement\n if (innerIndex !== -1) {\n //remove the idex of the matching charcters\n outer.splice(outerIndex, 1);\n inner.splice(innerIndex, 1);\n }\n --outerIndex;\n }\n return outer.length + inner.length\n}", "function isAnagram(str1, str2) {\n return formatString(str1) === formatString(str2);\n}", "function isAnagram(first, second) {\n let output1 = first.toLowerCase().split(\"\").sort().join(\"\");\n let output2 = second.toLowerCase().split(\"\").sort().join(\"\");\n return output1 == output2;\n}", "function isAnagram(str1, str2) {\n return formatStr(str1) === formatStr(str2)\n}", "function sherlockAndAnagrams(s) {\n let anag = 0\n let map = {}\n let st = []\n for(let i=0;i<s.length;i++){\n st.push(s[i]);\n }\n for(let i=0;i<s.length;i++){\n for(let j=0;j<(s.length - i);j++){\n let s1 = (st.slice(j,j+i+1).sort()).join();\n map[s1] = (map[s1])? map[s1]+1 : 1;\n }\n }\n let keys = Object.keys(map);\n for(let key of keys){\n anag += Math.floor(((map[key] - 1) * map[key] )/2)\n }\n return anag;\n}", "function makeAnagram(a, b) {\n // keeps track of deletions from str a and b\nlet count = 0 // letters matching from both str a and str b to make an anagram\nlet length = a.length\n// 1 <= |a|, |b| <=10**4\nconst lengthOfA = a.length\nconst lengthOfB = b.length\n\n// doesn't matter, we'll eventually ending up deleting letters that don't match up with each string\n// if (lengthOfA !== lengthOfB){\n// // the length has to be equal to the shortest character length,\n// // we will iterate until that point\n// lengthOfA > lengthOfB ? length = lengthOfB : length = lengthOfA\n// }\n \n // seperating each string letter\n a = a.split('')\n b = b.split('')\n \nfor (let i =0; i<length; i++){\n console.log(\"i = \" + \"\" + i)\n // if an anagram exists (letter in a is in b)\n if (b.includes(a[i])){\n console.log(\"letter in 'a, remove in 'b'--> \" + a[i])\n // removing the letter in a\n let temp = a[i]\n a.splice(i,1)\n // found match in a\n count+=1\n // find and remove the same letter in b\n b.splice(b.indexOf(temp),1)\n // found match in b\n count+=1\n // go back to same round to check new letter in same position\n i = i-1\n }\n } // subtracting the matching anagram count against original letter count of both strings\n return (lengthOfA + lengthOfB) - count\n}", "function fourthAnagram(str1, str2) {\n let obj = {};\n for (let i = 0; i < str1.length; i++) {\n if (obj[`${str1[i]}1`]) {\n obj[`${str1[i]}1`]++\n } else {\n obj[`${str1[i]}1`] = 1\n }\n }\n for (let i = 0; i < str2.length; i++) {\n if (obj[`${str2[i]}2`]) {\n obj[`${str2[i]}2`]++\n } else {\n obj[`${str2[i]}2`] = 1\n }\n } \n\n for (const key in obj) {\n if (obj[key[0]+\"1\"] !== obj[key[0]+\"2\"]) {\n return false;\n }\n }\n return true;\n}", "function anagram(string, str){\n return string.split('').sort().join('') === str.split('').sort().join('')\n}", "function testAnagram (s1, s2){\n // creating if statments \n if(!s1 || !s2 || s1.length !== s2.length){return false;}\n var lS1 = s1.toLowerCase();\n var lS2 = s2.toLowerCase();\n if(lS1 === lS2) {return false;}\n var rS1 = lS1.split('').sort().join('');\n var rS2 = lS2.split('').sort().join('');\n return rS1 === rS2;\n }", "function sherlockAndAnagrams(s) {\n let counter = 0;\n let hashMap = {};\n\n for (let i = 0; i < s.length; i++) {\n for (let j = i + 1; j < s.length + 1; j++) {\n let sub = s.slice(i, j);\n sub = sub.split('').sort().join('');\n if (hashMap[sub]) {\n // at least two anagrams were found.\n // tricky here, we need to count number of pair occurances.\n // we need to sum from 1 to n-1 (triangular number).\n //for example: n=5 ,sum = 1+2+3+4 = 10 pair of anagrams\n counter += hashMap[sub];\n hashMap[sub]++;\n } else {\n hashMap[sub] = 1;\n }\n }\n }\n return counter;\n}", "function makeAnagram(a, b) {\n let bigArr;\n let smallArr;\n let count = 0;\n if (a.length > b.length) {\n bigArr = a.split('');\n smallArr = b.split('');\n }\n else {\n bigArr = b.split('');\n smallArr = a.split('');\n }\n\n for(let i = 0; i < smallArr.length; i++) { \n if (bigArr.includes(smallArr[i])) {\n bigArr.splice(bigArr.indexOf(smallArr[i]), 1);\n count++;\n }\n }\n return smallArr.length - count + bigArr.length;\n}", "function validAnagram(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n const lookup = {}; // Ospace (a)\n const firstLength = first.length;\n for (let index = 0; index < firstLength; index++) { // Otime (a)\n const element = first[index];\n lookup[element] = (lookup[element] || 0) + 1;\n }\n const secondLength = second.length;\n for (let index = 0; index < secondLength; index++) { // Otime (b)\n const element = second[index];\n if (!lookup[element]) {\n return false;\n }\n lookup[element] -= 1;\n }\n return true;\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) return false\n\n let check = {}\n\n for (let i = 0; i < str1.length; i++) {\n const letter = str1[i]\n check[letter] ? (check[letter] += 1) : (check[letter] = 1)\n }\n\n for (let i = 0; i < str2.length; i++) {\n const letter = str2[i]\n if (!check[letter]) {\n return false\n } else {\n check[letter] -= 1\n }\n }\n\n return true\n}", "function possibleAnagram(arr1 , word){\n let arrAnagram = []\n for(let i = 0 ; i < arr1.length ; i++){\n let anagram = arr1[i]\n let count = 0\n for(let j = 0 ; j < anagram.length ; j++){\n for(let n = 0 ; n < word.length ; n++){\n if(word[n] == anagram[j]){\n count++\n }\n }\n }\n if(count === arr1[i].length && arr1[i].length === word.length){\n arrAnagram.push(anagram)\n }\n }\nreturn arrAnagram;\n}", "function anagram(s, t) {\n if(s.length !== t.length) return false\n let char = {};\n \n for(let i = 0; i < s.length; i++) {\n char[s[i]] ? char[s[i]]++ : char[s[i]] = 1\n }\n \n for(let j = 0; j < t.length; j++) { // one letter might appear more that twice\n // that is why we count them \n // instead of just setting the key to true or false\n if(!char[t[j]]) {\n return false\n }\n char[t[j]]--\n }\n return true;\n }", "function anagram(str1, str2){\n if(str1.length != str2.length)return false;\n characterCount = {}\n for(let s1 of str1){\n characterCount[s1] = characterCount[s1] + 1 || 1\n }\n for(let s2 of str2){\n if(!characterCount[s2])return false;\n else characterCount[s2]--;\n }\n return true;\n}", "function makeAnagram(str1, str2) {\n let counter1 = str1.split(\"\").reduce((acc, ltr) => {\n acc[ltr] = ++acc[ltr] || 1;\n return acc;\n }, {});\n let counter2 = str2.split(\"\").reduce((acc, ltr) => {\n acc[ltr] = ++acc[ltr] || 1;\n return acc;\n }, {});\n for (let ltr in counter2) {\n counter1[ltr] = (counter1[ltr] || 0) - counter2[ltr];\n }\n return Object.values(counter1).reduce((acc, val) => acc + Math.abs(val), 0);\n}", "function anagrams(prefix, str){\n if(str.length <= 1){\n // console.log(`The anagram is ${prefix}${str}`);\n } else {\n for(let i=0; i<str.length; i++){\n let currentLetter = str.substring(i, i+1);\n let previousLetters = str.substring(0,i);\n let afterLetters = str.substring(i+1);\n anagrams(prefix+currentLetter, previousLetters+afterLetters);\n }\n }\n\n}", "function isAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n for (var i = 0; i < str1.length; i++) {\n var foundEqual = false;\n for (var j = 0; j < str2.length; j++) {\n if (str1[i] === str2[j]) {\n foundEqual = true;\n break;\n }\n }\n if (!foundEqual) {\n return false;\n }\n }\n for (var i = 0; i < str2.length; i++) {\n var foundEqual = false;\n for (var j = 0; j < str1.length; j++) {\n if (str2[i] === str1[j]) {\n foundEqual = true;\n break;\n }\n }\n if (!foundEqual) {\n return false;\n }\n }\n return true;\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < str1.length; i++) {\n let letter = str1[i];\n // if letter exists, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n console.log(lookup)\n\n for (let i = 0; i < str2.length; i++) {\n let letter = str2[i];\n // can't find letter or letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n //we subtract one to make sure both str have same frequency of letter\n lookup[letter] -= 1;\n }\n }\n\n return true;\n}", "function anagram(str1, str2) {\n // if not equal then this string is not the same\n if (str1.length !== str2.length) return false\n let mapStr1={};\n let mapStr2={}\n let arr1 = str1.split('');\n let arr2 = str2.split('');\n let v2\n arr1.forEach((v,i)=>{\n mapStr1[v] = mapStr1[v] ? mapStr1[v] + 1 : 1\n v2 = arr2[i]\n mapStr2[v2] = mapStr2[v2] ? mapStr2[v2] + 1 : 1\n })\n\n for(let i in mapStr1) {\n if (mapStr1[i] !== mapStr2[i]) {\n return false\n }\n }\n return true\n}", "function anagram(str1, str2) {\n\tif (str1.length !== str2.length) {\n\t\treturn false;\n\t}\n\tlet frequencyStr1 = {};\n\tfor (let i = 0; i < str1.length; i++) {\n\t\tlet letter = str1[i];\n\t\tfrequencyStr1[letter] ? (frequencyStr1[letter] += 1) : (frequencyStr1[letter] = 1);\n\t}\n\n\tfor (let i = 0; i < str2.length; i++) {\n\t\tlet letter = str2[i];\n\t\tif (!frequencyStr1[letter]) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tfrequencyStr1[letter] -= 1;\n\t\t}\n\t}\n\treturn true;\n}", "function thirdAnagram(str1, str2) {\n let str1Obj = {};\n let str2Obj = {};\n for (let i = 0; i < str1.length; i++) {\n if (str1Obj[str1[i]]) {\n str1Obj[str1[i]]++\n } else {\n str1Obj[str1[i]] = 1\n }\n }\n for (let i = 0; i < str2.length; i++) {\n if (str2Obj[str2[i]]) {\n str2Obj[str2[i]]++\n } else {\n str2Obj[str2[i]] = 1\n }\n\n }\n\n\n for (const key in str1Obj) {\n\n if (str1Obj[key] !== str2Obj[key]) {\n return false\n }\n\n }\n\n return true\n\n}", "function validAnagram(word1, word2){\n if (word1.length !== word2.length) {\n return false;\n }\n\n let counter = {};\n\n for (let i = 0; i < word1.length; i++) {\n let letter = word1[i];\n if (counter[letter]) {\n counter[letter]++;\n } else {\n counter[letter] = 1;\n }\n }\n\n for (let i = 0; i < word2.length; i++) {\n let letter = word2[i];\n if (!counter[letter]) {\n return false;\n } else {\n counter[letter] -= 1;\n }\n }\n return true;\n}", "function anagram (str1,str2){\n if(str1.length!==str2.length)\n return false;\n\n let freqCounter1 = {};\n let freqCounter2 = {};\n\n for(let val of str1)\n freqCounter1[val] = (freqCounter1[val]||0)+1;\n\n for(let val of str2)\n freqCounter2[val] = (freqCounter2[val]||0)+1;\n \n for(let key in freqCounter2){\n \n if(!(key in freqCounter2))\n return false;\n \n if(freqCounter2[key]!==freqCounter1[key])\n return false;\n \n return true;\n }\n\n\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n\n if (str1 === '' && str2 === '') {\n return true;\n }\n\n const lookup = {};\n\n for (let i = 0; i < str1.length; i++) {\n let char = str1[i];\n lookup[char] ? (lookup[char] += 1) : (lookup[char] = 1);\n }\n\n for (let i = 0; i < str1.length; i++) {\n let char = str2[i];\n if (!lookup[char]) {\n return false;\n } else {\n lookup[char] -= 1;\n }\n }\n\n return true;\n}", "function isAnagram(s, t) {\n let newS = s.split(\"\").sort().join(\"\");\n let newT = t.split(\"\").sort().join(\"\");\n if (newS === newT) {\n return true\n } else {\n return false\n }\n}", "function checkAnagramWithTimeComplexity(str1, str2) {\n str1 = str1.toLowerCase();\n str2 = str2.toLowerCase();\n if (str1.length !== str2.length) return false\n let counting = {}\n for (let c of str1) {\n counting[c] = (counting[c] + 1) || 1;\n }\n for (let c of str2) {\n if (counting[c]) {\n --counting[c];\n }\n else {\n return false;\n }\n }\n return true;\n}", "function validAnagram(first, second){\n if(first.length !== second.length){\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < first.length; i++){\n let letter = first [i];\n //if letter exists in object list, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n\n for (let i = 0; i < second.length; i ++){\n let letter = second[i];\n // if can't find letter or letter is zero then it's not an anagram, return false\n // zero is falsey so it will return false if lookup[letter] = 0\n if(!lookup[letter]){\n return false;\n }else{\n lookup[letter] -= 1;\n }\n }\n return true;\n}", "function fourthAnagram(str1, str2) {\n let letterSums = {};\n\n // If we do the exact same subractions for each letter in\n // str2 as we do additions for str1, letter_sums will all be 0.\n str1.split(\"\").forEach((e) => (letterSums[e] = (letterSums[e] || 0) + 1));\n str2.split(\"\").forEach((e) => (letterSums[e] = (letterSums[e] || 0) - 1));\n\n // It's a zero-sum game!\n return Object.values(letterSums).every((sum) => sum === 0);\n}", "function sameFrequency(n1, n2){\n return validAnagram(n1.toString(), n2.toString());\n}", "function funWithAnagrams(arr) {\n let uniqueWords = [arr[0]];\n for (let i = 1; i < arr.length; i++) {\n let duplicate = false;\n for (let j = 0; j < uniqueWords.length; j++) {\n if (isAnagram(uniqueWords[j], arr[i])) {\n duplicate = true;\n }\n }\n if (!duplicate) uniqueWords.push(arr[i]);\n }\n return uniqueWords.sort();\n}", "function areAnagrams(str1, str2) {\n if (str1.length != str2.length) {\n return false;\n }\n let hash_map = {}\n for (let i = 0; i < str1.length; i++) {\n let char = str1[i];\n if (char in hash_map) {\n hash_map[char]++;\n } else {\n hash_map[char] = 1;\n }\n }\n\n console.log(hash_map);\n\n for (let i = 0; i < str2.length; i++) {\n let char = str2[i];\n if (!hash_map[char]) {\n return false;\n } else {\n hash_map[char]--;\n }\n }\n return true;\n}", "function findAnagram(str1, str2){ // You wrote this\r\n if(str1.length !== str2.length){\r\n return false;\r\n }\r\n let obj1 = {}\r\n let obj2 = {}\r\n for(let char of str1){\r\n obj1[char] = (obj1[char] || 0) + 1\r\n }\r\n for(let char of str2){\r\n obj2[char] = (obj2[char] || 0) + 1\r\n }\r\n for(let key in obj1){\r\n if(!(key in obj2)){\r\n return false\r\n }\r\n if(obj2[key] !== obj1[key]){\r\n return false\r\n }\r\n }\r\n return true\r\n}", "function isAnagram(s, t) {\n let sortedS = s.split(\"\").sort().join(\"\")\n let sortedT = t.split(\"\").sort().join(\"\")\n return sortedS === sortedT\n}", "function anagrams(string) {\n // Sets are collections of unique values\n var uniqPerms = new Set();\n\n function getPermutations(possibilities, myPermutation, call = 1) {\n console.log(chalk.bold.red(`[${call}] at top possibilities:${possibilities} myPermutation:${myPermutation}`));\n // if we've gone through the whole list of possibilities, we've got a permutation\n if (possibilities.length === 0) {\n console.log(chalk.green(`[${call}] Base Case: [${myPermutation}]`));\n return myPermutation;\n } else {\n // create an array that stores the newest permutation, plus that of all children\n var permutationList = [];\n // the length of the possibilities will diminish as we get closer to a permutation\n for (var i = 0; i < possibilities.length; i++) {\n // here's where we grab the possibilities for this branch\n var pre = possibilities.substring(0, i);\n var post = possibilities.substring(i + 1);\n\n // recursion time!\n // - myPermutation is the Truth for the next level and is made up of the Truth we were passed plus the possibility at i\n // - possibilities are made up of the remaining values to the left and right of the possibility at i\n // - concatenate the result into the list of permutations\n console.log(`[${call}] for loop i:${i} pre:${pre} newTruth:${possibilities[i]} post:${post} possibilities:${possibilities}`);\n permutationList = permutationList.concat(getPermutations(pre + post, myPermutation + possibilities[i], call + 1));\n }\n // once we've reached our base case, return the list of permutations\n console.log(`[${call}] returning permutationList:|${permutationList}|`);\n return permutationList;\n }\n }\n\n // kick off and loop through the resulting array, adding each element to the set to ensure uniqueness\n getPermutations(string, \"\").forEach(result => uniqPerms.add(result));\n\n // return the result as an array\n return Array.from(uniqPerms);\n\n}", "function validAnagram(s, t) {\n if (s.length !== t.length) {\n return false\n }\n let charMap = {}\n s = s.split('')\n for (let index = 0; index < s.length; index++) {\n if (charMap[s[index]]) {\n charMap[s[index]] += 1\n } else {\n charMap[s[index]] = 1\n }\n }\n for (let index = 0; index < t.length; index++) {\n if (!charMap[t[index]]) {\n return false\n } else {\n charMap[t[index]]--\n }\n }\n return true\n}", "function anagram(arr){\n const hash = new Map();\n let result = [];\n arr.forEach(item => {\n let sortedItem = item.split('').sort().join('');\n if(!hash.has(sortedItem)){\n hash.set(sortedItem, [item]);\n result.push(sortedItem);\n } else{\n let items = hash.get(sortedItem);\n items.push(item);\n hash.set(sortedItem, items);\n }\n });\n return result.map(item => hash.get(item.split('').sort().join('')));\n}", "function validAnagram(str1, str2) {\n //if both strings are empty return true\n if(str1.length === 0 && str2.length === 0) return true;\n //create two empty objects\n let obj1 = {};\n let obj2 = {};\n //loop through each of the strings and put them in the objects\n for(let char of str1) {\n if(obj1[char] > 0) {\n obj1[char]++\n } else {\n obj1[char] = 1;\n }\n }\n for(let char of str2) {\n if(obj2[char] > 0) {\n obj2[char]++\n } else {\n obj2[char] = 1;\n }\n }\n //check if each key in strings match to each other \n for(let key in obj1) {\n if(!key in obj2) return false;\n //chack if the frequencies match\n if(obj1[key] !== obj2[key]) return false;\n }\n return true;\n}", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n \n let s1 = str1.split(\"\").sort().join(\"\");\n let s2 = str2.split(\"\").sort().join(\"\");\n \n return s1===s2;\n\n}", "function sherlockAndAnagrams(s) {\n\n s = Array.from(s);\n var length = s.length;\n var counter = 0;\n\n for (var j = 1; j < length; j++) {\n var hash = {};\n for (var i = 0; i < length - j +1; i++) {\n var key = s.slice(i, i + j).sort();\n console.log(key);\n if (hash[key]) {\n hash[key] += 1;\n } else { hash[key] = 1; }\n }\n console.log(hash);\n for (var key in hash) {\n var n = hash[key];\n counter += n * (n - 1) / 2 ; \n }\n }\n return counter;\n\n\n}", "function pangrams(s) {\n s = s.toUpperCase(); //convert the string into one case eith uper or lower\n s = s.split(' ').join(''); // remove all the spaces\n s = s.split(''); // create all char array.\n s = [...new Set(s)]; // remove duplicate character from the array.\n\n return (s.length === 26 ? \"pangram\" : \"not pangram\");\n}", "function isAnagram(s1, s2) {\n if (s1.length !== s2.length) return false\n const map = new Map()\n for (let i = 0; i < s1.length; i++) {\n if (!map.has(s1[i])) {\n map.set(s1[i], 1)\n } else {\n map.set(s1[i], map.get(s1[i]) + 1)\n }\n }\n for (let i = 0; i < s2.length; i++) {\n if (!map.has(s2[i])) return false\n map.set(s2[i], map.get(s2[i]) - 1)\n if (map.get(s2[i]) === 0) {\n map.delete(s2[i])\n }\n }\n return map.size === 0\n}", "function checkAnagram(str1,str2){\n if(str1.length !== str2.length){\n return false;\n }\n var charStr1=str1.split(\"\").sort();\n var charStr2=str2.split(\"\").sort();\n\n for(var i=0; i<charStr1.length; i++){\n if (charStr1[i]!==charStr2[i]){\n return false;\n }\n }\n\n return true;\n\n}", "function validAnagram(str1, str2) {\n\n // no need to check if strings arent same length\n if(str1.length != str2.length) {\n return false\n }\n\n // storatge for counters\n let cache1 = {}\n let cache2 = {}\n\n // counter\n function counter(cache, str) {\n for(let char of str) {\n if(cache[char]) {\n cache[char] += 1\n } else {\n cache[char] = 1\n }\n }\n }\n\n counter(cache1, str1)\n counter(cache2, str2)\n\n // checking if each cache has same amount of each item\n for(const prop in cache1) {\n if(cache1[prop] !== cache2[prop]) {\n return false\n }\n }\n\n return true\n}", "function sherlockAndAnagrams(s) {\n \n var map = new Map();\n var totalCount = 0;\n\n for(var i = 0 ; i < s.length; i++) {\n for(var j=i+1 ; j <= s.length; j++) {\n var SubString = s.substring(i,j);\n\n var chars = [...SubString];\n chars.sort();\n \n SubString = String(chars);\n\n if(map.has(SubString)) {\n var value = map.get(SubString);\n totalCount = totalCount + value;\n\n map.set(SubString, value+1);\n } \n else {\n map.set(SubString, 1);\n }\n }\n }\n return totalCount;\n\n\n}", "function isAnagram(str1, str2) {\n if (str1.length !== str2.length) return false;\n\n let letterMap = {};\n\n for (let i = 0; i < str1.length; i++) {\n let current = str1[i].toLowerCase()\n if (!letterMap[current]) {\n letterMap[current] = 1\n } else {\n letterMap[current] ++\n }\n }\n \n for (let j = 0; j < str2.length; j++) {\n let current = str2[j].toLowerCase();\n if (letterMap[current]) {\n letterMap[current] --\n } else {\n return false;\n }\n }\n return Object.values(letterMap).every(el => el === 0) ? true : false;\n}", "function isAnagram (test, original) {\r\n \r\n // Make sure both strings are in same cases...\r\n const str1 = test.toLowerCase(); \r\n const str2 = original.toLowerCase(); \r\n\r\n if(str1.length !== str2.length) return false;\r\n\r\n let newObject = {};\r\n\r\n for(let i = 0; i < str1.length; i++) {\r\n let letter = str1[i];\r\n newObject[letter] ? newObject[letter] += 1 : newObject[letter] = 1;\r\n }\r\n \r\n for(let i = 0; i < str2.length; i++) {\r\n let letter = str2[i];\r\n if(!newObject[letter]) return false; \r\n else newObject[letter] -= 1;\r\n }\r\n return true;\r\n}", "function permutations(arr) {\n var output = {};\n\n // loop through all the words in the array\n for(var i=0; i<arr.length; i++) {\n var word = arr[i];\n var inOutput = false;\n\n // check all the keys in the output to see if the current word is an anagram of any of them\n for(key in output) {\n if (isAnagram(word, key)) { // if it is an anagram, update the value of that key\n output[key] += 1;\n inOutput = true;\n break; // no need to keep checking if anagram is found\n }\n }\n // if all the keys in the output have been checked and it's not an anagram of any of them\n // it means the word/any anagrams of it are not yet in the output, so add it to the output\n if (inOutput == false) {\n output[word] = 1;\n }\n }\n\n return output;\n}", "function isAnagram( s, t) {\n let charMap = new Map();\n let slength = s.length;\n let tlength = t.length;\n if( slength !== tlength) {\n return false;\n }\n for( let i=0 ; i < slength ; i++){\n charMap.set(s.charAt(i), (charMap.get(s[i]) || 0) +1);\n charMap.set(t.charAt(i), (charMap.get(t[i]) || 0) -1);\n }\n let isAnagram = true;\n charMap.forEach((countOfChar) => {\n if ( countOfChar !== 0 ) {\n isAnagram = false;\n return;\n }\n });\n return isAnagram;\n}", "function getAnagrams(input) {\r\n var counter = [],\r\n anagrams = [],\r\n chars = input.split(''),\r\n length = chars.length,\r\n i;\r\n\r\n for (i = 0; i < length; i++) {\r\n counter[i] = 0;\r\n }\r\n\r\n anagrams.push(input);\r\n i = 0;\r\n while (i < length) {\r\n if (counter[i] < i) {\r\n swap(chars, i % 2 === 1 ? counter[i] : 0, i);\r\n counter[i]++;\r\n i = 0;\r\n anagrams.push(chars.join(''));\r\n } else {\r\n counter[i] = 0;\r\n i++;\r\n }\r\n }\r\n\r\n return anagrams;\r\n}", "function isAnagram(str1, str2){\n \n if(str1==null || str2==null \n || str1.length==0 || str2.length==0 \n || str1.length != str2.length){\n return false;\n }\n\n for(let a of str1){\n if(!str2.contains(a)){ /// time complexity = O(n^2) :( \n return false;\n }\n }\n return true;\n\n}", "function isAnagram2(s1, s2) {\n if (s1.length !== s2.length) return false\n const s1Arr = s1.split(\"\")\n const s2Arr = s2.split(\"\")\n s1Arr.sort()\n s2Arr.sort()\n for (let i = 0;i < s1Arr.length; i++) {\n if (s1Arr[i] !== s2Arr[i]) {\n return false\n }\n }\n return true\n}", "function validAnagram(str1, str2) {\n // add whatever parameters you deem necessary - good luck!\n // Run checks if string is empty or strings are not same length\n if (str1 === \"\" && str2 === \"\") {\n return true;\n }\n if (str1.length !== str2.length) {\n return false;\n }\n //Initalize objects for counters\n let freqCounter1 = {};\n let freqCounter2 = {};\n\n //Create Objects through iteration\n for (let val of str1) {\n freqCounter1[val] = (freqCounter1[val] || 0) + 1;\n }\n for (let val of str2) {\n freqCounter2[val] = (freqCounter2[val] || 0) + 1;\n }\n\n //Iterate through one ob\n for (let key in freqCounter1) {\n if (!(key in freqCounter2)) {\n return false;\n }\n if (freqCounter2[key] !== freqCounter1[key]) {\n return false;\n }\n }\n return true;\n}" ]
[ "0.7457507", "0.734992", "0.6955697", "0.68699193", "0.68043065", "0.66622263", "0.6628819", "0.66139394", "0.66139394", "0.66139394", "0.6597109", "0.6526698", "0.6408619", "0.64051884", "0.6383834", "0.6381831", "0.637035", "0.6370068", "0.63697565", "0.6345368", "0.6345114", "0.62925977", "0.62917507", "0.62802124", "0.627684", "0.62701154", "0.62678736", "0.6267128", "0.62576944", "0.6246924", "0.62240714", "0.6223851", "0.6222604", "0.6219705", "0.6211401", "0.6194277", "0.61783457", "0.61781776", "0.616993", "0.61649895", "0.61619663", "0.61615473", "0.61551666", "0.61518824", "0.6150904", "0.61485636", "0.6130479", "0.61206543", "0.6115978", "0.6112051", "0.61075604", "0.6100531", "0.60998195", "0.609604", "0.60945004", "0.6070939", "0.6055597", "0.605553", "0.60476387", "0.603462", "0.603049", "0.6025551", "0.6024953", "0.60232055", "0.60152507", "0.6012384", "0.6002439", "0.59959793", "0.59947485", "0.59932226", "0.5963339", "0.59499836", "0.5928262", "0.5911339", "0.59018916", "0.58934516", "0.58934444", "0.58928245", "0.58925754", "0.58919424", "0.58888286", "0.5883006", "0.58752", "0.5869397", "0.5866025", "0.58652085", "0.5864275", "0.5860768", "0.5856309", "0.5855023", "0.5854051", "0.58521014", "0.58482414", "0.5847353", "0.5844323", "0.5841605", "0.58352923", "0.5834968", "0.5826155", "0.58241266" ]
0.7211629
2
It will used to check the Anagram Numbers
checkAnagram2(str1, str2) { let unsortedStr1 = "" + str1; let unsortedStr2 = "" + str2; if (unsortedStr1.length != unsortedStr2.length) { return false; } sortedStr1 = this.sort1(unsortedStr1); sortedStr2 = this.sort1(unsortedStr2); let b = this.check(sortedStr1, sortedStr2); if (b == true) { return true; } else { return false; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkAnagram(a = '', b = '') {\n var array = {};\n if (a === b) {\n return true;\n }\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n let res = a.charCodeAt(i) - 97;\n console.log('res', res);\n array[res] = (array[res] || 0) + 1;\n }\n console.log('array', array);\n\n for (let j = 0; j < b.length; j++) {\n let res = b.charCodeAt(j) - 97;\n if (!array[res]) {\n return false;\n }\n array[res]--;\n }\n return true;\n}", "function checkAnagram() {\t\n\t\tvar first_str, second_str, first_temp, second_temp;\n\t\tfirst_str = $(\"#anagram-a\").val();\n\t\tfirst_temp = first_str;\n\t\tsecond_str = $(\"#anagram-b\").val();\n\t\tsecond_temp = second_str\n\t\tif(first_str.length != second_str.length) {\n\t\t\t$(\"#anagram-output\").append(\"<p>\\\"\" + first_str + \"\\\" and \\\"\" \n\t\t\t\t+ second_str + \"\\\" are not anagrams for each other</p>\");\n\t\t\treturn;\n\t\t}\n\t\tfirst_str = first_str.split(\"\").sort().join(\"\");\n\t\tsecond_str = second_str.split(\"\").sort().join(\"\");\n\t\tfor(var i = 0; i < first_str.length; i++) {\n\t\t\tif(first_str[i] != second_str[i]) {\n\t\t\t\t$(\"#anagram-output\").append(\"<p>\\\"\" + first_temp + \"\\\" and \\\"\" \n\t\t\t\t+ second_temp + \"\\\" are not anagrams for each other</p>\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t$(\"#anagram-output\").append(\"<p>\\\"\" + first_temp + \"\\\" and \\\"\" \n\t\t\t\t+ second_temp + \"\\\" are anagrams for each other</p>\");\n\t}", "isAnagram(a, b) {\n\n var x = a.toLowerCase();\n var y = b.toLowerCase();\n if (x.length != y.length) {\n return false;\n //console.log(\"Given string is not Anagram.\");\n }\n else {\n var m = [], n = [];\n m = x.split(\"\");\n n = y.split(\"\");\n m = m.sort();\n n = n.sort();\n if (m.length == n.length) {\n for (let i = 0; i < m.length; i++) {\n if (m[i] != n[i]) {\n return false;\n }\n\n }\n return true;\n }\n }\n }", "anagram(string1, string2) {\n try {\n var format = /[a-zA-Z0-9]/;\n var result = false;\n /*\n *checks if strings are within the given format\n */\n if (format.test(string1) && format.test(string2)) {\n /*\n *checks if both strings are of equal length\n */\n if (string1.length == string2.length) {\n /*\n *splits the given strings and sorts them\n */\n var sort1 = string1.toString().split(\"\").sort().join(\"\");\n var sort2 = string2.toString().split(\"\").sort().join(\"\");\n result = sort1 == sort2;\n }\n else {\n console.log(\"Strings length must be of equal length\");\n }\n\n /*\n *checks if one string is an anagram of another\n */\n if (result == true) {\n // console.log(string1 + \" \" + string2);\n return true;\n }\n else {\n return false;\n }\n }\n else {\n console.log(\"Enter only string\");\n\n }\n }\n catch (error) {\n console.log(error.message);\n }\n}", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "function isAnagram(str1, str2) {}", "isAnagram(string1, string2) {\n string1=string1+\"\";\n string2=string2+\"\";\n if (string1.length != string2.length) {\n return false;\n }\n var arr = [];\n for (let index = 0; index < 36; index++) {\n arr[index] = 0;\n\n }\n for (let index = 0; index < string1.length; index++) {\n var ch = string1.charAt(index);\n if (ch >= 'a' && ch <= 'z') {\n var code = ch.charCodeAt(0);\n\n arr[code - 97]++;\n } else if (ch >= 'A' && ch <= 'Z') {\n var code = ch.charCodeAt(0);\n arr[code - 65]++;\n } else {\n var code = ch.charCodeAt(0);\n arr[code - 22]++;\n }\n ch = string2.charAt(index);\n if (ch >= 'a' && ch <= 'z') {\n var code = ch.charCodeAt(0);\n\n arr[code - 97]--;\n } else if (ch >= 'A' && ch <= 'Z') {\n var code = ch.charCodeAt(0);\n arr[code - 65]--;\n } else {\n var code = ch.charCodeAt(0);\n arr[code - 22]--;\n }\n\n\n }\n for (let index = 0; index < 36; index++) {\n if (arr[index] != 0) {\n return false;\n }\n }\n return true;\n}", "function isAnagram(stgOne, stgTwo) {\n \n \n}", "function anagramCheck (str1, str2) {\n\n // ---------- Your Code Here ----------\n\n // gets rid of all the spaces and makes them lowercase to produce a string of all the letters lumped together, making comparison easier\n str1 = str1.replace(/\\s/g, \"\");\n str1 = str1.toLowerCase();\n str2 = str2.replace(/\\s/g, \"\");\n str2 = str2.toLowerCase();\n\n\n // if (str1.length !== str2.length) {\n // return false;\n // }\n \n str1 = str1.split(\"\").sort().join(\"\");\n str2 = str2.split(\"\").sort().join(\"\");\n \n return (str1 == str2);\n\n // ----------- End Code Area -----------\n\n}", "algoanagram(s1, s2) {\n\n var l1 = s1.length\n var l2 = s2.length\n var flag = true\n if (l1 != l2) {\n flag = false\n }\n else {\n var s3 = s1.toLowerCase()\n var s4 = s2.toLowerCase()\n\n s3 = s3.split('').sort().join('');\n s4 = s4.split('').sort().join('');\n\n // console.log(s3);\n // console.log(s4);\n flag = s3 === s4;\n // var c=a.split(\" \")\n // var c=b.split(\" \")\n\n\n //console.log(c)\n // console.log(d)\n\n\n\n\n\n }\n if (flag == true) {\n console.log(s1 + \" and \" + s2 + \" are anagram\")\n }\n else {\n console.log(s1 + \" and \" + s2 + \" are not anagram\")\n }\n }", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n // check if str1 has the same length as str2 & same characters\n if(str1.length !== str2.length){\n return false\n }\n // create an object call lookup\n let lookup = {}\n// construct the object first\n for (let i = 0; i < str1.length; i++){\n letter = str1[i]\n //if letter exits, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n console.log(lookup)\n for (let i = 0; i < str2.length; i++){\n let letter = second[i];\n // can't find letter of letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1;\n }\n return true;\n }\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) return false\n\n let check = {}\n\n for (let i = 0; i < str1.length; i++) {\n const letter = str1[i]\n check[letter] ? (check[letter] += 1) : (check[letter] = 1)\n }\n\n for (let i = 0; i < str2.length; i++) {\n const letter = str2[i]\n if (!check[letter]) {\n return false\n } else {\n check[letter] -= 1\n }\n }\n\n return true\n}", "function validAnagram (str1, str2) {\n let obj = {};\n if (str1.length !== str2.length) return false;\n for (let char of str1) {\n obj[char] = obj[char] ? obj[char] + 1 : 1;\n }\n for (let char of str2) {\n if (!obj[char]) {\n return false;\n } else {\n obj[char]--;\n }\n }\n return true;\n}", "function validAnagram(first,second){\n if(first.length!== second.length){\n return false;\n }\n \n //Create an object \n const lookup = {};\n\n //Loop through first string\n for(let i =0;i<first.length;i++){\n let letter = first[i];\n //If letter exists increment otherwise set to 1\n lookup[letter]?lookup[letter]+=1:lookup[letter]=1;\n }\n console.log(lookup)\n\n //Loop through the second string \n for (let i = 0;i<second.length;i++){\n let letter =second[i];\n //If we can't find a letter or letter is zero , then its not an anagram\n if(!lookup[letter]){\n return false;\n }\n else{\n lookup[letter]-=1;\n }\n }\n\n return true;\n\n}", "function is_anagram (str1, str2) {\n return formatStr(str1) === formatStr(str2);\n}", "function validAnaram2(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n //Initalize object\n const lookup = {};\n\n for (let i = 0; i < first.length; i++) {\n let letter = first[i];\n //if letter exists, incremnt, otherwise set to 1\n lookup[letter] ? (lookup[letter] += 1) : (lookup[letter] = 1);\n }\n\n for (let i = 0; i < second.length; i++) {\n let letter = second[i];\n //Cant find letter or letter is zero then its not an anagram\n //Because zero is falsey\n if (!lookup[letter]) {\n return false;\n } else {\n //If letter exists, subtract one, one is truthy\n lookup[letter] -= 1;\n }\n }\n return true;\n}", "function validAnagram(str1, str2) {\n if(str1.length !== str2.length) {\n return false;\n }\n \n let lookup = {};\n \n for(i = 0; i < str1.length; i++){\n let letter = str1[i]\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n \n for(let j = 0; j < str2.length; j++) {\n let letter = str2[j]\n if(!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1\n }\n }\n return true;;\n}", "function validAnagram(str1, str2) {\n if (str1 === '' && str2 === '') {\n return true;\n }\n\n if (str1 === str2) {\n return true;\n }\n\n if (str1.length !== str2.length) {\n return false;\n }\n\n let anagram1 = {};\n\n for (let char of str1) {\n anagram1[char] = ++anagram1[char] || 1;\n }\n\n console.log('obj: ', anagram1);\n\n for (let char of str2) {\n if (!anagram1[char]) {\n return false;\n } else {\n anagram1[char] -= 1;\n }\n }\n return true;\n}", "function validAnagram(word1, word2){\n if (word1.length !== word2.length) {\n return false;\n }\n\n let counter = {};\n\n for (let i = 0; i < word1.length; i++) {\n let letter = word1[i];\n if (counter[letter]) {\n counter[letter]++;\n } else {\n counter[letter] = 1;\n }\n }\n\n for (let i = 0; i < word2.length; i++) {\n let letter = word2[i];\n if (!counter[letter]) {\n return false;\n } else {\n counter[letter] -= 1;\n }\n }\n return true;\n}", "function anagramStr(str, input){\n if(str.length != input.length){\n return false;\n }\n let loopData = {};\n str = str.toLowerCase().trim();\n for (let index = 0; index < str.length; index++) {\n let element = str[index];\n loopData[element] = element && loopData[element] ? loopData[element] + 1 : 1;\n }\n console.log(loopData);\n input = input.toLowerCase().trim();\n for (let index = 0; index < input.length; index++) {\n const element = input[index];\n if(!loopData[element]){\n return false;\n }\n loopData[element]--;\n }\n console.log(loopData);\n return true;\n}", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n if (str1.length !== str2.length ) {\n return false\n }\n\n let strObj = {};\n\n for (let val in str1 ) {\n // for strings you need to do strObj[str1[val]]\n // if key exists add to it if not create it\n strObj[str1[val]] = (strObj[str1[val]] || 0) + 1;\n }\n\n for (let val in str2) {\n strObj[str2[val]] = (strObj[str2[val]] || 0) + 1;\n }\n\n // now loop over the to see if the values are even\n for (let key in strObj) {\n if (strObj[key] % 2 !== 0) {\n return false\n }\n }\n\n return true\n\n}", "function validAnagram(s, t) {\n if (s.length !== t.length) {\n return false\n }\n let charMap = {}\n s = s.split('')\n for (let index = 0; index < s.length; index++) {\n if (charMap[s[index]]) {\n charMap[s[index]] += 1\n } else {\n charMap[s[index]] = 1\n }\n }\n for (let index = 0; index < t.length; index++) {\n if (!charMap[t[index]]) {\n return false\n } else {\n charMap[t[index]]--\n }\n }\n return true\n}", "function validAnagram(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < first.length; i++) {\n let letter = first[i];\n // if letter exists, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n // console.log(lookup)\n\n for (let i = 0; i < second.length; i++) {\n let letter = second[i];\n // can't find letter or letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1;\n }\n }\n console.log(lookup)\n return true;\n}", "function testAnagram (s1, s2){\n // creating if statments \n if(!s1 || !s2 || s1.length !== s2.length){return false;}\n var lS1 = s1.toLowerCase();\n var lS2 = s2.toLowerCase();\n if(lS1 === lS2) {return false;}\n var rS1 = lS1.split('').sort().join('');\n var rS2 = lS2.split('').sort().join('');\n return rS1 === rS2;\n }", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < str1.length; i++) {\n let letter = str1[i];\n // if letter exists, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n console.log(lookup)\n\n for (let i = 0; i < str2.length; i++) {\n let letter = str2[i];\n // can't find letter or letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n //we subtract one to make sure both str have same frequency of letter\n lookup[letter] -= 1;\n }\n }\n\n return true;\n}", "function anagram(s1, s2) {\n\ts1 = s1.replace(/\\W/g,'').toLowerCase();\n\ts2 = s2.replace(/\\W/g,'').toLowerCase();\n\t//does not remove numbers\n\tconsole.log(s1);\n\tif (s1.length != s2.length) return false;\n\treturn s1.split('').sort().join('') == s2.split('').sort().join('');\n}", "function validAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n\n if (str1 === '' && str2 === '') {\n return true;\n }\n\n const lookup = {};\n\n for (let i = 0; i < str1.length; i++) {\n let char = str1[i];\n lookup[char] ? (lookup[char] += 1) : (lookup[char] = 1);\n }\n\n for (let i = 0; i < str1.length; i++) {\n let char = str2[i];\n if (!lookup[char]) {\n return false;\n } else {\n lookup[char] -= 1;\n }\n }\n\n return true;\n}", "function isAnagram(str1, str2) {\n return formatString(str1) === formatString(str2);\n}", "function isAnagram(str1, str2) {\n return formatStr(str1) === formatStr(str2)\n}", "function validAnagram(str1, str2) {\n\tif (str1.length !== str2.length) return false;\n\n\t// Does the strings have the same chars and its counts\n\t// { a: 2, b: 1, r: 3, o: 5}\n\tlet freq1 = {};\n\tlet freq2 = {};\n\n\t// Iterate trough the strings and add the chars to the freq counters\n\tfor (let i of str1) {\n\t\tfreq1[i] = freq1[i] ? freq1[i] + 1 : 1;\n\t}\n\tfor (let i of str2) {\n\t\tfreq2[i] = freq2[i] ? freq2[i] + 1 : 1;\n\t}\n\tconsole.log(freq1, freq2);\n\t// Compare the strings and return bool\n\tfor (let i in freq1) {\n\t\tif (!(i in freq2)) {\n\t\t\treturn false;\n\t\t}\n\t\t// if the value of the key is diffrent\n\t\tif (freq1[i] !== freq2[i]) {\n\t\t\treturn false;\n\t\t}\n\t}\n\n\treturn true;\n}", "function countingAnagrams(str) {\n // Your code here\n counter = 0;\n words = str.split(' ')\n console.log(words)\n for (var i = 0; i < words.length; i++) {\n for (var j=0;j<words.length;j++){\n if (words[i]!==words[j] && isAnagram(words[i],words[j])){\n console.log(isAnagram(words[i],words[j]))\n counter++\n }\n }\n return counter\n }\n}", "function validAnagram(str1, str2) {\n //if both strings are empty return true\n if(str1.length === 0 && str2.length === 0) return true;\n //create two empty objects\n let obj1 = {};\n let obj2 = {};\n //loop through each of the strings and put them in the objects\n for(let char of str1) {\n if(obj1[char] > 0) {\n obj1[char]++\n } else {\n obj1[char] = 1;\n }\n }\n for(let char of str2) {\n if(obj2[char] > 0) {\n obj2[char]++\n } else {\n obj2[char] = 1;\n }\n }\n //check if each key in strings match to each other \n for(let key in obj1) {\n if(!key in obj2) return false;\n //chack if the frequencies match\n if(obj1[key] !== obj2[key]) return false;\n }\n return true;\n}", "function isAnagram(s1, s2) {\n var i = 0\n //sortChars :: String -> String\n , sortChars = function (s) {\n return s.toLowerCase().split('').sort().join('');\n }\n ;\n if (s1.length !== s2.length){ return false; }\n if (sortChars(s1) !== sortChars(s2)) { return false; }\n return true;\n}", "function anagrams(string1, string2){\n let obj = {};\n\n string1.split(\"\").forEach((char) => {\n if (!obj[char]) {\n obj[char] = 1;\n } else {\n obj[char] += 1;\n }\n });\n\n string2.split(\"\").forEach((char) => {\n if (!obj[char]) {\n obj[char] = 1;\n } else {\n obj[char] -= 1;\n }\n });\n\n return Object.values(obj).every(char => char === 0);\n}", "function validAnagram(str1, str2) {\n\n // no need to check if strings arent same length\n if(str1.length != str2.length) {\n return false\n }\n\n // storatge for counters\n let cache1 = {}\n let cache2 = {}\n\n // counter\n function counter(cache, str) {\n for(let char of str) {\n if(cache[char]) {\n cache[char] += 1\n } else {\n cache[char] = 1\n }\n }\n }\n\n counter(cache1, str1)\n counter(cache2, str2)\n\n // checking if each cache has same amount of each item\n for(const prop in cache1) {\n if(cache1[prop] !== cache2[prop]) {\n return false\n }\n }\n\n return true\n}", "function validAnagram(str1, str2) {\n // add whatever parameters you deem necessary - good luck!\n // Run checks if string is empty or strings are not same length\n if (str1 === \"\" && str2 === \"\") {\n return true;\n }\n if (str1.length !== str2.length) {\n return false;\n }\n //Initalize objects for counters\n let freqCounter1 = {};\n let freqCounter2 = {};\n\n //Create Objects through iteration\n for (let val of str1) {\n freqCounter1[val] = (freqCounter1[val] || 0) + 1;\n }\n for (let val of str2) {\n freqCounter2[val] = (freqCounter2[val] || 0) + 1;\n }\n\n //Iterate through one ob\n for (let key in freqCounter1) {\n if (!(key in freqCounter2)) {\n return false;\n }\n if (freqCounter2[key] !== freqCounter1[key]) {\n return false;\n }\n }\n return true;\n}", "function annagram(word1, word2) {\n let clean1 = word1.replace(/[.,\\/#№?\\d@!$%\\^&\\*;:{}=\\-_`~()]/g, \"\").replace(/\\s{2,}/g, \" \").toLowerCase().split(' ').join('').trim();\n let clean2 = word2.replace(/[.,\\/#№?\\d@!$%\\^&\\*;:{}=\\-_`~()]/g, \"\").replace(/\\s{2,}/g, \" \").toLowerCase().split(' ').join('').trim();\n console.log(clean1, clean2)\n\n let newStr1 = clean1.split('').sort().join('')\n let newStr2 = clean2.split('').sort().join('')\n console.log(newStr1, newStr2)\n\n if (newStr1.length === newStr2.length) {\n return newStr1 === newStr2 ? true : false\n } else {\n return false\n }\n}", "function validAnagram(first, second){\n\tif(first.length !== second.length){\n\t\treturn false;\n\t}\n\t\n\tconst lookup = {}; //obj as freq.counter\n\n\t//Break down the first string.\n\tfor(let i=0; i < first.length ; i++){\n\t\tlet letter = first[i];\n\t\t//if letter exists, increment, otherwise set to 1\n\t\tlookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n\t}\n\n\t//Break down the second string\n\t//then check to first string.\n\tfor(let i=0; i < second.length; i++){\n\t\tlet letter = second[i];\n\t\t//can't find letter or letter is zero then not anagram.\n\t\tif(!lookup[letter]){\n\t\t\treturn false;\n\t\t}else{\n\t\t\tlookup[letter] -= 1;\n\t\t}\t\n\t}\n\treturn true;\n}", "isAnagramPalindrome(primes){\n var arr = []; \n arr = primes;\n console.log('Anagrams that are palindromes');\n \n for (let i = 0; i < arr.length; i++) {\n for (let j = i+1; j < arr.length; j++) {\n if (this.anagramDetection(arr[i].toString(),arr[j].toString())) {\n if (this.isPalindrome(arr[i].toString(),arr[j].toString())) {\n console.log(arr[i]+' '+arr[j]);\n }\n }\n }\n }\n \n }", "function anagram(s, t) {\n if(s.length !== t.length) return false\n let char = {};\n \n for(let i = 0; i < s.length; i++) {\n char[s[i]] ? char[s[i]]++ : char[s[i]] = 1\n }\n \n for(let j = 0; j < t.length; j++) { // one letter might appear more that twice\n // that is why we count them \n // instead of just setting the key to true or false\n if(!char[t[j]]) {\n return false\n }\n char[t[j]]--\n }\n return true;\n }", "function anagram (str1, str2) {\n\tvar letterCount = { };\n\n\tletterCount = countWords(str1, letterCount, 1) // pass to do positive count of letters in str1\n\tletterCount = countWords(str2, letterCount, -1) // pass to do negative count of letters in str2\n\t\n\t/* If the strings are anagrams, we expect every entry in the dictionary to \n\t * be equal to 0. Otherwise there will be some entry with a negative or positive count. */\n\tfor (key in letterCount) {\n\t\tif (letterCount[key] != 0)\n\t\t\treturn false\n\t}\n\n\treturn true\n}", "function isAnagram( s, t) {\n let charMap = new Map();\n let slength = s.length;\n let tlength = t.length;\n if( slength !== tlength) {\n return false;\n }\n for( let i=0 ; i < slength ; i++){\n charMap.set(s.charAt(i), (charMap.get(s[i]) || 0) +1);\n charMap.set(t.charAt(i), (charMap.get(t[i]) || 0) -1);\n }\n let isAnagram = true;\n charMap.forEach((countOfChar) => {\n if ( countOfChar !== 0 ) {\n isAnagram = false;\n return;\n }\n });\n return isAnagram;\n}", "function anagram(arr, size) {\n var flag;\n var x = 0;\n\n for (i = 0; i < size; i++) {\n if (arr[i] > 10) {\n var no1 = arr[i];\n var a = Math.floor(no1 / 10);\n var b = no1 - a * 10;\n for (j = i + 1; j < size; j++) {\n var no2 = arr[j];\n var c = Math.floor(no2 / 10);\n var d = no2 - c * 10;\n if (a == d && b == c) {\n agram[x] = arr[j];\n x++;\n break;\n\n } else {\n continue;\n }\n }\n }\n if (arr[i] > 100) {\n var no1 = arr[i];\n var a = Math.floor(no1 / 100);\n var b = no1 - a * 100;\n var c = Math.floor(b / 10);\n var d = b - c * 10;\n for (j = i + 1; j < size; j++) {\n\n var no2 = arr[j];\n var e = Math.floor(no2 / 100);\n var f = no2 - e * 100;\n var g = Math.floor(f / 10);\n var h = f - g * 10;\n arr2.push(e);\n arr2.push(g);\n arr2.push(h);\n arr2.sort();\n\n var a1 = arr2[0];\n var a2 = arr2[1];\n var a3 = arr2[2];\n arr2 = [];\n if ((a == a1) && (c == a2) && (d == a3)) {\n agram[x] = arr[j];\n x++;\n break;\n } else {\n continue;\n }\n }\n }\n }\n}", "function validAnagram(first, second){\n if(first.length !== second.length){\n return false;\n }\n\n const lookup = {};\n\n for (let i = 0; i < first.length; i++){\n let letter = first [i];\n //if letter exists in object list, increment, otherwise set to 1\n lookup[letter] ? lookup[letter] += 1 : lookup[letter] = 1;\n }\n\n for (let i = 0; i < second.length; i ++){\n let letter = second[i];\n // if can't find letter or letter is zero then it's not an anagram, return false\n // zero is falsey so it will return false if lookup[letter] = 0\n if(!lookup[letter]){\n return false;\n }else{\n lookup[letter] -= 1;\n }\n }\n return true;\n}", "function fourthAnagram(str1, str2) {\n let obj = {};\n for (let i = 0; i < str1.length; i++) {\n if (obj[`${str1[i]}1`]) {\n obj[`${str1[i]}1`]++\n } else {\n obj[`${str1[i]}1`] = 1\n }\n }\n for (let i = 0; i < str2.length; i++) {\n if (obj[`${str2[i]}2`]) {\n obj[`${str2[i]}2`]++\n } else {\n obj[`${str2[i]}2`] = 1\n }\n } \n\n for (const key in obj) {\n if (obj[key[0]+\"1\"] !== obj[key[0]+\"2\"]) {\n return false;\n }\n }\n return true;\n}", "function anagram(str1,str2){\n\n //2. Check to see if input1 & input2 are strings, if not return error/false\n if (typeof(str1, str2) !== 'string'){\n return false;\n }\n\n //3. Check to see if input1 & input2 are the same length, if not return error/false\n if (str1.length !== str2.length){\n return false;\n }\n\n //4. Create objects for both inputs\n let stringBox1 = {};\n let stringBox2 = {};\n\n //5. For each value in string1, if does not exist, create key and set value to 1 in Object1.\n //6. If value exists in Object1, increment value by 1.\n for(let val of str1){\n stringBox1[val] = stringBox1[val] + 1 || 1;\n\n }\n console.log(stringBox1);\n //7. For each value in string2, if does not exist, create key and set value to 1 in Object2.\n //8. If value exists in Object2, increment value by 1.\n for(let val of str2){\n stringBox2[val] = stringBox2[val] + 1 || 1;\n\n }\n console.log(stringBox2)\n\n //9. For each key in Object1, compare to each key in Object2.\n for(let key in stringBox1){\n // If does not exist, return false.\n if(!(key in stringBox2)){\n console.log('step 9')\n return false;\n }\n //10. Compare value of that key to each value of every key in Object2.\n if(stringBox1[key] !== stringBox2[key]){\n console.log('step 10')\n return false;\n }\n //11. Return true.\n console.log('Step 11')\n return true;\n\n }\n\n\n}", "function validAnagram(str1, str2){\n // add whatever parameters you deem necessary - good luck!\n \n let s1 = str1.split(\"\").sort().join(\"\");\n let s2 = str2.split(\"\").sort().join(\"\");\n \n return s1===s2;\n\n}", "function checkAnagram(str1,str2){\n if(str1.length !== str2.length){\n return false;\n }\n var charStr1=str1.split(\"\").sort();\n var charStr2=str2.split(\"\").sort();\n\n for(var i=0; i<charStr1.length; i++){\n if (charStr1[i]!==charStr2[i]){\n return false;\n }\n }\n\n return true;\n\n}", "function checkAnagram(str1, str2){\n\n // Check if the length of the two array is the samey\n if(str1.length !== str2.length){\n return false;\n }\n\n// create two object frequencies\n let strFrequency1 = {};\n let strFrequency2 = {};\n\n // loop through each of the two string respectively and add their count to their objects\n for(let char of str1){\n strFrequency1[char] = ++strFrequency1[char] || 1;\n }\n for(let char of str2){\n strFrequency2[char] = ++strFrequency2[char] || 1;\n }\n console.log(strFrequency1);\n console.log(strFrequency2);\n // compare the two objects with occupiance of the frequencies\n for(let key in strFrequency1){\n if(strFrequency2[key] !== strFrequency1[key]){\n return false;\n }\n }\n // return either true or false\n return true;\n}", "function validAnagram2(first, second) {\n if (first.length !== second.length) return false;\n\n const lookup = {};\n\n for (let i = 0; i < first.length; i++) {\n let letter = first[i];\n // if letter exists, increment, otherwise set to 1\n lookup[letter] ? (lookup[letter] += 1) : (lookup[letter] = 1);\n }\n\n for (let i = 0; i < second.length; i++) {\n let letter = second[i];\n // can't find letter or letter is zero then it's not an anagram\n if (!lookup[letter]) {\n return false;\n } else {\n lookup[letter] -= 1;\n }\n }\n return true;\n}", "function anagram(str1, str2){\n if(str1.length != str2.length)return false;\n characterCount = {}\n for(let s1 of str1){\n characterCount[s1] = characterCount[s1] + 1 || 1\n }\n for(let s2 of str2){\n if(!characterCount[s2])return false;\n else characterCount[s2]--;\n }\n return true;\n}", "function makeAnagram(a, b) {\n\tconst charCounts = {};\n\n\tfor (const char of a) {\n\t\tif (charCounts[char]) {\n\t\t\tcharCounts[char] += 1;\n\t\t} else {\n\t\t\tcharCounts[char] = 1;\n\t\t}\n\t}\n\tfor (const char of b) {\n\t\tif (charCounts[char]) {\n\t\t\tcharCounts[char] -= 1;\n\t\t} else {\n\t\t\tcharCounts[char] = -1;\n\t\t}\n\t}\n\n\treturn Object.values(charCounts).reduce(\n\t\t(accu, val) => accu + Math.abs(val),\n\t\t0\n\t);\n}", "function anagrams(str1, str2) {\n let resultsHash = {};\n\n str1.split('').forEach( char => {\n if (!resultsHash[char]) resultsHash[char] = 0;\n resultsHash[char] += 1;\n })\n\n str2.split('').forEach( char => {\n if (!resultsHash[char]) resultsHash[char] = 0;\n resultsHash[char] -= 1;\n })\n\n // console.log(resultsHash)\n return Object.values(resultsHash).every( value => value == 0);\n}", "function isAnagram(str1, str2) {\n if (str1.length !== str2.length) {\n return false;\n }\n for (var i = 0; i < str1.length; i++) {\n var foundEqual = false;\n for (var j = 0; j < str2.length; j++) {\n if (str1[i] === str2[j]) {\n foundEqual = true;\n break;\n }\n }\n if (!foundEqual) {\n return false;\n }\n }\n for (var i = 0; i < str2.length; i++) {\n var foundEqual = false;\n for (var j = 0; j < str1.length; j++) {\n if (str2[i] === str1[j]) {\n foundEqual = true;\n break;\n }\n }\n if (!foundEqual) {\n return false;\n }\n }\n return true;\n}", "function isAnagram(s, t) {\n let newS = s.split(\"\").sort().join(\"\");\n let newT = t.split(\"\").sort().join(\"\");\n if (newS === newT) {\n return true\n } else {\n return false\n }\n}", "function validAnagram(first, second) {\n if (first.length !== second.length) {\n return false;\n }\n const lookup = {}; // Ospace (a)\n const firstLength = first.length;\n for (let index = 0; index < firstLength; index++) { // Otime (a)\n const element = first[index];\n lookup[element] = (lookup[element] || 0) + 1;\n }\n const secondLength = second.length;\n for (let index = 0; index < secondLength; index++) { // Otime (b)\n const element = second[index];\n if (!lookup[element]) {\n return false;\n }\n lookup[element] -= 1;\n }\n return true;\n}", "function isAnagram (str1, str2) {\n if(str1.length !== str2.length) return false\n let frequencyCounter1 = getCharFrequency(str1)\n let frequencyCounter2 = getCharFrequency(str2)\n for(let key in frequencyCounter1){\n if(!frequencyCounter2.hasOwnProperty(key)) return false\n if(frequencyCounter1[key] !== frequencyCounter2[key]) return false\n }\n return true\n}", "function validAnagram(str1, str2){\n // check length is the same, if so FALSE\n if (str1.length !== str2.length) return false;\n let obj1 = {}\n let obj2 = {}\n // make object 1 for str1: 1 for loop\n for (let char of str1) {\n obj1[char] = (obj1[char] || 0) + 1;\n }\n // make object 2 for str1: 1 for loop\n for (let char of str2) {\n obj2[char] = (obj2[char] || 0) + 1;\n }\n // compare objects!: 1 for loop \n for (let key in obj1) {\n // make sure each key for obj1 is in obj2\n if (!(key in obj2)) return false;\n // make sure each key value for obj1 is the same for obj2 \n if (obj1[key] !== obj2[key]) return false;\n }\n return true}", "function checkAnagramWithTimeComplexity(str1, str2) {\n str1 = str1.toLowerCase();\n str2 = str2.toLowerCase();\n if (str1.length !== str2.length) return false\n let counting = {}\n for (let c of str1) {\n counting[c] = (counting[c] + 1) || 1;\n }\n for (let c of str2) {\n if (counting[c]) {\n --counting[c];\n }\n else {\n return false;\n }\n }\n return true;\n}", "function isAnagram(str1, str2) {\n if (str1.length !== str2.length) return false;\n\n let letterMap = {};\n\n for (let i = 0; i < str1.length; i++) {\n let current = str1[i].toLowerCase()\n if (!letterMap[current]) {\n letterMap[current] = 1\n } else {\n letterMap[current] ++\n }\n }\n \n for (let j = 0; j < str2.length; j++) {\n let current = str2[j].toLowerCase();\n if (letterMap[current]) {\n letterMap[current] --\n } else {\n return false;\n }\n }\n return Object.values(letterMap).every(el => el === 0) ? true : false;\n}", "function anagram(s) {\n const sL = s.length;\n if ((sL & 1) === 0) {\n const mid = sL / 2;\n let firstSlice = s.slice(0, mid).split('');\n let secondSlice = s.slice(mid).split('');\n return sumUp(firstSlice, secondSlice);\n }\n return -1;\n\n}", "function anagrams(stringA, stringB) {\n let charMap = {};\n let alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');\n let specialChars = [0,0];\n for ( let i = 0; i < stringA.length; i++ ) {\n let currentChar = stringA[i].toLowerCase();\n if ( alphabet.indexOf(currentChar) !== -1 ) {\n if ( !charMap[currentChar] ) charMap[currentChar] = 0;\n charMap[currentChar] ++;\n }\n else {\n specialChars[0]++;\n }\n }\n \n for ( let i = 0; i < stringB.length; i++ ) {\n let currentChar = stringB[i].toLowerCase();\n if ( alphabet.indexOf(currentChar) === -1 ) specialChars[1]++;\n else {\n if ( !charMap[currentChar] ) {\n console.log(currentChar);\n return false;\n }\n charMap[currentChar]--;\n if ( charMap[currentChar] === 0 ) delete charMap[currentChar];\n }\n }\n if ( Object.keys(charMap).length > 0 ) return false;\n //console.log(st)\n return (stringA.length - specialChars[0]) === (stringB.length - specialChars[1])\n }", "function anagram(str1, str2) {\n\tif (str1.length !== str2.length) {\n\t\treturn false;\n\t}\n\tlet frequencyStr1 = {};\n\tfor (let i = 0; i < str1.length; i++) {\n\t\tlet letter = str1[i];\n\t\tfrequencyStr1[letter] ? (frequencyStr1[letter] += 1) : (frequencyStr1[letter] = 1);\n\t}\n\n\tfor (let i = 0; i < str2.length; i++) {\n\t\tlet letter = str2[i];\n\t\tif (!frequencyStr1[letter]) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tfrequencyStr1[letter] -= 1;\n\t\t}\n\t}\n\treturn true;\n}", "function isAnagram(first, second) {\n let output1 = first.toLowerCase().split(\"\").sort().join(\"\");\n let output2 = second.toLowerCase().split(\"\").sort().join(\"\");\n return output1 == output2;\n}", "function makeAnagram(a, b) {\n var aChars = a.split(\"\");\n var bChars = b.split(\"\");\n \n // determin what is the larger array and make it outer\n if (aChars.length > bChars.length) {\n var outer = aChars;\n var inner = bChars;\n } else {\n var outer = bChars;\n var inner = aChars;\n }\n // starting at the back, last index, of the larger array\n var outerIndex = outer.length-1;\n while (inner.length > 0 && outer.length > 0 && outerIndex >= 0) {\n //this will look for a charcter that is the same as the last in outer\n let innerIndex = inner.indexOf(outer[outerIndex]);\n //if the charcter is found endter statement\n if (innerIndex !== -1) {\n //remove the idex of the matching charcters\n outer.splice(outerIndex, 1);\n inner.splice(innerIndex, 1);\n }\n --outerIndex;\n }\n return outer.length + inner.length\n}", "function validAnagram(str1, str2) {\n let charItemsOne = str1.split('');\n let charItemsTwo = str2.split('');\n // console.log(charItemsOne);\n // console.log(charItemsTwo);\n if (charItemsTwo.length !== charItemsOne.length) {\n return false;\n }\n frequencyCounterOne = {};\n frequencyCounterTwo = {};\n\n for (const ItemOneElement of charItemsOne) {\n // console.log(ItemOneElement);\n frequencyCounterOne[ItemOneElement] =\n (frequencyCounterOne[ItemOneElement] || 0) + 1;\n }\n for (const ItemTwoElement of charItemsTwo) {\n frequencyCounterTwo[ItemTwoElement] =\n (frequencyCounterTwo[ItemTwoElement] || 0) + 1;\n }\n\n // console.log(frequencyCounterOne);\n // console.log(frequencyCounterTwo);\n // console.log('------------');\n\n for (const prop in frequencyCounterOne) {\n if (frequencyCounterOne.hasOwnProperty(prop)) {\n // console.log(frequencyCounterOne[prop]);\n // console.log(prop);\n\n if (!(prop in frequencyCounterTwo)) {\n return false;\n }\n\n if (frequencyCounterOne[prop] !== frequencyCounterTwo[prop]) {\n return false;\n }\n }\n }\n return true;\n}", "function mineValidAnagram(wordA, wordB) {\n\t// add whatever parameters you deem necessary - good luck!\n\tif (wordA.length !== wordB.length) return false;\n\tconst objA = {};\n\tconst objB = {};\n\tfor (const word of wordA) {\n\t\tobjA[word] = (objA[word] || 0) + 1;\n\t}\n\tfor (const word of wordB) {\n\t\tobjB[word] = (objB[word] || 0) + 1;\n\t}\n\n\tfor (let key in objA) {\n\t\t// If the key exist\n\t\tif (!(key in objB)) return false;\n\n\t\tif (objA[key] !== objB[key]) return false;\n\t}\n\n\treturn true;\n}", "function anagram (str1,str2){\n if(str1.length!==str2.length)\n return false;\n\n let freqCounter1 = {};\n let freqCounter2 = {};\n\n for(let val of str1)\n freqCounter1[val] = (freqCounter1[val]||0)+1;\n\n for(let val of str2)\n freqCounter2[val] = (freqCounter2[val]||0)+1;\n \n for(let key in freqCounter2){\n \n if(!(key in freqCounter2))\n return false;\n \n if(freqCounter2[key]!==freqCounter1[key])\n return false;\n \n return true;\n }\n\n\n}", "function validAnagram2(str1, str2) {\n if(str1.length !== str2.length) return false\n return str1.split(\"\").sort().join(\"\") === str2.split(\"\").sort().join(\"\");\n}", "function isAnagram (test, original) {\r\n \r\n // Make sure both strings are in same cases...\r\n const str1 = test.toLowerCase(); \r\n const str2 = original.toLowerCase(); \r\n\r\n if(str1.length !== str2.length) return false;\r\n\r\n let newObject = {};\r\n\r\n for(let i = 0; i < str1.length; i++) {\r\n let letter = str1[i];\r\n newObject[letter] ? newObject[letter] += 1 : newObject[letter] = 1;\r\n }\r\n \r\n for(let i = 0; i < str2.length; i++) {\r\n let letter = str2[i];\r\n if(!newObject[letter]) return false; \r\n else newObject[letter] -= 1;\r\n }\r\n return true;\r\n}", "function validAnagram(str1, str2){\n let sortedStr1 = str1.split('').sort().join('');\n let sortedStr2 = str2.split('').sort().join('');\n if (sortedStr1 === sortedStr2) {\n return true;\n } else {\n return false;\n }\n}", "function findAnagram(str1, str2){ // You wrote this\r\n if(str1.length !== str2.length){\r\n return false;\r\n }\r\n let obj1 = {}\r\n let obj2 = {}\r\n for(let char of str1){\r\n obj1[char] = (obj1[char] || 0) + 1\r\n }\r\n for(let char of str2){\r\n obj2[char] = (obj2[char] || 0) + 1\r\n }\r\n for(let key in obj1){\r\n if(!(key in obj2)){\r\n return false\r\n }\r\n if(obj2[key] !== obj1[key]){\r\n return false\r\n }\r\n }\r\n return true\r\n}", "function makeAnagram(a, b) {\n // keeps track of deletions from str a and b\nlet count = 0 // letters matching from both str a and str b to make an anagram\nlet length = a.length\n// 1 <= |a|, |b| <=10**4\nconst lengthOfA = a.length\nconst lengthOfB = b.length\n\n// doesn't matter, we'll eventually ending up deleting letters that don't match up with each string\n// if (lengthOfA !== lengthOfB){\n// // the length has to be equal to the shortest character length,\n// // we will iterate until that point\n// lengthOfA > lengthOfB ? length = lengthOfB : length = lengthOfA\n// }\n \n // seperating each string letter\n a = a.split('')\n b = b.split('')\n \nfor (let i =0; i<length; i++){\n console.log(\"i = \" + \"\" + i)\n // if an anagram exists (letter in a is in b)\n if (b.includes(a[i])){\n console.log(\"letter in 'a, remove in 'b'--> \" + a[i])\n // removing the letter in a\n let temp = a[i]\n a.splice(i,1)\n // found match in a\n count+=1\n // find and remove the same letter in b\n b.splice(b.indexOf(temp),1)\n // found match in b\n count+=1\n // go back to same round to check new letter in same position\n i = i-1\n }\n } // subtracting the matching anagram count against original letter count of both strings\n return (lengthOfA + lengthOfB) - count\n}", "function anagram(string, str){\n return string.split('').sort().join('') === str.split('').sort().join('')\n}", "function sherlockAndAnagrams(s) {\n let count = 0;\n //글자 수\n for (let i = 1; i < s.length; i++) {\n for (let j = 0; j < s.length - i; j++) {\n const target = s.substring(j, j + i, j);\n // console.log(\"-------\");\n for (let k = 1 + j; k < s.length - i + 1; k++) {\n let compared = s.substring(k, k + i);\n if (isAnagram(target, compared)) {\n count++;\n }\n }\n }\n }\n return count;\n}", "function isAnagram(s, t) {\n let sortedS = s.split(\"\").sort().join(\"\")\n let sortedT = t.split(\"\").sort().join(\"\")\n return sortedS === sortedT\n}", "function anagrams(s1, s2) { }", "function validAnagram(str, expect) {\n if (str.length !== expect.length) {\n return false;\n }\n\n if (str === \"\" && expect === \"\") {\n return true;\n }\n\n // create empty object\n const splitStr = {};\n const splitExpect = {};\n\n // loop\n for (let char of str) {\n if (char in splitStr) {\n // if no str in obj, add str to key, and set its value to 1\n splitStr[char] = splitStr[char] + 1;\n } else {\n //if str in obj, plus its value with 1\n splitStr[char] = 1;\n }\n }\n\n // loop that logic again with expect\n for (let char of expect) {\n if (char in splitExpect) {\n // if no str in obj, add str to key, and set its value to 1\n splitExpect[char] = splitExpect[char] + 1;\n } else {\n //if str in obj, plus its value with 1\n splitExpect[char] = 1;\n }\n }\n\n for (let char in splitStr) {\n if (!(char in splitExpect) || splitStr[char] !== splitExpect[char]) {\n return false;\n }\n }\n\n return true;\n}", "function thirdAnagram(str1, str2) {\n // Complexity (n + m) - time | space - 2 ==> 1\nlet obj = {}\nlet obj2 = {}\n\nfor (let i = 0; i < str1.length || i < str2.length; i++){\n const str1Key = str1[i], str2Key = str2[i];\n if(obj[str1Key]){\n obj[str1Key]++\n }else {\n obj[str1Key] = 1\n }\n if(obj2[str2Key]){\n obj2[str2Key]++\n }else {\n obj2[str2Key] = 1\n }\n}\n// const val1Array = Object.entries(obj);\n// const val2Array = Object.entries(obj2);\n\nfor (let key1 in obj) {\n if (obj[key1] !== obj2[key1]){\n return false;\n }\n}\nfor (let key2 in obj) {\n if (obj2[key2] !== obj1[key2]){\n return false;\n }\n}\nreturn true;\n\n// if (val1Array.sort().join('') === val2Array.sort().join('')){\n// return true\n// }else return false\n// console.log(val1Array)\n// console.log(val2Array)\n}", "function anagrams(prefix, str){\n if(str.length <= 1){\n // console.log(`The anagram is ${prefix}${str}`);\n } else {\n for(let i=0; i<str.length; i++){\n let currentLetter = str.substring(i, i+1);\n let previousLetters = str.substring(0,i);\n let afterLetters = str.substring(i+1);\n anagrams(prefix+currentLetter, previousLetters+afterLetters);\n }\n }\n\n}", "function fourthAnagram(str1, str2) {\n let letterSums = {};\n\n // If we do the exact same subractions for each letter in\n // str2 as we do additions for str1, letter_sums will all be 0.\n str1.split(\"\").forEach((e) => (letterSums[e] = (letterSums[e] || 0) + 1));\n str2.split(\"\").forEach((e) => (letterSums[e] = (letterSums[e] || 0) - 1));\n\n // It's a zero-sum game!\n return Object.values(letterSums).every((sum) => sum === 0);\n}", "function isAnagram(s1, s2) {\n if (s1.length !== s2.length) return false\n const map = new Map()\n for (let i = 0; i < s1.length; i++) {\n if (!map.has(s1[i])) {\n map.set(s1[i], 1)\n } else {\n map.set(s1[i], map.get(s1[i]) + 1)\n }\n }\n for (let i = 0; i < s2.length; i++) {\n if (!map.has(s2[i])) return false\n map.set(s2[i], map.get(s2[i]) - 1)\n if (map.get(s2[i]) === 0) {\n map.delete(s2[i])\n }\n }\n return map.size === 0\n}", "function makeAnagram(a, b) {\n let counter = {};\n let total = 0;\n Array.from(a).forEach((c) => {\n counter[c] = counter[c] || 0;\n counter[c] += 1;\n });\n Array.from(b).forEach((c) => {\n counter[c] = counter[c] || 0;\n counter[c] -= 1;\n });\n Object.keys(counter).forEach((k) => {\n if (counter[k] !== 0) total += Math.abs(counter[k]);\n });\n return total;\n}", "function isAnagram (a, b) {\n\t// turn each string into arrays to check for equality\n\tlet stringAArray = a.split('');\n let stringBArray = b.split('');\n\n // have a counter variable to keep track of how many characters match\n let numberOfMatches = 0;\n\n // check which string is smaller to loop through that string in the first loop\n // so we can reduce the number of equality checks\n if (stringAArray.length > stringBArray.length) {\n \tstringAArray = b.split('');\n stringBArray = a.split('');\n }\n\n // loop through both array of strings to check if stringAArray[i] === stringBArray[j]\n // push 2 counters to numberOfMatches for each match\n // set stringBArray[j] to null so that when we do an equality check it would not check that same value again and add counters to numberOfMatches\n for (let i = 0; i < stringAArray.length; i++) {\n for (let j = 0; j < stringBArray.length; j++) {\n if (stringAArray[i] === stringBArray[j]) {\n \t// console.log('match');\n numberOfMatches += 2;\n stringBArray[j] = null;\n break;\n }\n }\n }\n\n // console.log('number of matches: ' + numberOfMatches);\n // console.log('string a array: ' + stringAArray);\n // console.log('string b array: ' + stringBArray);\n // console.log('number of cuts: ' + (stringAArray.length + stringBArray.length) - numberOfMatches);\n\n // return total amount of cuts to both strings\n return (stringAArray.length + stringBArray.length) - numberOfMatches;\n}", "function isAnagram2(s1, s2) {\n if (s1.length !== s2.length) return false\n const s1Arr = s1.split(\"\")\n const s2Arr = s2.split(\"\")\n s1Arr.sort()\n s2Arr.sort()\n for (let i = 0;i < s1Arr.length; i++) {\n if (s1Arr[i] !== s2Arr[i]) {\n return false\n }\n }\n return true\n}", "function isAnagram(string1, string2){\n if(string1.length !== string2.length) return false;\n\n let string1CharCounts = {};\n let string2CharCounts = {}\n\n for(let i = 0; i < string1.length; ++i){\n let char = string1[i];\n string1CharCounts[char] = string1CharCounts[char] === undefined ? 1 : ++string1CharCounts[char];\n }\n\n for(let i = 0; i < string2.length; ++i){\n let char = string2[i];\n string2CharCounts[char] = string2CharCounts[char] === undefined ? 1 : ++string2CharCounts[char];\n }\n\n for(let char in string1CharCounts){\n let leftCount = string1CharCounts[char];\n let rightCount = string2CharCounts[char];\n\n if(leftCount !== rightCount) return false;\n\n delete string1CharCounts[char];\n delete string2CharCounts[char];\n }\n\n return !Object.keys(string2CharCounts).length;\n}", "function anagram(str1, str2) {\n // if not equal then this string is not the same\n if (str1.length !== str2.length) return false\n let mapStr1={};\n let mapStr2={}\n let arr1 = str1.split('');\n let arr2 = str2.split('');\n let v2\n arr1.forEach((v,i)=>{\n mapStr1[v] = mapStr1[v] ? mapStr1[v] + 1 : 1\n v2 = arr2[i]\n mapStr2[v2] = mapStr2[v2] ? mapStr2[v2] + 1 : 1\n })\n\n for(let i in mapStr1) {\n if (mapStr1[i] !== mapStr2[i]) {\n return false\n }\n }\n return true\n}", "function anagram(string) {\n const results = {}\n function buildCombos(combos, letters) {\n if(!letters.length) {\n return results[combos] = '';\n }\n for (var i = 0; i < letters.length; i++) {\n buildCombos(combos + letters.charAt(i), letters.slice(0, i) + letters.slice(i + 1));\n }\n}\n buildCombos('', string);\n return Object.keys(results);\n\n}", "function anagram(prefix, word) {\n if (word.length === 1) {\n console.log(prefix + word);\n }\n\n for (let i = 0; i < word.length; i++) {\n const firstChar = word.charAt(i);\n const remainder = word.substring(0, i) + word.substring(i + 1);\n anagram(prefix + firstChar, remainder);\n }\n}", "function isAnagram (s, t) {\n let anagram = true;\n if ( s.length !== t.length ) {\n return false;\n }\n else {\n let sCharArray = [...s];\n let tCharArray = [...t];\n sCharArray.sort();\n tCharArray.sort();\n for (let i = 0 ; i < sCharArray.length ; i++ ) {\n if ( sCharArray[i] !== tCharArray[i] ) {\n anagram = false;\n break;\n }\n }\n }\n return anagram;\n}", "function thirdAnagram(str1, str2) {\n let str1Obj = {};\n let str2Obj = {};\n for (let i = 0; i < str1.length; i++) {\n if (str1Obj[str1[i]]) {\n str1Obj[str1[i]]++\n } else {\n str1Obj[str1[i]] = 1\n }\n }\n for (let i = 0; i < str2.length; i++) {\n if (str2Obj[str2[i]]) {\n str2Obj[str2[i]]++\n } else {\n str2Obj[str2[i]] = 1\n }\n\n }\n\n\n for (const key in str1Obj) {\n\n if (str1Obj[key] !== str2Obj[key]) {\n return false\n }\n\n }\n\n return true\n\n}", "function isAnagram(test, original) {\n if (test.length !== original.length) {\n return false;\n }\n\n let obj = {};\n let obj2 = {};\n\n let tes = test.toLowerCase();\n let orig = original.toLowerCase();\n\n for (let i = 0; i < tes.length; i++) {\n let letter = tes[i];\n obj[letter] = obj[letter] + 1 || 1;\n }\n\n for (let j = 0; j < orig.length; j++) {\n let letter = orig[j];\n obj2[letter] = obj2[letter] + 1 || 1;\n }\n\n for (let k = 0; k < tes.length; k++) {\n let letter = tes[k];\n if (obj[letter] !== obj2[letter]) {\n return false;\n }\n }\n\n return true;\n}", "function isAnagram(str1, str2){\n \n if(str1==null || str2==null \n || str1.length==0 || str2.length==0 \n || str1.length != str2.length){\n return false;\n }\n\n for(let a of str1){\n if(!str2.contains(a)){ /// time complexity = O(n^2) :( \n return false;\n }\n }\n return true;\n\n}", "function printAnagram(word){\n console.log(`The word for which we will find an anagram is ${word}`);\n anagrams(' ', word);\n\n}", "function isAnagram(word1,word2) {\n /* \n Check if the length of the first word is equal to the length of the second word. If not, return false\n */\n if (word1.length != word2.length) {\n return false;\n }\n\n // Convert word1 and word2 to lower case\n word1 = word1.toLowerCase();\n word2 = word2.toLowerCase();\n\n /*\n Convert each string to an array, sort in alphabetical order and convert back to a string. Check if the updated strings are the same.\n */\n return word1.split('').sort().join('') == word2.split('').sort().join('');\n}", "isAnagram(str1, str2) {\n\n if (str1.length !== str2.length) {\n return false;\n }\n\n var sortStr1 = str1.split('').sort().join('');\n var sortStr2 = str2.split('').sort().join('');\n\n return (sortStr1 === sortStr2);\n }", "function areAnagrams(str1, str2) {\n if (str1.length != str2.length) {\n return false;\n }\n let hash_map = {}\n for (let i = 0; i < str1.length; i++) {\n let char = str1[i];\n if (char in hash_map) {\n hash_map[char]++;\n } else {\n hash_map[char] = 1;\n }\n }\n\n console.log(hash_map);\n\n for (let i = 0; i < str2.length; i++) {\n let char = str2[i];\n if (!hash_map[char]) {\n return false;\n } else {\n hash_map[char]--;\n }\n }\n return true;\n}", "function sameFrequency(n1, n2){\n return validAnagram(n1.toString(), n2.toString());\n}", "function validAnagram(str1, str2) {\n if (str1 === '' && str2 === '') {\n return true;\n }\n\n if (str1 === str2) {\n return true;\n }\n\n if (str1.length !== str2.length) {\n return false;\n }\n\n let arr1 = str1.split('');\n let arr2 = str2.split('');\n\n for (let i = 0; i < str1.length; i++) {\n let correctIndex = arr2.indexOf(arr1[i]);\n if (correctIndex === -1) {\n return false;\n }\n arr2.splice(correctIndex, 1);\n }\n return true;\n}" ]
[ "0.7745038", "0.7705903", "0.75967216", "0.75532055", "0.7515445", "0.7515445", "0.7515445", "0.7497276", "0.7480104", "0.7466251", "0.7387331", "0.73166096", "0.72766626", "0.7249045", "0.72319037", "0.72086513", "0.7199069", "0.7198323", "0.7177884", "0.7151432", "0.7150425", "0.7136896", "0.7122045", "0.7097497", "0.70639724", "0.70616734", "0.705429", "0.7038486", "0.7031325", "0.7005902", "0.69968337", "0.6985849", "0.69799393", "0.6970292", "0.69610864", "0.6947644", "0.6941492", "0.6941225", "0.69379056", "0.69195855", "0.6915275", "0.6899609", "0.68962985", "0.6887789", "0.6883071", "0.68798596", "0.68792146", "0.6852312", "0.684542", "0.68394065", "0.6831013", "0.68215084", "0.6811203", "0.6801526", "0.68000436", "0.67996585", "0.6793246", "0.678418", "0.6783898", "0.6777403", "0.6770496", "0.67693037", "0.6760707", "0.6760221", "0.6759103", "0.67572695", "0.6756848", "0.6754466", "0.67431545", "0.67236006", "0.67209065", "0.6706294", "0.67012566", "0.669807", "0.6688655", "0.6681992", "0.666743", "0.66653204", "0.66591233", "0.66563046", "0.66557467", "0.66407704", "0.66352963", "0.66213256", "0.6620166", "0.66001546", "0.6598594", "0.65963054", "0.65923804", "0.6591476", "0.6589587", "0.65869915", "0.6585963", "0.6576162", "0.6561141", "0.6544517", "0.6541666", "0.65376806", "0.6532898", "0.64777744" ]
0.716067
19
It will used to find Prime Numbers
findPrime(s1, s2) { var count = 0, flag = 0, k = 0; var prime = []; for (var i = s1; i <= s2; i++) { for (var j = 2; j < i; j++) { if (i % j == 0) { flag = 0; count++; break; } else { flag = 1; } } if (flag == 1) { prime[k++] = i; } } return prime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function primenum(){\n var num=+prompt('Enter a number');\n if(num<3){\n console.log('Not a prime number');\n } else {\n checkPrimenum();\n }\n\n function checkPrimenum() {\n for (var a=2;a<num;a++) {\n for (var b=2;b<a;b++) {\n if (a%b == 0) break;\n }\n if (b == a){\n console.log(a);\n }\n }\n } \n}", "function test_prime(n) {\n console.log(\"prime clicked\");\n console.log(n);\n\n if (n <= 1) {\n return false;\n } else if (n === 2 || n == 3) {\n return true;\n } else {\n for (var x = 2; x <= Math.floor(Math.sqrt(n)); x++) {\n if (n % x === 0) {\n console.log(x);\n return false;\n }\n }\n return true;\n }\n}", "function problem3(num){\n for(var x = 2; x<=num; x++){\n if(isPrime(x) !== true){\n }\n else if (num%x===0){\n num = num/x;\n }\n else if (isPrime(num) == true)\n return num;\n }\n}", "function primeNum(p) {\nvar isPrime = true;\nfor (var i = 2; i < 10; i++){\nif (p % i === 0 && p !== i) {\n isPrime = false;\n break;\n }\n }\n return isPrime;\n}", "function isPrime(n){\n console.log(\"Các số nguyên tố trong khoảng từ 1 đến \"+n)\n if(n <2){\n console.log(\"không có số nguyên tố nào cả\")\n \n }else{\n console.log(2)\n for(var i = 3; i <= n; i++ ){\n \n for(var j=2; j < Math.sqrt(i); j++){\n if(i % j === 0){\n return 0;\n \n }\n console.log(i) \n }\n \n }\n \n }\n \n \n}", "function test_prime(n)\n{ \n if (n===1) {return false; }\n else if(n === 2)\n{ return true; }\nelse {\nfor(var x = 2; x < n; x++) {\n if(n % x === 0) \n{ return false; } \n}\n return true; \n }\n}", "function findPrime(nPrimes,startAt){\n var n = 100\n k=startAt+nPrimes\n \n while (startAt<=k){\n i=2\n flag = false\n while(i<startAt){\n if(startAt%i===0){\n flag = true\n }\n \n i++\n }\n \n console.log(flag? startAt+' is not a prime':startAt+' is prime')\n startAt++\n }\n}", "function getPrime(x,y){\n for(let i=x;i<y;i++){\n let flag = true;\n for(let a=2;a<i;a++){\n if(i%a==0 && i!==a){\n flag= false\n break\n }\n }\n if(flag==true){\n console.log(i)\n }\n }\n}", "function testPrimeNum(num){\n for(var i=2; i<num; i++){\n if(num%i===0){\n return false;\n }\n return num>1;\n }\n}", "function identifyPrime(num) {\n for(var i = 2; i < num; i++) {\n if(num % i === 0) { \n return console.log(\"No\");\n }\n } \n if (num > 1) { \n return console.log(\"Yes\");\n }\n}", "isPrime(number) {\n\n }", "function isPrime(x) {\n var i;\n \n console.log('Checking base');\n if (isNaN(x) || !isFinite(x) || x < 2) {\n return false;\n }\n\n console.log('Checking x % 2 ');\n if (x % 2 === 0) {\n return x === 2;\n }\n\n console.log('Checking x % 3');\n if (x % 3 === 0) {\n return x === 3;\n }\n\n console.log('Checking x % 5');\n if (x % 5 === 0) {\n return x === 5;\n\n }\n\n for (i = 7; i <= Math.sqrt(x); i += 30) {\n console.log('Checking x % ' + i);\n if (x % i === 0) {\n return false;\n }\n\n console.log('Checking x % ' + (i + 4));\n if (x % (i + 4) === 0) {\n return false;\n }\n\n console.log('Checking x % ' + (i + 6));\n if (x % (i + 6) === 0) {\n return false;\n }\n\n console.log('Checking x % ' + (i + 10));\n if (x % (i + 10) === 0) {\n return i + 10;\n }\n\n console.log('Checking x % ' + (i + 12));\n if (x % (i + 12) === 0) {\n return i + 12;\n }\n\n console.log('Checking x % ' + (i + 16));\n if (x % (i + 16) === 0) {\n return i + 16;\n }\n\n console.log('Checking x % ' + (i + 22));\n if (x % (i + 22) === 0) {\n return i + 22;\n }\n\n console.log('Checking x % ' + (i + 24));\n if (x % (i + 24) === 0) {\n return i + 24;\n }\n }\n\n return true;\n }", "isPrime(number)\n{\n if(number==0 || number == 1)\n {\n return false;\n }\n else\n {\n for (let index = 2; index < number; index++)\n {\n if (number % index == 0) \n {\n return false;\n }\n }\n return true;\n }\n}", "function test_prime(n)\r\n{\r\n\r\n if (n===1)\r\n {\r\n return false;\r\n }\r\n else if(n === 2)\r\n {\r\n return true;\r\n }else\r\n {\r\n for(var x = 2; x < n; x++)\r\n {\r\n if(n % x === 0)\r\n {\r\n return false;\r\n }\r\n }\r\n return true; \r\n }\r\n}", "function testPrimeNum(n){\n if(n===1){\n return false;\n }else if(n===2){\n return true;\n }else{\n for(var i=2; i<n;i++){\n if(n%i===0){\n return false;\n }\n }\n return true;\n }\n}", "function isPrime(n)\r\n{\r\n var flag=0;\r\n for(let i=2 ; i < n/2 ; i++) {\r\n if(n%i === 0) {\r\n flag = 1;\r\n break;\r\n }\r\n }\r\n if(flag == 0) {\r\n return true;\r\n }\r\n}", "function prim(x) {\n if (x < 2) return false;\n\n for (let i = 2; i < x; i++) {\n if (x % i === 0) {\n return false;\n }\n }\n return true;\n}", "function findSmallerPrimes() {\n for (let i = 0; i < 1000; i++) {\n isPrime(i);\n }\n}", "function findPrimes(startFrom, endAt)\n\t{\n\t// INSERT YOUR CODE HERE\n\t}", "function demoFun(num,prime){\nvar x=0\nfor(var i=2;i<num;i++){\nif(num%i == 0){\nx=1\nbreak;\n}\n}\nif(x == 0){\nprime()\n}\n}", "function test_prime(n)\n{\n\n if (n===1)\n {\n return false;\n }\n else if(n === 2)\n {\n return true;\n }else\n {\n for(var x = 2; x < n; x++)\n {\n if(n % x === 0)\n {\n return false;\n }\n }\n return true; \n }\n}", "function printPrimes(){\n var isPrime = true;\n for(let i = 2; i <= 100; i++) {\n isPrime = true;\n for (let j = 2; j <= i/2; j++) {\n if (i%j === 0) {\n isPrime = false;\n break;\n }\n }\n if (isPrime) {\n console.log(i);\n }\n }\n}", "function checkPrime(number){\n //var faktor = [];\n var jumlahFaktor = 0;\n for(let i=1; i<=number; i++){\n if(number%i === 0){\n //faktor.push(i);\n jumlahFaktor++;\n }\n }\n if(jumlahFaktor === 2){\n return true;\n } else {\n return false;\n }\n }", "function isPrime(n) {\n\t// TODO:\n}", "function isPrime(num) {\n for(var i = 2; i < num; i++) {\n if(num % i === 0) \n }\n\n }", "function check(num) {\r\n if (num == 1) {\r\n console.log('Not a Prime Number');\r\n } else {\r\n for (let i = 2; i <= Math.sqrt(num); i++) {\r\n if (num % i == 0) {\r\n console.log(\"Not a Prime Number\");\r\n return;\r\n }\r\n }\r\n console.log(\"is Prime\");\r\n }\r\n}", "function showPrimes(limit) {\n for (let i = 0; i <= limit; i++) {\n if (isPrime(i)) {\n console.log(i);\n }\n }\n}", "function showPrimes(n) {\n nextPrime: for (let i = 2; i < n; i++) {\n \n for (let j = 2; j < i; j++) {\n if (i % j == 0) continue nextPrime;\n }\n \n alert( i ); // a prime\n }\n }", "function allPrimesLessThanN(n) {\n for (let i = 0; i < n; i++) {\n if (isPrime2(i)) {\n \n }\n }\n}", "function nextPrime(n){\n if(n === 0){return 2;}\n var answer = 0;\n function isPrime(num, start) {\n for ( var i = 2; i < num; i++ ) {\n if ( num % i === 0 ) {\n return false;\n }\n }\n return true;\n }\n for(var i = n + 1; i < n + 100; i++){\n if(isPrime(i , n)){\n answer = i;\n break;\n }\n }\n return answer;\n}", "function primeTests() {\n console.log(isPrime(1), \" -> false\");\n console.log(isPrime(2), \" -> true\");\n console.log(isPrime(3), \" -> true\");\n console.log(isPrime(4), \" -> false\");\n}", "function listPrimeNumbers(number){\n const aqui = document.querySelector('.primos');\n const para = document.createElement('p');\n aqui.appendChild(para);\n const dentro = document.querySelector('p');\n dentro.id = \"dentro\";\n for(let i= number; i>1 ; i--){\n \n //const dentro= document.querySelector('.pimos);\n if (isPrime(i)){\n console.log(i);\n \n dentro.textContent += \" \"+i;\n \n \n }\n } \n}", "function test_prime(n)\n{\n if (n===1)\n {\n return false;\n }\n else if(n === 2)\n {\n return true;\n }else\n {\n for(var x = 2; x < n; x++)\n {\n if(n % x === 0)\n {\n return false;\n }\n }\n return true; \n }\n}", "function prime(n){\n var p=Math.floor((Math.sqrt(n)));\n console.log(p)\n if(n==0||n==1||n==2||n==3){\n return \"Prime\"\n }\n for(i=2;i<=p;i++){\n if(n%i==0){\n return console.log(\"Number is not prime\")\n }\n }\n return console.log(\"Number is prime\")\n }", "function isPrime(n){\n if (n<=1){\n return false //number isnt prime \n }\n for (let i= 2; i< n; i++){\n if ( (n % i) ==0){\n false /*number isnt prime // we \n cant do i<= n coz that would definately \n return 0 when the \n value of n== i ;and test would end \n without answering any questions */\n }\n }\nreturn true /*the number is indeed prime \ncoz(i) it is either less than or equal to 1\nand (ii) there was a number less than it that coul\nreturn a remainder of 0 on division */\n}", "isPrime(number) {\n if (number == 0 || number == 1) {\n return false;\n }\n for (let index = 2; index < number; index++) {\n if (number % index == 0) {\n return false;\n }\n\n }\n return true;\n}", "function isPrime(num) {\n if(num < 2) return false;\n \n for (let i = 2; i < num; i++){\n if( num % i === 0){\n return false;\n }\n }\n return true;\n }", "function prime (n) {\nvar counter = 0;\nwhile (counter <= n) {\n var notPrime = false;\n counter++\n var i = 2;\n while (i <= counter) {\n if (counter%i===0 && i!==counter) {\n notPrime = true;\n }\n i++;\n }\n if (notPrime === false) {\n console.log(counter);\n }\n}\n}", "function checkPrime(x) {\n for (let i = 2; i <= x/2; i++) {\n if (x%i === 0) {\n return null;\n }\n }\n return x;\n}", "function isPrime(num) {\n for(var i = 2; i < num; i++){\n if(num % i === 0){ \n return false;\n }\n }\n //return num !== 1;\n return true;\n }", "function nextPrime(num1) {\n\n var isPrime=false;\n\n for (i = (num1+1); isPrime == false; i++){\n console.log(\"Now i is: \" + i)\n for (k=2; k%num1==0; k++){\n console.log(\"Now k is: \" + k)\n console.log(\"i % k = \" + i%k)\n \n }\n }\n }", "function isPrime(num){\n\n // if any of the values between 2 and the num\n // var can evenly go into num then return false\n for(let i = 2; i < num; i++){\n if(num % i === 0){\n return false;\n }\n }\n return true;\n}", "function showPrimes(limit) {\n for (number = 2; number <= limit; number++)\n if (isPrime(number)) console.log(number);\n}", "function PrimeTest(a){\n if (isNaN(a) || !isFinite(a) || a % 1 || a < 2) return false; \n var m = Math.sqrt(a);\n for (var i = 2; i <= m; i++) if (a % i==0) return false;\n return true;\n}", "function isPrime(number){\n //determine if number is 1\n if(number === 1){\n return false;\n }\n//0 gives you NaN and all the numbers are divisible by 1. Therefore, you\n//start at 2.\n for(var i = 2; i < number; i++){\n if(number % i === 0){ //if the statement is true, then return false\n return false;\n }\n }\n return true;\n}", "function isPriNum (num){\n if (num%1 !== 0 | num ===1){\n return false;\n }\n \n if(num === 2){\n return true\n }\n if (num%2 === 0){\n return false\n }\n\n else{\n for (var a = num-2; a >= 2; a = a-2){\n if (num%a === 0){\n return false\n } \n }\n return true\n }\n}", "function nth_prime(n) {\n\n}", "function getPrime() {\n var i = 0;\n var j = 0;\n\n limit_numbers = document.getElementById('limit').value;\n\n //loop till i equals to limit_numbers of numbers\n for (i = 1; i <= limit_numbers; i++) {\n count = 0;\n\n for (j = 1; j <= i; j++) {\n // % modules will give the reminder value, so if the reminder is 0 then it is divisible\n if (i % j == 0) {\n //increment the value of count\n count++;\n }\n }\n\n\n //prime number should be exactly divisible by 2 times only (itself and 1)\n if (count == 2) {\n document.getElementById(\"result\").insertAdjacentHTML('beforeend', i + '<br>');\n }\n }\n}", "function isPrime(num) {\nwhile ( num < 0){\n return false\n }\nwhile(num <= 3){\n if(num !=1 && num % 1 == 0 && num % Number(num) ==0){\n return true;\n } else {\n return false;\n }\n }\n\nwhile( num >3){\n if(num != 1 && num % 1 == 0 && num % Number(num) ==0 && num % 2 != 0 && num % 3 != 0 ){\n return true;\n } else {\n return false\n }\n }\n}", "function isPrime(num) {\n num = Math.abs (num);\nif (num < 2) {return false;}\nfor (let i=2;i<num;i++) { \n if (num%i === 0){ \n return false;}\n}\nreturn true;\n}", "function prime(index) {\n\n}", "function isPrime(pNum)\r\n{\r\n for (i = 2; i < pNum; i++)\r\n {\r\n const result = pNum % i;\r\n\r\n if (result === 0)\r\n {\r\n return false;\r\n }\r\n }\r\n\r\n //in this case returning pNum if it's greather than 1, as 1 would skip the for loop as well as a negative number\r\n return pNum > 1;\r\n\r\n}", "function checkPrime(number){\n var pom = true\n for (var i = 2; i <= number; i++){\n if ((number %i ) === 0 && number !== i){\n pom = false;\n }\n }\n return pom;\n}", "function checkprime(){\r\n\r\n var firstelement = 0;\r\n firstelement = items[0];\r\n \r\n\r\n if(firstelement===\"\" || items.length == 0){\r\n alert(\"Enter valid Number\");\r\n \r\n }\r\n else if(firstelement===\"0\"){\r\n\r\n document.getElementById(\"ans01\").innerHTML=firstelement +' - is neither Prime nor Composite';\r\n\r\n }else if(firstelement===\"1\"){\r\n \r\n document.getElementById(\"ans01\").innerHTML=firstelement +' - is not a Prime Number';\r\n\r\n }else if(firstelement===\"2\"){\r\n \r\n document.getElementById(\"ans01\").innerHTML=firstelement +' - is a Prime Number';\r\n }else{\r\n for(var x=2;x<firstelement;x++)\r\n {\r\n if(firstelement%x===0)\r\n { \r\n \r\n document.getElementById(\"ans01\").innerHTML=firstelement +' - is not a Prime Number';\r\n return ;\r\n }\r\n }\r\n \r\n document.getElementById(\"ans01\").innerHTML=firstelement +' - is a Prime Number';\r\n }\r\n}", "function isPrime(testNo){\n \n var result = false;\n for(var n = testNo - 1; n > 1; n--){\n result = (testNo % n === 0) + result;\n }\n \n if(result === 0 && testNo > 1){\n return true;\n }return false;\n }", "function checkPrimeNumber(start, end) {\n console.log('The prime numbers between ' + start + ' and ' + end + ' are:');\n for (let i = start; i <= end; i++) {\n let flag = false;\n for (let j = 2; j < i; j++) {\n if (i % j == 0) {\n flag = true;\n break;\n }\n }\n\n if (i > 1 && flag === false) {\n console.log(i);\n }\n }\n\n}", "function isPrime(n)\r\n{\r\n if(n%2!==0){\r\n return true\r\n \r\n }\r\n}", "function cekPrime (param1){\n for(var i=2;i< param1; i++){\n if(param1 % i==0){\n return false;\n }\n }\n return true;\n}", "function isPrime(input){\n var count = 0;\n for(var i = 1; i <= input; i++){\n if(input % i == 0){\n count++\n }\n }\n // console.log(count)\n if(input == 1 || input == 0){\n return (\"Neither Prime Nor Co-Prime\")\n }\n else if(count == 2){\n return(\"Prime\")\n }\n else{\n return(\"Not Prime\")\n }\n}", "function printPrimes(nPrimes)\r\n{\r\n var n = 0;\r\n var i = 2;\r\n \r\n while(n < nPrimes)\r\n {\r\n if (isPrime(i))\r\n {\r\n console.log(n, \" → \", i);\r\n n++;\r\n }\r\n \r\n i++;\r\n }\r\n}", "function isPrime(n){\n for (let a = 2; a < n; a++){\n if (n%a === 0){\n return false;\n }\n }\n return true;\n }", "function isPrime(n){\n var divisor = 2;\n \n while (n > divisor){\n if(n % divisor == 0){\n return false; \n }\n else\n divisor++;\n }\n return true;\n }", "function getPrimes(int) {\r\n var primes = [];\r\n var curr = 2n;\r\n \r\n while (curr < int) {\r\n if ((int / curr) * curr === int) {\r\n int /= curr;\r\n primes.push(curr);\r\n console.log(curr);\r\n } else {\r\n curr += 1n;\r\n }\r\n }\r\n primes.push(int);\r\n \r\n return primes;\r\n}", "function isPrime(num){\r\n if (num === 1 || num ===2 || num===3){\r\n return true;\r\n }\r\n for(var i =2 ; i<=num/2 ; i++){\r\n if (num%i === 0){\r\n return false;\r\n }\r\n } \r\n return true;\r\n}", "function showPrimes(limit) {\n for(let number=2; number<=limit; number++) {\n\n let isPrime = true;\n \n for (let factor=2; factor<number; factor++) {\n if (number % factor === 0) {\n //isPrime = false;\n //break; // no sense in checking the rest of the numbers\n }\n }\n\n if (isPrime) console.log(number);\n } \n}", "function showPrimes(n) {\n\n for (let i = 2; i < n; i++) {\n if (!isPrime(i)) continue;\n \n alert(i); // a prime\n }\n }", "function isPrime(n)\r\n{\r\n\tfor(let k=2;k<n;k++){\r\n\t\tif(!(n%k))\r\n\t\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isPrime(n)\r\n{\r\n\tfor(let k=2;k<n;k++){\r\n\t\tif(!(n%k))\r\n\t\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isPrime(v)\n{ let count=0;\n for(i=1;i<=v/2;i++)\n {\n if(v%i==0)\n count++\n }\n if(count>1)\n return false;\n else \n return true;\n}", "function isPrime(n) {\n\n if (n === 1) {\n return false;\n }\n else if (n === 2) {\n return true;\n } else {\n for (var i = 2; i < n; i++) {\n if (n % i === 0) {\n return false;\n }\n }\n return true\n }\n}", "function isPrime(n) {\n var sum = 0\n if (n <= 1) {\n return false\n } else {\n for (var i = 2; i < n+1; i++) {\n if (n % i === 0) {\n sum++\n if (n === 2) {\n return true\n }\n }\n if (sum > 1){\n return false\n }\n }\n if (sum === 1) {\n return true\n }\n }\n}", "function PrimeTime(num) { \n for (var i = 2; i < num / 2; i++){\n if (num % i === 0){\n return false;\n }\n }\n return true;\n}", "function isPrime(number) {\n for (let i=2; i < number; i++) {\n // check that the correct thing is targeted \n // console.log(i);\n if (number % i === 0) {\n // return number, not prime\n return false \n }\n } \n return true\n // return controls flow of the function (rest of the function is ignored)\n\n // divide the number by all the numbers leading up to it\n // if any of those return a whole number, not it is not prime\n // if we get this far without a NO, then YES \n}", "function divisors(num){\n var divs = [];\n for(var i=num-1;i>1;i--){\n if(num%i === 0){\n divs.unshift(i);\n }\n }\n if(divs.length < 1){\n return `${num} is prime`\n } else {\n return divs;\n }\n}", "function is_prime(num){\n if(num <= 1){\n return false\n }\n for(let i = 2; i < Math.floor(Math.sqrt(num)) + 1 ; i++){\n if(parseInt(num % i) === 0 ){\n return false\n }\n\n }\n return true\n}", "function notPrimes(a,b) {\n let nonPrimeArr = [];\n for(let i = a; i <= b; i++) {\n if(!isPrime(i) && checkForPrimeDigits(i)) {\n nonPrimeArr.push(i)\n }\n }\n return nonPrimeArr;\n\n function checkForPrimeDigits(num) {\n let numStr = num.toString();\n for(let elem of numStr) {\n if(elem!=='2' && elem!=='3' && elem!=='5' && elem!=='7') {\n return false;\n }\n }\n return true;\n }\n function isPrime(num) {\n if(num < 2) return false;\n for(let i=2; i < num; i++){\n if(num%i===0) return false;\n }\n return true;\n }\n}", "function isPrime(n){\n //define variable named divisor with value 2\n var divisor = 2;\n\n // while n > divisor, keep running code inside the while loop\n //n = 137, divisor = 2\n while (n > divisor){\n if(n % divisor == 0){\n return false; \n }\n else {\n divisor++;\n }\n }\n return true;\n}", "function numPrimorial(n) {\r\n let j;\r\n let arr = new Set;\r\n\r\n function createPrimeArr(length) {\r\n if (arr.size == n) return;\r\n for (let i = 1; i <= length; i++) {\r\n let tempArr = [];\r\n for (j = 0; j <= i; j++) {\r\n if (i % j == 0) tempArr.push(i);\r\n }\r\n\r\n if (tempArr.length == 2) {\r\n\r\n arr.add(tempArr[0])\r\n };\r\n };\r\n createPrimeArr(length + 1)\r\n };\r\n createPrimeArr(n)\r\n return arr\r\n}", "function printAllPrimesUpTo(max){\n for (let i = 2; i <= max; i++) {\n let possiblePrime = checkPrime(i);\n if (possiblePrime) {\n console.log(possiblePrime);\n }\n }\n}", "function IsPrime(n){\n var divisor = 2;\n\n while(n > divisor){\n if (n % divisor == 0){\n return false;\n }\n else divisor++;\n }\n return true;\n}", "function isPrime(num) {\n return [...Array(num + 1).keys()].filter(el => num % el === 0).length === 2;\n}", "function isPrime(num) {\n\t// Your code\n}", "function printPrimes(limit) {\n // the for loop iterates through the prime numbers up to the limit passed in as argument\n for(var i = 1; i<=limit; i++) {\n // call checkPrime to see if each iteration is Prime\n if(checkPrime(i)===true) {\n console.log(i);\n }\n }\n}", "function findPrime(num) {\n var result = true;\n for (var i = 2; i < num; i++) {\n if (num % i === 0) {\n return !result;\n }\n } return result;\n}", "isPrime(index) {\n var n = 2;\n while (n <= index / 2) {\n if (index % n == 0) {\n return 0;\n }\n n++;\n }\n return index;\n}", "function isPrime(num) {\n //TODO\n for (var i = 2; i < num; i++){\n if(num % i == 0){\n return false;\n }\n \n }\n return num >= 2\n}", "function isPrime(num) {\n if(num===1) {\n return false\n }\n else if (num === 2) {\n return true\n }\n \n for(var i = 3; i < num-1; i++)\n if(num % i === 0) {\n return false\n }\n return true\n}", "function getRemAndPrime(num) {\n if (num !== 1) { /*If Number Is One Thats A End Point Of Recursive*/\n let i = 1;\n while (++i) {\n if (isPrime(i)) {/*Check Prime*/\n let res = num / i;\n if (!isFloat(res)) {/*Result Should Be Whole number*/\n primeList.push(i);\n getRemAndPrime(res);\n break;\n }\n }\n }\n } else {\n console.log(JSON.stringify(primeList) + \"===\" + primeList.reduce((a, b) => { return a * b }, 1));\n }\n}", "function prime(a){\n\n for(let i=2;i<a;i++){\n\n if(a%i == 0){\n return \"Nu este prim\"\n }\n }\n\n return \"Este prim\";\n\n}", "function checkPrime(x) {\n if (x <= 1) {\n return false;\n }\n for (let i = 2; i < x; i++) {\n if (x % i === 0) {\n return false;\n }\n }\n return true;\n}", "function primeChecker (num) {\n \n if (num < 1) return false;\n \n var newNum = Math.floor(Math.sqrt(num));\n \n for (var i = 2; i <= newNum; i++)\n {\n if (num % i === 0)\n {\n return false;\n }\n }\n \n return true;\n }", "function isPrime(n) {\n var divisor = 2;\n while (n > divisor){\n if(n % divisor == 0) {\n return false;\n } else {\n divisor++;\n }\n }\n return true;\n}", "function isPrime(num)\n{\n\tvar count=0;\n\tfor(var i=2;i<Math.sqrt(num)+1;i++){\n\t\tif(num%i ==0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\t}\n\treturn true;\n}", "function solve([num]) {\r\n let isPrime = true;\r\n for (let i = 2; i <= Math.sqrt(num); i++) { // for better optimization\r\n if (num % i === 0) {\r\n isPrime = false;\r\n console.log(\"Not Prime\");\r\n break;\r\n }\r\n \r\n }\r\n \r\n if (isPrime) {\r\n console.log(\"Prime\");\r\n }\r\n }", "function isPrime(num) {\n let result = false;\n \n for(let i = 2; i <= Math.floor(Math.sqrt(num)); i++) {\n if(num % i === 0){\n result = false;\n break;\n } \n result = true;\n }\n return result;\n }", "function isPrime(n) {\n let counter = 2;\n let len = Math.floor(Math.sqrt(n));\n while (counter <= len) {\n if (n%counter == 0){ return false;}\n counter += 1;\n}\n return true;\n}", "function isPrime(n) {\n for (var i = 2;i < n; i++) {\n if(n % i === 0){\n return false;\n }\n }\n return n > 1;\n}", "function sumPrimes(num) {\n sum = 1;\n for (let i=2;i<=num;i++) {\n console.log(\"-----\");\n console.log(\"i=\"+i);\n for (let j=2;j<i;j++) {\n console.log(\"j=\"+j);\n if (i % j == 0) {\n break;\n }\n }\n sum = sum + i;\n console.log(\"sum=\"+sum);\n }\n return sum;\n}", "function isPrime(num){\n if (num < 2){\n return false;\n }\n if (num === 2){\n return true;\n }\n\n for(let i = 2; i < num; i++){\n if (num % i === 0){\n return false;\n }\n }\n\n return true;\n}", "function isPrime(num) {\n let counter = 0;\n for (let i = 1; i <= num; i++) {\n if ((num % i) == 0) {\n counter++;\n if (counter > 2) {\n return false;\n }\n }\n }\n return true;\n}", "function showPrimes(limit) {\n for (let number = 2; number <= limit; number++) {\n // 2 - current (number)\n\n let isPrime = true;\n for (let factor = 2; factor < number; factor++) {\n if (number % factor === 0) {\n isPrime = false;\n break;\n }\n }\n if (isPrime) console.log(number);\n }\n}" ]
[ "0.7559418", "0.7433733", "0.7407744", "0.74072254", "0.73666185", "0.7259035", "0.72511977", "0.72162956", "0.72153944", "0.71979624", "0.71897966", "0.7165928", "0.7163561", "0.7150123", "0.7146827", "0.7132259", "0.71286863", "0.71257406", "0.71123326", "0.7095039", "0.7084952", "0.70794576", "0.70686793", "0.7068504", "0.70582145", "0.70530885", "0.70520264", "0.7046565", "0.7046133", "0.7045751", "0.70428526", "0.7038625", "0.70360154", "0.7024839", "0.7024828", "0.70240545", "0.7021699", "0.7013833", "0.70117", "0.7008573", "0.70069", "0.7003211", "0.7001595", "0.69951344", "0.69951326", "0.6987233", "0.6987207", "0.69842553", "0.6982797", "0.6977581", "0.6967005", "0.69598085", "0.69563115", "0.69534993", "0.6950608", "0.6950113", "0.694789", "0.6941301", "0.6938411", "0.6937921", "0.693576", "0.6934339", "0.6928134", "0.6927679", "0.6923254", "0.69193536", "0.68879503", "0.68879503", "0.6887255", "0.6879372", "0.68788165", "0.6872308", "0.68720776", "0.684847", "0.6846752", "0.68464774", "0.6842933", "0.6832712", "0.6829857", "0.68257743", "0.68223435", "0.6821994", "0.6817973", "0.6808533", "0.6803429", "0.6800859", "0.68000257", "0.679558", "0.6794873", "0.67876726", "0.6782964", "0.6782297", "0.6777938", "0.6774541", "0.67717046", "0.67707455", "0.6768337", "0.67523026", "0.67521507", "0.675203", "0.6749601" ]
0.0
-1
It will used to checks the item length
check(s1, s2) { for (let i = 0; i < s1.length; i++) { if (s1.charAt(i) != s2.charAt(i)) { return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "isFull() {\n return this.items.length == this.maxItems;\n }", "get length() {\n\t\treturn this.items.length;\n\t}", "hasItem() {\n return this.size > 0\n }", "function listLength(){\n\treturn item.length;\n}", "function listLength() {\n return item.length;\n}", "get length() {\n return this.items.size;\n }", "function getLength(item) {\r\n if (!IsUndefinedNullOrEmpty(item))\r\n return item.length;\r\n else\r\n return 0;\r\n}", "function checkInputLength() {\r\n\r\n\treturn item.value.length\r\n\r\n}", "size() {\n return this.items.length();\n }", "size() {\r\n\t\treturn this.items.length;\r\n\t}", "function hasLength (data, length) {\n return assigned(data) && data.length === length;\n }", "size() {\n\t\treturn this.items.length();\n\t}", "size() {\n return this.items.length;\n }", "size() {\n\t\treturn this.items.length;\n\t}", "function checkListLen() {\n return ul.children.length;\n}", "isValid() {\n return this.item.name.length > 0;\n }", "size() {\n\n return this.items.length;\n }", "size(){\n return this.items.length;\n }", "size(){\n return this.items.length;\n\n }", "size() {\n return this.items.length\n }", "size(){\n return this.items.length;\n }", "function listLength() {\n return listItems.length;\n}", "verifyLength(value, len) {\n if (value.length >= len) {\n\n return true;\n }\n return false;\n }", "contadorCarrito(){\r\n return this.itemsCarrito().length\r\n }", "_getItemCount() {\n return this.options.length + this.optionGroups.length;\n }", "function checkLimit() {\n return global.maxItems && global.detailsEnqueued >= global.maxItems;\n}", "isEmpty(){\n return this.items.length == 0;\n }", "function listLength() {\n\tconsole.log(listItems.length);\n\treturn listItems.length;\n}", "function isFull(){\n if(basket < maxItems){\n return false;\n } else {\n return true;\n }\n}", "get isFull() {\n return this._length === this._maxLength;\n }", "function length() {\n\treturn this.listSize;\n}", "isEmpty(){\n if(this.items.length == 0){\n return true;\n }\n else{\n return false;\n }\n }", "itemCount() {\n return this.__roomItems.length;\n }", "get length() {\n return array.length == 0\n }", "function itemLoaded(err, item, size){\n\tloadedItems.push(item);\n\tif(loadedItems.length == size){\n\t\titemsLoaded();\n\t}\n}", "isEmpty(){\n return this.items.length == 0; \n }", "function isFull(array) {\n if (array.length < maxItems) {\n return false;\n } else {\n return true;\n }\n}", "function length (data, value) {\n assert.not.undefined(value);\n\n return assigned(data) && data.length === value;\n }", "function isFull(items) {\n for (let i = 0; i < items.length; i++) {\n if (items <= maxItems) {\n return false;\n } else {\n return true;\n }\n }\n}", "static verifyLength(value, length) {\n return value.length >= length;\n\n }", "isEmpty() \n { \n return this.items.length == 0; \n }", "isFull() {\n return this.length() === this.capacity;\n }", "isEmpty() {\n return !this.items.length;\n }", "moreWidth() {\n return this.widthList_.length > 0;\n }", "isEmpty(){\n return this.items.length == 0;\n }", "reachedCapacity(){\n return this.amount >= this.item.stackMax ;\n }", "get itemCount() {\n return this._itemsByElement.size;\n }", "get length() {\n this._update();\n return this._list.length;\n }", "checkLength(currentPos, direction, length) {\n for (var i = 0; i < length; i++) {\n var x = currentPos.x;\n var y = currentPos.y;\n if (x >= this.props.size || y >= this.props.size || x < 0 || y < 0) {\n return false;\n }\n currentPos = this.move(currentPos, direction);\n }\n return true;\n }", "hasItems() {\n return Boolean(this.data) && Boolean(this.data.types) && this.data.types.length > 0;\n }", "isEmpty() {\n return this.items.length == 0\n }", "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "verifyLength(value, length) {\n if (value.length >= length) {\n return true;\n }\n return false;\n }", "get length() {\n\t\t\t\treturn _collection.length;\n\t\t\t}", "empty () {\n return !(this.length >= 1);\n }", "has(key) {\n const idx = asItemIndex(key);\n return typeof idx === 'number' && idx < this.items.length;\n }", "isEmpty() {\r\n if (this.items.length == 0){\r\n\r\n console.log(\"true\");\r\n }else{\r\n console.log(\"false\");\r\n }\r\n }", "isEmpty() {\n return this.items.length === 0;\n }", "hasMore() {\n return this.length > this.#index + 1;\n }", "isEmpty(){\n if(this.items.length === 0){\n return true;\n }\n return false;\n }", "checkIngredientAmountSize() {\n if (this.ingredientsReview.length > this.ingredinetsCheckedAmounts.length) {\n var needToAdd = this.ingredientsReview.length - this.ingredinetsCheckedAmounts.length;\n for (var i = 0; i < needToAdd; i++) {\n this.ingredinetsCheckedAmounts.push(\"0\");\n }\n } else if (this.ingredientsReview.length < this.ingredinetsCheckedAmounts.length) {\n this.ingredinetsCheckedAmounts.length = this.ingredientsReview.length;\n }\n this.ingredientAmountSize = this.ingredinetsCheckedAmounts.length;\n }", "get itemSize() { return this._itemSize; }", "get itemSize() { return this._itemSize; }", "function hasAtLeastOneItem(val) {\n return val.length >= 1;\n}", "countItems(type) {\n let key = this.getKey(type)\n return this.items[key].length\n }", "getLength() {\nreturn this.length;\n}", "function Count(obj) {\n if ( obj.length < opts['minlen']) {\n if (opts['messages']['multicheck']) {\n errors.push (opts['messages']['multicheck']);\n } else {\n errors.push (opts['title'] + ' must select ' + opts['minlen'] + ' to ' + opts['maxlen'] + ' items');\n }\n }\n }", "function isFull(){\n for ( let i = 0; i < basket.length; i++){\n if (basket[i] <= maxItems) {\n return true;\n } else {\n return false;\n }\n}\n}", "size(){return this.content.length;}", "size(){return this.content.length;}", "get length() {\n return this._list.length;\n }", "size() {\n return this.data.length;\n }", "function checkItemCount(itemsList)\n\t{\n\t\tvar itemsCount=0;\n\t\tfor (var i = 0; i < itemsList.length; i ++) {\n\t\t\t if (itemsList[i].trim() != '') {\n\t\t\t\t\t itemsCount++;\n\t\t\t }\n\t\t }\n\t\t\t return itemsCount;\n\t}", "get itemCount() {\n return this._list.childNodes.length;\n }", "function validate_len(list) {\n if (list._list.length > list._context._interpreter._flags.maxContainersLen) {\n throw new Errors.ExceedMemoryLimit(\"List exceeded maximum container length (\" + list._context._interpreter._flags.maxContainersLen + \")\");\n }\n}", "static isValidItems(items = [TestQuestion.structure]){\n return ((items && items.length > 0) &&\n items.every(item => TestQuestion.isValidItem(item))\n );\n }", "GetItemCount() {}", "isEmpty() {\n\t\treturn this.items == 0;\n\t}", "get length() { return this._length; }", "get length() { return this._length; }", "size(){\n return this.data.length\n }", "isEmpty() {\n\t\treturn this.items.length === 0;\n\t}", "function check_len(_indefinite_length, _length)\n {\n if(_indefinite_length == true)\n return 1;\n\n return _length;\n }", "function question5 () {\n for (let i = 0; i < data.length; i++) {\n if (data[i].materials.length >= 8) {\n // measures the length of each item's materials and if it is 8 or more\n console.log(data[i].title, data[i].materials.length, data[i].materials);\n }\n }\n}", "get length() {\n return this.list.size;\n }", "get _length () {\n return 1\n }", "get _length () {\n return 1\n }", "isEmpty(){\n return this.size==0;\n }", "size(){\n // Object.keys returns an array of all the properties of a given obj...\n return Object.keys(this.items).length;\n\n \n // OR, iterate thru object and increase counter for each (this does the same thing as Object.keys does under the hood)\n // var count = 0;\n // for (var key in this.items){\n // if (this.items.hasOwnProperty(key)){\n // count++;\n // }\n // }\n // return count;\n \n }", "isEmpty(){ return this.size == 0; }", "isEmpty(){\n return (this.size === 0); \n }", "get isFull(){return members.length >= numObjects;}", "size() {\n return this.length;\n }", "size() {\n return this.length;\n }", "size() {\n return this.length;\n }" ]
[ "0.7566723", "0.729179", "0.7223443", "0.7103082", "0.70947486", "0.7092027", "0.7012876", "0.6960686", "0.6781206", "0.6768775", "0.675496", "0.6721194", "0.67148685", "0.6703809", "0.6666471", "0.6663264", "0.66553223", "0.66301084", "0.66029966", "0.65893716", "0.65891606", "0.65273553", "0.6475722", "0.63711137", "0.63391674", "0.6332714", "0.6329967", "0.63289714", "0.6326896", "0.6325968", "0.6313263", "0.6300695", "0.62944615", "0.6290071", "0.6289082", "0.6287451", "0.6275741", "0.6270696", "0.6255052", "0.62490547", "0.6241543", "0.6218596", "0.62169564", "0.62119615", "0.61954", "0.61939377", "0.61843956", "0.61808974", "0.61676264", "0.61474067", "0.61188257", "0.61154175", "0.61154175", "0.61154175", "0.61154175", "0.61154175", "0.61154175", "0.61154175", "0.61154175", "0.6100519", "0.6084693", "0.6082489", "0.60791826", "0.60652924", "0.60641193", "0.6055519", "0.60534227", "0.60510385", "0.60510385", "0.6043209", "0.6035824", "0.60325706", "0.6025404", "0.60247874", "0.6017934", "0.6017934", "0.601723", "0.6015969", "0.60071504", "0.6001643", "0.60009944", "0.59966147", "0.5994518", "0.59872806", "0.59578824", "0.59578824", "0.5955678", "0.5950106", "0.594211", "0.5940392", "0.5939189", "0.5939133", "0.5939133", "0.59334254", "0.59168774", "0.5914614", "0.5910002", "0.5896907", "0.589364", "0.589364", "0.589364" ]
0.0
-1
It will used to sort the Items
sort1(str) { let ch = str.split(''); for (let i = 0; i < str.length; i++) { for (let j = i + 1; j < str.length; j++) { if (ch[i] > ch[j]) { let t = ch[i]; ch[i] = ch[j]; ch[j] = t; } } } var sortedStr = ""; for (let i = 0; i < ch.length; i++) { sortedStr += ch[i]; } return sortedStr; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function _sortItems() {\n\t\t\tthis.items.sort(_itemSortOrder);\n\t\t}", "itemsToSort() {\n return [];\n }", "sortedItems() {\n return this.childItems.slice().sort((i1, i2) => {\n return i1.index - i2.index;\n });\n }", "sortListItems() {\n let sortedItems = this.props.listItems.slice();\n return sortedItems.sort((a, b) => {\n if (a.value > b.value) {\n return -1;\n } else if (a.value < b.value) {\n return 1;\n }\n return 0;\n });\n }", "static sortItems()\n {\n //bubble sort\n var length = Explorer.items.length;\n for (var i = 0; i < length; i++) {\n for (var j = 0; j < (length - i - 1); j++) {\n //sort by type, if same type sort by name\n if((Explorer.items[j].type > Explorer.items[j+1].type) ||\n (\n Explorer.items[j].type == Explorer.items[j+1].type &&\n Explorer.items[j].name > Explorer.items[j+1].name\n )\n ) {\n //Swap the numbers\n var tmp = Explorer.items[j]; //Temporary variable to hold the current number\n Explorer.items[j] = Explorer.items[j+1]; //Replace current number with adjacent number\n Explorer.items[j+1] = tmp; //Replace adjacent number with current number\n }\n }\n }\n }", "function sortListItems()\r\n{\r\n\tallItems.sort(compareListItems);\r\n}", "sortProducts() {}", "sortedItems() {\n if (!this.sortField) return this.itemsToSort;\n return orderBy(this.itemsToSort, [this.sortField], [this.sortOrder]);\n }", "function sort() {\n\t\t\tvar self = this;\n\t\t\tthis._items.sort(function (a, b) {\n\t\t\t\tvar aCompare = self._comparator(a),\n\t\t\t\t\tbCompare = self._comparator(b);\n\t\t\t\t\n\t\t\t\tif (angular.isString(aCompare)) {\n\t\t\t\t\treturn self._direction * aCompare.localeCompare(bCompare);\n\t\t\t\t} else {\n\t\t\t\t\tif (aCompare > bCompare) {\n\t\t\t\t\t\treturn self._direction;\n\t\t\t\t\t} else if (aCompare == bCompare) {\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t\treturn -self._direction;\n\t\t\t\t}\n\t\t\t});\n\t\t}", "sortBy(field) {\n var sortedItems = this.props.itemsFromParent.sort( (a, b) => {\n if(field === \"price\") {\n if (a.item.price > b.item.price) {\n return 1;\n }\n if (a.item.price < b.item.price) {\n return -1;\n }\n return 0;\n }\n if(field === \"title\") {\n if (a.item.title > b.item.title) {\n return 1;\n }\n if (a.item.title < b.item.title) {\n return -1;\n }\n return 0;\n }\n if(field === \"location\") {\n if (a.dist > b.dist) {\n return 1;\n }\n if (a.dist < b.dist) {\n return -1;\n }\n return 0;\n }\n });\n this.updateData(sortedItems);\n }", "repeaterOnSort() {\n }", "__itemsSorted(event) {\n\n\t \thijackEvent(event);\n\n\t // An array of uid's ordered by user\n\t // by drag and drop reordering.\n\t const {sorted} = event.detail;\n\n\t const newIndexes = sorted.map(item => ({\n\t \tcoll: this.coll,\n \tdoc: item.uid,\n \tdata: {index: item.index}\n\t }));\n\n\t setBatch(newIndexes);\n\t }", "sort () {\r\n this._data.sort((a, b) => a.sortOrder !== b.sortOrder ? b.sortOrder - a.sortOrder : a.value.localeCompare(b.value))\r\n }", "sortBy() {\n // YOUR CODE HERE\n }", "function sortJson() {\r\n\t \r\n}", "sortData() {\n this.data.sort(($val1, $val2 ) => {\n const a = JSON.stringify($val1[this.sortBy]);\n const b = JSON.stringify($val2[this.sortBy]);\n if ( a < b ){\n return -this.sortDir;\n }\n if ( a > b ){\n return this.sortDir;\n }\n return 0;\n });\n }", "sort(){\n\n }", "function Sort() {}", "Sort() {\n\n }", "function sortItems(items, sorting) {\n const sortedItems = items;\n // return items.toSorted((a: Item, b: Item) => {\n sortedItems.sort((a, b) => {\n switch (sorting) {\n case 'nameAsc':\n return a.name.localeCompare(b.name);\n case 'nameDesc':\n return b.name.localeCompare(a.name);\n case 'sizeAsc':\n if (!a.size) {\n return -1;\n }\n if (!b.size) {\n return 1;\n }\n if (a.size < b.size) {\n return -1;\n }\n else if (a.size == b.size) {\n return 0;\n }\n return 1;\n case 'sizeDesc':\n if (!b.size) {\n return -1;\n }\n if (!a.size) {\n return 1;\n }\n if (b.size < a.size) {\n return -1;\n }\n else if (a.size == b.size) {\n return 0;\n }\n return 1;\n case 'accessedAsc':\n if (!b.accessed) {\n return -1;\n }\n if (!a.accessed) {\n return 1;\n }\n return b.accessed.localeCompare(a.accessed);\n case 'accessedDesc':\n if (!a.accessed) {\n return -1;\n }\n if (!b.accessed) {\n return 1;\n }\n return a.accessed.localeCompare(b.accessed);\n }\n return 0;\n });\n return sortedItems;\n}", "processSortItemsByTask() {\n // IF WE ARE CURRENTLY INCREASING BY TASK SWITCH TO DECREASING\n if (window.todo.model.isCurrentItemSortCriteria(ItemSortCriteria.SORT_BY_TASK_INCREASING)) {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_TASK_DECREASING);\n }\n // ALL OTHER CASES SORT BY INCREASING\n else {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_TASK_INCREASING);\n }\n }", "sort() {\n\t}", "sort() {\n\t}", "sortItems(items, propertyName) {\n // sort the custom items by their position in the list\n if (Array.isArray(items)) {\n items.sort((itemA, itemB) => {\n if (itemA && itemB && itemA.hasOwnProperty(propertyName) && itemB.hasOwnProperty(propertyName)) {\n return itemA[propertyName] - itemB[propertyName];\n }\n return 0;\n });\n }\n }", "_insertionSort() {\n let arr = this.curList.listItems;\n\n for (let i = 1; i < arr.length; i++) {\n let tempObj = arr[i];\n let tempValue = arr[i].sortingOrder;\n let j = i - 1;\n\n while (j >= 0 && tempValue < arr[j].sortingOrder) {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j + 1] = tempObj;\n }\n\n // Set sorted listItems arr to curList & alter curList in listCollection\n this.curList.listItems = arr;\n this.listCollection[this._findObjectAlgo()] = this.curList;\n\n this._setLocalStorage();\n }", "function sortAssets2() {\r\n\t//}\r\n\tchangeList();\r\n\t}", "function sortItems(arr) {\r\n return arr.sort();\r\n}", "function sortListsByDate() {\r\n\t\treturn getItems().sort(function(a,b){\r\n \t\t\treturn new Date(`${a.date} ${a.time}`) - new Date(`${b.date} ${b.time}`);\r\n\t\t});\r\n\t}", "processSortItemsByStatus() {\n // IF WE ARE CURRENTLY INCREASING BY STATUS SWITCH TO DECREASING\n if (window.todo.model.isCurrentItemSortCriteria(ItemSortCriteria.SORT_BY_STATUS_INCREASING)) {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_STATUS_DECREASING);\n }\n // ALL OTHER CASES SORT BY INCRASING\n else {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_STATUS_INCREASING);\n }\n }", "function sortData (data) {\n ...\n}", "onCollectionSort() {\n let me = this;\n\n if (me.configsApplied) {\n // console.log('onCollectionSort', me.collection.items);\n // me.fire('load', me.items);\n }\n }", "onCollectionSort() {\n let me = this;\n\n if (me.configsApplied) {\n // console.log('onCollectionSort', me.collection.items);\n // me.fire('load', me.items);\n }\n }", "sortItems(value) {\r\n let isAsc = true;\r\n if (value === this.state.sortOn) \r\n isAsc = !this.state.sortAsc;\r\n function compare(a,b) {\r\n const x = (a[value] ? a[value].toLowerCase() : null);\r\n const y = (b[value] ? b[value].toLowerCase() : null);\r\n if (isAsc) {\r\n if (x === null) {\r\n return 1;\r\n }\r\n else if (y === null) {\r\n return -1;\r\n }\r\n else if (x === y) {\r\n return 0;\r\n }\r\n else {\r\n return x < y ? -1 : 1;\r\n }\r\n }\r\n else {\r\n if (x === null) {\r\n return -1;\r\n }\r\n else if (y === null) {\r\n return 1;\r\n }\r\n else if (x === y) {\r\n return 0;\r\n }\r\n else {\r\n return x > y ? -1 : 1;\r\n }\r\n }\r\n }\r\n this.setState({\r\n items: this.state.items.sort(compare),\r\n sortOn: value,\r\n sortAsc: isAsc\r\n })\r\n }", "function sortByItem(array){\n array = array.sort(function(a, b) {\n if ((a.sortBy) > (b.sortBy)) {\n return -1;\n }\n if ((a.sortBy) < (b.sortBy)) {\n return 1;\n }\n // a must be equal to b\n return 0;\n });\n}", "sortByPriority(){\n this.list.sort(function(a,b){\n var aprio = a.priority; \n var bprio = b.priority; \n if (aprio === bprio){\n return 0; \n }\n else if (aprio === \"high\" && (bprio === \"medium\" || bprio === \"low\")\n || (aprio === \"medium\" && bprio === \"low\")){\n return -1;\n }\n return 1;\n\n });\n $(\"#theTasks\").empty();\n this.list.forEach(function(item){\n item.addToDom();\n });\n }", "function order() {\n\t\t\t\n\t\t\t// Will hold all of the orderItems representing items. \n\t\t\tthis.items = [];\n\t\t\t\n\t\t\t// \n\t\t\tthis.getCountItemLanguage = function(){\n\t\t\t\t\n\t\t\t\t\n\t\t\t};\n\t\t\t\n\t\t\t// Add an item to the count\n\t\t\t\n\t\t}", "function resort(){\n if(scope.sorting && scope.sorting.obj){\n var sortKey = scope.sorting.obj.field;\n sorter(sortKey,scope.sorting.direction);\n }\n }", "function resort(){\n if(scope.sorting && scope.sorting.obj){\n var sortKey = scope.sorting.obj.field;\n sorter(sortKey,scope.sorting.direction);\n }\n }", "get overrideSorting() {}", "function sortCutterItems() {\n for (var i = 0; i < gees.assets.cutterItems.length; i++) {\n // Grab name as is (eg BlueMarble).\n var item = gees.assets.cutterItems[i];\n item.sort_name = item.target_path.toLowerCase();\n }\n // Sort the list.\n gees.assets.cutterItems.sort(gees.tools.sort.asc('sort_name'));\n}", "_resort() {\n // Ensure there's something to do.\n if (!this.orderComponents) return;\n\n // Define the comparator for the sort.\n /**\n * Return a comparison result for the two given models, honouring each\n * comparitor in order of their inclusion in the component list. \n */\n const compareModels = (a, b) => {\n for (let i = 0; i < this.orderComponents.length; i++) {\n // Comprehend this order component.\n const {\n identity: {attribute, type}, value: direction\n } = this.orderComponents[i];\n\n // Use the type comparator to retrieve and integer result of\n // the comparison.\n let value = type.compareValues(a[attribute], b[attribute]);\n // Modify based on order.\n if (direction == 'desc') value *= -1;\n // If this comparator found a difference between the two,\n // return it. Note that if it didn't, the next gets a chance\n // to.\n if (value > 0 || value < 0) return value;\n }\n\n return 0;\n };\n\n // Perform the sort.\n this._value.sort(compareModels);\n }", "sortedItems(){\n return this.myList.slice(0).reverse();\n }", "processSortItemsByDueDate() {\n // IF WE ARE CURRENTLY INCREASING BY STATUS SWITCH TO DECREASING\n if (window.todo.model.isCurrentItemSortCriteria(ItemSortCriteria.SORT_BY_DUE_DATE_INCREASING)) {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_DUE_DATE_DECREASING);\n } \n // ALL OTHER CASES SORT BY INCREASING\n else {\n window.todo.model.sortTasks(ItemSortCriteria.SORT_BY_DUE_DATE_INCREASING);\n }\n }", "set sortingOrder(value) {}", "function translateAndOrderItems(){\n //check if list is array or not\n if(!angular.isArray(scope.items)){\n var item=scope.items;\n scope.items=[];\n scope.items.push(item);\n }\n //add file translate to list\n for (var int = 0; int < scope.items.length; int++) {\n \tif (attrs.prefix && scope.items[int].value){\n \t\t if (scope.items[int].value != \"N.A.\") {\n \t scope.items[int].translate=$translate.instant(attrs.prefix+'.'+scope.items[int].value);\n \t } else {\n \t scope.items[int].translate = \"Not Available\";\n \t }\n \t}\n }\n //sort items in list\n if(scope.sort != \"false\"){\n scope.items = $filter('orderBy')(scope.items,'translate');\n }\n \n /*this.findElementInElement_V3(lazyList,[lazyChoiceField])['Option']=fieldNode;*/\n }", "function sortArrayAscByItem(){\r\n return function(obj1, obj2){\r\n if (obj1.itemText > obj2.itemText) return 1;\r\n if (obj1.itemText < obj2.itemText) return -1;\r\n return 0;\r\n }\r\n}", "get sortingOrder() {}", "sortByTag(){\n this.list.sort(function(a,b){\n return a.tag.localeCompare(b.tag);\n });\n $(\"#theTasks\").empty();\n this.list.forEach(function(item){\n item.addToDom();\n });\n }", "comparator(item) {\n return item.get('position');\n }", "function sortData(data) {\n displayComic(data.comics);\n //displayManga(data.manga);\n //displayGNovel(data.graphicNovels);\n readyComicFunctions();\n}", "function sort(){\n var toSort = S('#sched-list').children;\n toSort = Array.prototype.slice.call(toSort, 0);\n\n toSort.sort(function(a, b) {\n var a_ord = +a.id.split('e')[1]; //id tags of the schedule items are timeINT the INT = the numeric time\n var b_ord = +b.id.split('e')[1]; //splitting at 'e' and getting the element at index 1 gives use the numeric time\n\n return (a_ord > b_ord) ? 1 : -1;\n });\n\n var parent = S('#sched-list');\n parent.innerHTML = \"\";\n\n for(var i = 0, l = toSort.length; i < l; i++) {\n parent.appendChild(toSort[i]);\n }\n }", "function sortByScore()\n {\n newsItems.sort(function(a,b) {return a.points<b.points});\n console.log(newsItems);\n\n addNewsListItems();\n\n }", "_sortItems(item) {\n const that = this;\n\n if (!that.grouped) {\n return;\n }\n\n const groups = [],\n groupChildren = [];\n let parent;\n\n if (item instanceof JQX.MenuItemsGroup) {\n parent = item.container.firstElementChild;\n }\n else if (item === that.$.mainContainer) {\n parent = item;\n }\n\n const children = Array.from(parent.children);\n\n children.sort(function (a, b) {\n return (a.label).localeCompare(b.label);\n });\n\n // sort items in DOM\n for (let i = children.length - 1; i >= 0; i--) {\n parent.insertBefore(children[i], parent.firstElementChild);\n }\n\n // retrieve groups and first elements in groups\n for (let i = 0; i < children.length; i++) {\n const currentChild = children[i],\n firstCharacter = currentChild.label.charAt(0),\n index = groups.indexOf(firstCharacter.toUpperCase());\n\n if (index === -1) {\n groups.push(firstCharacter.toUpperCase());\n groupChildren.push([currentChild]);\n }\n else {\n groupChildren[index].push(currentChild);\n }\n }\n\n that._appendGroupLabels(groups, groupChildren);\n }", "function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }", "function sortList(a,b) {\n if (a.total < b.total)\n return -1;\n if (a.total > b.total)\n return 1;\n return 0;\n }", "function sorter(sortItem)\n{\n\t//check to see if we are currently sorting by this item\n\t//if we are, append the '-' sign so that we can invert the sort in newSorter()\n\tsortItem = (currentSort == sortItem) ? \"-\"+sortItem : sortItem;\n\t\n\t//then make sure our currentSort equals the sort item for the next time we sort\n\tcurrentSort = sortItem;\n\tfilms.sort(newSorter(sortItem));\n\tcreateTable(films);\n}", "function inject_sort_indices(items) {\n items.forEach(item=>{\n let o = wkof.settings[script_id].sort.type.order;\n let order = {r: o.indexOf('rad'), k: o.indexOf('kan'), v: o.indexOf('voc')};\n item.type = order[item.UID[0]];\n item.overdue = calculate_overdue(item);\n });\n }", "_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 }", "function sortByRating(list) {\n // your code here..\n \n}", "function sortActive(item, index) {\n //console.log(\"im sort\" + item);\n putAtPosition(item, index);\n changeColorofBar(item + 1, true);\n key2++;\n}", "function sortingAscend() {\n setSearchData(null)\n let sorted = studentData.sort(function(a, b){\n return b.id - a.id;\n })\n\n setStudentData(sorted)\n console.log(sorted, typeof(sorted))\n }", "doSortSection() {\n this.sortedSections = [];\n\n for (let [sectionId, sectionObject] of Object.entries(this.formData.sections)) {\n this.sortedSections.push(sectionObject)\n }\n\n this.sortedSections.sort((a, b) => {\n return a.sortOrder - b.sortOrder;\n })\n }", "sort() {\n if (this.sortOrder === 'asc') {\n this.set('sortOrder', 'desc');\n\n } else if (this.sortOrder === '') {\n this.set('sortOrder', 'asc');\n\n } else {\n this.set('sortOrder', '');\n\n }\n }", "sortedListings() {\n return this.state.data.sort((a, b) => {\n return b.id - a.id\n })\n }", "function currentItems() {\n children = []\n for (let i = 1; i < $(\"ul.items\").children().length + 1; i++) {\n children.push($(\"ul.items li:nth-child(\" + i + \")\").find(\"h2\").text())\n }\n $(\"ul.items\").empty()\n JsontoHTMLSort(children)\n }", "function onSort() {\n\tvar items = {};\n\titems[ this.options.sortIdKey ] = this.sorTable.sortId;\n\titems[ this.options.sortAscKey ] = this.sorTable.sortAsc;\n\tchrome.storage.local.set( items );\n}", "Sort() {\n var i, ln;\n\n if (!tp.IsEmpty(this.SortInfoList) && this.SortInfoList.Count > 0) {\n tp.ListSort(this.fRows, this.SortInfoList.List);\n\n if (!this.BindingSuspended) {\n for (i = 0, ln = this.fListeners.length; i < ln; i++) {\n this.fListeners[i].DataSourceSorted();\n }\n\n this.OnSorted();\n }\n\n\n }\n\n }", "function _sort_items(X,Y) {\n var yt, xt, comp;\n yt = Y.getTitle().toLowerCase();\n xt = X.getTitle().toLowerCase();\n comp = (xt>yt)?1:((yt>xt)?-1:0);\n return (comp);\n}", "function sortOrder(a,b) {\n return b.size - a.size;\n }", "get sort() { return this._sort; }", "get sort() { return this._sort; }", "get sort() { return this._sort; }", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key = scope.headers[i].field;\n if(scope.sorting.field === key){\n scope.sorting.direction = scope.sorting.direction * -1;\n }else{\n scope.sorting.field = key;\n scope.sorting.direction = 1;\n }\n sorter(key,scope.sorting.direction);\n scope.sorting.obj = scope.headers[i];\n scope.buildTable();\n\n };\n }", "function sorte ( i ){\n return function(){\n if(scope.sorting.obj){\n //var index = _.findIndex(scope.viewer, scope.sorting.obj);\n }\n var key = scope.headers[i].field;\n if(scope.sorting.field === key){\n scope.sorting.direction = scope.sorting.direction * -1;\n }else{\n scope.sorting.field = key;\n scope.sorting.direction = 1;\n }\n sorter(key,scope.sorting.direction);\n scope.sorting.obj = scope.headers[i];\n scope.buildTable();\n\n };\n }", "shuffleItems() {\r\n this.items.sort(() => Math.random() - 0.5);\r\n this.items.forEach((item, index) => {\r\n item.div.style.order = index;\r\n });\r\n }", "function sortByTime()\n {\n newsItems.sort(function(a,b) {return a.created_at<b.created_at});\n console.log(newsItems);\n\n addNewsListItems(); \n }", "function sortItems(items) {\n return _.sortBy(items, [\n function(item) {\n return item.name.toLowerCase();\n },\n 'id'\n ]);\n}", "sortingFunction() {\n let records = this.get('content');\n if (isArray(records) && records.length > 1) {\n let sorting = this.get('sorting') || [];\n if (sorting.length === 0) {\n sorting = [{ propName: 'id', direction: 'asc' }];\n }\n\n for (let i = 0; i < sorting.length; i++) {\n let sort = sorting[i];\n if (i === 0) {\n records = this.sortRecords(records, sort, 0, records.length - 1);\n } else {\n let index = 0;\n for (let j = 1; j < records.length; j++) {\n for (let sortIndex = 0; sortIndex < i; sortIndex++) {\n if (records.objectAt(j).get(sorting[sortIndex].propName) !== records.objectAt(j - 1).get(sorting[sortIndex].propName)) {\n records = this.sortRecords(records, sort, index, j - 1);\n index = j;\n break;\n }\n }\n }\n\n records = this.sortRecords(records, sort, index, records.length - 1);\n }\n }\n\n this.set('content', records);\n }\n\n let componentName = this.get('componentName');\n this.get('_groupEditEventsService').geSortApplyTrigger(componentName, this.get('sorting'));\n }", "function toogleSort(){\r\n\t\tif(settings.sort_type=='desc'){\r\n\t\t\tsettings.sort_type='asc';\r\n\t\t }else{\r\n\t\t\t settings.sort_type='desc';\r\n\t\t }\r\n\t}", "function sortRenderOrder() {\n \n var sortBy = function(field, reverse, primer){\n var key = primer ? function(x) {return primer(x[field])} : function(x) {return x[field]};\n reverse = [-1, 1][+!!reverse];\n return function (a, b) {\n\treturn a = key(a), b = key(b), reverse * ((a > b) - (b > a));\n } \n }\n \n gadgetRenderOrder.sort(sortBy(\"tabPos\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"paneId\", true, parseInt));\n gadgetRenderOrder.sort(sortBy(\"parentColumnId\", true, parseInt));\n }", "function sortOrder(a, b) {\n\t return b.size - a.size;\n\t }", "static DEFAULT_SORT_BY_FIELD(){ return \"description\"}", "function prepareSortingAndOrders(container) {\n\n\t\t\tvar opt = getOptions(container);\n\n\t\t\t/************************************************\n\t\t\t\t-\tHANDLING OF SORTING ISSUES -\n\t\t\t*************************************************/\n\n\t\t\t// PREPARE THE DATE SRINGS AND MAKE A TIMESTAMP OF IT\n\t\t\tcontainer.find('.tp-esg-item').each(function() {\n\t\t\t\tvar dd = new Date(jQuery(this).data('date'));\n\t\t\t\tjQuery(this).data('date',dd.getTime()/1000);\n\t\t\t})\n\n\t\t\tjQuery(opt.filterGroupClass+'.esg-sortbutton-order,'+opt.filterGroupClass+' .esg-sortbutton-order').each(function() {\n\t\t\t\tvar eso = jQuery(this);\n\t\t\t\teso.removeClass(\"tp-desc\").addClass(\"tp-asc\");\n\t\t\t\teso.data('dir',\"asc\");\n\t\t\t})\n\t}", "cargarSort(){\n //Variables para agregar opciones\n var oDesc = \"-\";\n var asc = \" (ascending)\";\n var dsc = \" (descending)\";\n\n //Se carga el sort en base a las metricas y dimensiones seleccionadas\n var metDim = this.state.selectedMetricas.concat(this.state.selectedDimensions);\n var sortMD =[];\n if(metDim.length > 0){\n var val =0;\n for(var i = 0; i < metDim.length; i++){\n sortMD.push({value: val, label: oDesc.concat(metDim[i].label), name: metDim[i].name.concat(dsc), type: metDim[i].type});\n val++;\n sortMD.push({value: val, label:metDim[i].label, name: metDim[i].name.concat(asc), type: metDim[i].type});\n val++;\n }\n }\n this.setState({sort: [] });\n this.setState({sort: sortMD});\n }", "cargarSort(){\n //Variables para agregar opciones\n var oDesc = \"-\";\n var asc = \" (ascending)\";\n var dsc = \" (descending)\";\n\n //Se carga el sort en base a las metricas y dimensiones seleccionadas\n var metDim = this.state.selectedMetricas.concat(this.state.selectedDimensions);\n var sortMD =[];\n if(metDim.length > 0){\n var val =0;\n for(var i = 0; i < metDim.length; i++){\n sortMD.push({value: val, label: oDesc.concat(metDim[i].label), name: metDim[i].name.concat(dsc), type: metDim[i].type});\n val++;\n sortMD.push({value: val, label:metDim[i].label, name: metDim[i].name.concat(asc), type: metDim[i].type});\n val++;\n }\n }\n this.setState({sort: [] });\n this.setState({sort: sortMD});\n }", "function sortTheItem(e) {\r\n\te.preventDefault();\r\n\tif (e.target.classList.contains('dropdown-name')) {\r\n\t\tcontentBody.innerText = \"\"\r\n\t\tsortByName()\r\n\t\tshowPage(currentPage)\r\n\t} else if (e.target.classList.contains('dropdown-rate')) {\r\n\t\tcontentBody.innerText = \"\"\r\n\t\tsortByRate()\r\n\t\tshowPage(currentPage)\r\n\t} \r\n}", "_reorderItemsByIndex() {\n const that = this;\n let items = that.enableShadowDOM && that.shadowRoot ? that.shadowRoot.querySelectorAll('jqx-accordion-item') : that.getElementsByTagName('jqx-accordion-item'),\n itemsArray = Array.from(items),\n hasInitialIndexes = false,\n itemsIndexes = itemsArray.map(function (item) {\n if (item.index !== null) {\n hasInitialIndexes = true;\n }\n else {\n item.index = 0;\n }\n\n return item.index;\n });\n\n if (!hasInitialIndexes) {\n return;\n }\n\n const itemsCount = itemsArray.length;\n\n if (itemsCount < 2) {\n return;\n }\n\n let itemsIndexesSorted = itemsIndexes.slice();\n\n itemsIndexesSorted.sort(function (a, b) {\n return parseInt(a) - parseInt(b);\n });\n\n if (itemsIndexes.toString() === itemsIndexesSorted.toString()) {\n return;\n }\n\n for (let i = 0; i < itemsCount; i++) {\n let reorderedItem;\n\n for (let j = 0; j < itemsCount; j++) {\n if (items[j].index === itemsIndexesSorted[i]) {\n reorderedItem = items[j];\n }\n }\n\n that.$.container.insertBefore(reorderedItem, items[i]);\n }\n }", "function theQwertyGrid_sortInt(key) {\n\t\t\tif(_theQwertyGrid_sortInAsc) {\n\t\t\t\t_theQwertyGrid_sortInAsc = false;\n\t\t\t\t_theQwertyGrid_displayData.sort(function(a,b) {\n\t\t\t\t\treturn a[key] - b[key];\n\t\t\t\t});\n\t\t\t}\n\t\t\telse {\n\t\t\t\t_theQwertyGrid_sortInAsc = true;\n\t\t\t\t_theQwertyGrid_displayData.sort(function(b,a) {\n\t\t\t\t\treturn a[key] - b[key];\n\t\t\t\t});\n\t\t\t}\n\t\t\ttheQwertyGrid_reFillTable(_theQwertyGrid_displayData);\n\t\t\t\n\t\t}", "function sortGames(item1, item2) {\n if (item1.name < item2.name) {\n return -1;\n }\n\n if (item1.name > item2.name) {\n return 1;\n }\n\n return 0;\n}", "sortedTasks(state){\n //criar uma variavel para ordernar nossas tarefas sem alterar o estado original(state)\n let sorted = state.tasks\n return sorted.sort((a,b) => {\n //se o a for menor então ele retorna para corrigir a ordenação\n if(a.name.toLowerCase() < b.name.toLowerCase()) return -1\n //mesma inversa se for o inverso da primeira situação\n if(a.name.toLowerCase() > b.name.toLowerCase()) return 1\n\n return 0\n }) \n }", "sortByDueDate(){\n this.list.sort(function(a,b){\n return a.duedate - b.duedate;\n });\n $(\"#theTasks\").empty();\n this.list.forEach(function(item){\n item.addToDom();\n });\n }", "function SorteiaItem(){\n\t\tvar item;\n\t\tvar random = Random(_MaximoFogo);\n\t\tif(random < _MaisBomba){\n\t\t\titem = ItemMaisBomba();\n\t\t}else{\n\t\t\tif(random < _MaisFogo){\n\t\t\t\titem = ItemMaisFogo();\n\t\t\t}else{\n\t\t\t\tif(random < _MaisVelocidade){\n\t\t\t\t\titem = ItemMaisVelocidade();\n\t\t\t\t}else{\n\t\t\t\t\tif(random < _MaximoFogo){\n\t\t\t\t\t\titem = ItemMaximoFogo();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn item;\n\t}", "onHandleSort(event) {\n const { fieldName: sortedBy, sortDirection } = event.detail;\n const cloneData = [...this.data];\n\n cloneData.sort(this.sortBy(sortedBy, sortDirection === 'asc' ? 1 : -1));\n this.data = cloneData;\n this.sortDirection = sortDirection;\n this.sortedBy = sortedBy;\n }", "sort(type) {\n const { getSortBy, batmanListings, supermanListings} = this.props;\n getSortBy({ type, batmanListings, supermanListings });\n }", "function sort() {\n elementArray.sort(function (x, y) {\n return x.elem - y.elem;\n });\n render(elementArray);\n }", "function SortMediaList() {\n self.MediaColList.col_1.length = 0;\n self.MediaColList.col_2.length = 0;\n self.MediaColList.col_3.length = 0;\n if (!MediaService.myGalleryList) {\n self.noResult = true;\n } else {\n var total = MediaService.myGalleryList.length;\n if (total == 0) {self.noResult = true;} else {self.noResult = false;}\n var rest = total % 3;\n for (var i = 0; i < total; i++) {\n if ($rootScope.sinceDate > parseDateTime(MediaService.myGalleryList[i].userDate).unix && $rootScope.untilDate < parseDateTime(MediaService.myGalleryList[i].userDate).unix) {\n if ((i % 3) === 0) {\n MediaObjSet(MediaService.myGalleryList[i] , self.MediaColList.col_1);\n } else if ((i % 3) === 1) {\n MediaObjSet(MediaService.myGalleryList[i] , self.MediaColList.col_2);\n } else if ((i % 3) === 2) {\n MediaObjSet(MediaService.myGalleryList[i] , self.MediaColList.col_3);\n }\n }\n }\n }\n }", "function sortOrder(a, b) {\n return b.size - a.size;\n }", "function sortOrder(a, b) {\n return b.size - a.size;\n }", "function sortFieldList() {\n\tvar mylist = $('#editorFieldList');\n\tvar listitems = mylist.children('.formItem').get();\n\tlistitems.sort(function(a, b) {\n\t\tvar labelA = $(a).find('label').html().toLowerCase();\n\t\tvar labelB = $(b).find('label').html().toLowerCase();\n\t\treturn labelA.localeCompare(labelB);\n\t});\n\t$.each(listitems, function(idx, itm) {\n\t\tmylist.append(itm);\n\t});\n}", "orderUp(){\n let orderBy = document.querySelector(\".orderBy\").value\n if(orderBy === \"edad\"){ \n let itemsOrdenados = this.state.items.sort( function(a,b){\n return a.dob.age - b.dob.age\n })\n this.setState({items: itemsOrdenados})\n\n } else if( orderBy === \"nombre\"){\n \n let itemsOrdenados = this.state.items.sort(function ( a, b ) {\n if ( a.name.first.toLowerCase() < b.name.first.toLowerCase()){\n return -1;\n }\n if ( a.name.first.toLowerCase() > b.name.first.toLowerCase() ){\n return 1;\n }\n return 0;\n })\n this.setState({items: itemsOrdenados})\n\n }else if(orderBy === \"nacionalidad\"){\n let itemsOrdenados = this.state.items.sort(function ( a, b ) {\n if ( a.location.country.toLowerCase() < b.location.country.toLowerCase()){\n return -1;\n }\n if ( a.location.country.toLowerCase() > b.location.country.toLowerCase() ){\n return 1;\n }\n return 0;\n })\n this.setState({items: itemsOrdenados})\n }\n }", "function sortByPriceUp(array){\n renderItem(array.sort(function(a,b){\n return parseInt(a.price.replace(/\\D/g,\"\")) - parseInt(b.price.replace(/\\D/g,\"\"));\n }));\n}" ]
[ "0.80443954", "0.75165844", "0.7428703", "0.7377399", "0.7350056", "0.73243546", "0.72168475", "0.71424717", "0.71039855", "0.7026434", "0.7000534", "0.6972711", "0.6957353", "0.69409835", "0.69165134", "0.6905147", "0.6879739", "0.68567854", "0.6843812", "0.6803581", "0.68014765", "0.67760897", "0.67760897", "0.67644304", "0.673019", "0.66968364", "0.6686629", "0.6668283", "0.6658732", "0.6634865", "0.66229385", "0.66229385", "0.6608366", "0.65991575", "0.65934455", "0.6583492", "0.6546175", "0.6546175", "0.65449", "0.6530309", "0.6529415", "0.65226537", "0.6454336", "0.6446101", "0.643251", "0.64322567", "0.6430873", "0.6430832", "0.6427606", "0.64241946", "0.6417675", "0.64041305", "0.6397811", "0.6391335", "0.6391335", "0.63661826", "0.6364997", "0.63443255", "0.6294757", "0.62885416", "0.6277204", "0.6276414", "0.62714154", "0.6269664", "0.62578404", "0.6248416", "0.62467486", "0.6243801", "0.6243582", "0.6241741", "0.6241741", "0.6241741", "0.62229323", "0.62229323", "0.6215906", "0.62129134", "0.62102264", "0.6201526", "0.6198866", "0.6194706", "0.6189917", "0.61854744", "0.61847275", "0.61817926", "0.61817926", "0.6177555", "0.61741155", "0.61721087", "0.616724", "0.61650366", "0.61647946", "0.61635125", "0.61610657", "0.6159893", "0.6157387", "0.6157041", "0.61561334", "0.61561334", "0.61495906", "0.6149363", "0.6133233" ]
0.0
-1
Check if the validation functions were ok, if so go to the next page.
function handleClickEnter() { if(validEmail==true && validName==true) { //navigate into ChooseHelp screen navigation.navigate("ChooseHelp", { userName: nameText, userEmail: emailText, }); } else // in case the validation fail we pop up alert { Alert.alert("שגיאה","אנא הזן שם ואימייל תקניים",[{text:"אישור"}]) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function next(){\n\tvalidate();\n}", "function next(){\n\tvalidate();\n}", "function next(){\n validate();\n}", "function next(){\n validate();\n}", "function stepNext() {\n\t$(\"#signupBtn\").click(function(e) {\n\t\te.stopPropagation();\n\t\tvalidateFormOnClick();\n\t});\n\n\t$(\"#nextBtn1\").click(\n\t\t\tfunction(e) {\n\t\t\t\te.stopPropagation();\n\t\t\t\t/*\n\t\t\t\t * checks for social media accounts\n\t\t\t\t */\n\t\t\t\tif ($(\".soicalMediaAccounts:checked\").length != 0) {\n\t\t\t\t\t$(\"#soicalMediaAccountsValidation\").text(\"\");\n\t\t\t\t\t$(\".step\").hide(\"fast\");\n\t\t\t\t\t$(\"#hrsOnlineForm\").show(\"slow\");\n\t\t\t\t} else {\n\t\t\t\t\t$(\"#soicalMediaAccountsValidation\").text(\n\t\t\t\t\t\t\t\"must select atleast one\");\n\t\t\t\t}\n\t\t\t\t/*\n\t\t\t\t * remove validation message is user has checked atleast one\n\t\t\t\t * value\n\t\t\t\t */\n\t\t\t\t$(\".soicalMediaAccounts\").change(function() {\n\t\t\t\t\tif (this.checked) {\n\t\t\t\t\t\tif ($(\"#soicalMediaAccountsValidation\").text() != null)\n\t\t\t\t\t\t\t$(\"#soicalMediaAccountsValidation\").text(\"\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t});\n\n\t$(\"#nextBtn2\").click(function() {\n\t\t$(\".step\").hide(\"fast\");\n\t\t$(\"#onlineForForm\").show(\"slow\");\n\t});\n\n\t$(\"#nextBtn3\").click(function() {\n\t\t$(\".step\").hide(\"fast\");\n\t\t$(\"#isBusinessInternetBasedForm\").show(\"slow\");\n\t});\n\n\t$(\"#nextBtn4\").click(function() {\n\t\t$(\".step\").hide(\"fast\");\n\t\t$(\"#isInternetInfluencerForm\").show(\"slow\");\n\t});\n}", "function WizardValidacion(paso) {\r\n if (Page_ClientValidate('ValidacionPaso' + paso + '')) {\r\n if (paso < 3)\r\n $(\"#pagesWizard\").wijwizard(\"next\");\r\n }\r\n}", "validate() {\n // step 1\n if (this.currentStep === 1) {\n let categories = form.querySelectorAll(\"input[type='checkbox']:checked\");\n let counter = 0;\n for (let i = 0; i < categories.length; i++) {\n if (categories[i].checked) {\n counter++\n }\n }\n if (counter > 0) {\n return true;\n }\n else {\n alert(\"Wybierz co najmniej jedną opcję.\");\n return false;\n }\n // step 2\n } else if (this.currentStep === 2) {\n let bagQuantity = form.querySelector(\"input[type='number']\");\n if (bagQuantity.value <= 0) {\n alert(\"Musisz oddać conajmniej jeden worek.\");\n return false;\n }\n else {\n return true;\n }\n }\n // step 3\n else if (this.currentStep === 3) {\n let institutionName = form.querySelector(\"input[type='radio']:checked\");\n if (institutionName !== null) {\n return true;\n }\n else {\n alert(\"Wybierz organizację.\");\n return false;\n }\n }\n // step 4\n else if (this.currentStep === 4) {\n\n let divInput = document.querySelectorAll(\"div[data-step='4'] div[class='form-section form-section--columns'] input[type='text']\");\n let errorCounter = 0;\n let street = divInput[0].value;\n let errorStreet = document.getElementById(\"errorStreet\");\n if (street === \"\") {\n errorStreet.innerHtml = \"Podaj nazwę ulicy.\";\n errorCounter++;\n } else {\n errorStreet.innerHtml = \"\";\n }\n\n let city = divInput[1].value;\n let errorCity = document.getElementById(\"errorCity\");\n if (city === \"\") {\n errorCity.innerText = \"Podaj nazwę miasta.\";\n errorCounter++;\n } else {\n errorCity.innerText = \"\";\n }\n\n let zipCode = divInput[2].value;\n let errorZipCode = document.getElementById(\"errorZipCode\");\n if (zipCode === \"\") {\n errorZipCode.innerText = \"Podaj kod pocztowy.\";\n errorCounter++;\n } else {\n errorZipCode.innerText = \"\";\n }\n\n return errorCounter <= 0;\n }\n }", "function pageValidation() {\n\n if ($('#names').val() == \"\") {\n $(\"#errLabel\").html('&nbsp;&nbsp;&nbsp;&nbsp; Please Enter Full Name!');\n return false;\n }\n if ($('#email').val() == \"\") {\n $(\"#errLabel\").html('&nbsp;&nbsp;&nbsp;&nbsp; Please Enter email id !');\n return false;\n }\n if ($('#password').val() == \"\") {\n $(\"#errLabel\").html('&nbsp;&nbsp;&nbsp;&nbsp; Please enter password!');\n return false;\n }\n if ($('#repwd').val() == \"\") {\n $(\"#errLabel\").html('&nbsp;&nbsp;&nbsp;&nbsp; Please re-Enter password!');\n return false;\n }\n if ($('#password').val() != $('#repwd').val()) {\n $(\"#errLabel\").html('&nbsp;&nbsp;&nbsp;&nbsp; Passwords do not match.!');\n return false;\n }\n return true;\n}", "function nextButtonHandler() {\n switch (currentState) {\n case \"SelectAnomalyTypes\":\n saveAnomalyTypesForm();\n loadElementSelectionForm();\n break;\n case \"SelectElementTypes\":\n saveElementTypesForm();\n loadTerrainModificationSelectionForm();\n break;\n case \"SelectTerrainModificationTypes\":\n saveTerrainModificationTypesForm();\n loadNextElementSeedForm();\n break;\n case \"ElementSeedForm\":\n if ((0, _FormValidators.checkCustomInputs)()) {\n saveElementSeedForm();\n loadNextElementSeedForm();\n }\n break;\n case \"TerrainModificationForm\":\n if ((0, _FormValidators.checkCustomInputs)()) {\n saveTerrainModificationForm();\n loadNextTerrainModificationForm();\n }\n break;\n case \"AnomalyForm\":\n if ((0, _FormValidators.checkCustomInputs)()) {\n saveAnomalyForm();\n loadNextAnomalyForm();\n }\n break;\n case \"ReviewForm\":\n if (_FormValidators.checkBasicInputs) submitCustomEnvironment();\n }\n}", "function checkStep1() {\r\n\tif ($('#name').val() == \"\") {\r\n\t\t$(\"#name\").focus();\r\n\t\tmessage(\"Please enter your name.\");\r\n\t\treturn false;\r\n\t}\r\n\tif (!validateEmail($('#email').val())) {\r\n\t\t$(\"#email\").focus();\r\n\t\tmessage(\"Please enter a valid email.\");\r\n\t\treturn false;\r\n\t}\r\n\tif ($('#story').val() == \"\") {\r\n\t\t$(\"#story\").focus();\r\n\t\tmessage(\"Please enter your story.\");\r\n\t\treturn false;\r\n\t}\r\n\tmessage(\"\");\r\n\treturn true;\r\n}", "function handle_enter() {\n switch (page) {\n case 'register':\n validate_register();\n break;\n case 'update_user':\n validate_update_user();\n break;\n case 'create_game':\n validate_game_data();\n break;\n case 'reconfig_game':\n validate_game_data();\n break;\n case 'game':\n validate_game();\n break;\n case 'game_search':\n validate_game_search();\n break;\n case 'add_remove_moderator':\n validate_add_remove_moderator();\n break;\n case 'user_help':\n validate_send_report();\n break;\n case 'blacklist_whitelist':\n validate_blacklist_whitelist();\n break;\n default:\n break;\n }\n}", "function appValidation() {\n if ($(\"#registerForm\").length > 0)\n registerFormValid();\n if ($(\"#loginForm\").length > 0)\n loginFormValid();\n if ($(\"#checkForm\").length > 0)\n checkFormValid();\n if ($('#saleForm').length > 0)\n saleFormValid();\n }", "function validateStep(step)\n {\n var error = 1;\n var hasError = false;\n\t\t\n if (step == 1)\n {\n var testValue = checkStep1();\n if (testValue == false)\n {\n hasError = true;\n }\n }\n\n if (step == 2)\n {\n var testValue = checkStep2();\n if (testValue == false)\n {\n hasError = true;\n }\n }\n\n if (step == 3) {\n var testValue = checkStep3();\n if (testValue == false) {\n hasError = true;\n }\n }\n\n if (step == 4)\n {\n var step1 = checkStep1();\n var step2 = checkStep2();\n var step3 = checkStep3();\n\n if (step1 == true || step2 == true || step3 == true) {\n $(\"#ImgBtnSubmit\").attr('src', '../images/submit_false.png');\n //$('#redirectRelius').hide();\n $('#ProfileMessage').text('Please verify all tabs with a red X on them! When you have completed those steps there will be large green check mark on this page.');\n hasError = true;\n }\n else {\n $(\"#ImgBtnSubmit\").attr('src', '../images/submit_ok.png');\n $('#ProfileMessage').text('Click the Green check mark to submit application.');\n hasError = false;\n }\n \n //Setting this to -1 will keep the form from submitting until everything is correct.\n if(hasError == true){\n error = -1;\n }\n\t\t\n return error;\n }\n }", "function validateSteps(){\n var FormErrors = false;\n for(var i = 1; i < fieldsetCount; ++i){\n var error = validateStep(i);\n if(error == -1)\n FormErrors = true;\n }\n $('#surveyForm').data('errors',FormErrors);\n }", "function nextSection() {\r\n // If the user is currently on step 2, the personal information input will be validated\r\n if (current == 1)\r\n {\r\n next.addEventListener(\"click\", validateInfo, false);\r\n if (!validateInfo())\r\n return;\r\n }\r\n // Increment current step by 1 and call function to display the new step\r\n current++;\r\n show(current);\r\n}", "function validateSteps(){\n var FormErrors = false;\n for (var i = 1; i <= fieldsetCount; ++i)\n {\n var error = validateStep(i);\n if(error == -1)\n FormErrors = true;\n }\n $('#formElem').data('errors',FormErrors);\t\n }", "function checkRequired(checksum) {\n let allElements = document.getElementsByClassName(\"main\")[currentPage].querySelectorAll(\"input, select, textarea\"); \n let counter = 0;\n for (let i = 0; i < allElements.length; i++) {\n let currentItem = allElements[i];\n if (currentItem.tagName == \"TEXTAREA\" || currentItem.tagName == \"SELECT\") {\n if (currentItem.value != 0) {\n counter++;\n //console.log(currentItem.value);\n }\n }\n else if (currentItem.type = \"radio\") {\n if (currentItem.checked == true) {\n counter++;\n }\n }\n }\n let numberOfPages = document.getElementsByClassName(\"page\").length;\n if (counter == checksum) {\n if (currentPage < numberOfPages - 2) {\n nextPage();\n }\n else {\n submit();\n }\n\n }\n else {\n document.getElementsByClassName(\"main\")[currentPage].querySelectorAll(\"p.alert\")[0].style.display = \"block\";\n }\n}", "function validateNextStep() {\n var parent_fieldset = $(this).parents('fieldset');\n var next_step = true;\n\n parent_fieldset.find('#amount').each(function() {\n var regExpression = new RegExp('\\\\d{1,}').test($(this).val());\n if (!regExpression || $(this).val().length > 10000) {\n $(this).addClass('input-error');\n next_step = false;\n } else {\n $(this).removeClass('input-error');\n }\n });\n parent_fieldset.find('#Period').each(function() {\n var regExpression = new RegExp('\\\\d{1,}').test($(this).val());\n if (!regExpression || $(this).val().length > 12) {\n $(this).addClass('input-error');\n next_step = false;\n } else {\n $(this).removeClass('input-error');\n }\n });\n parent_fieldset.find('#Code').each(function() {\n var regExpression = new RegExp('\\\\d{10}').test($(this).val());\n var getDays = $(this).val().slice(0, 5);\n var startYearCount = moment([1899, 11, 31]);\n var getBirth = startYearCount.add(getDays, 'days');\n var ageNow = getBirth.fromNow();\n var ageNowNumber = ageNow.replace(/[^\\d,]/g, '');\n\n if (!regExpression || $(this).val().length > 10 || ageNowNumber < 21) {\n $(this).addClass('input-error'); \n next_step = false;\n } else {\n $(this).removeClass('input-error');\n }\n });\n parent_fieldset.find('#Surname').each(function() {\n var regExpression = new RegExp('\\\\D').test($(this).val());\n if (!regExpression) {\n $(this).addClass('input-error');\n next_step = false;\n } else {\n $(this).removeClass('input-error');\n }\n });\n parent_fieldset.find('#Name').each(function() {\n var regExpression = new RegExp('\\\\D').test($(this).val());\n if (!regExpression) {\n $(this).addClass('input-error');\n next_step = false;\n } else {\n $(this).removeClass('input-error');\n }\n });\n parent_fieldset.find('#City').each(function() {\n var regExpression = new RegExp('\\\\D').test($(this).val());\n if (!regExpression) {\n $(this).addClass('input-error');\n next_step = false;\n } else {\n $(this).removeClass('input-error');\n }\n });\n\n if (next_step) {\n if (animating) return false;\n animating = true;\n current_fs = $(this).parent();\n next_fs = $(this).parent().next();\n $('#progressbar li').eq($('fieldset').index(next_fs)).addClass('active');\n next_fs.show();\n //hide the current fieldset with style\n current_fs.animate(\n { opacity: 0 },\n {\n step: function(now, mx) {\n //as the opacity of current_fs reduces to 0 - stored in \"now\"\n //1. scale current_fs down to 80%\n scale = 1 - (1 - now) * 0.2;\n //2. bring next_fs from the right(50%)\n left = now * 50 + '%';\n //3. increase opacity of next_fs to 1 as it moves in\n opacity = 1 - now;\n current_fs.css({ transform: 'scale(' + scale + ')' });\n next_fs.css({ left: left, opacity: opacity });\n },\n duration: 800,\n complete: function() {\n current_fs.hide();\n animating = false;\n },\n //this comes from the custom easing plugin\n easing: 'easeInOutBack'\n }\n );\n }\n}", "function step1Validator() {\n // return a boolean\n }", "function checkStep1()\n {\n var validData = true;\n\n //alert('Call 1: ' + validData);\n validData = checkEmployerType(validData); //Validate teh employer type.\n //alert('Call 2: ' + validData);\n validData = checkPayrollName(validData); //Validate the Payroll Business Name.\n //alert('Call 3: ' + validData);\n validData = checkDistrictName(validData); //Validate the employer name.\n //alert('Call 4: ' + validData);\n validData = checkEmployerEIN(validData); //Validate the employer EIN number.\n //alert('Call 5: ' + validData);\n validData = checkDistrictAddress(validData); //Validate the employer address.\n //alert('Call 6: ' + validData);\n validData = checkDistrictCity(validData); //Validate the employer city.\n validData = checkDistrictZip(validData); //Validate the employer zip code.\n validData = checkDistrictState(validData); //Validate the employer state.\n validData = checkDistrictRenewalDescription(validData); //Validate the initial renewal date.\n validData = checkRenewalDate(validData); //Validate the initial rewewal date.\n validData = check2ndRenewalInfo(validData); //Validate the entire second renewal date.\n\n //alert('Step 1 End ' + validData);\n\n /*********************************************************************************************\n *********** Return whether the data is valid or not for STEP 1 *******************************\n *********************************************************************************************/\n if (validData == false)\n {\n $('#sp_step1').removeClass('error checked');\n $('#sp_step1').addClass('error');\n return true;\n }\n else {\n $('#sp_step1').removeClass('error checked');\n $('#sp_step1').addClass('checked');\n return false;\n }\n }", "function validatePage(){\n\tif(controller == 'shop/'){\n\t$.valid = true;\n\t\t$('div.addressSection').children('div').each(function(){\n\t\t\t$(this).trigger('validate');\n//\t\t\talert('$.valid is '+$.valid);\n\t\t\tif($.valid == false){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t})\n\t\treturn true;\n\t}\n}", "function goNext(state) {\n console.log('kyc-flow-router - goNext', state);\n var needsDocumentType = !(state.countryCode && state.documentType);\n var needsVerify = state.inPreview;\n var needsDocumentation = !(state.documentType && state.documents && state.documents.length === ((state.documentType === 'passport') ? 2 : 3));\n var needsPersonalInfo = !state.kycIsSubmitted;\n\n if (state.status) {\n // KYC Status Page\n console.log('KYC-FLOW - KYC Status');\n $state.go('tabs.buybitcoin-kyc-status');\n return;\n }\n\n //New Customer Page\n if (needsDocumentType) {\n console.log('KYC-FLOW - Verification');\n $state.go('tabs.buybitcoin-kyc-document-info');\n return;\n }\n\n if (needsVerify) {\n console.log('KYC-FLOW - Document Preview');\n $state.go('tabs.buybitcoin-kyc-document-verify', {count: state.documents.length});\n return;\n }\n\n //Document Photo Page\n if (needsDocumentation) {\n console.log('KYC-FLOW - Document Photo');\n $state.go('tabs.buybitcoin-kyc-document-capture', {count: state.documents.length});\n return;\n }\n\n // Personal Info Page\n if (needsPersonalInfo) {\n console.log('KYC-FLOW - Personal Info');\n $state.go('tabs.buybitcoin-kyc-personal-info');\n return;\n }\n\n // KYC Status Page\n console.log('KYC-FLOW - KYC Status');\n $state.go('tabs.buybitcoin-kyc-status');\n }", "function validateSteps(){\n\t\tvar FormErrors = false;\n\t\tfor(var i = 1; i < fieldsetCount; ++i){\n\t\t\tvar error = validateStep(i);\n\t\t\tif(error == -1)\n\t\t\t\tFormErrors = true;\n\t\t}\n\t\t$('#formElem').data('errors',FormErrors);\t\n\t}", "function goToNext(e) {\n e.preventDefault()\n // validate()\n // console.log(validate());\n if (validate()) {\n document.querySelector('.slide-container').style.display = 'none'\n document.querySelector('.slide-container-2').classList.add('show')\n } \n return\n \n\n}", "function validation() {\t\t\t\t\t\r\n\t\t\t\t\tvar frmvalidator = new Validator(\"app2Form\");\r\n\t\t\t\t\tfrmvalidator.EnableOnPageErrorDisplay();\r\n\t\t\t\t\tfrmvalidator.EnableMsgsTogether();\r\n\r\n\t\t\t\t\tif (document.getElementById('reasonForVisit').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitPatientReason\",\"req\",\"Please enter your reason For Visit\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitPatientReason_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (document.getElementById('visitYes').checked==false){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitNewpatient\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\tif (document.getElementById('visitNo').checked==false){\r\n\t\t\t\t\t\t\tfrmvalidator.addValidation(\"visitNewpatient\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitNewpatient_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('visitPrDocYes').checked==false){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"hasPhysian\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\tif (document.getElementById('visitPrDocNo').checked==false){\r\n\t\t\t\t\t\t\tfrmvalidator.addValidation(\"hasPhysian\",\"selone\",\"Please select an option 'Yes or No'\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_hasPhysian_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('emailAddress').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitEmail\",\"req\", \"Email is required\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitEmail\",\"email\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitEmail_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('patientFirstName').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientFirstName\",\"req\",\"Please enter your First Name\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientFirstName_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('patientLastName').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientLastName\",\"req\",\"Please enter your Last Name\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientLastName_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('pdob').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"pdob\",\"\",\"DOB is required\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_pdob_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('phoneNumber').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientPhoneNumber\",\"req\",\"Phone Number is required\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientPhoneNumber\",\"numeric\",\"numbers only\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientPhoneNumber\",\"minlen=10\",\"not enough numbers\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientPhoneNumber_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('visitGender').value==\"0\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"visitGender\",\"dontselect=0\",\"Please select an option 'Male or Female'\");\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_visitGender_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('patientZipCode').value==\"\"){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientZipCode\",\"numeric\",\"numbers only\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientZipCode\",\"minlen=5\",\"not a valid zipcode\");\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"patientZipCode\",\"req\",\"zip code is required\");\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_patientZipCode_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif (document.getElementById('visit_terms_911').checked==false){\r\n\t\t\t\t\t\tfrmvalidator.addValidation(\"agreeTerms\",\"selmin=2\",\"please check all boxes to continue\");\r\n\t\t\t\t\t\tif (document.getElementById('visit_custom_terms').checked==false){\r\n\t\t\t\t\t\t\tfrmvalidator.addValidation(\"agreeTerms\",\"selmin=2\",\"please check all boxes to continue\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}else {\r\n\t\t\t\t\t\tdocument.getElementById('app2Form_agreeTerms_errorloc').innerHTML=\"\"; // CLEARING THE error message\r\n\t\t\t\t\t}\r\n \r\n}", "function validate(action) {\n //getting current question number\n var currentQuestion, validAction, nextQuestion, nextMenu, prevMenu;\n currentQuestion = parseInt($(\"#test_head_container span\").text());\n validAction = (action === \"prev\" && currentQuestion > 1) || (action === \"next\" && currentQuestion < 3);\n prevMenu = (action === \"prev\" && currentQuestion === 1);\n nextMenu = (action === \"next\" && currentQuestion === 3);\n\n //if it's a valid action moving to the next or previous question, then several functions are called to changed the page content\n if (validAction) {\n //if next was clicked, nextQuestion increases. If prev was clicked, it decreases.\n nextQuestion = currentQuestion + 1;\n if (action === \"prev\") {\n nextQuestion = currentQuestion - 1;\n }\n //changing progress bar\n changeProgress(currentQuestion, nextQuestion, action);\n //slide to next or previous question\n slide(currentQuestion, nextQuestion, action);\n }\n \n //moving to next section\n if (nextMenu) {\n changeSection('2', 'next');\n }\n \n //moving to previous section\n if (prevMenu) {\n changeSection('2', 'prev');\n }\n}", "function validate_form(){\n if (is_form_valid(form)) {\n sendForm()\n }else {\n let $el = form.find(\".input:invalid\").first().parent()\n focus_step($el)\n }\n }", "function validate(inputs)\r\n{\r\n\t/*conditions*/\r\n\tif()\r\n\t\t/*any error will be return to problem page*/\r\n\t\treturn \"error\";\r\n\telse if()\r\n\t{\r\n\t\treturn \"error\";\r\n\t}\r\n\r\n}", "function OnComplete(result) \n{\n let status = String(result.status); \n\n // validation passed, redirect to the complete page\n if (StringEquals(status, \"true\"))\n {\n location.href = '/complete';\n } \n else\n {\n OnValidationFailed();\n }\n}", "function validate() {\r\n\r\n\r\n \r\n // set the progress of the background\r\n progress.style.width = ++position * 100 / questions.length + 'vw'\r\n\r\n // if there is a new question, hide current and load next\r\n if (questions[position]) hideCurrent(putQuestion)\r\n else hideCurrent(done)\r\n \r\n \r\n\r\n }", "function checkStep2()\n {\n var validData = true;\n\n //alert(\"Alert Data 1:\" + validData);\n validData = checkUserFname(validData);\n //alert(\"Alert Data 2:\" + validData);\n validData = checkUserLname(validData);\n //alert(\"Alert Data 3:\" + validData);\n validData = checkUserEmail(validData);\n //alert(\"Alert Data 4:\" + validData);\n validData = checkUserPhone(validData);\n //alert(\"Alert Data 5:\" + validData);\n validData = checkUsername(validData);\n //alert(\"Alert Data 6:\" + validData);\n validData = checkInitPassword(validData);\n //alert(\"Alert Data 7:\" + validData);\n validData = checkBothPasswords(validData);\n //alert(\"Alert Data 8:\" + validData);\n\n if (validData == false) {\n $('#sp_step2').removeClass('error checked');\n $('#sp_step2').addClass('error');\n return true;\n }\n else {\n $('#sp_step2').removeClass('error checked');\n $('#sp_step2').addClass('checked');\n return false;\n }\n }", "function step2Validator() {\r\n // return a boolean\r\n alert(\"Step 2 completed!\");\r\n }", "function validationsOk() {\n\n // Validate if in the HTML document exist a form\n if (formExistence.length === 0) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"Form tag doesn't exist in the html document\"\n return;\n }\n\n // Validate the quantity of labels tags are in the document\n if (labelsQuantity.length !== 4) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"There aren't the enoght quantity of label tags in the document\"\n return;\n }\n\n // Validate the quantity of buttons are in the document\n if (buttonsQuantity.length !== 2) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"There aren't the enoght quantity of button tags in the document\"\n return;\n }\n\n // Validate the quantity of inputs tags are in the document\n if (inputsQuantity.length !== 4) {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"red\"\n infoDiv.innerText = \"There aren't the enoght quantity of inputs tags in the document\"\n return;\n }\n\n // Validate if the email input contains text \n if (emailInput.value === \"\" || emailInput.value === null || !isEmail(emailInput.value)) {\n return;\n }\n if (nameInput.value === \"\" || nameInput.value === null) {\n return;\n }\n // Validate if the password input contains text\n if (passwordInput.value === \"\" || passwordInput.value === null) {\n return;\n }\n // Validate if the confirm-password input contains text\n if (confirmPasswordInput.value === \"\" || confirmPasswordInput.value === null) {\n return;\n }\n // Validate if the confirm-password match with the password\n if (confirmPasswordInput.value !== passwordInput.value) {\n return;\n }\n // all validations passed\n else {\n infoDiv.style.display = \"block\"\n infoDiv.style.color = \"green\"\n infoDiv.innerText = `Registered Succesfully. Your account data is: ${emailInput.value} ${nameInput.value} ${passwordInput.value.type = \"******\"} ${confirmPasswordInput.value.type = \"******\"}`\n return;\n }\n}", "function validateStep(step){\n\tif(step == fieldsetCount) \n\t\treturn;\n\t\n\tvar error = 1;\n\tvar hasError = false;\n\t$('#formElem').children(':nth-child('+ parseInt(step) +')').find(':input:not(button)').each(function(){\n\t\tvar $this \t\t= $(this);\n\t\tvar valueLength = jQuery.trim($this.val()).length;\n\t\t\n\t\tif($this.attr('id') != '_file' && valueLength == '' && step != 5){\n\t\t\thasError = true;\n\t\t\t$this.css('background-color','#FFEDEF');\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$this.css('background-color','#FFFFFF');\t\t\t\t\t\n\t\t}\n\t\t\n\t\t//if ($this)\n\t\t\n\t\tif (step == 5 && ($this.attr('id') == 'select_reviewer' || $this.attr('id') == 'select_approver'))\n\t\t\tif ($this.val() == 0) {\n\t\t\t\thasError = true;\n\t\t\t\t$this.css('background-color','#FFEDEF');\n\t\t\t} else\n\t\t\t\t$this.css('background-color','#FFFFFF');\n\t});\n\tvar $link = $('#navigation li:nth-child(' + parseInt(step) + ') a');\n\t$link.parent().find('.error,.checked').remove();\n\n\tvar valclass = 'checked';\n\tif(hasError){\n\t\terror = -1;\n\t\tvalclass = 'error';\n\t}\n\t$('<span class=\"'+valclass+'\"></span>').insertAfter($link);\n\n\treturn error;\n}", "function validateStep(step){\n if(step == fieldsetCount) return;\n\n var error = 1;\n $form = $(\"#surveyForm\");\n $hasError = false;\n $form.children(':nth-child('+ parseInt(step) +')').find(\".required\").each(function(){\n $inputContainer = $(this);\n $hasButtonList = false;\n $isChecked = false;\n $inputContainer.find(\":input:not(button)\").each(function(){\n var $this = $(this);\n\n if($this.attr(\"type\") == \"radio\" || $this.attr(\"type\") == \"checkbox\"){\n $hasButtonList = true;\n if($this.is(\":checked\")){\n $isChecked = true;\n }\n }else{\n var valueLength = jQuery.trim($this.val()).length;\n if(valueLength == 0){\n $hasError = true;\n if( $this.parent().find(\".tmp-check-required\").length == 0){\n $this.parent().append(\"<span class=\\'help-inline tmp-check-required\\'>Required</span>\");\n }\n $this.closest('.required').addClass(\"error\");\n }else{\n $this.parent().find(\".tmp-check-required\").remove();\n $this.closest('.required').removeClass(\"error\");\n }\n }\n });\n\n if($isChecked == false && $hasButtonList){\n $hasError = true;\n if($inputContainer.find(\".tmp-check-required\").length == 0){\n $inputContainer.find('.controls').append(\"<span class=\\'help-inline tmp-check-required\\'>Required</span>\");\n }\n $inputContainer.addClass(\"error\");\n }else if($hasButtonList && $isChecked){\n $inputContainer.find(\".tmp-check-required\").remove();\n $inputContainer.removeClass(\"error\");\n }\n });\n\n var $link = $('#navigation li:nth-child(' + parseInt(step) + ') a');\n $link.parent().find('.error,.checked').remove();\n\n var valclass = 'checked';\n if($hasError){\n //$(\"#errorModal\").modal(\"show\");\n error = -1;\n valclass = 'error';\n }\n\n $('<span class=\"'+valclass+'\"></span>').insertAfter($link);\n\n return error;\n }", "function validateSteps(){\n\tvar FormErrors = false;\n\tfor(var i = 1; i < fieldsetCount; ++i){\n\t\tvar error = validateStep(i);\n\t\tif(error == -1)\n\t\t\tFormErrors = true;\n\t}\n\t$('#formElem').data('errors',FormErrors);\n}", "function checkHomeDataFilled() {\n\t\t\tif (vm.flags.booknowSectionfieldsValid != true) {\n\t\t\t\t//$state.go('home');\n\t\t\t\twindow.location = \"/web/CustPortal/\";\n\t\t\t}\n\t\t}", "function formValidate() \n{\n // clear all errors, even if it's the first run\n clearErrors();\n var countErrors=0;\n // Is their first name using english characters and/or punctuation\n if (!nameCheck()) countErrors++;\n // Is their mobile number a valid Australian number\n if (!mobileCheck()) countErrors++;\n // Is credit card number between 14-19 digits\n if (!cardNoCheck()) countErrors++;\n // Is their credit card not yet expired\n if (!expiryCheck()) countErrors++;\n // Have they ordered any tickets\n if (!purchaseCheck()) countErrors++;\n // Block or allow submission depending on number of errors\n console.log(countErrors);\n return (countErrors==0);\n}", "function formValidator() {\n if ( ($('#payment').val() === \"credit card\" ) ) {\n\t\t\n paymentCheck();\n\t\tzipCodeCheck();\n\t\tcvvCheck();\n\n if ( nameFieldCheck() && emailFieldCheck() && validateActivity() && paymentCheck() && zipCodeCheck() && cvvCheck() ) {\n return true;\n } else { \n return false;\n }\n } else { \n if ( nameFieldCheck() && emailFieldCheck() && validateActivity() ) { \n return true;\n } else { \n return false;\n }\n }\n}", "function formValidation() {\n //* If validation of email fails, add the warning class to email input and set the display of warning message to inline.\n if (!validation.isEmailValid(email.value)) {\n email.classList.add(\"warning\");\n email.nextElementSibling.style.display = \"inline\";\n }\n //* If validation of name fails, add the warning class to name input and set the display of warning message to inline.\n if (!validation.isNameValid(name.value)) {\n name.classList.add(\"warning\");\n name.nextElementSibling.style.display = \"inline\";\n }\n /*\n * If validation of message fails, add the warning class to message text area and set the display of warning\n * message to inline\n */\n if (!validation.isMessageValid(message.value)) {\n message.classList.add(\"warning\");\n message.nextElementSibling.style.display = \"inline\";\n }\n /*\n *If validation of title fails, add the warning class to title input and set the display of warning\n *message to inline\n */\n\n if (!validation.isTitleValid(title.value)) {\n title.classList.add(\"warning\");\n title.nextElementSibling.style.display = \"inline\";\n }\n if (\n validation.isEmailValid(email.value) &&\n validation.isNameValid(name.value) &&\n validation.isTitleValid(title.valid) &&\n validation.isMessageValid(message.value)\n ) {\n return true;\n } else return false;\n}", "function checkInput()\r\n{\r\n\t//var isCorrect=false;\r\n\tvar errors = new Array();\r\n\tvar href=location.pathname; //get website address to determine we are in designer or company\r\n\t\r\n\tif(href.search(\"designer\")!=-1)\r\n\t{\r\n\t\t//designer page\r\n\t\terrors = CheckforNullandSpace(\"#form_username\",errors,\"#label_username\",\"Please enter Username\");\r\n errors = CheckforNullandSpace(\"#form_password\",errors,\"#label_password\",\"Please enter Password\");\r\n errors = CheckforNullandSpace(\"#form_confirm\" ,errors,\"#label_confirm\" ,\"Please enter Confirm Password\");\r\n\t\r\n\t\tif($(\"#form_password\").val()!=$(\"#form_confirm\").val())\r\n\t\t{\r\n\t\t\t//loadPopup(\"error.html\",\"Password and Confirm Password must be the same\");\r\n\t\t\terrors.push(\"Password and Confirm Password must be the same\");\r\n\t\t\t$(\"#label_password\").attr(\"style\",errorStyle);\r\n\t\t\t$(\"#label_confirm\").attr(\"style\",errorStyle);\r\n\t\t}\r\n\t\terrors = CheckforNull(\"#form_ans_q1\",errors,\"#label_ans_q1\",\"Please enter answer for Security Question 1\");\r\n\t\terrors = CheckforNull(\"#form_ans_q2\",errors,\"#label_ans_q2\",\"Please enter answer for Security Question 2\");\r\n\t\terrors = CheckforNull(\"#form_first_name\",errors,\"#label_firstname\",\"Please enter First Name\");\r\n\t\terrors = CheckforNull(\"#form_last_name\" ,errors,\"#label_lastname\" ,\"Please enter Last Name\");\r\n\t\terrors = CheckforNull(\"#form_address_1\",errors,\"#label_address_1\",\"Please enter Street Address 1\");\r\n\t\terrors = CheckforNull(\"#form_city\",errors,\"#label_city\",\"Please enter City\");\r\n\t\terrors = CheckforNull(\"#form_state\",errors,\"#label_state\",\"Please enter State\");\r\n\t\terrors = CheckforNullandNumber(\"#form_zipcode\",errors,\"#label_zipcode\",\"Please enter Zip Code\")\r\n\t\terrors = CheckforNull(\"#form_country\",errors,\"#label_country\",\"Please enter Country\");\r\n\t\terrors = CheckforNullandPhoneNumber(\"#form_cell_phone\",errors,\"#label_cell_phone\",\"Cell Phone Number\");\r\n\t\terrors = CheckforNullinSelect(\"#form_languages\",errors,\"#label_languages\",\"Please select at least 1 language\");\r\n\t\terrors = CheckforNull(\"#form_company_name\",errors,\"#label_company_name\",\"Please enter Company Name\");\r\n\t\terrors = CheckforNullandPhoneNumber(\"#form_brand_work_phone\",errors,\"#label_brand_work_phone\",\"Brand Work Phone Number\");\r\n\t\t//errors = CheckforNullandPhoneNumber(\"#form_fax\",errors,\"#label_fax\",\"Fax Number\");\r\n\t\terrors = CheckforNullinSelect(\"#form_skills\",errors,\"#label_skills\",\"Please select at least 1 skill\");\r\n\t\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\terrors = CheckforNullandSpace(\"#form_username\",errors,\"#label_username\",\"Please enter Username\");\r\n errors = CheckforNullandSpace(\"#form_password\",errors,\"#label_password\",\"Please enter Password\");\r\n errors = CheckforNullandSpace(\"#form_confirm\" ,errors,\"#label_confirm\" ,\"Please enter Confirm Password\");\r\n \r\n if($(\"#form_password\").val()!=$(\"#form_confirm\").val())\r\n\t\t{\r\n\t\t\t//loadPopup(\"error.html\",\"Password and Confirm Password must be the same\");\r\n\t\t\terrors.push(\"Password and Confirm Password must be the same\");\r\n\t\t\t$(\"#label_password\").attr(\"style\",errorStyle);\r\n\t\t\t$(\"#label_confirm\").attr(\"style\",errorStyle);\r\n\t\t}\r\n \r\n\t\terrors = CheckforNull(\"#form_ans_q1\",errors,\"#label_ans_q1\",\"Please enter answer for Security Question 1\");\r\n\t\terrors = CheckforNull(\"#form_ans_q2\",errors,\"#label_ans_q2\",\"Please enter answer for Security Question 2\");\r\n\t\terrors = CheckforNull(\"#form_first_name\",errors,\"#label_firstname\",\"Please enter First Name\");\r\n\t\terrors = CheckforNull(\"#form_last_name\" ,errors,\"#label_lastname\" ,\"Please enter Last Name\");\r\n\t\terrors = CheckforNullinSelect(\"#form_languages\",errors,\"#label_languages\",\"Please select at least 1 language\");\r\n\t\terrors = CheckforNullandPhoneNumber(\"#form_cell_phone\",errors,\"#label_cell_phone\",\"Cell Phone Number\");\r\n\t\terrors = CheckforNull(\"#form_company_name\",errors,\"#label_company_name\",\"Please enter Company Name\");\r\n\t\terrors = CheckforNull(\"#form_address_1\",errors,\"#label_address_1\",\"Please enter Street Address 1\");\r\n\t\terrors = CheckforNull(\"#form_city\",errors,\"#label_city\",\"Please enter City\");\r\n\t\terrors = CheckforNull(\"#form_state\",errors,\"#label_state\",\"Please enter State\");\r\n\t\terrors = CheckforNullandNumber(\"#form_zip\",errors,\"#label_zipcode\",\"Please enter Zip Code\")\r\n\t\terrors = CheckforNull(\"#form_country\",errors,\"#label_country\",\"Please enter Country\");\r\n\t\terrors = CheckforNullandPhoneNumber(\"#form_phone\",errors,\"#label_phone\",\"Compnay Phone Number\");\r\n\t\t//errors = CheckforNullandPhoneNumber(\"#form_fax\",errors,\"#label_fax\",\"Company Fax Number\");\r\n\t\terrors = CheckforNullandSpace(\"#form_website\",errors,\"#label_website\",\"Please enter comapny Website\");\r\n\t\r\n\t}\r\n\treturn errors;\r\n}", "onNext() {\n\t\tconst validationRes = this.validate();\n\n\t\tif (validationRes === undefined) {\n\t\t\tthis.props.onNext();\n\t\t} else {\n\t\t\tthis.props.ui.showErrorAlert(\n\t\t\t\tthis.t('errors.invalidFieldsAlert.title'),\n\t\t\t\tthis.t('errors.invalidFieldsAlert.message')\n\t\t\t);\n\t\t}\n\t}", "function validateForm() {\n validateFirstName();\n validateLastName();\n validateStreet();\n validateCity();\n validateZipCode();\n}", "function validateStep1(form,stepLogin){\n if(stepLogin == 'email'){\n let email = form['email'];\n if(email.value === ''){\n email.classList.add('frm__error__border');\n email.nextElementSibling.nextElementSibling.classList.add('frm__error--block');\n email.focus();\n return false;\n }\n }else if(stepLogin == 'account'){\n let fields = [\"first_name_account\", \"password\", \"password_confirm\"];\n fields.forEach((element) => {\n if(form[element].value === ''){\n document.querySelector('.' + element).previousElementSibling.previousElementSibling.classList.add('frm__error__border');\n document.querySelector('.' + element).classList.add('frm__error--block');\n return false;\n }\n });\n let fn = form['first_name_account']; \n if(fn.value === ''){\n fn.classList.add('frm__error__border');\n fn.nextElementSibling.nextElementSibling.classList.add('frm__error--block');\n fn.focus();\n return false;\n }\n let ps = form['password'];\n let lower = /[a-z]/g, upper = /[A-Z]/g, digits = /[0-9]/g, special = /[!@#$%^&*]/g;\n //|| (!lower.test(ps.value)) || (!digits.test(ps.value)) || (!upper.test(ps.value)) || (!special.test(ps.value))\n if(ps.value === ''){\n ps.classList.add('frm__error__border');\n ps.nextElementSibling.nextElementSibling.classList.add('frm__error--block');\n ps.focus();\n return false;\n }else if(ps.value.length < 8){\n document.querySelector('.frm__error--password').classList.add('frm__error--block');\n document.querySelector('.frm__error--password').innerText = 'The password needs at least 8 characters. Create a new password and try again.'\n ps.focus();\n return false;\n }else{\n document.querySelector('.frm__error--password').innerText = '';\n }\n let pc = form['password_confirm'];\n if(pc.value === ''){\n pc.classList.add('frm__error__border');\n pc.nextElementSibling.nextElementSibling.classList.add('frm__error--block');\n pc.focus();\n return false;\n }\n if(pc.value !== ps.value){\n pc.classList.add('frm__error__border');\n pc.nextElementSibling.nextElementSibling.classList.add('frm__error--block');\n pc.nextElementSibling.nextElementSibling.innerText = 'Please enter the same value again.'\n pc.focus();\n return false;\n }\n let chkTerms = form['terms_conditions'];\n if(!chkTerms.checked){\n chkTerms.parentElement.nextElementSibling.classList.add('frm__error--block');\n chkTerms.parentElement.nextElementSibling.innerText = 'Accept the terms';\n chkTerms.focus();\n return false;\n }\n if((!lower.test(ps.value)) || (!digits.test(ps.value)) || (!upper.test(ps.value)) || (!special.test(ps.value))){\n document.querySelector('.frm__error--password').innerText = '';\n return false;\n }\n\n }else if(stepLogin == 'password'){\n let ps = form['password'];\n if(ps.value === ''){\n ps.classList.add('frm__error__border');\n ps.nextElementSibling.nextElementSibling.classList.add('frm__error--block');\n ps.focus();\n return false;\n }else if(ps.value !== 'Demo@123'){\n ps.classList.add('frm__error__border');\n ps.nextElementSibling.nextElementSibling.innerText = 'Invalid login or password.'\n ps.nextElementSibling.nextElementSibling.classList.add('frm__error--block');\n ps.focus();\n return false;\n }\n }\n return true;\n}", "function Validation()\n{\n Validation1();\n Validation2();\n Validation3();\n Validation4();\n}", "function setupPage(validate){\n\tjq('#kualiForm').dirty_form({changedClass: 'dirty'});\n\n validateClient = validate;\n\t//Make sure form doesn't have any unsaved data when user clicks on any other portal links, closes browser or presses fwd/back browser button\n\tjq(window).bind('beforeunload', function(evt){\n var validateDirty = jq(\"[name='validateDirty']\").val();\n\t\tif (validateDirty == \"true\")\n\t\t{\n\t\t\tvar dirty = jq(\".uif-field\").find(\"input.dirty\");\n\t\t\t//methodToCall check is needed to skip from normal way of unloading (cancel,save,close)\n\t\t\tvar methodToCall = jq(\"[name='methodToCall']\").val();\n\t\t\tif (dirty.length > 0 && methodToCall == null)\n\t\t\t{\n\t\t\t\treturn \"Form has unsaved data. Do you want to leave anyway?\";\n\t\t\t}\n\t\t}\n\t});\n\n\tjq('#kualiForm').validate(\n\t{\n\t\tonsubmit: false,\n\t\tignore: \".ignoreValid\",\n\t\tonclick: function(element) {\n if(validateClient){\n if(element.type != \"select-one\") {\n var valid = jq(element).valid();\n dependsOnCheck(element, new Array());\n }\n }\n\t\t},\n\t\tonfocusout: function(element) {\n if(validateClient){\n var valid = jq(element).valid();\n dependsOnCheck(element, new Array());\n if((element.type == \"select-one\" || element.type == \"select-multiple\") && jq(element).hasClass(\"valid\")){\n applyErrorColors(getAttributeId(element.id, element.type) + \"_errors_div\", 0, 0, 0, true);\n showFieldIcon(getAttributeId(element.id, element.type) + \"_errors_div\", 0);\n }\n }\n\t\t},\n\t\twrapper: \"li\",\n\t\thighlight: function(element, errorClass, validClass) {\n\t\t\tjq(element).addClass(errorClass).removeClass(validClass);\n jq(element).attr(\"aria-invalid\", \"true\");\n\t\t\tapplyErrorColors(getAttributeId(element.id, element.type) + \"_errors_div\", 1, 0, 0, true);\n\t\t\tshowFieldIcon(getAttributeId(element.id, element.type) + \"_errors_div\", 1);\n\t\t},\n\t\tunhighlight: function(element, errorClass, validClass) {\n\t\t\tjq(element).removeClass(errorClass).addClass(validClass);\n jq(element).attr(\"aria-invalid\", \"false\");\n\t\t\tapplyErrorColors(getAttributeId(element.id, element.type) + \"_errors_div\", 0, 0, 0, true);\n\t\t\tshowFieldIcon(getAttributeId(element.id, element.type) + \"_errors_div\", 0);\n\t\t},\n\t\terrorPlacement: function(error, element) {\n\t\t\tvar id = getAttributeId(element.attr('id'), element[0].type);\n\t\t\t//check to see if the option to use labels is on\n\t\t\tif (!jq(\"#\" + id + \"_errors_div\").hasClass(\"noLabels\")) {\n\t\t\t\tvar label = getLabel(id);\n\t\t\t\tlabel = jq.trim(label);\n\t\t\t\tif (label) {\n\t\t\t\t\tif (label.charAt(label.length - 1) == \":\") {\n\t\t\t\t\t\tlabel = label.slice(0, -1);\n\t\t\t\t\t}\n\t\t\t\t\terror.find(\"label\").before(label + \" - \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tjq(\"#\" + id + \"_errors_div\").show();\n\t\t\tjq(\"#\" + id + \"_errors_errorMessages\").show();\n\t\t\tvar errorList = jq(\"#\" + id + \"_errors_errorMessages ul\");\n\t\t\terror.appendTo(errorList);\n\t\t}\n\t});\n\n jq(\".required\").each(function(){\n jq(this).attr(\"aria-required\", \"true\");\n });\n\n\tjq(document).trigger('validationSetup');\n\tpageValidatorReady = true;\n\n\tjq.watermark.showAll();\n}", "function checkRequired() {\n let canAdvance = true;\n let curPage = document.getElementById('calendar-wizard').currentPage;\n if (curPage) {\n let eList = curPage.getElementsByAttribute('required', 'true');\n for (let i = 0; i < eList.length && canAdvance; ++i) {\n canAdvance = (eList[i].value != \"\");\n }\n\n let notificationbox = document.getElementById(\"location-notifications\");\n if (canAdvance && document.getElementById(\"calendar-uri\").value &&\n curPage.pageid == \"locationPage\") {\n let [reason,] = parseUri(document.getElementById(\"calendar-uri\").value);\n canAdvance = (reason == errorConstants.SUCCESS);\n setNotification(reason);\n } else {\n notificationbox.removeAllNotifications();\n }\n document.getElementById('calendar-wizard').canAdvance = canAdvance;\n }\n}", "function initDiscoveryPage() {\r\n manageState(actions.businessStructureStep);\r\n $(\"#previous\").click(function () {\r\n $(window).scrollTop($('#heading').offset().top);\r\n $(\"#previous\").blur();\r\n manageState(previousAction);\r\n });\r\n $(\"#next\").click(function () {\r\n if (isTrust) {\r\n \tif (currentAction == actions.businessStructureStep || currentAction == actions.helpMeDecideResultStep) {\r\n \twindow.location.href = \"trust.html\";\r\n }\r\n }\r\n if (currentAction == actions.finishedStep) {\r\n \t// finished selecting, start applying...\r\n \tvar queryStr = \"?type=\";\r\n \tvar first = true;\r\n \t$(\"input[type=checkbox]:checked\").each(function(i, item) {\r\n \t\tfirst?first=false:queryStr+=',';\r\n \t\tqueryStr += item.id;\r\n \t});\r\n \tlocation.href = \"../register.html\" + queryStr;\r\n \treturn;\r\n }\r\n $(window).scrollTop($('#heading').offset().top);\r\n $(\"#next\").blur();\r\n if (!ifAnythingSelected(\"questions\") && previousAction != actions.helpMeDecideStep\r\n \t && previousAction != actions.helpMeDecideSelectStep && previousAction != actions.employeeStep\r\n \t && previousAction != actions.activityGSTStep) { // ignore step 4\r\n $(\"#validation\").show();\r\n $(window).scrollTop($('#validation').offset().top);\r\n $(\".scroll\").click(function (event) {\r\n event.preventDefault();\r\n var full_url = this.href;\r\n var parts = full_url.split(\"#\");\r\n var trgt = parts[1];\r\n var target_offset = $(\"#\" + trgt).offset();\r\n var target_top = target_offset.top;\r\n jQuery('html, body').animate({\r\n scrollTop: target_top\r\n }, 1200);\r\n });\r\n return;\r\n }\r\n manageState(nextAction);\r\n });\r\n}", "function formNavigation() {\n //find current active element\n var item = document.querySelector('form#websiteForm li.active');\n\n // Determine which question we are on be checking the child inputs\n\n if (item.querySelector('#fullName') !== null) {\n if(validateName()){\n answers.questionOne = item.querySelector('#fullName').value;\n item.classList.remove('active');\n updateSideNavigation();\n // Check if another list element (question) exists\n if (item.nextElementSibling){\n item.nextElementSibling.classList.add('active');\n pageNumber(2);\n }else{\n // When we have no more questions we show the review page.\n var formReview = document.querySelector('#review');\n reviewValues();\n formReview.style.top = 0;\n }\n }else{\n item.querySelector('#fullName').classList.add('required');\n }\n }\n\n if (item.querySelector('#email') !== null) {\n if(validateEmail()){\n answers.questionTwo = item.querySelector('#email').value;\n item.classList.remove('active');\n updateSideNavigation();\n // Check if another list element (question) exists\n if (item.nextElementSibling){\n item.nextElementSibling.classList.add('active');\n pageNumber(3);\n }else{\n // When we have no more questions we show the review page.\n reviewValues();\n var formReview = document.querySelector('#review');\n formReview.style.top = 0;\n\n }\n }else{\n\n item.querySelector('#email').classList.add('required');\n }\n }\n\n if (item.querySelector('.web-priority') !== null) {\n var choices = item.getElementsByClassName('priority');\n\n for(var i = 0; i < choices.length; i++){\n if(choices[i].checked){\n answers.questionThree = choices[i].value;\n }\n }\n\n item.classList.remove('active');\n updateSideNavigation();\n // Check if another list element (question) exists\n if (item.nextElementSibling){\n item.nextElementSibling.classList.add('active');\n pageNumber(4);\n }else{\n // When we have no more questions we show the review page.\n reviewValues();\n var formReview = document.querySelector('#review');\n formReview.style.top = 0;\n\n }\n\n }\n\n if (item.querySelector('#websiteColor') !== null) {\n answers.questionFour = item.querySelector('#websiteColor').value;\n item.classList.remove('active');\n updateSideNavigation();\n // Check if another list element (question) exists\n if (item.nextElementSibling){\n item.nextElementSibling.classList.add('active');\n pageNumber(5);\n }else{\n // When we have no more questions we show the review page.\n reviewValues();\n var formReview = document.querySelector('#review');\n formReview.style.top = 0;\n\n }\n\n }\n\n if (item.querySelector('#websiteDesc') !== null) {\n if(validateDesc()){\n answers.questionFive = item.querySelector('#websiteDesc').value;\n item.classList.remove('active');\n updateSideNavigation();\n // Check if another list element (question) exists\n if (item.nextElementSibling){\n item.nextElementSibling.classList.add('active');\n pageNumber(6);\n }else{\n // When we have no more questions we show the review page.\n reviewValues();\n var formReview = document.querySelector('#review');\n formReview.style.top = 0;\n }\n }else{\n item.querySelector('#websiteDesc').classList.add('required');\n }\n }\n\n if (item.querySelector('#budget') !== null) {\n if(validateBudget()){\n answers.questionSix = item.querySelector('#budget').value;\n item.classList.remove('active');\n updateSideNavigation();\n // Check if another list element (question) exists\n if (item.nextElementSibling){\n item.nextElementSibling.classList.add('active');\n pageNumber(7);\n }else{\n // When we have no more questions we show the review page.\n reviewValues();\n var formReview = document.querySelector('#review');\n formReview.style.top = 0;\n\n }\n }else{\n item.querySelector('#budget').classList.add('required');\n }\n }\n\n\n\n} //end form naviagtion", "nextPage() {\r\n this.mapSectionStatus();\r\n if (!this.state.allQuestionsCompleted) {\r\n /* reset questions to the top of the page */\r\n this.divRef.current.scrollTo(0, 0);\r\n }\r\n\r\n const numberOfQuestions = this.state.pages[this.state.index].questions\r\n .length;\r\n var controllingQuestionIndex = numberOfQuestions - 1;\r\n var answerIndex = this.findAnswer(\r\n this.state.index,\r\n controllingQuestionIndex\r\n );\r\n\r\n /* validation check for questions */\r\n var passed = true;\r\n\r\n if (\r\n !(\r\n (this.state.SurveyTitle === \"CIDP SOC\" ||\r\n this.state.SurveyTitle === REPEAT_VISIT_SURVEY) &&\r\n this.state.answerIndexes.length !== 0\r\n )\r\n ) {\r\n const currentPage = this.state.pages[this.state.index];\r\n var errors = this.state.errorFields;\r\n var answerIndexes = this.state.answerIndexes;\r\n currentPage.questions.forEach((question, qIndex) => {\r\n const isRequired = question.required;\r\n\r\n var foundObject = answerIndexes.find(answer => {\r\n return answer.qIndex === qIndex && answer.page === this.state.index;\r\n });\r\n\r\n if (!foundObject && question.questionType !== \"Label\") {\r\n var answerObject = {\r\n page: this.state.index,\r\n qIndex: qIndex,\r\n answer: \"\"\r\n };\r\n\r\n answerIndexes.push(answerObject);\r\n }\r\n // we are checking if the foundobject is undefined or foundobect is exist but the answer doesn't\r\n // the foundobject is empty for the first time when we click on the survey and without answers click on Next button\r\n if (\r\n (!foundObject ||\r\n (foundObject &&\r\n (foundObject.answer === \"\" ||\r\n typeof foundObject.answer == \"undefined\"))) &&\r\n this.state.questionsAnswered[qIndex] === false &&\r\n isRequired\r\n ) {\r\n errors[qIndex] = true;\r\n passed = false;\r\n } else {\r\n errors[qIndex] = false;\r\n }\r\n\r\n answerIndexes.sort((a, b) => {\r\n return a.page - b.page || a.qIndex - b.qIndex;\r\n });\r\n\r\n this.setState({ answerIndexes: answerIndexes, errorFields: errors });\r\n });\r\n }\r\n\r\n //updating pending assessments even when we click on next button\r\n updatePendingAssessmentState(\r\n this.props.patient.MRN,\r\n this.state.selectedSurvey,\r\n {\r\n firstName: this.props.patient.FirstName,\r\n lastName: this.props.patient.PatientLastName,\r\n MRN: this.props.patient.MRN,\r\n DOB: moment(new Date(Date.parse(this.props.patient.DOB))).format(\r\n \"MM/DD/YYYY\"\r\n )\r\n }\r\n );\r\n\r\n if (passed) {\r\n var nextPage = getNextPage(\r\n this.state.pages,\r\n this.state.index,\r\n controllingQuestionIndex,\r\n answerIndex\r\n );\r\n\r\n while (nextPage === -1 && controllingQuestionIndex > 0) {\r\n controllingQuestionIndex = controllingQuestionIndex - 1;\r\n answerIndex = this.findAnswer(\r\n this.state.index,\r\n controllingQuestionIndex\r\n );\r\n nextPage = getNextPage(\r\n this.state.pages,\r\n this.state.index,\r\n controllingQuestionIndex,\r\n answerIndex\r\n );\r\n\r\n if (nextPage === -1) {\r\n if (\r\n this.state.pages[this.state.index].questions &&\r\n !this.state.pages[this.state.index].questions.find(\r\n item => item.required\r\n )\r\n ) {\r\n if (this.state.index + 1 < this.state.pages.length) {\r\n nextPage = this.state.index + 1;\r\n }\r\n }\r\n }\r\n }\r\n if (nextPage === -1 && !this.state.allQuestionsCompleted) {\r\n this.setState(\r\n { allQuestionsCompleted: true, progress: \"100\" },\r\n\r\n () => {\r\n this.saveToLocalStorage();\r\n }\r\n );\r\n } else {\r\n /* reset question values back to false */\r\n const questionsToComplete = this.state.pages[nextPage].questions.map(\r\n (question, qIndex) => {\r\n return question.questionType === \"Label\";\r\n }\r\n );\r\n\r\n //getting prevc surveyid,surveyname,surveyindecx for updating survey side bar\r\n this.handleNextandPrevPages(this.state, nextPage);\r\n\r\n const previousPage = {\r\n index: this.state.index,\r\n progress: this.state.progress\r\n };\r\n\r\n const historyStack = this.state.indexProgressStack;\r\n historyStack.push(previousPage);\r\n\r\n this.setState(\r\n {\r\n prevIndex: this.state.index,\r\n index: nextPage,\r\n prevProgress: this.state.progress,\r\n progress: Math.round((nextPage / this.state.pages.length) * 100),\r\n questionsAnswered: questionsToComplete,\r\n indexProgressStack: historyStack\r\n },\r\n () => {\r\n this.saveToLocalStorage();\r\n this.divRef.current.scrollTo(0, 0);\r\n }\r\n );\r\n\r\n /* when decision logic for the page prompts to skip a page,\r\n check whether there were previously stored answers for page\r\n that won't exist;\r\n ex. IG Administration Survey pages 0, 1, 2 where page 0 answer is decision\r\n */\r\n this.removeSkippedAnswersHistory(\r\n this.state.index,\r\n this.state.prevIndex\r\n );\r\n }\r\n }\r\n }", "function next_step() {\n\t//just to prevent submission\n\tevent.preventDefault();\n\t//true means it comes as next step\n\tpopup(true);\n}", "function validateInstructionChecks() {\n \n instructionChecks = $('#instr').serializeArray();\n\n var ok = true;\n var allanswers = true;\n if (instructionChecks.length < 2) {\n alert('Please complete all questions.');\n allanswers = false;\n \n \n } else {\n allanswers = true;\n for (var i = 0; i < instructionChecks.length; i++) {\n // check for incorrect responses\n if(instructionChecks[i].value === \"incorrect\") {\n alert('At least one answer was incorrect; please read the instructions and try again.');\n ok = false;\n break;\n }\n }\n }\n \n \n // goes to next section\n if (!allanswers) {\n showInstructionCheck;\n } else if(!ok) {\n showInstructions(); \n } else {\n hideElements();\n showDummyVignette(); \n }\n}", "function isValidStep() {\n if ($scope.inputs.enterpriseLabel === '' || !$scope.inputs.enterpriseLabel) {\n trackClientLabelFail('Missing Enterprise Name');\n $scope.setFormError('Please enter organization name.');\n return false;\n }\n if ($scope.inputs.enterpriseLabel.indexOf('.') !== -1) {\n trackClientLabelFail('Invalid Organization Name');\n $scope.setFormError('Organization names cannot contain periods.');\n return false;\n }\n if ($scope.inputs.enterpriseLabel.length > 50) {\n trackClientLabelFail('Invalid Organization Name Length');\n $scope.setFormError('Organization names cannot be longer than 50 characters.');\n return false;\n }\n return true;\n }", "function goto_next_form() {\n context.current++;\n if (context.current >= context.workflow.length) {\n return finish_survey(); //todo: verify that when going Back and clicking Next this doesn't break the flow\n }\n //Store the incremented value of 'current'\n Survana.Storage.Set('current', context.current, function () {\n //load the next form\n window.location.href = context.workflow[context.current];\n }, on_storage_error);\n }", "function validation() {\r\n\t\t\r\n\t}", "function onXareltoSubmit() {\n //first clear error element\n var t = document.getElementById(\"errorElement\");\n t.innerHTML=\"\";\n if (!validateName()) {\n displayFormErrors(\"name\");\n return false;\n } else if (!validateZipCode()){\n displayFormErrors(\"zip\");\n return false;\n } else if (!validateTelephone()){\n displayFormErrors(\"telephone\");\n return false;\n } else if (!validateEmail()) {\n displayFormErrors(\"email\");\n return false;\n } else if(!validateConsent()){\n displayFormErrors(\"consent\");\n return false;\n }\n return true;\n}", "function validate1() {\n valCheck = true;\n\t\n\t//Checks if form items are correct\n var firstNameResult = checkTextBox(document.forms[\"validationForm\"][\"firstName\"].value);\n\tvar lastNameResult = checkTextBox(document.forms[\"validationForm\"][\"lastName\"].value);\n\tvar genderResult = checkDropdown(document.forms[\"validationForm\"][\"Gender\"].options[document.forms[\"validationForm\"][\"Gender\"].selectedIndex].value);\n\tvar stateResult = checkDropdown(document.forms[\"validationForm\"][\"State\"].options[document.forms[\"validationForm\"][\"State\"].selectedIndex].value);\n\t\n\t//Selects proper image according to the results\n var image1 = getImage(Boolean(firstNameResult), \"firstName\");\n\tvar image2 = getImage(Boolean(lastNameResult), \"lastName\");\n\tvar image3 = getImage(Boolean(genderResult), \"Gender\");\n\tvar image4 = getImage(Boolean(stateResult), \"State\");\n\t\n\t//Selects proper notification according to the results\n var labelNotifyFirst=getNotification(Boolean(firstNameResult), \"firstName\");\n\tvar labelNotifyLast=getNotification(Boolean(lastNameResult), \"lastName\");\n\tvar labelNotifyGender=getNotification(Boolean(genderResult), \"Gender\");\n\tvar labelNotifyState=getNotification(Boolean(stateResult), \"State\");\n\t\n\t//appends items\n document.getElementById(\"firstName\").appendChild(image1);\n document.getElementById(\"firstName\").appendChild(labelNotifyFirst);\n\t\n\tdocument.getElementById(\"lastName\").appendChild(image2);\n document.getElementById(\"lastName\").appendChild(labelNotifyLast);\n\t\n\tdocument.getElementById(\"Gender\").appendChild(image3);\n document.getElementById(\"Gender\").appendChild(labelNotifyGender);\n\t\n\tdocument.getElementById(\"State\").appendChild(image4);\n document.getElementById(\"State\").appendChild(labelNotifyState);\n\t\n\t//enters next page if all form items are checked\n\tif(firstNameResult == true && lastNameResult == true && genderResult == true && stateResult == true){\n\tsetTimeout(function(){location.replace(\"validation2.html\");},1050);\n\n\t}\n\n}", "function checkValidSimplePage(formname,tName)\r\n{\r\n\tvar arrCntrl = Runner.controls.ControlManager.getAt(tName);\r\n\tvar form = $('#'+formname);\r\n\tvar valRes = true;\r\n\tvar isFocused = false;\r\n\tfor(var i = 0; i < arrCntrl.length; i++) \r\n\t{\r\n\t\tvar vRes = arrCntrl[i].validate();\r\n\t\tif(vRes.result) \t\t\r\n\t\t{\t\r\n\t\t\tif(arrCntrl[i].getControlType() == 'RTE' && arrCntrl[i].useRTE)\r\n\t\t\t{\r\n\t\t\t\tvar clone = arrCntrl[i].getForSubmit();\t\r\n\t\t\t\t$(clone).prependTo(form);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\t\tvalRes = false;\r\n\t\t\t\tif(!isFocused)\r\n\t\t\t\t{\r\n\t\t\t\t\tarrCntrl[i].setFocus();\r\n\t\t\t\t\tisFocused = true;\r\n\t\t\t\t}\t\r\n\t\t\t}\t\r\n\t}\r\n\treturn valRes;\r\n}", "function formValidation(){\n //If-else statement for every item I want to check:\n submitButton.on(\"click\", function(event){\n if(name.val() === ''){\n event.preventDefault();\n $('#name-invalid').html('<p>*You must enter a name.</p>');\n $(window).scrollTop(0);\n name.addClass(\"invalid-field\");\n } else {\n $('#name-invalid').html(''); \n name.removeClass(\"invalid-field\");\n };\n if(emailField.val().match(emailRegex) === null){\n event.preventDefault();\n $('#email-invalid').html('<p>*You must enter a valid email address.</p>');\n $(window).scrollTop(0);\n emailField.addClass(\"invalid-field\");\n } else {\n $('#email-invalid').html(''); \n emailField.removeClass(\"invalid-field\");\n };\n if (totalCost === 0) {\n event.preventDefault();\n $('#activities-invalid').html('<p>*You must choose at least one activity.</p>');\n $(window).scrollTop(0);\n } else {\n $('#activities-invalid').html(''); \n };\n if(paymentField.val() === 'select_method') {\n event.preventDefault();\n $('#payment-invalid').html('<p>*You must select a payment method.</p>');\n $(window).scrollTop(0);\n paymentField.addClass(\"invalid-field\");\n } else {\n $('#payment-invalid').html(''); \n paymentField.removeClass(\"invalid-field\");\n };\n if(paymentField.val() === 'credit card') {\n if(creditCardNumberField.val().match(creditCardRegex) === null){\n event.preventDefault();\n $('#cc-num-invalid').html('<p>*You must enter a valid credit card number.</p>');\n $(window).scrollTop(0);\n creditCardNumberField.addClass(\"invalid-field\");\n } else {\n $('#cc-num-invalid').html(''); \n creditCardNumberField.removeClass(\"invalid-field\");\n };\n if(zipField.val().match(zipCodeRegex) === null){\n event.preventDefault();\n $('#zip-invalid').html('<p>*You must enter a valid 5-digit zip code.</p>');\n $(window).scrollTop(0);\n zipField.addClass(\"invalid-field\");\n } else {\n $('#zip-invalid').html(''); \n zipField.removeClass(\"invalid-field\");\n };\n if(cvvField.val().match(cvvRegex) === null){\n event.preventDefault();\n $('#cvv-invalid').html('<p>*You must enter a valid 3-digit CVV.</p>');\n $(window).scrollTop(0);\n cvvField.addClass(\"invalid-field\");\n } else {\n $('#cvv-invalid').html(''); \n cvvField.removeClass(\"invalid-field\");\n };\n };\n });\n}", "function loadNextAnomalyForm() {\n currentState = \"AnomalyForm\";\n anomalyIndex += 1;\n if (anomalyIndex == anomalyForms.length) loadReviewPage();else if (anomalyForms[anomalyIndex][\"selected\"]) loadAnomalyForm();else loadNextAnomalyForm();\n}", "function validateSteps(stepnumber){\n\t\t var isStepValid = true;\n\t\t if(stepnumber == 1){\t\n\t\t\t\t\t\t\tif (($('input[type=radio]:checked').size() == 0))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tisStepValid=false;\n\t\t\t\t\t\t\t\t $('#wizard').smartWizard('setError',{stepnum:1,iserror:!isStepValid});\n\t\t\t\t\t\t\t\t\t$('#wizard').smartWizard('showMessage',\"Vous devez choisir un type de projet\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse{\n\t\t\t\t\t\t\t\t$('#wizard').smartWizard('setError',{stepnum:1,iserror:!true});\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t if(stepnumber == 4){\t\t\n\t\t\t\t\t\t\tisStepValid = LiveValidation.massValidate( [ project_title, project_objective ] );\n\t\t\t\t\t\t\tsetError(stepnumber,isStepValid);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(stepnumber == 6){\t\t\n\t\t\t\t\t\t\tisStepValid = LiveValidation.massValidate( [ project_start_date ] );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tsetError(stepnumber,isStepValid);\n\t\t\t\t\t\t}\n\t\n \t\t\t\treturn isStepValid;\n\t\t }", "function validate () {\r\n\tif(localStorage.getItem(\"orders\") == null || total <= 0) {//only process if orders are there\r\n\t\talert(\"You have not selected any items\");\r\n\r\n\t}\r\n\telse {location.href = \"validate.html\";}\r\n}", "function formValidation(){\n var result;\n\n result = textValidation(firstName,fName);\n result = textValidation(middleName,mName) && result;\n result = textValidation(sirName,lName) && result;\n result = numberValidation(unitNum,unitNumber) && result;\n result = numberValidation(StreetNum,stNumber) && result;\n result = textValidation(streetName,stName) && result;\n result = textValidation(city,cityName) && result;\n result = postCodeValidation(postCode,pCode) && result;\n result = phoneValidation(phoneNumber,phoNumber) && result;\n result = userNameValidation(userName,uName) && result;\n result = password1Validation(password1,pWord) && result;\n result = password2Validation(password2,pWordC,password1) && result;\n if (result == false){\n alert(\"Submission Failed\")\n }\n else {\n alert(\"Submission was Successful\")\n }\n return result;\n}", "function validate_step3(){\r\n var txtvolume = document.getElementById('volume');\r\n var txtvtbp = document.getElementById('vtbp');\r\n var i = 0;\r\n\r\n if (txtvolume.value.length == 0) {\r\n i=1;\r\n if (!txtvolume.classList.contains('failed')) {\r\n addMyClass(txtvolume, 'failed');\r\n }\r\n } else {\r\n txtvolume.classList.remove('failed');\r\n }\r\n\r\n if (txtvtbp.value.length == 0) {\r\n i=1;\r\n if (!txtvtbp.classList.contains('failed')) {\r\n addMyClass(txtvtbp, 'failed');\r\n }\r\n } else {\r\n txtvtbp.classList.remove('failed');\r\n }\r\n\r\n //finish\r\n if (i > 0) {\r\n tellEm('Some of these form fields are required.', 'tellem2');\r\n return false;\r\n } else {\r\n txtvolume.classList.remove('failed');\r\n txtvtbp.classList.remove('failed');\r\n\r\n tellEm('', 'tellem2');\r\n return true;\r\n }\r\n}", "function validate_form_goal()\n{\n\t// season (only need to check if season2 is not empty)\n\tbseason = document.createitem.season2.value != \"\";\n\tif (!bseason)\n\t{\n\t\tdocument.createitem.season.value = 0;\n\t}\n\telse\n\t{\n\t\tdocument.createitem.season.value = document.createitem.season1.value + \"/\" + document.createitem.season2.value\n\t}\n\t\t\n\t\t\n\t// At this point, if bok equals true, then the details have been filled correctly\n\t////////////////////////////////////////////////////////////////////////\n\t\n\t// submit form if it has been correctly populated\n\tshow_topscorers(\"div_topscorer\",\"get_topscorer.php\")\n}", "function navigateToMore() {\n\tremoveMessageFromDivId();\n\tremoveSuccessOrFailureStrip();\n\tvar pathName = $(location).attr('pathname');\n\tvar fundingSourceTypes_JsonType=\"\";\n\tif($('#editCardForm').is(':visible')){\n\t\t\tfundingSourceTypes_JsonType = getFundingSource(\"editCardForm\");\n\t\tif(isEditCardFieldsChanged(fundingSourceTypes_JsonType)){\n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMorePage(pathName);\n\t\t}\n\t}else if($('#addPaymentCardForm').is(':visible')){\n\t\t\tfundingSourceTypes_JsonType = getFundingSource(\"addPaymentCardForm\");\n\t\tif(isValueInAddCardFormFields(\"addCardForm\" + fundingSourceTypes_JsonType)) { \n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t}else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMorePage(pathName);\n\t\t}\n\t}else if($('#edit_profile_area').is(':visible')){\n\t\tif(isEditProfileFieldsChanged()){\n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMorePage(pathName);\n\t\t}\n\t} else if($('#edit_profile_security_area').is(':visible')){\n\t\tif(isUserSecurityFieldsChanged()){\n\t\t\tshowAnimatedPopup('editCardOnManagesCard', 'editcardCredPopUp');\n\t\t} else {\n\t\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\t\tmoveToMorePage(pathName);\n\t\t}\n\t} else{\n\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\tmoveToMorePage(pathName);\n\t}\t /*mainPaymentPageResize();*/\n\t$('#clearOnClickBtn').unbind( \"click\" );\n\t$('#clearOnClickBtn').click(function(event){\n\t\t/* Checking for if user clicked home tab in locator page then s/he should move to main_payment_page */\n\t\tmoveToMorePage(pathName);\n\t});\n}", "function roboxAppControlValidatePage(searchString)\n{\n var page = null;\n\n // get the specified page, if any\n \n if(searchString && searchString.length > 1) {\n\tvar params = parseQuery(searchString);\n\tif(params.hasOwnProperty('page')) {\n\t page = params.page;\n\t}\n }\n\n // page is either 'null' or something, but that something may not be right...\n // so decode the page and init appropraitely\n \n switch(page) {\n\n\t// for any of these cases, the page is valid\n\n case \"testing\":\n case \"driving\":\n case \"competition\":\n\treturn(page);\n\n\t// the default case handles both null and a challenge specified in URL\n\n default:\n\tindex = 0;\n\tif(page) {\n\t var index = challenges.indexOf(page);\n\t if(index < 0) {\n\t\tindex = 0;\n\t }\n\t}\n\treturn(index);\n }\n}", "function validateForm() {\n\t\tvar $fields = $(\".form-control:visible\");\n\t\tvar $thisStep = $('.formPaso-stepper:visible');\n\t\tvar $nextStep = $thisStep.attr('data-nextStep');\n\t\tvar $filledFields = $fields.find('input[value!=\"\"]');\n\t\tvar $emptyFields = $fields.filter(function() {\n\t \treturn $.trim(this.value) === \"\";\n\t });\n \tfunction continueForm() {\n\t \t// apaga stepper\n\t \t// $('#stepper_portabilidad li').removeClass('active');\n\t \t// prende stepper correcto\n\t \t$('#stepper_portabilidad li.stepperLED-' + $nextStep).addClass('active');\n\t \t// deshabilita este boton\n\t \t$($thisStep).find('.nextStep').addClass('disabled');\n\t \t// oculta este paso\n\t \t$($thisStep).slideUp('1200');\n\t \t// muestra el paso siguiente\n\t \t$('#portateForm-' + $nextStep).slideDown('1200');\n\t \t// habilita el boton a paso siguiente\n\t \t$('#portateForm-' + $nextStep).find('.nextStep').removeClass('disabled');\n\t \t// anima el DOM hasta el stepper\n\t \t$('html, body').animate({scrollTop: $(\"#stepper_portabilidad\").offset().top - 30}, 500);\n\t\t // cancela form button\n\t \treturn false;\n\t }\n\t\tif (!$emptyFields.length) {\n\t\t\t// if form is ok...\n\t\t\t$('#camposvacios').slideUp();\n\t\t\tcontinueForm();\n\t\t} else {\n\t\t console.log($emptyFields);\n\t\t $emptyFields.parents('.form-group').addClass('invalidInput').removeClass('input-effect');\n\t\t $filledFields.addClass('totallyValidInput');\n\t\t console.log($filledFields);\n\t\t $('#camposvacios').slideToggle();\n\t\t $('html, body').animate({scrollTop: $(\"#camposvacios\").offset().top}, 200);\n\t\t}\n\t}", "function initializePage() {\n\t$(\".formSubmit\").click(function(event){\n\t if (errCheck() == true)\n\t {\n\t\t$('.searchMenu').slideUp('slow');\n\t\t$('.hidden2').slideDown('slow');\n\t }\n\t event.preventDefault();\n\t});\n\t\n\t$(\".moveNext\").click(function(event){\n\t\tevent.preventDefault();\n\t\t$(\".toFade\").slideUp('slow');\n\t\t$('.hidden2').slideDown('slow');\n\t});\n}", "function formValidationOnInput(section) {\r\n let header = document.querySelector('section.header.stages'),\r\n form = section.querySelector('.form-content'),\r\n category = section.querySelector('.category'),\r\n nxtBtn = section.querySelector('.next-btn button'),\r\n inputs = [], bodyContent, stages, nextPage;\r\n \r\n if (!nxtBtn) {\r\n if (section.parentElement.parentElement.querySelector('.next-btn button')) {\r\n nxtBtn = section.parentElement.parentElement.querySelector('.next-btn button');\r\n }\r\n }\r\n\r\n // Get nextPage\r\n if (header) {\r\n stages = header.querySelectorAll('.stage');\r\n stages.forEach(function(item) {\r\n if (item.classList.contains('active')) {\r\n if (item.nextElementSibling) {\r\n nextPage = item.nextElementSibling.getAttribute('data-stage');\r\n } else {\r\n nextPage = 'success'\r\n }\r\n }\r\n })\r\n }\r\n // check if form exist\r\n if (form) {\r\n let inputs = section.querySelectorAll('input'),\r\n inputsList = [],\r\n categories, activeCategory;\r\n\r\n // check if category exist\r\n if (category) {\r\n categories = section.querySelectorAll('.category'),\r\n activeCategory = section.querySelector('.category.active');\r\n if (inputs.length === 0) {\r\n // check if active category exist\r\n if (activeCategory) {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n } else {\r\n nextBtnActive(nxtBtn, form, nextPage, section, false);\r\n }\r\n } else {\r\n // add mandatory input\r\n inputs.forEach(function(item) {\r\n let rowGroup = window.getComputedStyle(item.closest('.row-group')).getPropertyValue('display'),\r\n inputGroupDisplay = window.getComputedStyle(item.closest('.input-group')).getPropertyValue('display'),\r\n innerGroup = window.getComputedStyle(item.parentElement).getPropertyValue('display');\r\n if (!item.classList.contains('optional')) {\r\n if (inputGroupDisplay !== 'none' && innerGroup !== 'none' && rowGroup !== 'none') {\r\n if (item.getAttribute('type') === 'text' || item.getAttribute('type') === 'number' || item.hasAttribute('readonly')) {\r\n inputsList.push(item);\r\n }\r\n } else {\r\n item.classList.remove('complete-input');\r\n if (activeCategory) {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n } else {\r\n nextBtnActive(nxtBtn, form, nextPage, section, false);\r\n }\r\n }\r\n }\r\n });\r\n inputsList.forEach(function(item) {\r\n item.addEventListener('blur', function() {\r\n formValidation(section, item, true);\r\n })\r\n item.addEventListener('input', function() {\r\n if (item.value !== '') {\r\n formValidation(section, item, false);\r\n item.classList.add('complete-input');\r\n } else {\r\n item.classList.remove('complete-input');\r\n }\r\n let completeNum = form.querySelectorAll('.complete-input');\r\n activeCategory = section.querySelector('.category.active');\r\n if (completeNum.length === inputsList.length && activeCategory) {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n } else {\r\n let categoryDisplay = window.getComputedStyle(category.parentElement).getPropertyValue('display');\r\n if (completeNum.length === inputsList.length && categoryDisplay === 'none') {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n } else {\r\n nextBtnActive(nxtBtn, form, nextPage, section, false);\r\n }\r\n }\r\n });\r\n let completeNum = form.querySelectorAll('.complete-input');\r\n activeCategory = section.querySelector('.category.active');\r\n if (completeNum.length === inputsList.length && activeCategory) {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n } else {\r\n nextBtnActive(nxtBtn, form, nextPage, section, false);\r\n }\r\n });\r\n let completeNum = form.querySelectorAll('.complete-input'),\r\n categoryDisplay = window.getComputedStyle(category.parentElement).getPropertyValue('display');\r\n activeCategory = section.querySelector('.category.active');\r\n if (completeNum.length === inputsList.length && categoryDisplay === 'none') {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n } else {\r\n if (activeCategory && categoryDisplay !== 'none') {\r\n if (completeNum.length === inputsList.length && activeCategory) {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n } else {\r\n nextBtnActive(nxtBtn, form, nextPage, section, false);\r\n }\r\n } else {\r\n if (category.parentElement.classList.contains('optional')) {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n } else {\r\n nextBtnActive(nxtBtn, form, nextPage, section, false);\r\n }\r\n }\r\n }\r\n }\r\n } else {\r\n // add mandatory input\r\n inputs.forEach(function(item) {\r\n if (!item.classList.contains('optional')) {\r\n if (item.getAttribute('type') === 'text' || item.getAttribute('type') === 'number' || item.hasAttribute('readonly')) {\r\n inputsList.push(item);\r\n }\r\n }\r\n });\r\n if (inputsList.length !== 0) {\r\n inputsList.forEach(function(item) {\r\n item.addEventListener('blur', function() {\r\n formValidation(section, item, true);\r\n })\r\n item.addEventListener('input', function() {\r\n if (item.value !== '') {\r\n formValidation(section, item, false);\r\n item.classList.add('complete-input');\r\n } else {\r\n item.classList.remove('complete-input');\r\n }\r\n let completeNum = form.querySelectorAll('.complete-input');\r\n if (completeNum.length === inputsList.length) {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n } else {\r\n nextBtnActive(nxtBtn, form, nextPage, section, false);\r\n }\r\n });\r\n let completeNum = form.querySelectorAll('.complete-input');\r\n if (completeNum.length === inputsList.length) {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n } else {\r\n nextBtnActive(nxtBtn, form, nextPage, section, false);\r\n }\r\n });\r\n } else {\r\n nextBtnActive(nxtBtn, form, nextPage, section, true);\r\n }\r\n\r\n }\r\n }\r\n\r\n}", "function checker () {\n\tfinalResult += exercises[pointer].studentAnswer;\n\t++pointer;\n\tif ( pointer == exercises.length ) {\n\t\talert(\"The exam is finished.\");\n\t\treturn 0;\n\t}\n\tnxtbtnContainer.style.display = \"none\";\n\tbuildAndShow();\n}", "function goToFormPage(formType, formIndex) {\n document.getElementById(\"next-button\").innerText = \"Next\";\n switch (formType) {\n case \"SelectAnomalyTypes\":\n if (formIndex < elementSeedForms.length && elementSeedForms[formIndex].selected) {\n elementSeedIndex = formIndex;\n terrainModificationIndex = -1;\n anomalyIndex = -1;\n loadElementSeedForm();\n }\n break;\n case \"terrain-modification\":\n if (formIndex < terrainModificationForms.length && terrainModificationForms[formIndex].selected) {\n elementSeedIndex = elementSeedForms.length;\n terrainModificationIndex = formIndex;\n anomalyIndex = -1;\n loadTerrainModificationForm();\n }\n break;\n case \"anomaly\":\n if (formIndex < anomalyForms.length && anomalyForms[formIndex].selected) {\n elementSeedIndex = elementSeedForms.length;\n terrainModificationIndex = terrainModificationForms.length;\n anomalyIndex = formIndex;\n loadAnomalyForm();\n }\n break;\n }\n}", "function validate_status_input(trial_offset, next_payment_offset) {\n if (trial_offset > next_payment_offset) {\n alert(\"Отступ даты пробного периода не может быть больше отступа даты следующей оплаты!\");\n return false;\n }\n return true;\n}", "function onValidation() {\n\tclearErrors();\n\n\tvar allValidReq = checkRequiredFields();\n\tvar allValidDob = true;\n\tif ($.inArray(\"dob\", getRequiredFields()) > 0)\n\t{\n\t\tallValidDob = checkValidDob();\n\t}\n\t\n\tvar allValidNames = checkValidNames();\n\n\tif ($(\"#usSocialSecurityNumber\").length) {\n\t\tallValidNames = allValidNames && checkSSN();\n\t}\n\t\n\tvar allValidAddress = true;\n\tif (countryIsUSA()) {\n\t\tallValidAddress = checkValidUSAAddress();\n\t}\n\t\n\treturn allValidReq && allValidDob && allValidNames & allValidAddress;\n}", "function validateStep(step){\n\t\tif(step == fieldsetCount) return;\n\t\t\n\t\tvar error = 1;\n\t\tvar hasError = false; \n \n if(step==1)\n {\n if($('#title').val()==\"\")\n { \n hasError = true;\n\t\t\t\t//$('#title').css('background-color','#FFEDEF');\n //alert('Please Provide Event Title');\n $.colorbox({html:\"Please Provide Event Title\",fixed:true});\n\n return false;\n }\n \n if($('#event_logo').val()==\"\")\n { \n hasError = true;\n\t\t\t\t//$('#title').css('background-color','#FFEDEF');\n //alert('Please Provide Event Logo');\n $.colorbox({html:\"Please Provide Event Logo\",fixed:true});\n return false;\n } \n \n }\n if(step==3)\n {\n if($('#start_date').val()==\"\")\n {\n hasError = true;\n\t\t\t\t//$('#title').css('background-color','#FFEDEF');\n //alert('Please Provide Event Start Date');\n $.colorbox({html:\"Please Provide Start Date\",fixed:true});\n return false;\n }\n \n if($('#end_date').val()==\"\")\n {\n hasError = true;\n\t\t\t\t//$('#title').css('background-color','#FFEDEF');\n //alert('Please Provide Event End Date');\n $.colorbox({html:\"Please Provide Event End Date\",fixed:true});\n return false;\n }\n \n if($('#country').val()==\"\")\n {\n hasError = true;\n\t\t\t\t//$('#title').css('background-color','#FFEDEF');\n //alert('Please Provide Event Country');\n $.colorbox({html:\"Please Provide Event Country\",fixed:true});\n return false;\n }\n if($('#category').val()==\"\")\n {\n hasError = true;\n\t\t\t\t//$('#title').css('background-color','#FFEDEF');\n //alert('Please Provide Event Category');\n $.colorbox({html:\"Please Provide Event Category\",fixed:true});\n return false;\n } \n \n }\n if(step==5)\n {\n \n if($('#event_tickets').html()==\"\")\n {\n hasError = true;\n\t\t\t\t//$('#title').css('background-color','#FFEDEF');\n //alert('Please Create atleast one ticket');\n $.colorbox({html:\"Please Create atleast one ticket\",fixed:true});\n return false;\n } \n \n }\n if(step==7)\n {\n \n \n } \n \n if(hasError){\n\t\t\terror = -1;\n\t\t\tvalclass = 'error';\n\t\t}\n \n return error;\n \n\t}", "function formValidation() {\n var email = document.getElementById('email').value;\n var firstname = document.getElementById('firstname').value;\n var lastname = document.getElementById('lastname').value;\n var phone = document.getElementById('phone').value;\n var address = document.getElementById('address').value;\n var postcode = document.getElementById('postcode').value;\n\n // nest all supporting functions, if all true then send thank you alert\n if (email_validation(email)) {\n if (firstname_validation(firstname)) {\n if (lastname_validation(lastname)) {\n if (phone_validation(phone)) {\n if (address_validation(address)) {\n if (postcode_validation(postcode)) {\n alert('Thank you for submitting the form.');\n document.getElementById(\"edit_account\").submit();\n }\n }\n }\n }\n }\n }\n\n}", "function initializePage() {\n ok.addEventListener('click', validateForm);\n}", "function validateAndSubmitUsingFormMethodToCall(){\n validateAndSubmit(null, replacePage);\n}", "function nextTab() {\r\n\tvar visible;\r\n\tvar steps = ['Null','Step1','Step2','Step3','Step4'];\r\n\tfor (var i = 1; i < steps.length; i++) {\r\n\t\tif ($('#' + steps[i]).is(\":visible\")) {\r\n\t\t\tvisible = i;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\tif(visible == 4) {\r\n\t\tfocusoncurrent();\r\n\t\t$('ul.tabs').tabs('select_tab', 'Step1');\r\n\t\t$(\"#nextButton\").html(\"Next\");\r\n\t\treturn;\r\n\t}\r\n\tif(visible == 3) {\r\n\t\t$(\"#nextButton\").html(\"See Your Pin\");\r\n\t}\r\n\tif(visible == 2 ) {\r\n\t\tif (!checkStep2())\r\n\t\t\treturn;\r\n\t\t$(\"#nextButton\").html(\"Continue\");\r\n\t\tformSubmit();\r\n\t}\r\n\tif(visible == 1) {\r\n\t\t$('.mobileText').css(\"color\",\"red\");\r\n\t\tif (!checkStep1())\r\n\t\t\treturn;\r\n\t}\r\n\t$('ul.tabs').tabs('select_tab', steps[visible +1]);\r\n\tif(visible == 1) {\r\n\t\t$(\"#nextButton\").html(\"Pin to Map\");\r\n\t\t$(\"#location\").focus();\r\n\t}\r\n}", "function validate_form(step_index){\r\n var names = $.map($('#steps li').eq(step_index).find('input, select'), function (elm) { return elm.name; }) \r\n\t\t/*if($('#steps li').eq(step_index).val() != ''){\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}*/\r\n var s = submitPartialFunction(names);\r\n return s; \r\n\t}", "function validate_advanced1()\n{\n\t$(\".errors-class\").html(\"\");\n\tif(($(\"#pan\").val()!=\"\") && validatePan($(\"#pan\").val())==false)\n\t{\n\t\t$(\"#pan-error\").html(\"Please fill valid PAN Number.\");\n\t\t$(\"#pan\").focus();\n\t\treturn false;\n\t}\n\telse if(($(\"#aadhaar\").val()!=\"\") && $(\"#aadhaar\").val().length<12)\n\t{\n\t\t$(\"#aadhaar-error\").html(\"Aadhaar can't be less than 12 digits.\");\n\t\t$(\"#aadhaar\").focus();\n\t\treturn false;\n\t}\n\t\n\telse\n\t{\n\t\t$('.div1').removeClass('current');\n\t\t$('.div2').addClass('current');\n\t\t$('.div1').addClass('done');\n\t\t$(\"#div1\").hide();\n\t\t$(\"#div2\").show();\n\t\treturn true\n\t}\n}", "function validateStep() {\n\tvar token = sessionStorage.getItem('token');\n\tvar form = document.getElementById('formStep');\n\tvar url = '//order.astel.be/orderForms/validateStep/' + token;\n\tvar postParameters = serialize(form);\n\tmakeAjaxPostRequest(url, postParameters, 'validateCallBackSuccess', 'validateCallBackFailure');\n}", "function formCheck(step){\n\n\t\t\t\t\t\t\tvar check = false;\n\t\t\t\t\t\t\tswitch(step){\n\n\t\t\t\t\t\t\t\t//check that the URL has \"http://\"\n\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\tvar inputCheck = $('#step'+$step.toString()+\"_\"+$type.toString()).find(\"input\").val();\n\t\t\t\t\t\t\t\t\tif(inputCheck.indexOf('http') < 0){\n\t\t\t\t\t\t\t\t\t\t$('#step'+$step.toString()+\"_\"+$type.toString()).find(\"input\").addClass(\"input-invalid\");\n\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\t$('#step'+$step.toString()+\"_\"+$type.toString()).find(\"input\").removeClass(\"input-invalid\");\n\t\t\t\t\t\t\t\t\t\tcheck = true;\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t//check that the input is not blank\n\t\t\t\t\t\t\t\tcase 2:\n\t\t\t\t\t\t\t\tcase 3:\n\t\t\t\t\t\t\t\tcase 4:\n\t\t\t\t\t\t\t\t\tvar inputCheck = $('#step'+$step.toString()+\"_\"+$type.toString()).find(\"input\").val();\n\t\t\t\t\t\t\t\t\tif(inputCheck.length < 1){\n\t\t\t\t\t\t\t\t\t\t$('#step'+$step.toString()+\"_\"+$type.toString()).find(\"input\").addClass(\"input-invalid\");\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\t$('#step'+$step.toString()+\"_\"+$type.toString()).find(\"input\").removeClass(\"input-invalid\");\n\t\t\t\t\t\t\t\t\t\tcheck = true;\n\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t};\n\t\t\t\t\t\treturn check;\n\t\t\t\t\t}", "function nextPage() {\n\n if (pastContests.length > pastEndIndex + 30) {\n pastStartIndex = pastStartIndex + 30;\n pastEndIndex = pastEndIndex + 30;\n }\n\n if (nonPastContests.length >= nonPastEndIndex + 30) {\n nonPastStartIndex = nonPastStartIndex + 30;\n nonPastEndIndex = nonPastEndIndex + 30;\n }\n\n makePastCards(pastContests);\n makeNonPastCards(presentContests, futureContests);\n}", "function feedbackPageHandler(){\n $('main').on('submit', 'form.radio-answers', function() {\n event.preventDefault();\n console.log('next question button clicked');\n STORE.questionNumber += 1;\n if (STORE.questionNumber === 6) {\n currentPage = 'resultsPage';\n return render();\n } else {\n currentPage = 'questionPage';\n return render();\n } \n });\n}", "goToPage(e) {\n e.preventDefault();\n\n // Parse and check page number\n const pageNumber = filterInt(this.refs.pageInput.value);\n if (pageNumber && !isNaN(pageNumber) && pageNumber > 0 && pageNumber <= this.props.nPages) {\n // Remove error class from input form\n this.refs.pageFormGroup.classList.remove(\"has-error\");\n this.refs.pageFormGroup.classList.add(\"has-success\");\n // Hide the modal and go to page\n $(this.refs.paginationModal).modal(\"hide\");\n this.props.goToPage(pageNumber);\n } else {\n // Set error class on input form\n this.refs.pageFormGroup.classList.add(\"has-error\");\n this.refs.pageFormGroup.classList.remove(\"has-success\");\n return;\n }\n }", "function formValidate() {\r\n\tclearErrors();\r\n\tvar errorCounter = 0;\r\n\tconsole.log(clearErrors);\r\n\tif(!addressCheck()) errorCounter++;\r\n return (errorCounter==0);\r\n}", "function afterSub (e) {\n let counter = 0,\n clases = document.querySelectorAll('.fieldp input');\n \n clases.forEach(function (elem) {\n //real validation is in html in here we are just checked if not valid write it down\n if(!elem.checkValidity()){\n counter += 1\n }\n })\n //if all html validattion was right its js validation Time\n if(counter == 0){\n //see if pss s are same or not\n let confirm = ui.validpass(clases);\n if(confirm === 'yes'){\n //if pss math send info and show user that it s Done \n ui.gifdone();\n radyInfo(clases);\n }\n else if(confirm === 'no'){\n //if not math show error to user\n ui.massage('please match the passworads','error');\n }\n}\n //if Html validations are not right(not valid)\n else if(counter > 0){\n ui.massage('please fill all the fields','error');\n counter = 0;\n } \n}", "function PromoterValidation() {\n\n \n\n var bool = true;\n var Lo_Obj = [\"ddlOwner\", \"ddlPromPrefer\", \"txtPromFName\", \"txtPromMName\", \"txtPromLName\", \"ddlPromNominee\", \"txtPromNomineeName\", \"txtPromDBO\", \"ddlGender\",\n \"txtPromCAddres\", \"ddlPromCState\", \"ddlPromCCity\", \"txtPromCPIN\", \"txtPromPAddress\", \"ddlPromPState\", \"ddlPromPCity\", \"txtPromPPIN\",\n \"txtPromPhone\", \"txtPromCell\", \"txtPromPan\", \"txtPromAdhar\", \"txtPromQualification\", \"txtPromEmail\"];\n var Ls_Msg = [\"Company Owner\", \"Preference\", \"First Name\", \"Middele Name\", \"Last Name\", \"Nominee Type\", \"Nominee Name\", \"Date of Birth\", \"Gender\",\n \"Current Address\", \"Current state\", \"Current city\", \"Current pin\", \"Permanent Address\", \"Permanent State\", \"Permanent City\", \"Permanent PIN\",\n \"Landline Number\", \"Mobile Number\", \"PAN Number\", \"Adhar Number\", \"Qualification\", \"Email\"];\n\n if (!CheckMandatory(Lo_Obj, Ls_Msg)) {\n return false;\n }\n return bool;\n}", "function isCorrect(song){\n console.log('Inside of isCorrect: ' + song);\n //List gets next song\n //console.log('Inside of isCorrect (nextPageCount): ' + nextPageCount);\n getNextPage(song.value);\n if(correctSongs.includes(song.value)){\n //Redirects to next genre page\n alert('Correct.');\n document.location.href = getNextPage(song.value);;\n } else {\n //Redirects to next genre page\n //console.log('Inside of isCorrect: ' + nextPageCount);\n alert('Incorrect.');\n // console.log('Inside of isCorrect: ' + nextPageCount);\n if(getNextPage(song.value) === 'about.html'){\n document.location.href = getNextPage(song.value);\n } else {\n document.location.href = getNextPage(song.value);\n }\n }\n}", "function checkForm(storeFolder){\n\t\t\tcasper.then(function(){\n\t\t\tvar fl = storeFolder+\"/AfterLogin.png\";\n\t\t\tthis.capture(fl);\n\t\t\tconsole.log(\"create AfterLogin.png\" +fl);\n\t\t\t\n\t\t\tvar isFound = this.evaluate(function(){\t\t\t\t\t\n\t\t\t\t\t#loginValidation# \n\t\t\t\t});\n\t\t\t\n\t\t\t\n\t\t\tconsole.log(\" found ? \" + isFound);\n\t\t\t\n\t\t\tif(isFound ){\n\t\t\t\tRESULT['loginStatus'] = 200;\n\t\t\t\tthis.echo(\"The login passed.Redirected to page with title \"+this.getTitle()+\" welcome msg \");\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tRESULT['loginStatus'] = 500;\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\n\t\t});\n\t}", "function validateForm(){\n\t\n\tvar boo1 = validateLabPerson();\n\tvar boo2 = validateBioPerson();\n\tvar boo3 = validatePI();\n\tvar boo4 = validateBillTo();\n\tvar boo5 = validateRunType();\n\n\tvar boo6 = validateAllTables();\n//\tvar boo6 = true;\n\n\tvar boo7 = validateDate();\n\tvar boo8 = validateIAccept();\n\n\tvar boo9 = validateConcentrationUnit();\n\tvar boo10 = validateTubesAndLanes();\n\t\n//\talert(\"boo1 = \" + boo1 + \" boo2 = \" + boo2 + \" boo3 = \" + boo3 + \" boo4 = \" + boo4 +\" boo5 = \" + boo5 +\" boo6 = \" + boo6 + \" boo7 = \" + boo7 + \" boo8 = \" + boo8 + \" boo9 = \" + boo9 + \" boo10 = \" + boo10);\n\tif (boo1 && boo2 && boo3 && boo4 && boo5 && boo6 && boo7 && boo8 && boo9 && boo10){\t\n//\tif(validateLabPerson() && validateBioPerson() && validatePI() && validateBillTo() && validateRunType() && validateTable()){\n\t\t//insert fields used to generate csv\n\t\tinsertTableSize();\t\t\t\t\t// insert size of all table - used when generating csv file\n\t\tgenerateOrderNoteID();\t\t\t\t// insert orderNoteID\n\t\taddPI2TubeTag();\t\t\t\t\t// indsæt \"de tre tegn\" (fra PI) i tubetaggen.\n\t\tsetVersion();\t\t\t\t\t\t// insert the version number in the hidden field.\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n\t\n\treturn false;\n}", "validateForm() {\n return this.validateEmail() === 'success'\n && this.validateEmails() === 'success'\n && this.selectedPatent !== null;\n }", "function checkIfLinedUp() {\n\n if (nameAnswer.value.toLowerCase() === 'nominal' && ageAnswer.value.toLowerCase() === \"continuous\" && shoesizeAnswer.value.toLowerCase() === \"discrete\") {\n finishPuzzleOne.classList.toggle('hide');\n window.scrollTo(0,document.body.scrollHeight); //if they are all correct show the next button\n }\n }", "function validateForm() {\r\n return validatePassword() && validateState();\r\n}", "function validateForm() {\n\n var error = 0;\n\n if (!validateUsername()) {\n error++;\n }\n if (!validateEmail()) {\n error++;\n }\n if (!validateAddress('address1')) {\n error++;\n }\n if (document.getElementById('address2').value.length > 0 && !validateAddress('address2')) {\n error++;\n }\n if (!validateAddress('city')) {\n error++;\n }\n if (!validatePassword()) {\n error++;\n }\n if (!confirmPassword()) {\n error++;\n }\n if (!validateDate()) {\n alert(\"You must enter your date of birth\");\n return false;\n }\n if (!ofAge()) {\n alert(\"You cannot register if you are under 18\");\n return false;\n }\n if (error > 0) {\n alert(\"Please fill out form completely\");\n return false;\n }\n}", "function customValidation() {\n debugger;\n \n //Loop through each tactic\n for( var i = 0; i < campaignItem.get('tactics'); i++ ) {\n \n //Switch to the tactic tab\n var tacticLabel = '#tactic-'+(i+1);\n tacticCollectionView.switchTab(tacticLabel);\n \n //Retrieve the View for the currently selected Tactic Model\n var currentTactic = Number(tacticCollectionView.activeTab.slice(-2))-1; //Calculate the View that corresponds to the currently active tactic.\n var thisTacticView = tacticViews[currentTactic];\n \n //Alert user and exit if image files have not been uploaded.\n if( thisTacticView.model.attributes.creatives == \"\" ) {\n alert('Tactic #'+ (i+1) +' is missing the creatives (images) required to run the ad. Please click the \"Upload files...\" button and upload these images.');\n return false;\n }\n \n //Alert user and exit if hyperlocal target was selected but no lat/longs are provided\n if( thisTacticView.model.attributes.geoTarget == \"hyperlocal\" ) {\n if( thisTacticView.model.attributes.hyper_local_lat.length == 0 ) {\n alert('A hyperlocal target for tactic #'+ (i+1) +' has been selected, but no Lat/Long coordinates have been provided. Please submit an address to retrieve Lat/Long coordinates.');\n return false;\n }\n \n //Alert user and exit if geographical target was selected but no zip codes were provided\n } else {\n if( thisTacticView.model.attributes.zipcodes.length == 0 ) {\n alert('A geographical target for tactic #'+ (i+1) +' has been selected, but no zip codes have been provided. Please provide zip codes.');\n return false;\n }\n }\n \n }\n \n //Return true by default.\n return true;\n }", "function goToNextPage() {\n\t\tif ( canNextPage() ) {\n\t\t\tgoToPage( currentPage() + 1 );\n\t\t}\n\t}", "function validateOnSubmit() {\n\n var elem;\n\n var errs=0;\n\n // execute all element validations in reverse order, so focus gets\n\n // set to the first one in error.\n\n if (!validateTelnr (document.forms.demo.telnr, 'inf_telnr', true)) errs += 1; \n\n if (!validateAge (document.forms.demo.age, 'inf_age', false)) errs += 1; \n\n if (!validateEmail (document.forms.demo.email, 'inf_email', true)) errs += 1; \n\n if (!validatePresent(document.forms.demo.from, 'inf_from')) errs += 1; \n\n\n\n if (errs>1) alert('There are fields which need correction before sending');\n\n if (errs==1) alert('There is a field which needs correction before sending');\n\n\n\n return (errs==0);\n\n }", "function navigate() {\n // Advance to next question by increasing the questionIndex value\n questionIndex++;\n // Verify condition of next question and\n if (questionIndex !== questionArray.length) {\n game();\n } else {\n endGame();\n }\n}", "function validate(){\r\n\tvar validableForms = $(\".validableForm\");\r\n\tfor(var i=0;i<validableForms.length;i++){\r\n\t\t$(validableForms[i]).validationEngine({promptPosition : \"bottomLeft\"\r\n\t\t\t , scroll: false});\r\n\t}\r\n}" ]
[ "0.71317196", "0.71317196", "0.7058191", "0.7058191", "0.6951164", "0.6631861", "0.6607814", "0.6533495", "0.6413473", "0.64059114", "0.6386095", "0.63504255", "0.6330983", "0.6321142", "0.6263472", "0.62310755", "0.62258863", "0.61797196", "0.61787224", "0.61752063", "0.6163866", "0.61495596", "0.61476296", "0.6147295", "0.6139764", "0.61313117", "0.6120801", "0.6115933", "0.61010367", "0.6093592", "0.60853165", "0.60650647", "0.60598594", "0.60595983", "0.60429966", "0.6036239", "0.6032876", "0.6028035", "0.60255903", "0.59976923", "0.5978656", "0.5974194", "0.5963093", "0.5951472", "0.5950373", "0.59407926", "0.5934008", "0.59261435", "0.5906095", "0.5882124", "0.5843955", "0.5839225", "0.58262944", "0.5820862", "0.5811671", "0.5797393", "0.5788543", "0.57710195", "0.5764585", "0.5763784", "0.5759948", "0.5734229", "0.57306087", "0.57289517", "0.5725252", "0.5718213", "0.5712971", "0.57061166", "0.5702385", "0.56913245", "0.5689054", "0.568742", "0.568715", "0.568394", "0.5682963", "0.56641376", "0.5663018", "0.5654611", "0.5651627", "0.56493604", "0.5634625", "0.56327045", "0.56326014", "0.56302226", "0.56281555", "0.5626029", "0.56253916", "0.56233275", "0.5617072", "0.5610656", "0.5610073", "0.561002", "0.5607331", "0.5605778", "0.5604313", "0.5603984", "0.56007683", "0.55940723", "0.559371", "0.55908835", "0.55904806" ]
0.0
-1
check for valid mail
function emailValidation() { let re = /\S+@\S+\.\S+/; if (re.test(emailText)==false) { setErrorEmail("אנא הזן אימייל תקין"); setValidEmail(false); } else { setErrorEmail(""); setValidEmail(true); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkmail(){\r\n\tif((/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(compMail.val())))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function checkMail()\n {\n email = $('#ftven_formabo_form_email').val();\n var emailPattern = /^[a-zA-Z0-9.!#$%&'*+\\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;\n return (emailPattern.test(email));\n }", "function checkmail(){\r\n\tif((/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(email.val())))\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function validarMail(mail){ \n cadena=/^([a-zA-Z0-9\\._-]+)@([a-zA-Z0-9\\._-]+)\\.([a-zA-Z0-9\\._-]+)$/; \n\tif(cadena.test(mail))\n return 1;\n else\n return 0;\n}", "function check_mail(mail_str){\r\n var reyx=/^([a-zA-Z0-9_\\.-])+@([a-zA-Z0-9_\\.-])+\\.([a-zA-Z0-9_-])+/;\r\n if(! reyx.exec(mail_str)) return false;\r\n return true;\r\n}", "function validateMail() {\r\n\t// empty field\r\n\tif (email.value == \"\") {\r\n\t\talertEmail.textContent = \"Email cannot be blank.\";\r\n\t\temail.focus();\r\n\t\treturn false;\r\n\t}\r\n\r\n\t// valid email\r\n\tif (!(/^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(email.value))) {\r\n\t\talertEmail.textContent = \"Enter a valid email address.\";\r\n\t\temail.focus();\r\n\t\treturn false;\r\n\t}\r\n}", "validateEmail(mail) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)) {\n return (true)\n }\n alert(\"You have entered an invalid email address!\")\n return (false)\n }", "function validiraj_mail(){\n\n var pattern = /^[a-zA-Z0-9]+@[a-z]{2,10}\\.[a-z]{2,4}$/;\n var tekst = document.getElementById(\"forma\").mail_input.value;\n var test = tekst.match(pattern);\n\n if (test == null) {\n document.getElementById(\"mail_error\").classList.remove(\"hidden\");\n valid_test = false;\n } else{\n console.log(\"validiran mail\");\n document.getElementById(\"mail_error\").classList.add(\"hidden\");\n }\n }", "function ValidateEmail(mail) \n{\n \n if (/^(([^<>()[\\]\\\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/.test(mail))\n {\n return (true)\n }\n return (false)\n}", "function emailIsValid() {\n\n var myPattern = /^[-a-z0-9~!$%^&*_=+}{\\'?]+(\\.[-a-z0-9~!$%^&*_=+}{\\'?]+)*@([a-z0-9_][-a-z0-9_]*(\\.[-a-z0-9_]+[a-z][a-z])|([0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}))(:[0-9]{1,5})?$/i;\n var emailValue = $mail.val();\n\n var isValid = emailValue.search(myPattern) >= 0;\n return (isValid);\n }", "function validateMail(){\n\t\tvar x=document.getElementById('email');\n\t\tvar atpos = x.indexOf(\"@\");\n\t\tvar dotpos = x.lastIndexOf(\".\");\n\t\tif (atpos < 1 || dotpos < atpos+2 || dotpos+2 >= x.length){\n\t\t alert(\"Not a valid e-mail address\");\n\t\t x.focus();\n\t\t return false;\n\t\t }\n\t}", "function validateEmail(mail)\n{\n return (/^\\w+([.-]?\\w+)*@\\w+([.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail))\n}", "function validateEmail(mail) \n { \n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)) \n { \n return (true);\n } \n return (false); \n}", "function isValidMail(email){\n\tvar Temp = email;\n\tif ((Temp==null)||(Temp==\"\")){\t\t\t\t\n\t\treturn false;\n\t}\n\telse{\n\t\tvar AtSym = Temp.indexOf('@');\n\t\tvar Period = Temp.lastIndexOf('.');\n\t\tvar Space = Temp.indexOf(' ');\n\t\tvar Length = Temp.length - 1 ; // Array is from 0 to length-1\n\t\t\tif ((AtSym < 1) || // '@' cannot be in first position\n\t \t\t(Period <= AtSym+1) || // Must be atleast one valid char btwn '@' and '.'\n\t\t \t(Period == Length ) || // Must be atleast one valid char after '.'\n\t\t\t (Space != -1)) // No empty spaces permitted\n\t\t { \n\t\t\t\t return false;\n\n\t \t\t}\n\t\treturn true;\n\t\t}\t\t\n}", "function valid(text, ismail) {\n ismail = typeof ismail != 'undefined' ? ismail : false;\n if (ismail)\n return /^[-a-z0-9!#$%&'*+/=?^_`{|}~]+(\\.[-a-z0-9!#$%&'*+/=?^_`{|}~]+)*@([a-z0-9]([-a-z0-9]{0,61}[a-z0-9])?\\.)*(aero|arpa|asia|biz|cat|com|coop|edu|gov|info|int|jobs|mil|mobi|museum|name|net|org|pro|tel|travel|[a-z][a-z])$/.test(text);\n else\n return !/^[ \\t\\r\\n\\v\\f]*$/.test(text);\n}", "function checkEmail() {}", "function validateEmail(mail)\n{\n if(/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)){ return true; }\n\treturn false;\n}", "function validateEmail(){\n\tvar re = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n var result = re.test($.txtfieldMail.value);\n if(result == 0){\n \t$.txtfieldMail.value = \"\";\n \tutilities.showAlert(Alloy.Globals.selectedLanguage.forgotUsername,Alloy.Globals.selectedLanguage.invalidmail,function(){});\n }\n}", "function emailValid(){\n if(/\\S+@\\S+\\.\\S+/g.test(email)){\n setErrors('')\n return true\n }else{\n setErrors('Email is not valid!')\n }\n return false\n }", "function validarEmail(txtMail) {\n patron = /^(([^<>()[\\]\\.,;:\\s@\\\"]+(\\.[^<>()[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$/;\n return patron.test(txtMail);\n}", "function isValidMail(email, errorContent) {\n var mailPattern = new RegExp('^[a-z0-9]+([_|\\.|-]{1}[a-z0-9]+)*@[a-z0-9]+([_|\\.|-]{1}[a-z0-9]+)*[\\.]{1}[a-z]{2,6}$', 'i');\n if (mailPattern.test(email)) {\n return (true);\n }\n else {\n if(errorContent)\n errorContent.innerText = MessagesHelper.TXT_EMAIL_INVALID;\n return (false);\n }\n }", "function checkEmail() {\r\n const emailValue = email.value.trim();\r\n\r\n var mailformat = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/;\r\n if (emailValue === '' || !emailValue.match(mailformat)) {\r\n isValid &= false;\r\n setErrorFor(email, 'Email not valid');\r\n return;\r\n }\r\n\r\n isValid &= true;\r\n}", "function emailIsValid(email) {\n return /\\S+@\\S+\\.\\S+/.test(email);\n }", "function isValidEmail(mail) {\n return /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,4})+$/.test(mail);\n}", "function validarEmail(mail)\n{\n\tif (mail==\"\" || ( mail.indexOf ('@', 0) != -1 && mail.indexOf ('.', 0) != -1 ))\n\t\treturn (true);\n\telse {\n\t\talert(\"Escriba una dirección de correo válida.\"); \n \treturn (false);\n\t}\n}", "function ValidarCampoEmail(mail) {\n expr = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n if (!expr.test(mail)) return false;\n else return true;\n}", "function checkEmail(mail) {\n var k = mail;\n for (var i = 0; i < k.length; i++)\n if ((k[i] == '@') || (k[i] == '.') || (k[i] == '_'))\n return true;\n return false;\n}", "function checkMail() {\n if (getMail().length > 0) {\n if (isSignExist() && isSignSame() && isCharbefSign() && isDotExist() && isDotSame() && isCharbefDotAfSign() && isAfterDot()) {\n return true;\n }\n else {\n return false;\n }\n }\n //nothing put in mail box\n else {\n document.eMail.uMail.style.borderColor = \"grey\";\n document.getElementById(\"errMail\").style.display = \"none\";\n return false;\n }\n}", "function checkMail(em) \r{\r\tvar error = \"\";\r\t\r\t// Valida el email\r\treg = /^(.+)@(.+)\\.(.{2,3})$/;\r\r\tif (!reg.test(em)) \r\t{\r\t\tdocument.getElementById(\"maillabel\").className = \"error\";\r\t\terror = \"<b>Invalid e-mail</b>\";\r\t}\r\r\treturn error;\r}", "function check_email() {\n\n\t\tvar pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/i);\n\t\n\t\tif(pattern.test($(\"#email\").val())) {\n\t\t\t$(\"#erroremail\").hide();\n\t\t} else {\n\t\t\t$(\"#erroremail\").html(\"Direccion inválida\");\n\t\t\t$(\"#erroremail\").show();\n\t\t\terror_email = true;\n\t\t}\n\t\n\t}", "function ValidateEmail(mail) \n{\n if (/^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(mail))\n {\n return true;\n }\n else{\n return false;\n }\n}", "function validateEmail(mail){\n\tatsign = mail.indexOf(\"@\");\n\tdot = mail.lastIndexOf(\".\");\n\n\tif((atsign < 1) || (dot < 1) || ((dot - atsign) < 2) || (dot == mail.length - 1)){\n\t\treturn false;\n\t}else{\n\t\treturn true;\n\t}\n}", "function email(){\n var emailReg =/[a-z].*(@)[a-z]*(.)[a-z]{2,}$/;\n var validEmail = document.getElementById('email').value;\n if (emailReg.test(validEmail) === false)\n {\n throw \"invalid email address\";\n }\n }", "function ValidateEmail(mail) {\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail)) {\n return (true)\n }\n //alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function validate_email() {\n return email.length > 0 && email.length < 50;\n }", "function validarEmail(email){expr=/^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;if(!expr.test(email)) return false;else return true;}", "function checkMail(email)\n{\n var str1=email;\n var arr=str1.split('@');\n var eFlag=true;\n if(arr.length != 2)\n {\n eFlag = false;\n }\n else if(arr[0].length <= 0 || arr[0].indexOf(' ') != -1 || arr[0].indexOf(\"'\") != -1 || arr[0].indexOf('\"') != -1 || arr[1].indexOf('.') == -1)\n {\n eFlag = false;\n }\n else\n {\n var dot=arr[1].split('.');\n if(dot.length < 2)\n {\n eFlag = false;\n }\n else\n {\n if(dot[0].length <= 0 || dot[0].indexOf(' ') != -1 || dot[0].indexOf('\"') != -1 || dot[0].indexOf(\"'\") != -1)\n {\n eFlag = false;\n }\n\n for(i=1;i < dot.length;i++)\n {\n if(dot[i].length <= 0 || dot[i].indexOf(' ') != -1 || dot[i].indexOf('\"') != -1 || dot[i].indexOf(\"'\") != -1 || dot[i].length > 4)\n {\n eFlag = false;\n }\n }\n }\n }\n return eFlag;\n}", "function checkMail(email)\n{\n var str1=email;\n var arr=str1.split('@');\n var eFlag=true;\n if(arr.length != 2)\n {\n eFlag = false;\n }\n else if(arr[0].length <= 0 || arr[0].indexOf(' ') != -1 || arr[0].indexOf(\"'\") != -1 || arr[0].indexOf('\"') != -1 || arr[1].indexOf('.') == -1)\n {\n eFlag = false;\n }\n else\n {\n var dot=arr[1].split('.');\n if(dot.length < 2)\n {\n eFlag = false;\n }\n else\n {\n if(dot[0].length <= 0 || dot[0].indexOf(' ') != -1 || dot[0].indexOf('\"') != -1 || dot[0].indexOf(\"'\") != -1)\n {\n eFlag = false;\n }\n\n for(i=1;i < dot.length;i++)\n {\n if(dot[i].length <= 0 || dot[i].indexOf(' ') != -1 || dot[i].indexOf('\"') != -1 || dot[i].indexOf(\"'\") != -1 || dot[i].length > 4)\n {\n eFlag = false;\n }\n }\n }\n }\n return eFlag;\n}", "function ValidateEmail(mail) \n{\n if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(mail))\n {\n return (true)\n }\n // alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function validateEmail(myMail){\n const reg = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n return reg.test(myMail);\n}", "function comprobar_mail(email){\n\tvar filter=/^[A-Za-z0-9][A-Za-z0-9_\\.]*@[A-Za-z0-9_]+.[A-Za-z0-9_.]+[A-za-z]$/;\n\tvar aux = filter.test(email);\n\tif(aux == true)\n\t\treturn false;\n\treturn true;\n}", "function validEMail(addr){\r\n\tvar filter = /^([\\d\\w\\.\\-\\+])+\\@(([\\d\\w\\-\\+])+\\.)+([a-zA-Z]{2,})$/;\r\n\treturn (filter.test(addr));\r\n}", "function ValidateEmail(mail) \n{\n if (/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\\.[a-zA-Z0-9-]+)*$/.test(mail))\n {\n return (true)\n }\n alert(\"You have entered an invalid email address!\")\n return (false)\n}", "function validarEmail(fr_correo) {\n\t\tvar expresionRegularEmail = /^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i; \n\t\tif( !(expresionRegularEmail.test(fr_correo)) || (fr_correo.length > 64) ) {\n\t\t\treturn false;\n \t} else {\n \t\treturn true;\n\t\t}\n}", "function validarEmail(email) {\n\n expr = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n if ( !expr.test(email) )\n swal(\"Error: Correo Incorrecto\", \"\", \"info\");\n \n\n }//end function validarEmail", "function validateEmail(mail)\n{\n var filter = /^([\\w-\\.]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([\\w-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$/;\n if(filter.test(mail))\n {\n return true;\n }\n else{\n return false;\n }\n}", "function validateEmail(mail){\n\tvar mailStr = mail[0].value;\n\tif(emptyString(mailStr))\t\t// return false if the mail is not specified.\n\t\treturn false;\n\t\n\t// trim spaces and replace slash with a comma.\n\tmailStr = mailStr.replace(/ /g,\"\");\n\tmailStr = mailStr.replace(/\\//g,\",\");\n\t\n\t// split string to validate all email addresses.\n\tvar mailArr = mailStr.split(\",\");\n\t\n\t// validate all email addresses, return false if one one the e-mail is wrong formatted\n\tfor(var i = 0; i < mailArr.length;i++){\n\t\tvar atpos=mailArr[i].indexOf(\"@\");\n\t\tvar dotpos=mailArr[i].lastIndexOf(\".\");\n\t\tif (atpos<1 || dotpos<atpos+2 || dotpos+2>=mailArr[i].length)\n\t\t\treturn false;\n\t}\n\t\n\t// Insert changes in the input field.\n\t$(\"#\" + mail[0].id).val(mailStr);\n\t\n\treturn true;\n}", "function validationMailValidator(element) {\n\n\tif (element.value == '')\n\t\treturn true;\n\n\treturn validateField(element, 'email');\n\n}", "function isEmailValid (body) {\n if ('email' in body &&\n validator.isEmail(body['email'] + '') &&\n validator.isLength(body['email'] + '', { min: 5, max: parseInt(maxEmailVarcharAmount) })) {\n console.log('email ' + body['email'] + ' pass')\n return true\n } else {\n console.log('email ' + body['email'] + ' fail')\n return false\n }\n}", "function checkEmail(email) \n{ \n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/; \n if(email.match(mailformat)) \n return true; \n else \n return false;\n}", "function validEmail(check){\n return /^\\w+@\\w+(\\.(\\w)+)$/i.test(check.value);\n}", "function isOkEmail() {\n\n //The program looks there is the right format.\n let indexOfAt = emailUser.value.indexOf('@');\n let textBeforeAt = emailUser.value.slice(0, indexOfAt);\n let textAfterAt = emailUser.value.slice(indexOfAt+1, emailUser.value.length);\n let indexOfDot = textAfterAt.indexOf('.');\n let textBeforeDot = textAfterAt.slice(0, indexOfDot);\n let textAfterDot = textAfterAt.slice(indexOfDot+1, emailUser.value.length);\n\n //fThe program that there are all the elements and later the right format\n if (emailUser.value === \"\") {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_mailEmpty_EM');\n okEmail = false;\n } else if (!emailUser.value.includes('@')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_At_EM');\n return false;\n } else if(textAfterAt.length == 0 || (textAfterAt.length == 1 && indexOfDot == 0)) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_domain_EM');\n return false;\n } else if (!emailUser.value.includes('.')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_no_dot_EM');\n return false;\n } else if (emailUser.value.includes(' ')) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_blank_Space_EM');\n return false;\n } else if (textBeforeAt.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textBeforeDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else if (textAfterDot.length === 0) {\n clearAllEmailErrors();\n errorIndication(emailUser, 'email_bad_Format_EM');\n return false;\n } else {\n clearAllEmailErrors();\n return true;\n }\n }", "function validar_email(email) {\r\n var patron = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\r\n return patron.test(email) ? true : false;\r\n }", "function validateEmail(email) {\n\tvar valid \n\treturn valid = /\\S+@\\S+\\.\\S+/.test(email);\n}", "function validateEmail() {\r\n var re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\r\n return re.test(email.val());\r\n}", "function validateEmail(email) \r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function regExpEmail() {\n // Récupération des données saisies\n const emailValid = contact.email;\n // Injection du HTML\n const checkEmail = document.querySelector(\"#emailErrorMsg\");\n\n // Indication de la bonne saisie ou l'erreur dans le HTML\n if (/^[a-zA-Z0-9.-_]+[@]{1}[a-zA-Z0-9.-_]+[.]{1}[a-z]{2,10}$/.test(emailValid)) {\n checkEmail.innerHTML = \"<i class='fas fa-check-circle form'></i>\";\n return true;\n } else {\n checkEmail.innerHTML = \"<i class='fas fa-times-circle form'></i> format incorrect\";\n }\n }", "function checkEmail() {\n var pattern = new RegExp(/^[+a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,4}$/i);\n \n if (pattern.test(emailInput.val())) {\n emailInput.removeClass(\"error\");\n $(\"#email_error_message\").hide();\n }\n else {\n $(\"#email_error_message\").html(\"Enter valid email address\");\n $(\"#email_error_message\").show();\n emailInput.addClass(\"error\");\n error_email = true;\n }\n }", "function email() {\n var errors = document.querySelector(\"#errors\");\n var email = document.querySelector(\"#email\");\n var string = email.value.trim();\n var patt = /^[a-z0-9_\\-\\.]+\\@[a-z]+\\.[a-z]{2,4}$/i;\n if(!patt.test(string)) {\n errorMessage(\"<p>Please enter a valid Email address</p>\");\n return false;\n } else {\n return true;\n }\n}", "function validate_Email(sender_email) {\n var expression = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n if (expression.test(sender_email)) {\n return true;\n }\n else {\n return false;\n }\n }", "function validate_Email(sender_email) {\n var expression = /^[\\w\\-\\.\\+]+\\@[a-zA-Z0-9\\.\\-]+\\.[a-zA-z0-9]{2,4}$/;\n if (expression.test(sender_email)) {\n return true;\n }\n else {\n return false;\n }\n }", "function checkEmail(element) {\n\t\tvar thisRow = element.parent().parent();\n\t\tvar title = thisRow.children().get(0).innerText;\n\t\tvar str = element.val().trim();\n\n\t\tvar regex = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\n\t\tif (!regex.test(str)) {\n\t\t\tif (thisRow.children().get(2) == undefined) {\n\t\t\t\tthisRow.append(\"<td class='validate'>\" + title + \" Wrong email format.</td>\");\n\t\t\t} else {\n\t\t\t\tthisRow.children().get(2).remove();\n\t\t\t\tthisRow.append(\"<td class='validate'>\" + title + \" Wrong email format.</td>\");\n\t\t\t}\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "function check_email_req(email){\n var testEmail = /^[A-Z0-9._%+-]+@([A-Z0-9-]+\\.)+[A-Z]{2,4}$/i;\n if (testEmail.test(email)){\n return true;\n }\n\n return false;\n }", "function emailValidation(){\n if (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(emailNode.value)){\n return true;\n }\n alert(\"You have entered an invalid email address!\");\n return false;\n }", "verifyEmail(value) {\n var emailRex = /^(([^<>()[\\]\\\\.,;:\\s@']+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+'))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if (emailRex.test(value)) {\n return true;\n }\n return false;\n }", "function validateEmail(anEmail) {\n var mailFormat = /^\\W+([\\.-]?\\W+)*@\\W+([\\.-]?\\W+)*(\\.\\W{2,3})+$/;\n if (anEmail.value.match(mailFormat)) {\n return true;\n } else {\n alert(\"The email format is wrong\");\n anEmail.style.border = \"2px solid red\";\n anEmail.focus();\n return false;\n }\n }", "function validate_email(field,alerttxt)\r\n{\r\n\tif (/^\\w+([\\+\\.-]?\\w+)*@\\w+([\\+\\.-]?\\w+)*(\\.\\w{2,6})+$/.test(field.value))\r\n\t{\r\n\t\treturn true;\r\n\t}\r\n\telse \r\n\t{\r\n\t\tshow_it(field,alerttxt)\r\n\t\treturn false;\r\n\t}\r\n}", "function validateEmail(email)\r\n{\r\n var re = /\\S+@\\S+\\.\\S+/;\r\n return re.test(email);\r\n}", "function checkEmail(n)\r\n{\r\n\treturn n.search(/^\\w+((-\\w+)|(\\.\\w+))*\\@[A-Za-z0-9]+((\\.|-)[A-Za-z0-9]+)*\\.[A-Za-z0-9]+$/)!=-1?!0:!1\r\n\t\r\n}", "function validarEmail() {\n // usaremos una expresion regular para que el mail cumpla un patron\n // \\S+ que comience con una secuencia de caracteres\n // seguido de una @exp\n // para terminar dos secuencias de caracteres con un punto entre ellas: \\S+\\.\\S+\n var exp = /\\S+@\\S+\\.\\S+/g;\n if (!exp.test(document.getElementById(\"email\").value)){\n document.getElementById(\"email\").value = \"error!\";\n document.getElementById(\"email\").focus();\n document.getElementById(\"email\").className=\"error\";\n document.getElementById(\"errores\").innerHTML = \"Error en el mail, formato no correcto.\";\n return false;\n }\n else {\n document.getElementById(\"email\").className=\"\";\n document.getElementById(\"errores\").innerHTML = \"\";\n return true;\n }\n}", "function checkEmail() {\n formMail = document.getElementById(\"inputMail\").value;\n if (formMail == \"\") {\n checkMessage += \"\\n\" + \"Renseigner votre adresse mail afin de valider la commande\";\n } else if (checkMail.test(formMail) == false) {\n checkMessage += \"\\n\" + \"Adresse mail invalide, vérifier votre adresse mail\";\n }\n}", "function checkmail(){ \n\n var exp=/^([\\w\\.\\-]+)@([\\w\\-]+)\\.([a-z]{2,3})((\\.[a-z]{2,3}?)?)$/; \n var mail=document.getElementById(\"email\");\nif(!exp.test(mail.value))\n {\n mail.style.border=\"solid red\";\n mail.focus();\n alert(\"email format is not valid\");\n return false;\n }else\n {\n mail.style.border=\"solid green\";\n //alert(\"valid email\");\n return true;\n }\n}", "function checkEmail() {\n\t\tvar email=document.sform.eml.value;\n\t\tif (email==\"\") {\n\t\t\talert (\"Please enter a valid email.\");\n\t\t\tdocument.sform.eml.focus();\n\t\t\treturn false;\n\t\t} \n\t\telse if (!(email.includes(\"@\"))) {\n\t\t\talert (\"Please enter a valid email.\");\n\t\t\tdocument.sform.eml.value=\"\";\n\t\t\tdocument.sform.eml.focus();\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "function emailValidator() {\n const divParent = email.parentNode\n const emailReg = new RegExp('^[a-zA-Z0-9.-_]+[@]{1}[a-zA-Z0-9.-_]+[.]{1}[a-z]{2,10}$', 'g') // Expression régulière à respecter\n if (!emailReg.test(email.value)) { // On teste l'email sur la base de la RegExp\n divParent.setAttribute('data-error-visible', 'true')\n divParent.setAttribute('data-error', 'Vous devez entrer votre email')\n return false\n } else {\n divParent.setAttribute('data-error-visible', 'false')\n return true\n }\n}", "function checkEmail(email) {\n var re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n if(re.test(email.value.trim())){\n showSuccess(email);\n } else {\n showError(email, 'Email is not valid');\n }\n\n}", "function validar_email(valor) \n{\n\tif (/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(valor))\n\t{\n\t\t//alert(\"La dirección de email \" + valor + \" es correcta.\") \n\t\treturn (true)\n\t} \n\telse \n\t{\n\t\t//alert(\"La dirección de email es incorrecta.\");\n\t\treturn (false);\n\t}\n}", "function validEmail(thisEmail){\n var isMatch = thisEmail.match(/^[a-z0-9\\_\\.]+(@)[a-z0-9\\-]+\\.[a-z]{2,3}$/)\n if(isMatch){\n return true;\n }else{\n return false;\n }\n}", "function verifyemail(addr){\n//\tif (document.layers||document.all){\n\t\treturn checkemail(addr);\n//\t}else{\n//\t\treturn true;\n//\t}\n}", "function isNotValidEmail(mail) {\n\treturn !/^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/.test(mail);\n}", "function emailCheck(email) {\n\tatSplit = email.split('@');\n\tif (atSplit.length == 2 && alphaNumCheck(atSplit[0])) {\n\t\tperiodSplit = atSplit[1].split('.')\n\t\tif (periodSplit.length == 2 && alphaNumCheck(periodSplit[0] + periodSplit[1])) {\n\t\t\treturn true;\n\t\t}\n\t}\n\tvalCheck = false;\n\treturn false;\n}", "function ValidateEmail(email)\n{\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "function emailIsValid (email) {\r\n return /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/.test(email)\r\n}", "function checkEmail(input){\r\n var errors = [], warns = [], invalidChars = [], email = input.value, atAt = email.indexOf('@'),\r\n localPart = email.slice(0, atAt > -1 ? atAt : email.length), errorText = '',\r\n domain = atAt == -1 ? '' : email.slice(atAt + 1), ats = 0, domainName = domain,\r\n domainDots = 0,\r\n validDomainChars = '-.abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0124356789',\r\n validLocalChars = '!#$%&*+/=?^_`{|}~' + validDomainChars;\r\n //Whole email\r\n if(email == '') warns.push('Ingresa tu correo electrónico.');\r\n if(atAt == 0) errors.push('El correo no puede comenzar con una arroba.');\r\n // Local part\r\n if(atAt == -1) warns.push('El correo debe contener una arroba.');\r\n if(localPart.indexOf('.') == 0)\r\n errors.push('La parte local no puede empezar con un punto.');\r\n else if(localPart.lastIndexOf('.') == atAt - 1 && localPart.lastIndexOf('.') > -1)\r\n errors.push('La parte local no puede terminar con un punto.');\r\n for(var i = 0; i < localPart.length; i++){\r\n if(validLocalChars.indexOf(localPart.charAt(i)) == -1)\r\n invalidChars.push(localPart.charAt(i) == ' ' ? 'espacio' : localPart.charAt(i));\r\n if(localPart.charAt(i) == '.' && i < localPart.length - 1)\r\n if(localPart.charAt(i+1) == '.')\r\n errors.push('La parte local no puede contener dos o más puntos consecutivos.');\r\n }\r\n if(invalidChars.length){\r\n for(i in invalidChars){\r\n errorText += invalidChars[i];\r\n }\r\n errors.push((invalidChars.length > 1 ? 'Los caracteres' : 'El caracter') + ' <b>' + errorText + '</b> no ' + (invalidChars.length > 1 ? 'están permitidos' : 'está permitido') + ' en la parte local.');\r\n invalidChars = [];\r\n }\r\n if(localPart.length > 64) errors.push('La parte local no puede tener más de 64 caracteres.');\r\n // Domain\r\n if(domain == '') warns.push('Ingresa el dominio.');\r\n else{\r\n if(domain.lastIndexOf('.') == domain.length - 1){\r\n warns.push('Ingresa un subdominio.');\r\n errors.push('El dominio no puede terminar con un punto.')\r\n }\r\n if(domain.indexOf('.') == 0) errors.push('El dominio no puede empezar con un punto.');\r\n for(var i = 0; i < domain.length; i++){\r\n if(validDomainChars.indexOf(domain.charAt(i)) == -1)\r\n invalidChars.push(domain.charAt(i) == ' ' ? 'espacio' : domain.charAt(i));\r\n if(domain.charAt(i) == '.' && i < domain.length){\r\n if(domain.charAt(i+1) == '.') errors.push('El dominio no puede tener dos o más puntos consecutivos.');\r\n domainDots++;\r\n }\r\n }\r\n if(invalidChars.length){\r\n for(i in invalidChars){\r\n errorText += invalidChars[i];\r\n }\r\n errors.push((invalidChars.length > 1 ? 'Los caracteres' : 'El caracter') + ' <b>' + errorText + '</b> no ' + (invalidChars.length > 1 ? 'están permitidos' : 'está permitido') + ' en el dominio.');\r\n }\r\n for(var i = 0; i < domainDots + 1; i++) {\r\n for(var ind = 0; ind < i; ind++){\r\n domainName = domainName.slice(domainName.indexOf('.') + 1);\r\n }\r\n domainName = domainName.slice(0, domainName.indexOf('.') > -1 ? domainName.indexOf('.') : domainName.length);\r\n if(domainName.length > 63 && domainDots)\r\n errors.push('El subdominio ' + domainName + ' no debe contener mas de 63 caracteres.');\r\n if(domainName.indexOf('-') == 0)\r\n errors.push('El ' + (domainDots == 0 ? 'dominio' : 'subdominio \"' + domainName + '\"') + ' no puede empezar con un guión.');\r\n if(domainName.lastIndexOf('-') == domainName.length - 1 && domainName)\r\n errors.push('El ' + (domainDots == 0 ? 'dominio' : 'subdominio \"' + domainName + '\"') + ' no puede terminar con un guión.');\r\n domainName = domain;\r\n }\r\n if(domain.length > 255) errors.push(\"El dominio no puede contener mas de 255 caracteres.\");\r\n }\r\n //Whole email\r\n for(var i = 0; i < email.length; i++){\r\n if(email.charAt(i) == '@') ats++;\r\n }\r\n if(ats > 1) errors.push('El correo no puede contener mas de una arroba.');\r\n if(email.length > 320) errors.push('El correo no debe contener mas de 320 caracteres.');\r\n for(i in warns){\r\n console.log(warns[i]);\r\n }\r\n}", "function checkemail(str) {\n\tvar filter =/^\\w+[\\+\\.\\w-]*@([\\w-]+\\.)*\\w+[\\w-]*\\.([a-z]{2,7}|\\d+)$/i;\n\treturn (filter.test(str))\n}", "function validarEmail(email) {\n\n var patronArroba = /[@]/;\n\n if (patronArroba.test(email)) { //reviso que exista una @\n\n var dominio = email.split(\"@\")[1]; //divido donde halla una @\n if (dominio == 'gmail.com') {\n return 'success';\n } else {\n return 'dominio';\n }\n\n } else {\n return 'formato';\n }\n\n}", "function emailOk(email) {\n const re = /^(([^<>()[\\]\\\\.,;:\\s@\"]+(\\.[^<>()[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n}", "function validateEmail(){\r\n\t\tvar x = document.survey_form.email.value; //get the value\r\n\t\tvar emailPattern = /^[a-zA-Z._-]{1,25}[@][a-zA-Z]{1,25}[.][a-zA-Z]{3}$/; //variable storing the pattern\r\n\t\tvar emailPattern2 = /^[a-zA-Z._-]{1,25}[@][a-zA-Z]{1,25}[.][a-zA-Z]{1,25}[.][a-zA-Z]{3}$/; //variable storing the pattern\r\n\t\tif(emailPattern.test(x) ||emailPattern2.test(x)){;}\r\n\t\telse{alert(\"Please enter an email address. For example: [email protected]\")}\r\n\t}", "function checkemail(str){\n\tvar testresults = false;\n\tvar filter=/^([\\w-]+(?:\\.[\\w-]+)*)@((?:[\\w-]+\\.)*\\w[\\w-]{0,66})\\.([a-z]{2,6}(?:\\.[a-z]{2})?)$/i;\n\t\tif (filter.test(str)){\n\t\t\ttestresults=true;\n\t\t}\n\treturn (testresults);\n}", "function ValidateEmail(inputText){\n var mailformat = /^\\w+([\\.-]?\\w+)*@\\w+([\\.-]?\\w+)*(\\.\\w{2,3})+$/;\n if(inputText.match(mailformat))\n return true;\n else\n return false;\n }", "function validateEmail(email) {\n\t\tvar re = /\\S+@\\S+\\.\\S+/;\n\t\treturn re.test(email);\n\t}", "function valid_email(email) {\n var re = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n return re.test(email);\n }", "function checkEmail(email) {\n\n if (!email.match(emailRegex)) {\n emailError.textContent = 'Veuillez entrer une adresse mail valide.';\n formSub.email.classList.add('invalid');\n emailValid = false;\n } else {\n emailError.textContent = '';\n formSub.email.classList.remove('invalid');\n formSub.email.classList.add('valid');\n emailValid = true;\n }\n}", "function validateEmail(addr,man,db) {\n\tif (addr == '' && man) {\n\t if (db) alert('email address is mandatory');\n\t return false;\n\t}\n\tvar invalidChars = '\\/\\'\\\\ \";:?!()[]\\{\\}^|';\n\tfor (i=0; i<invalidChars.length; i++) {\n\t if (addr.indexOf(invalidChars.charAt(i),0) > -1) {\n\t\t if (db) alert('email address contains invalid characters');\n\t\t return false;\n\t }\n\t}\n\tfor (i=0; i<addr.length; i++) {\n\t if (addr.charCodeAt(i)>127) {\n\t\t if (db) alert(\"email address contains non ascii characters.\");\n\t\t return false;\n\t }\n\t}\n\t\n\tvar atPos = addr.indexOf('@',0);\n\tif (atPos == -1) {\n\t if (db) alert('email address must contain an @');\n\t return false;\n\t}\n\tif (atPos == 0) {\n\t if (db) alert('email address must not start with @');\n\t return false;\n\t}\n\tif (addr.indexOf('@', atPos + 1) > - 1) {\n\t if (db) alert('email address must contain only one @');\n\t return false;\n\t}\n\tif (addr.indexOf('.', atPos) == -1) {\n\t if (db) alert('email address must contain a period in the domain name');\n\t return false;\n\t}\n\tif (addr.indexOf('@.',0) != -1) {\n\t if (db) alert('period must not immediately follow @ in email address');\n\t return false;\n\t}\n\tif (addr.indexOf('.@',0) != -1){\n\t if (db) alert('period must not immediately precede @ in email address');\n\t return false;\n\t}\n\tif (addr.indexOf('..',0) != -1) {\n\t if (db) alert('two periods must not be adjacent in email address');\n\t return false;\n\t}\n\tvar suffix = addr.substring(addr.lastIndexOf('.')+1);\n\tif (suffix.length != 2 && suffix != 'com' && suffix != 'net' && suffix != 'org' && suffix != 'edu' && suffix != 'int' && suffix != 'mil' && suffix != 'gov' & suffix != 'arpa' && suffix != 'biz' && suffix != 'aero' && suffix != 'name' && suffix != 'coop' && suffix != 'info' && suffix != 'pro' && suffix != 'museum') {\n\t if (db) alert('invalid primary domain in email address');\n\t return false;\n\t}\n\treturn true;\n}", "function validateEmail(email) {\n var re = /\\S+@\\S+\\.\\S+/;\n return re.test(email);\n}", "function validar_email(campo){\nvar email = /^([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,4})+$/;\nreturn email.test(campo);\n}" ]
[ "0.8023664", "0.7806133", "0.77738947", "0.77203655", "0.7699831", "0.7600315", "0.7530985", "0.7529407", "0.75201476", "0.751663", "0.75128525", "0.7510788", "0.7491818", "0.7486242", "0.7466248", "0.7463119", "0.74416625", "0.7432805", "0.743129", "0.7430499", "0.7429546", "0.74261856", "0.74184734", "0.7412924", "0.74122894", "0.74060977", "0.7388713", "0.73868686", "0.73427105", "0.72873694", "0.72807026", "0.72734755", "0.72285306", "0.7218288", "0.72014254", "0.71974534", "0.71909785", "0.71909785", "0.7159591", "0.7154215", "0.7153701", "0.7130797", "0.71265227", "0.711954", "0.71099067", "0.7109539", "0.7075056", "0.70718354", "0.70679617", "0.70410246", "0.70223284", "0.7010441", "0.7010183", "0.70068157", "0.7000353", "0.6995275", "0.69873685", "0.69860715", "0.69762784", "0.69701564", "0.69701564", "0.6958295", "0.69463885", "0.69463885", "0.69463885", "0.69463885", "0.69463885", "0.6945924", "0.69402593", "0.6935008", "0.6933865", "0.69278616", "0.69236296", "0.6913701", "0.6913689", "0.6911816", "0.690459", "0.689799", "0.688145", "0.68778235", "0.68719697", "0.6870204", "0.6868667", "0.6867987", "0.6867237", "0.68615663", "0.68601495", "0.6855027", "0.68383074", "0.68320787", "0.6829857", "0.68218565", "0.6820599", "0.68070513", "0.679577", "0.67929006", "0.6791431", "0.67879903", "0.6784436", "0.6779904" ]
0.7249135
32
check for valid name
function nameValidation() { if (nameText == password) { navigation.navigate("AdminAuth"); } else{ let re = /^[\u0590-\u05FF]*$/; if(re.test(nameText)==false) { setErrorName("שם לא תקין (אנא הזן שם בעברית)"); setValidName(false); } else { setErrorName(""); setValidName(true); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static isNameValid (name) {\n return /^\\w+$/.test(name)\n }", "function isValidName(str) { return NAME_PATTERN.test(str); }", "function isValidName(str) { return NAME_PATTERN.test(str); }", "function isNameValid(name) {\n return /^[A-Za-z0-9_]+$/.test(name)\n}", "static isNameValid(newName) {\n var pattern = new RegExp(\"^[a-zA-Z_][a-zA-Z_0-9]{1,50}$\");\n if (pattern.test(newName)) {\n return true;\n }\n else {\n return false;\n }\n }", "function nameValidator() {\n const nameValue = nameInput.value;\n const validName = /.+/.test(nameValue); \n return validName;\n}", "_isValidName(name) {\n return Boolean(name.match(/^[a-z][a-z0-9_.\\-]*$/i));\n }", "validName(name) {\n const validator = new RegExp(/^[a-zA-Z0-9]+$/);\n return validator.test(name);\n }", "function checkName(name){\r\n\tif(/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(name))\t\t\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function checkName(name){\r\n\tif(/^[A-Za-z0-9]+(?:[ _-][A-Za-z0-9]+)*$/.test(name))\t\t\r\n\t\treturn true;\r\n\treturn false;\r\n}", "function isValidName(name) {\nvar i = 0;\n\tfor ( i = 0; i < name.length; i++ ) {\n\t\tif ( isNameUnsafe(name.charAt(i)) == true )\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "function isValidName(name) {\n if (typeof name === \"string\" && name.length > 3 && name.length < 12) {\n return true;\n }\n\n return false;\n }", "function nameIsValid() {\n var nameValue = $name.val();\n return (nameValue.length > 0 && !$.isNumeric(nameValue)) ;\n }", "function isValidName(name) {\r\n return /^[A-Za-z][A-Za-z\\'\\-]+([\\ A-Za-z][A-Za-z\\'\\-]+)*/.test(name);\r\n}", "function isValidName(data) {\n var re = /^[a-zA-Z0-9_\\- ]*$/;\n\n return re.test(data);\n }", "function valid_name(name) {\n\tvar reg =/^([\\x20-\\x21]|[\\x23-\\x5b]|[\\x5d-\\x7e])*$/;\n\tif (!reg.test(name)) {\n\t\treturn false;\n\t} \n\treturn true;\n}", "function validateName (name) {\n return /\\S+/.test(name)\n}", "function isValidName(name) {\r\n return name.trim().length > 2;\r\n }", "function validateName(name) {\n var iChars = \"!@#$%^&*()+=-[]\\';,./{}|<>?~_\";\n for (var i = 0; i < name.length; i++) {\n \tif (iChars.indexOf(name.charAt(i)) != -1) {\n \treturn true;\n \t}\n }\n}", "function isValidName(name) {\n if (name.length >= 3 && name != null) {\n return true;\n }\n return false;\n}", "function assertValidName(name) {\n\t (0, _invariant2.default)(NAME_RX.test(name), 'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.');\n\t}", "function assertValidName(name) {\n\t (0, _jsutilsInvariant2['default'])(NAME_RX.test(name), 'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.');\n\t}", "isNameValid(name) {\n let workString = name;\n let regExpOnlySpaces = /\\S/;\n \n if(!workString.match(regExpOnlySpaces)){\n return false;\n }\n if(workString.length > 15 || workString.length < 5){\n return false;\n }\n \n return true;\n \n }", "function validate_name(){\n name_outcome = validate.validateStr(name); //bool\n checkForm();\n }", "function isFilenameValid(name) {\n return /^[A-Za-z0-9][A-Za-z0-9\\._\\-]*$/.test(name)\n}", "function validName(sprintname) {\n if (!sprintname)\n return false;\n return true;\n}", "function validateName(name) {\n return /^[a-zA-Z\\s]+$/.test(name);\n }", "function validateName(name){\r\n\tvar regexLetters = /^[A-Za-z]+$/;\r\n\t\r\n\tif(!regexLetters.test(name)){\r\n\t\treturn false;\r\n\t}\r\n\tif(name.length < 3){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function isNameValid (element){\n return /^[a-z]*$/i.test(element);\n\n}", "function assertValidName(name) {\n (0, _jsutilsInvariant2['default'])(NAME_RX.test(name), 'Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.');\n}", "function isValidName(name) {\n var alphaExp = /^[A-Za-z]+( [A-Za-z]+)*$/;\n if (name.match(alphaExp))\n return true;\n else\n return false;\n}", "function validateName(e) {\n var re = /^[a-zA-Z]+$/;\n return re.test(e);\n}", "function badName(name) {\r\n if (name.trim() === \"\") {\r\n return true;\r\n }\r\n return false;\r\n}", "function validName(name,currName) {\n if(name === currName) {\n return \"Names match.<br>\";\n }\n if(name === \"\" || /[0-9a-zA-Z ]+/.test(name)) {\n return \"\";\n } \n return \"Invalid name.<br>\";\n}", "validateName() {\n // Do not delete this internal method.\n this.name = this.name.replace(/[^a-z0-9]/gi, '_').toLowerCase();\n }", "function checkName(name) {\n return /^[a-z, A-Z]+\\s*$/.test(name);\n}", "function isNotValidName(name) {\n\treturn !/^[a-zA-Z]{1,60}\\s?[a-zA-Z]{1,30}$/.test(name);\n}", "function isName(c) {\n return (ch >= 'a' && ch <= 'z') ||\n (ch >= 'A' && ch <= 'Z') ||\n (ch >= '0' && ch <= '9') ||\n '-_*.:#[]'.indexOf(c) >= 0;\n }", "function validate_name(input_name) {\n\tvar re = /(?=.*[a-zA-Z ])^[a-zA-Z ]{5,100}$/;\n\treturn re.test(input_name);\n}", "function validateName(event) {\n char=event.which;\n if(char >31 && char !=32 && (char <65 || char >90) && (char <97 || char >122)) {\n return false;\n }\n}", "function isValidName(name) {\n if (typeof name !== \"string\") return false;\n if (name.length === 0 || name.length === 1 || Number(name) === 0) return false;\n const splittedArray = name.trim().split(\" \")\n return !splittedArray.some(item => item.length === 1);\n}", "function nameCheck(entry) {\n\tlet regex = /^[A-Z]+$/i;\n\tif (entry != null && entry.match(regex)) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}", "function validateName(name) {\n return (!name.match('.*\\\\d+.*') && name.length < 20 && isNotEmpty(name));\n}", "function isName(name){\n return /^[A-Za-z\\s]+$/.test(name)\n}", "function isValidName(username) {\n return /^[A-z ]+$/.test(username);\n }", "isNameValid(playerName) {\n if (!playerName) {\n alert('Error. Empty Name');\n return false;\n }\n if (playerName.length > 15) {\n alert('Name should not exceed 15 characters.');\n this.changeNameClickHandler();\n return false;\n }\n return true;\n }", "function isValidName(name) {\n // must be a string\n // must be non empty\n // must contain non-whitespace of at least 3 chars\n \n \n let typeOfName = typeof name === \"string\";\n let checkEmptiness = name.length > 0 ;\n let checkLength = name.split(\" \").join(\"\").length > 0;\n \n return typeOfName && checkEmptiness && checkLength;\n}", "function nameValidate() {\r\n const nameRegex = /^([A-Z][a-z]{2,9})(\\s?[a-zA-Z]{3,10})?$/;\r\n wrongInp.classList.replace(\"d-block\", \"d-none\");\r\n rightInp.classList.replace(\"d-block\", \"d-none\");\r\n\r\n if (nameRegex.test(suNameInput.value) == true && suNameInput.value != \"\") {\r\n suNameInput.classList.add(\"is-valid\");\r\n suNameInput.classList.remove(\"is-invalid\");\r\n suNameAlert.classList.replace(\"d-block\", \"d-none\");\r\n return true;\r\n } else {\r\n suNameInput.classList.add(\"is-invalid\");\r\n suNameInput.classList.remove(\"is-valid\");\r\n suNameAlert.classList.replace(\"d-none\", \"d-block\");\r\n return false;\r\n }\r\n }", "function isValidName(string) {\n\t\tvar test = new RegExp('[a-z]+[.]?[a-z]+', 'i');\n\t\treturn test.test(string);\n\t}", "function checkUser(name){\n\tvar patt = /^[a-zA-Z0-9_-]+$/;\n\tif(name == null || name.match(patt) == null || name.length == 0){\n\t\treturn false;\t\n\t}\t\t\t\n\treturn true;\n}", "function nameCheck(name) {\n if (name.indexOf('\\\\') !== -1) {\n return false;\n }\n\n var reg = new RegExp('[*:/?<>\\\"|\\\\x5c]', 'g');\n if (reg.test(name)) {\n // invalid file or folder name.\n return false;\n }\n return true;\n}", "function ValidateUserName(name) {\n var expr = /^[a-zA-Z0-9]+$/;\n return expr.test(name);\n}", "function validateName (nameValue) {\n\t \tfor (i =0; i < nameValue.length; i++) {\n\t \t\t// Raine: charCodeAt takes a single parameter, the index of the character. If you don't pass anything,\n\t \t\t// it's going to interpret undefined as 0, but you should really pass 0 explicitly. In this case you\n\t \t\t// can just use nameValue.charCodeAt(i); David: done\n\t \t\tvar utf8 = nameValue[i].charCodeAt(i);\n\n\t \t\t// Raine: This would be easier to understand if it was abstracted into two separate functions, \n\t \t\t// isLowerCaseLetter and isUpperCaseLetter. Anything to break apart functionality into small,\n\t \t\t// meaningful chunks is a good thing. David: done\n\t \t\tif (!(isUpperCaseLetter(utf8)|| isLowerCaseLetter(utf8))) {\n\t \t\t\treturn false;\n\t \t\t}\t\t\n\t\t}\n\t\treturn true;\n\t}", "function $isValidName(name) {\n var isValid = true, errMsgTitle, errMsgDesc;\n\n /* isEmpty? */\n if (!name) {\n isValid = false;\n errMsgTitle = \"MESSAGE_ERROR_INVALID_WIDGETNAME_TITLE\";\n errMsgDesc = \"MESSAGE_ERROR_INVALID_WIDGETNAME_DESC\";\n } else if (nameIdMap[name]) { /* check for duplicate name */\n isValid = false;\n errMsgTitle = \"MESSAGE_ERROR_DUPLICATE_WIDGETNAME_TITLE\";\n errMsgDesc = \"MESSAGE_ERROR_DUPLICATE_WIDGETNAME_DESC\";\n }\n\n /* name is not valid, show the error message */\n if (!isValid) {\n wmToaster.show(\"error\", $rootScope.locale[errMsgTitle], $rootScope.locale[errMsgDesc]);\n }\n\n return isValid;\n }", "function isValidName(name){\n if (typeof(name) === \"string\"){\n var trimmedName = name.trim();\n var splittedName = trimmedName.split(\" \");\n console.log(splittedName);\n for (var i =0; i<splittedName.length; i++) {\n if(splittedName[i].length <= 1) {\n //throw \"Parameter is not acceptable\";\n result false;\n }\n \n else {return true;}\n }\n }\n else {\n //throw \"Parameter is not acceptable\";\n return false;\n\n }\n}", "function validate_name(){\n name_outcome = validate.validateStr(name); //bool\n \n if(!name_outcome){ //if incorrect data - inform user\n $('#name_error').text('* please enter a valid name');\n }else{\n $('#name_error').text('');\n }\n checkForm();\n }", "function validateName(name){\n if( name.value == null || name.value.length == 0 || /^\\s+$/.test(name.value) ) {\n document.querySelector('.name-error').style.display = \"inline\";\n return false;\n };\n document.querySelector('.name-error').style.display = \"none\";\n return true;\n}", "function validateName(name) {\n const regex = /^([a-zA-Z]+\\s)*[a-zA-Z]+$/;\n if (regex.test(name)) {\n return true;\n }\n else {\n return false;\n }\n}", "function isValidName(encodingName) {\n return fixEncoding(encodingName) !== undefined;\n}", "function namecheck(element)\n{\n\tvar re = /^[A-Za-z\\s.]+$/;\n if(re.test(element))\n \t{\n\t\treturn true;\n\t}\n else\n {\n\t\treturn false;\n\t}\n}", "function validateName () {\n let username = nameInput.value;\n\n if (username.length > 0) {\n isValid(nameInput);\n isNameValid = true;\n } else {\n isInvalid(nameInput);\n isNameValid = false;\n }\n}", "validateName() {\n const name = this.state.newName;\n return !NewRecipe.validInput(name) || name.length > 80 ? 'error' : null;\n }", "function validateName(nameInput) {\n var errMsg = '';\n\n // INVALID: empty name field\n var name = String(nameInput)\n if (name.length == 0) {\n errMsg = 'Name cannot be empty. ';\n }\n\n // INVALID whitespace in name or F/L name has multiple words\n var stringArray = String(name).split(/(\\s+)/);\n if (stringArray.length > 1) { \n errMsg = errMsg + 'Invalid space in name. ';\n }\n\n // INVALID: name has non-alphabet characters \n var letters = /^[A-Za-z]+$/;\n if(!(name.match(letters))) {\n errMsg = errMsg + 'Name Can Not Have Non-Alphabet Characters or numbers';\n }\n\n // Concatenate all errors\n if (errMsg.length != 0) {\n return errMsg;\n }\n\n // Valid Name\n return '';\n }", "function isValidName(str) {\n var pattern = /^[a-zA-Z_\\.0-9\\s]{1,20}$/;\n return str.match(pattern); \n}", "function nameCheck(name) {\n return /\\d/.test(name);\n }", "function isValidName(el){\n\n var regex = new RegExp(/^([^0-9%+=/#@&|{}£^\\[\\]()*_°]*)$/);\n return regex.test($.trim(el.val()));\n\n}", "function assertValidName(name, isIntrospection) {\n if (!name || typeof name !== 'string') {\n throw new Error('Must be named. Unexpected name: ' + name + '.');\n }\n if (!isIntrospection && !hasWarnedAboutDunder && !noNameWarning && name.slice(0, 2) === '__') {\n hasWarnedAboutDunder = true;\n /* eslint-disable no-console */\n if (console && console.warn) {\n var error = new Error('Name \"' + name + '\" must not begin with \"__\", which is reserved by ' + 'GraphQL introspection. In a future release of graphql this will ' + 'become a hard error.');\n console.warn(formatWarning(error));\n }\n /* eslint-enable no-console */\n }\n if (!NAME_RX.test(name)) {\n throw new Error('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.');\n }\n}", "function assertValidName(name, isIntrospection) {\n if (!name || typeof name !== 'string') {\n throw new Error('Must be named. Unexpected name: ' + name + '.');\n }\n if (!isIntrospection && !hasWarnedAboutDunder && !noNameWarning && name.slice(0, 2) === '__') {\n hasWarnedAboutDunder = true;\n /* eslint-disable no-console */\n if (console && console.warn) {\n var error = new Error('Name \"' + name + '\" must not begin with \"__\", which is reserved by ' + 'GraphQL introspection. In a future release of graphql this will ' + 'become a hard error.');\n console.warn(formatWarning(error));\n }\n /* eslint-enable no-console */\n }\n if (!NAME_RX.test(name)) {\n throw new Error('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.');\n }\n}", "function assertValidName(name, isIntrospection) {\n if (!name || typeof name !== 'string') {\n throw new Error('Must be named. Unexpected name: ' + name + '.');\n }\n if (!isIntrospection && !hasWarnedAboutDunder && !noNameWarning && name.slice(0, 2) === '__') {\n hasWarnedAboutDunder = true;\n /* eslint-disable no-console */\n if (console && console.warn) {\n var error = new Error('Name \"' + name + '\" must not begin with \"__\", which is reserved by ' + 'GraphQL introspection. In a future release of graphql this will ' + 'become a hard error.');\n console.warn(formatWarning(error));\n }\n /* eslint-enable no-console */\n }\n if (!NAME_RX.test(name)) {\n throw new Error('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but \"' + name + '\" does not.');\n }\n}", "function isValidName(text){\n const isValid = /^.+$/.test(text);\n const target = $('#name');\n addOrRemoveInvalidInputClass(target, isValid);\n return isValid;\n}", "function checkIfNoIllegalCharacters ( name ) {\n return ( name.indexOf(\".\") === -1 ) &&\n ( name.indexOf(\"/\") === -1 ) &&\n ( name.indexOf(\":\") === -1) &&\n ( name.indexOf(\"*\") === -1 );\n }", "function validateName(x) {\n if (!/^\\S(?!.*\\s{2})(?!=.*[0-9]).{2,}$/.test(x.trim())) {\n // x cannot contain digits, 2 consecutive spaces and must be at least 2 characters long (not including leading and trailing space characters)\n return false;\n }\n return true;\n}", "function assertValidName(name) {\n var error = isValidNameError(name);\n\n if (error) {\n throw error;\n }\n\n return name;\n}", "function assertValidName(name) {\n var error = isValidNameError(name);\n\n if (error) {\n throw error;\n }\n\n return name;\n}", "function assertValidName(name) {\n var error = isValidNameError(name);\n\n if (error) {\n throw error;\n }\n\n return name;\n}", "function assertValidName(name) {\n var error = isValidNameError(name);\n\n if (error) {\n throw error;\n }\n\n return name;\n}", "function assertValidName(name) {\n var error = isValidNameError(name);\n\n if (error) {\n throw error;\n }\n\n return name;\n}", "function isName(code) {\n return isNameStart(code) || isDigit(code) || code === 0x002D;\n}", "function isValidName() {\r\n var x = document.getElementById(\"Name\");\r\n var regex = /^[a-zA-Z]+(([',. -][a-zA-Z ])?[a-zA-Z]*)*$/;\r\n if (!x.value.match(regex)) {\r\n document.getElementById('validName').style.display = \"block\";\r\n document.getElementById('validNameSpace').style.display = \"block\";\r\n isName = false;\r\n }\r\n else {\r\n document.getElementById('validName').style.display = \"none\";\r\n document.getElementById('validNameSpace').style.display = \"none\";\r\n isName = true;\r\n }\r\n}", "function nameValid() {\n const nameValue = nameInput.value;\n const testName = /^[a-z\\s]+ [a-z\\s]+$/i.test(nameValue);\n \n if (testName === true) {\n nameInput.style.borderColor = 'white';\n displayError(nameInput, '', 'name-error');\n return true;\n } else {\n nameInput.style.borderColor = 'red';\n displayError(nameInput, 'Please include both your first and last name.', 'name-error');\n return false;\n };\n}", "validateName () {\n\t\tlet error = this.validator.validateString(this.attributes.name);\n\t\tif (error) {\n\t\t\treturn { name: error };\n\t\t}\n\t}", "_isValid(name) {\n return name.length <= this._MAX_LENGTH && this._isPrintableString(name);\n }", "function validateName(){\r\n\t\tvar n = document.survey_form.name.value; //get the value\r\n\t\tvar namePattern = /^[a-zA-Z\\s]+$/; //variable storing the pattern\r\n\t\tif(namePattern.test(n)){;}\r\n\t\telse{alert(\"Please enter only alpabetical characters (A-Z).\" )}\r\n\t}", "function validateName(fields, data, errors) {\n var re = /^[a-zA-Záéíóäëiöúàèììù_ ]{2,}$/;\n if (!(re.test(data[\"nom\"].value)) || !(re.test(data[\"prenom\"].value))) {\n errors.push(\"Les noms et prénoms doivent contenir uniquement des\" +\n \" lettres, espaces, tirets et au minimum 2 caractères.\");\n }\n}", "function validateListName(name) {\n\t\tvar isValid = true;\n\n\t\tname = $.trim(name);\n\n\t\tif (name === \"\") {\n\t\t\t// (Please enter a name for your list)\n\t\t\tshowInlineError('Please enter a name for your list');\n\t\t\tisValid = false;\n\t\t} else if (name.length > 50) {\n\t\t\t// (You have entered more than 50 characters. Please enter a different name.)\n\t\t\tshowInlineError('You have entered more than 50 characters. Please enter a different name.');\n\t\t\tisValid = false;\n\t\t} else if (name.match(/[`<>\\/~]+.*$/)) {\n\t\t\t// (You have entered an invalid character. Only a-z, 0-9, ! @ # $ % ^ & ( ) - _ + = , . ? \\\" ' \\ : are allowed. Please try again.)\n\t\t\tshowInlineError('You have entered an invalid character. Only a-z, 0-9, ! @ # $ % ^ & ( ) - _ + = , . ? \" \\' \\ : are allowed. Please try again.');\n\t\t\tisValid = false;\n\t\t}\n\t\treturn isValid;\n\t}", "function checkName() {\n // Start isValid as false\n let isValid = false;\n // Min/max character count\n const min = 3,\n max = 30;\n // Trim the name input value\n const name = nameInput.value.trim();\n\n // Check if name input is empty\n if (isEmpty(name)) {\n showError(nameInput, 'Name cannot be blank');\n // Check if name input is at least 3 characters and no more than 30 characters\n } else if (!isBetween(name.length, min, max)) {\n showError(nameInput, `Name must be between ${min} and ${max} characters`);\n // Otherwise, clear the error and set isValid to true\n } else {\n clearError(nameInput);\n isValid = true;\n }\n return isValid;\n}", "function validateName(data) {\n\tvar error = \"\";\n\tvar re = /^[a-zA-Z ]*$/;\n\tif (!re.test(data.value)) {\n\t\tdata.style.background = \"Red\";\n\t\tdocument.getElementById(\"nameValidationError\").innerHTML =\n\t\t\t\"Only alphabets are allowed\";\n\t\tvar error = \"1\";\n\t} else {\n\t\tdata.style.background = 'url(\"assets/back-blur3.jpg\")';\n\t\tdocument.getElementById(\"nameValidationError\").innerHTML = \"\";\n\t}\n\treturn error;\n}", "validateIntentName(name){\n var regex = /[a-zA-Z\\-0-9]+([_]|[-]|[a-zA-Z\\-0-9])*$/;\n return regex.test(name);\n }", "function validateSingleName(val){\n var keymash = /(([b-df-hj-np-tv-z])(?!\\2)){5}/;\n var v = trim(val);\n return (v != null && v.length >= 2 && !keymash.test(v))\n}", "function nameValidate(name, password) {\n var errMsg = \"\";\n if(!RegExp(/^.{3,15}$/).test(name)) {\n errMsg += \"Name must be between 3 - 15 characters<br>\";\n }\n if(!RegExp(/^[a-z0-9_']*$/i).test(name)) {\n errMsg += \"Name can only contain alphanumeric characters and _ or \\'<br>\";\n }\n if(!RegExp(/^[a-zA-Z0-9!@#$%^&*]*$/).test(password)) {\n errMsg += \"Password can only contain alphanumberic characters or !@#$%^&*<br>\";\n }\n if(!RegExp(/^.{8,20}$/).test(password)) {\n errMsg += \"Password must be between 8 - 20 characters\";\n }\n return errMsg;\n}", "function characterSuitableForNames(char) {\n return /[-_A-Za-z0-9]/.test(char); // notice, there's no dot or hash!\n }", "function checkInputName(input) {\n\n var value = input.value;\n var reg = new RegExp(\"^[a-zA-Z]+$\");\n var result = value.search(reg);\n var invalid = result == -1;\n\n if (invalid) {\n invalidInput(input);\n } else {\n resetBorder(input);\n }\n }", "function isValidName(name){\n if(typeof(name) === \"string\") {\n let trimmedString = name.trim(); // delete all the spaces from both sides.\n let splittedStringArray = trimmedString.split(\" \"); // split the string into substrings inside an Array.\n for(let i = 0; i<splittedStringArray.length; i++) {\n if(splittedStringArray[i].length > 1) {\n return true // this is a valid name if the string contains more than 1 letter logically...\n } else {\n return false // otherwise, single letter string doesn't make sense as a valid name.\n }\n }\n } else {\n console.log( name + \" is not even a string!\"); \n return false;\n }\n}", "function checkNameLength(name) {\n if (name.length > 0 && name.length <= 10) {\n return true;\n } else {\n return false;\n }\n}", "function checkName(){\n\t//rules: \tmust be longer than 1 characters, no more than 25\n\t//\t\t\tcan not contain numbers\n\tvar name = theForm.charName;\n\t//use a local message variable\n\tvar msg = \"\";\n\t\n\t//use the trim function (from the trim document) to get rid of leading and\n\t//trailing spaces\n\tnameVal = trim(name.value);\n\t\n\t//|| (double pipeline) is 'or'\n\tif(nameVal.length < 2 || nameVal.length > 25){\n\t\tmsg += \"Your name must be longer than a single charcter but no more than 25. \";\n\t}\n\t\n\t//check for numbers\n\t//isNaN = 'is not a number'\n\t//use a for loop to loop through the characters and see if any of them are numbers (by checking if they are not numbers)\n\tfor(var n=0;n<nameVal.length;n++){\n\t\t//get each character\n\t\tvar thisChar = nameVal.substring(n,n+1);\n\t\tif(isNaN(thisChar) == false){\n\t\t\tmsg += \"No numbers!\";\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\t//check for error message\n\tif(msg != \"\"){\n\t\tname.parentNode.childNodes[5].innerHTML = '<span class=\"error\">' + msg + '</span>';\n\t\treturn true;\n\t}else{\n\t\tname.parentNode.childNodes[5].innerHTML = '<span class=\"correct\">A good, strong name.</span>';\n\t}\n}", "function nameValidate(evt) {\n var theEvent = evt || window.event;\n var key = theEvent.keyCode || theEvent.which;\n key = String.fromCharCode( key );\n var regex = /[A-Za-z]+/;\n if( !regex.test(key) ) {\n theEvent.returnValue = false;\n if(theEvent.preventDefault) theEvent.preventDefault();\n }\n}", "function validateName(control, message, showMessage)\n{\n var result = true;\n if (control != null)\n {\n var pattern = /([\\\"\\*\\\\\\>\\<\\?\\/\\:\\|]+)|([ ]+$)|([\\.]?[\\.]+$)/;\n var trimed = control.value.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n var idx = trimed.search(pattern);\n if (idx != -1)\n {\n informUser(control, \"'\" + trimed.charAt(idx) + \"' \" + message, showMessage);\n result = false;\n }\n }\n \n return result;\n}", "function validateNames (el) {\n if(el.value == 0 || el.value.length <= 2) {\n\n setError(el, errorMessages.names);\n return false;\n }\n else { \n removeError(el);\n return true;\n }\n}", "function validateName(value,data,name,form)\n{\n var message = \"\";\n if(value === \"\")\n message = \"* Required\";\n else if (!value.match(/^[a-zA-Z ]+$/))\n message = \"* Must be alphabets characters only\";\n\n if(message) {\n form.elements[name].define(\"invalidMessage\", message);\n return false\n }\n return true;\n}", "setPersonName(name) {\n name = name.trim();\n const nameRegex = /^[a-zA-Z]{1,100}$/;\n\n if (!name.length || !name || (name.length > 100)) {\n throw new Error('Invalid name length');\n }\n\n if (name.match(nameRegex)) {\n return name;\n }\n throw new Error('Name includes symbols that are not allowed');\n }" ]
[ "0.8717828", "0.84375066", "0.84375066", "0.8429613", "0.8240088", "0.8238637", "0.8213514", "0.81875825", "0.8180992", "0.8180992", "0.81525606", "0.8141352", "0.8132209", "0.8125066", "0.81192434", "0.8115598", "0.79977965", "0.79930735", "0.7978189", "0.7973492", "0.7899242", "0.7896577", "0.78691214", "0.78349817", "0.7807592", "0.78022695", "0.77582365", "0.7745612", "0.7739104", "0.7738026", "0.7724167", "0.77151203", "0.7707535", "0.76990336", "0.76917577", "0.76689607", "0.76557577", "0.7652023", "0.7639273", "0.76335275", "0.76174515", "0.76107436", "0.7570808", "0.75647306", "0.7547194", "0.7538046", "0.75210273", "0.749677", "0.7479166", "0.7475149", "0.7473672", "0.7473529", "0.7465825", "0.74606323", "0.74386144", "0.7410009", "0.7409311", "0.73969203", "0.7384306", "0.7381481", "0.73811185", "0.7371713", "0.73599654", "0.73427314", "0.733623", "0.732655", "0.73073024", "0.73073024", "0.73073024", "0.72965837", "0.7274888", "0.7250229", "0.72395134", "0.72395134", "0.72395134", "0.72395134", "0.72395134", "0.72257954", "0.7223082", "0.7222706", "0.7218427", "0.72049564", "0.71959996", "0.7184715", "0.7168579", "0.7167204", "0.71481055", "0.71436113", "0.71379286", "0.7136816", "0.7134803", "0.7131149", "0.7121238", "0.7111536", "0.70945567", "0.7076349", "0.7070783", "0.7057685", "0.7052599", "0.70422477" ]
0.7266709
71
Tracks coverage objects and writes results by listening to events emitted from wct test runner.
function Listener(emitter, pluginOptions) { this.map = istanbulCoverage.createCoverageMap(); this.istanbulConfig = config.loadFile(pluginOptions.configFile, pluginOptions.configOverrides); this.reporter = createReporter(this.istanbulConfig); this.validator = new Validator(pluginOptions.thresholds); this.reporter.addAll(pluginOptions.reporters) pluginOptions.npm = pluginOptions.npm || emitter.options.npm; emitter.on('sub-suite-end', function (browser, data) { if (data && data.__coverage__) { Object.keys(data.__coverage__).forEach(filename => { this.map.addFileCoverage(data.__coverage__[filename]) }); } middleware.cacheClear(); }.bind(this)); emitter.on('run-end', function (error) { if (error && pluginOptions.onlyWriteSuccess) { throw Error('Tests failed. Not writing coverage report.'); } const mapStore = libSourceMaps.createSourceMapStore({}); const transformed = mapStore.transformCoverage(this.map); // Log a new line to not overwrite the test results outputted by WCT console.log('\n'); this.reporter.write(transformed.map); mapStore.dispose(); if (!validator.validate(transformed.map)) { throw Error('Coverage failed'); } }.bind(this)); emitter.hook('define:webserver', function (app, assign, options, done) { const newApp = express(); newApp.use(middleware.middleware(emitter.options.root, pluginOptions, emitter)); newApp.use(app); assign(newApp); done(); }.bind(this)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function runCoverage(callback) {\n\tconsole.log(\"Run Coverage:\");\n\tvar numTests = testsToRun.length;\n\tconsole.log(\"Number of tests to run: \" + numTests);\n\t//for each test move it back and run cobertura\n\tasync.whilst(areTestsToRun, runTest, function (err) {\n\t\tif (err) {\n\t\t\tconsole.log(\"Coverage not completed \" + err);\n\t\t\tcallback(err);\n\t\t} else {\n\t\t\tconsole.log(\"\\nAll coverage completed\\n\\n\");\n\t\t\tcallback(null);\n\t\t}\n\t});\n}", "registerTestListeners () {\n\t\tthis.disposables.add(this.testRunner.onWillBeginBatchTest(({project, queue}) => {\n\t\t\tthis.runningQueue = queue\n\t\t\tthis.runningBatch = true\n\n\t\t\treturn this.update({\n\t\t\t\tstate: 'test-begin',\n\t\t\t\tactiveProject: project.getRoot(),\n\t\t\t})\n\t\t}))\n\n\t\tthis.disposables.add(this.testRunner.onDidCompleteBatchTest(({project}) => {\n\t\t\treturn this.update({\n\t\t\t\tstate: 'test-end',\n\t\t\t\tactiveProject: project.getRoot(),\n\t\t\t}).then(() => {\n\t\t\t\tthis.runningQueue = null\n\t\t\t\tthis.runningBatch = false\n\t\t\t})\n\t\t}))\n\n\t\tthis.disposables.add(this.testRunner.onDidBeginTest(({project, queue}) => {\n\t\t\tthis.runningQueue = queue\n\n\t\t\treturn this.update({\n\t\t\t\tstate: this.runningBatch ? 'test-progress' : 'test-begin',\n\t\t\t\tactiveProject: project.getRoot(),\n\t\t\t\ttestReport: null,\n\t\t\t\tcoverageReport: null,\n\t\t\t})\n\t\t}))\n\n\t\tthis.disposables.add(this.testRunner.onDidCompleteTest(({project}) => {\n\t\t\tconst coverage = this.isCodeCoverageEnabled()\n\t\t\tconst testReport = project.getTestReport()\n\t\t\tlet coverageReport\n\n\t\t\tif (coverage) {\n\t\t\t\tcoverageReport = project.getCoverageReport()\n\t\t\t}\n\n\t\t\treturn this.update({\n\t\t\t\tstate: this.runningBatch ? 'test-progress' : 'test-end',\n\t\t\t\tactiveProject: project.getRoot(),\n\t\t\t\ttestReport,\n\t\t\t\tcoverageReport,\n\t\t\t}).then(() => {\n\t\t\t\tif (!this.runningBatch) {\n\t\t\t\t\tthis.runningQueue = null\n\t\t\t\t}\n\t\t\t})\n\t\t}))\n\n\t\tthis.disposables.add(this.testRunner.onDidCancelTest(({project}) => {\n\t\t\treturn this.update({\n\t\t\t\tstate: 'test-end',\n\t\t\t\tactiveProject: project.getRoot(),\n\t\t\t\ttestReport: null,\n\t\t\t\tcoverageReport: null\n\t\t\t}).then(() => {\n\t\t\t\tthis.runningQueue = null\n\t\t\t\tthis.runningBatch = false\n\t\t\t})\n\t\t}))\n\n\t\tthis.disposables.add(this.testRunner.onTestCommandLine(({project, data}) => {\n\t\t\tif (!this.terminalReport) {\n\t\t\t\tif (this.refs.terminal) {\n\t\t\t\t\tthis.refs.terminal.clear();\n\t\t\t\t\tthis.refs.terminal.writeln(data + '\\n')\n\t\t\t\t}\n\n\t\t\t\treturn this.update({\n\t\t\t\t\tstate: 'test-progress',\n\t\t\t\t\tactiveProject: project.getRoot()\n\t\t\t\t})\n\t\t\t}\n\t\t}))\n\n\t\tthis.disposables.add(this.testRunner.onTestOutputData(({project, data}) => {\n\t\t\tif (!this.terminalReport) {\n\t\t\t\tif (this.refs.terminal) {\n\t\t\t\t\tthis.refs.terminal.write(data)\n\t\t\t\t}\n\n\t\t\t\treturn this.update({\n\t\t\t\t\tstate: 'test-progress',\n\t\t\t\t\tactiveProject: project.getRoot()\n\t\t\t\t})\n\t\t\t}\n\t\t}))\n\n\t\tthis.disposables.add(this.testRunner.onTestErrorData(({project, data}) => {\n\t\t\tif (!this.terminalReport) {\n\t\t\t\tif (this.refs.terminal) {\n\t\t\t\t\tthis.refs.terminal.write(data)\n\t\t\t\t}\n\n\t\t\t\treturn this.update({\n\t\t\t\t\tstate: 'test-progress',\n\t\t\t\t\tactiveProject: project.getRoot()\n\t\t\t\t})\n\t\t\t}\n\t\t}))\n\n\t\tthis.disposables.add(this.testRunner.onClearAll(() => {\n\t\t\treturn this.clear()\n\t\t}))\n\t}", "function collectorTest () {\n\n /**\n * Set the event before collecting metadata.\n */\n collector.on(\"fileParsed\", (metadata, namespace)=>{\n assert.ok(++mockCount <= 3, \"Too many mocks\");\n assert.strictEqual(Object.keys(metadata.methods).length, 4);\n assert.strictEqual(metadata.propertyData.length, 2);\n assert.ok(metadata, \"Failed to get metadata after parsing.\");\n assert.ok(namespace, \"Failed to get namespace after parsing.\");\n });\n\n /**\n * If this timeout is reached, then the collector failed to trigger the callback\n * @type {number}\n */\n\n /**\n * Tests the Collector and MetaData\n */\n collector.filePath = mockPath;\n collector.collect().then(()=>{\n // Validate that the callback is only called once\n assert.strictEqual(collector.namespaces.length, 3);\n for(let i = 0; i < collector.namespaces; i++){\n let name = collector.namespaces[i];\n let data = collector.classMetadata(name);\n assert.strictEqual(data.methods.length, 4);\n assert.strictEqual(data.propertyData.length, 2);\n }\n if(mockCount === 3){\n clearTimeout(successTimeout);\n hrend = process.hrtime(hrstart);\n console.info('Collector Test Execution time (hr): %dms', hrend[1] / 1000000);\n } else {\n throw \"OnComplete triggered before all files parsed.\";\n }\n });\n\n}", "function set_coverage(obj)\n{\n // return dictionary\n var ret = {};\n\n // function to wrap a method for coverage\n function wrap_method(obj, key)\n {\n // add to return dict\n ret[key] = 0;\n\n // copy the old function\n obj[\"__coverage_\" + key] = obj[key];\n\n // create the wrapping function\n obj[key] = function()\n {\n // add counter\n ret[key]++;\n\n // call original function\n return obj[\"__coverage_\" + key].apply(this, arguments);\n }\n }\n\n // set all object methods\n for (var key in obj)\n {\n if (typeof obj[key] === \"function\") {\n wrap_method(obj, key);\n }\n }\n\n // set all object prototype methods\n for (var key in obj.prototype)\n {\n if (typeof obj.prototype[key] === \"function\") {\n wrap_method(obj.prototype, key);\n }\n }\n\n // return the results dictionary\n return ret;\n}", "get coverage() {\n\t\treturn this.__coverage;\n\t}", "function next_test() {\n if (current_test < test.length) {\n kid = cp.fork(test[current_test++], [], { stdio: \"inherit\" });\n\n kid.on(\"exit\", next_test);\n } else {\n\n ass.report(\"html\", function (err, report) {\n require(\"fs\").writeFileSync(\"./coverage.html\", report);\n });\n }\n}", "function coverageFilesForTest() {\n return coverageData;\n}", "async function runTests() {\n await fse.remove(\"cypress/report\");\n await cypress.run({\n spec: \"cypress/integration/**/*.spec.ts\",\n });\n const jsonReport = await merge({\n reportDir: \"cypress/report\",\n });\n await generator.create(jsonReport, {\n reportDir: \"cypress/report\",\n reportTitle: \"Bridge-X E2E All Test\",\n });\n await fse.writeJson(\"cypress/report/mochawesome-stat.json\", jsonReport, { spaces: 2 });\n}", "function clearCoverage() {\n coverageData = {};\n disposeDecorators();\n isCoverageApplied = false;\n}", "function coverageFile(filename) {\n\tthis.filename = filename;\n\tthis.DARecords = []\n\tthis.BRDARecords = []\n}", "function observe(oQUnit) {\n\t\t\t\t// see https://github.com/js-reporters/js-reporters (@since QUnit 2)\n\t\t\t\toQUnit.on(\"runStart\", function (oDetails) {\n\t\t\t\t\toTest.testCounts = oDetails.testCounts;\n\t\t\t\t\tprogress(0);\n\t\t\t\t});\n\t\t\t\toQUnit.on(\"testEnd\", function () {\n\t\t\t\t\tprogress(oTest.testCounts.finished + 1);\n\t\t\t\t});\n\t\t\t\toQUnit.on(\"runEnd\", function (oDetails) {\n\t\t\t\t\toTest.testCounts = oDetails.testCounts;\n\t\t\t\t\tsummary(oDetails.runtime, oTest);\n\t\t\t\t\tfinish(oDetails.status === \"failed\");\n\t\t\t\t});\n\t\t\t}", "function cover(modules, options) {\r\n \"use strict\";\r\n\r\n if (!_.isArray(modules)) {\r\n modules = [modules];\r\n }\r\n\r\n var gen = new IDGenerator({\r\n chars: \"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ;:=?@!~#$%&-_\"\r\n }),\r\n modObjs = modules.map(function(modName) {\r\n return new Module(modName, options.base);\r\n });\r\n\r\n var params = {\r\n idGenerator: gen,\r\n sourceStore: {},\r\n timings: options.timings\r\n };\r\n\r\n return parseUtils\r\n .listScriptsInModules(modObjs, false)\r\n .then(function(allFiles) {\r\n return processFiles(allFiles, params);\r\n })\r\n .then(function(results) {\r\n var output = genCoverageData(\r\n results.blocks,\r\n results.functions,\r\n gen.getIDs(),\r\n params.sourceStore\r\n );\r\n fs.writeFileSync(options.output, JSON.stringify(output), \"utf8\");\r\n\r\n // add headers\r\n modObjs.forEach(function(m) {\r\n addHeader(m.getStartupScripts());\r\n });\r\n })\r\n .catch(function(e) {\r\n console.error(\"There was a problem: \", e);\r\n });\r\n}", "registerListeners() {\n process.on('wdioCucumberJsReporter:attachment', this.cucumberJsAttachment.bind(this));\n }", "async report() {\n const { logger, db } = this[OPTIONS];\n const testedPages = await db.read('tested_pages');\n\n logger.info('Saving JSON report');\n const json = new JSONReporter(this[OPTIONS]);\n await json.open();\n await json.write(testedPages);\n await json.close();\n\n logger.info('Saving HTML Report');\n const html = new HTMLReporter(this[OPTIONS]);\n await html.open();\n await html.write(testedPages);\n await html.close();\n }", "trackEvent(name, properties, measurements, tagOverrides, contextObjects) {\n _.forEach(this.appInsightsClients, (client) => {\n client.trackEvent(name, properties);\n });\n }", "trackEvent(telemetry) {\n const { name, properties, metrics: measurements } = telemetry;\n this.defaultClient.trackEvent({ name, properties, measurements });\n }", "function calculateCoverage() {\n var numTrue = 0;\n for (var i in codeCoverage) {\n if (codeCoverage[i]) {\n numTrue++;\n }\n }\n return numTrue * 100 / codeCoverage.length\n}", "crawlerListeners() {\n this.on('crawlstart', () => {\n this.crawlStartTime = Date.now();\n });\n\n this.on('queueadd', (queueItem, responseObject) => {\n this.status.updateTotalResources();\n // this.urlQueue.push(queueItem.url);\n });\n\n this.on('fetchheaders', (queueItem, responseObject) => {\n this.status.updateProcessResources();\n });\n\n this.on('discoverycomplete', (queueItem, resources) => {\n\n if(!this.shouldCombPages()) return;\n\n console.log('start of comb | pages: ', this.pages.length, \" | queue: \", this.queue.length);\n\n this.combPages();\n\n var report = this.getCrawlReport();\n\n this.deleteProcessedPages();\n\n console.log('end of comb | pages: ', this.pages.length, \" | queue: \", this.queue.length);\n this.emit('BrokenLinkCrawller::comb', report);\n });\n\n this.on('complete', () => {\n this.crawlEndTime = Date.now();\n this.crawlDurationInSeconds = capDecimals((this.crawlEndTime - this.crawlStartTime) / 1000, 2);\n var report = this.getCrawlReport();\n\n this.emit('BrokenLinkCrawller::complete', report);\n setTimeout(function() {\n process.kill(process.pid, 'SIGUSR2');\n }, 10000);\n });\n }", "async run() {\n if (this.startDelay) {\n await this.pause(this.startDelay);\n }\n \n const start = new Date();\n console.log(`Cavy test suite started at ${start}.`);\n\n for (let i = 0; i < this.testCases.length; i++) {\n let {description, f} = this.testCases[i];\n try {\n await f.call(this);\n console.log(`${description} ✅`);\n } catch (e) {\n console.warn(`${description} ❌\\n ${e.message}`);\n }\n await this.component.clearAsync();\n this.component.reRender();\n }\n\n const stop = new Date();\n const duration = (stop - start) / 1000;\n console.log(`Cavy test suite stopped at ${stop}, duration: ${duration} seconds.`);\n }", "trackTrace(telemetry) {\n this.defaultClient.trackTrace(telemetry);\n }", "function cov_2fpze8ad7p(){var path=\"/Users/federicolacabaratz/bootcamp/collab/skylab-bootcamp-202001/staff/federico-lacabaratz/share-my-spot/share-my-spot-api/logic/save-spot-photo.spec.js\";var hash=\"6075a72b2a405bb8817f93427c26829ae2e7ed0d\";var global=new Function(\"return this\")();var gcv=\"__coverage__\";var coverageData={path:\"/Users/federicolacabaratz/bootcamp/collab/skylab-bootcamp-202001/staff/federico-lacabaratz/share-my-spot/share-my-spot-api/logic/save-spot-photo.spec.js\",statementMap:{},fnMap:{},branchMap:{},s:{},f:{},b:{},_coverageSchema:\"1a1c01bbd47fc00a2c39e90264f33305004495a9\",hash:\"6075a72b2a405bb8817f93427c26829ae2e7ed0d\"};var coverage=global[gcv]||(global[gcv]={});if(!coverage[path]||coverage[path].hash!==hash){coverage[path]=coverageData;}var actualCoverage=coverage[path];cov_2fpze8ad7p=function(){return actualCoverage;};return actualCoverage;}", "startEventListener() {\n // Utils.pzChestContract.CreateChest().watch((err, { result }) => {\n // if (err) return console.error('Failed to bind event listener:', err);\n\n // console.log('Chest Created');\n // console.log(result);\n // });\n }", "function healthCheckCallback(healthCheckResults) {\n console.log(\"Results are ready.\");\n var newSource = sfp.readFile('test-output/temp.js');\n // healthCheckResults.source = sfp.readFile(tempFilePath);\n healthCheckResults.source = realSource;\n healthCheckResults.processedSource = newSource;\n runJsDoc('test-output', healthCheckResults);\n }", "function applyCodeCoverage(editor) {\n if (!editor || editor.document.languageId !== 'go' || editor.document.fileName.endsWith('_test.go')) {\n return;\n }\n let doc = editor.document.fileName;\n if (path.isAbsolute(doc)) {\n doc = pathUtils_1.fixDriveCasingInWindows(doc);\n }\n const cfg = config_1.getGoConfig(editor.document.uri);\n const coverageOptions = cfg['coverageOptions'];\n for (const filename in coverageData) {\n if (doc !== pathUtils_1.fixDriveCasingInWindows(filename)) {\n continue;\n }\n isCoverageApplied = true;\n const cd = coverageData[filename];\n if (coverageOptions === 'showCoveredCodeOnly' || coverageOptions === 'showBothCoveredAndUncoveredCode') {\n if (decorators.type === 'gutter') {\n editor.setDecorations(decorators.coveredGutter, cd.coveredOptions);\n }\n else {\n detailed(editor, decorators.coveredHighlight, cd.coveredOptions);\n }\n }\n if (coverageOptions === 'showUncoveredCodeOnly' || coverageOptions === 'showBothCoveredAndUncoveredCode') {\n if (decorators.type === 'gutter') {\n editor.setDecorations(decorators.uncoveredGutter, cd.uncoveredOptions);\n }\n else {\n detailed(editor, decorators.uncoveredHighlight, cd.uncoveredOptions);\n }\n }\n }\n}", "function healthCheckCallback(healthCheckResults) {\n console.log(\"Results are ready.\");\n var newSource = sfp.readFile('test-output/temp.js');\n // healthCheckResults.source = sfp.readFile(tempFilePath);\n healthCheckResults.source = realSource;\n healthCheckResults.processedSource = newSource;\n runJsDoc(projectPath + '/test-output', healthCheckResults);\n }", "function trackGarbageCollection() {\n Services.prefs.setBoolPref('javascript.options.mem.notify', true);\n Services.obs.addObserver(\n function(subject, topic, json) {\n console.harness('~~~ GC completed ~~~');\n },\n 'garbage-collection-statistics', /* strong */ false);\n Services.obs.addObserver(\n function(subject, topic, json) {\n console.harness('~~~ CC completed ~~~');\n },\n 'cycle-collection-statistics', /* strong */ false);\n}", "sendLogs() {\n this.log.info('logging from tests');\n }", "function concertThis(artist) {\n //create the url using the artist\n var url = \"https://rest.bandsintown.com/artists/\" + artist + \"/events?app_id=\" + keys.bandsInTown.id;\n request(url, function (error, response, body) {\n // If the request is successful (i.e. if the response status code is 200)\n if (!error && response.statusCode === 200) {\n // Parse the body of the site and recover the venue name, location and date\n var json = JSON.parse(body); // `json` will be an array of objects\n console.log();\n for (i = 0; i < json.length; i++) {\n //print a line for each item in the array\n data = json[i];\n var date = data.datetime.substr(0, data.datetime.indexOf('T'));\n //convert the date to the correct format\n date = moment(date, \"YYYY-MM-DD\").format('L');\n var outputString = data.venue.name + \" in \" + data.venue.city + \", \" + data.venue.country + \" on \" + date;\n console.log(outputString);\n writeFile(outputString + \"\\n\");\n }\n }\n else if (error) {\n //log the error\n console.error('Error occurred: ' + error);\n writeFile('Error occurred: ' + error + \"\\n\");\n }\n });\n}", "function reportEvents(_events) {\n events = _events;\n renderEvents();\n }", "function TestWriter(){W.apply(this,arguments);this.buffer=[];this.written=0}", "function receive_hinet(json_text) {\n\tjson_object = JSON.parse(json_text);\n if (json_object.hasOwnProperty('error')) {\n $(\"#hinet_view\").html('<span class=\"error\">' +\n json_object.error + '</span>');\n return;\n }\n // update hinet view\n var hinet_view_html = json_object.result.html_view;\n $(\"#hinet_view\").html(hinet_view_html).hide().fadeIn();\n // update hinet coverage\n $(\"#hinet_coverage\").append('<h4>channel coverage</h4>');\n $(\"#hinet_coverage\").append(\n '<div id=\"coverage_floats\" class=\"float_container\"></div>');\n $(\"#hinet_coverage\").append(\n '<span class=\"note\">Click on field square to display coverage.</span>');\n $(\"#hinet_coverage\").append(\n '<br /><span class=\"timer\"></span>');\n var hinet_coverage_svgs = json_object.result.hinet_coverage_svgs;\n var hinet_coverage_ids = json_object.result.hinet_coverage_ids;\n $(\"#coverage_floats\").append([\n '<div class=\"layer_coverage\">',\n 'image <br />',\n hinet_coverage_svgs[0],\n '</div>'\n ].join(\"\\n\"));\n cov_throbber_ids = [];\n var i;\n var j;\n var cov_throbber_id;\n for (i = 1; i < hinet_coverage_svgs.length; i += 1) {\n cov_throbber_id = \"cov_throbber_\" + i.toString();\n cov_throbber_ids.push(cov_throbber_id);\n $(\"#coverage_floats\").append([\n '<div class=\"layer_coverage\">',\n 'layer ' + i.toString() +\n '&#160;<img id=\"' + cov_throbber_id +\n '\" src=\"/images/small_throbber.gif\" class=\"hidden\" /><br />',\n hinet_coverage_svgs[i],\n '</div>'\n ].join(\"\\n\"));\n // make the coverage svg elements clickable\n for (j = 0; j < hinet_coverage_ids[i].length; j += 1) {\n $(\"#\" + hinet_coverage_ids[i][j]).click(\n _get_coverage_function(i,j));\n }\n }\n // update hinet params\n $(\"#hinet_config\").append('<h4>network parameters</h4>');\n $(\"#hinet_config\").append('<pre>' + json_object.result.hinet_config_str +\n '</pre>');\n}", "function $Reporter(runner) {\n\tvar started,\n\t\ttitle;\n\n\trunner.on('suite', function (suite) {\n\t\ttitle = suite.title;\n\t});\n\n\trunner.on('test', function (test) {\n\t\tTi.API.info('!TEST_START: ' + test.title);\n\t\tstarted = new Date().getTime();\n\t});\n\n\trunner.on('pending', function (test) {\n\t\t// TODO Spit out something like !TEST_SKIP: ?\n\t\tstarted = new Date().getTime(); // reset timer. pending/skipped tests basically start and end immediately\n\t});\n\n\t// 'pending' hook for skipped tests? Does 'pending', then immediate 'test end'. No 'test' event\n\n\trunner.on('fail', function (test, err) {\n\t\ttest.err = err;\n\t\tfailed = true;\n\t});\n\n\trunner.on('test end', function (test) {\n\t\tvar tdiff = new Date().getTime() - started,\n\t\t\tresult = {\n\t\t\t\tstate: test.state || 'skipped',\n\t\t\t\tduration: tdiff,\n\t\t\t\tsuite: title,\n\t\t\t\ttitle: test.title,\n\t\t\t\terror: test.err // TODO Include the message property on Windows!\n\t\t\t},\n\t\t\tstringified = JSON.stringify(result);\n\n\t\t\tstringified = stringified.replace(/\\\\n/g, \"\\\\n\")\n\t\t\t\t\t .replace(/\\\\'/g, \"\\\\'\")\n\t\t\t\t\t .replace(/\\\\\"/g, '\\\\\"')\n\t\t\t\t\t .replace(/\\\\&/g, \"\\\\&\")\n\t\t\t\t\t .replace(/\\\\r/g, \"\\\\r\")\n\t\t\t\t\t .replace(/\\\\t/g, \"\\\\t\")\n\t\t\t\t\t .replace(/\\\\b/g, \"\\\\b\")\n\t\t\t\t\t .replace(/\\\\f/g, \"\\\\f\");\n\t\t\t// remove non-printable and other non-valid JSON chars\n\t\t\tstringified = stringified.replace(/[\\u0000-\\u0019]+/g,'');\n\t\tTi.API.info('!TEST_END: ' + stringified);\n\t\t$results.push(result);\n\t});\n}", "function recordEvent(info) {\n ///console.log('event', info);\n var detail = { detail: info };\n var event = new CustomEvent('benchmarkEvent', detail);\n document.dispatchEvent(event);\n }", "_run()\n {\n var info = this._getInfoFromPackageJson()\n\n if (Tester.is(this._output, 'function')) {\n this._output('################################################')\n this._output(info.label)\n this._output(info.labelDescription)\n this._output('################################################')\n }\n\n var start = new Date()\n\n // @todo Progress bar start.\n\n this._runTestMethods()\n\n // @todo Progress bar stop.\n\n var end = new Date()\n var time = end - start\n var formatTime = time > 1000 ? (time / 1000).toFixed(1) + ' seconds' : time + ' miliseconds'\n var memoryBytes = process.memoryUsage().heapTotal\n var trace = Tester.getBacktrace(new Error(), 3)\n\n this._resultsJson = {\n info: info,\n errors: this._errors,\n ok: this._ok,\n all: this._all,\n className: this.constructor.name,\n assertionsCounter: this._assertionsCounter,\n testsCounter: this._testsCounter,\n timeMiliseconds: time,\n formatTime: formatTime,\n memoryBytes: memoryBytes,\n formatMemory: Tester.formatBytes(memoryBytes),\n from: trace\n }\n\n if (Tester.is(this._output, 'function')) {\n var arr = this._showOk === true ? this._all : this._errors\n for (let value of arr) {\n if (this._colorize === true) {\n // reverse red\n value = value.replace(/^Error:/, '\\x1b[31m\\x1b[7mError:\\x1b[0m')\n // reverse\n value = value.replace(/^Ok:/, '\\x1b[7mOk:\\x1b[0m')\n }\n this._output(value)\n }\n\n var className = this.constructor.name + ':'\n\n this._output(className)\n this._output(' - tests ' + this._testsCounter)\n this._output(' - assertions ' + this._assertionsCounter)\n this._output(' - errors ' + this._errors.length)\n this._output(' - time ' + formatTime)\n this._output(' - memory ' + Tester.formatBytes(memoryBytes))\n this._output(' - from ' + trace)\n this._output('')\n }\n }", "track({eventType, args}) {\n this.handleEvent(eventType, args);\n }", "runTestCasesAndFinish()\n {\n this.runTestCases();\n InspectorTest.completeTest();\n }", "function runCoopReportingTest(testName, tests){\n tests.forEach( test => {\n coopCoepReportingTest(testName, ...test);\n });\n verifyRemainingReports();\n}", "function reportEvents(_events) {\n\t\tevents = _events;\n\t\trenderEvents();\n\t}", "function reportEvents(_events) {\n\t\tevents = _events;\n\t\trenderEvents();\n\t}", "function reportEvents(_events) {\n\t\tevents = _events;\n\t\trenderEvents();\n\t}", "function reportEvents(_events) {\n\t\tevents = _events;\n\t\trenderEvents();\n\t}", "function reportEvents(_events) {\n\t\tevents = _events;\n\t\trenderEvents();\n\t}", "function reportEvents(_events) {\n\t\tevents = _events;\n\t\trenderEvents();\n\t}", "function reportEvents(_events) {\n\t\tevents = _events;\n\t\trenderEvents();\n\t}", "function reportEvents(_events) {\n\t\tevents = _events;\n\t\trenderEvents();\n\t}", "function testClientSideInstrumentOnProxyServer() {\n\n // TODO - Check the first available port here starting from minPort\n var minPort = 10901,\n maxPort = 11000,\n hostName = \"localhost\",\n routerJsonPath = __dirname + \"/config/router.json\",\n proxyManager = new ProxyManager(routerJsonPath, {}),\n options,\n req;\n\n global.currentSessionid = global.currentSessionid || '12345';\n\n function createProxyServerRequest(minPort, maxPort, hostName, callback) {\n\n proxyManager.runRouterProxy(minPort, maxPort, hostName, function (proxyHostMsg) {\n\n console.log(\"in test client side instrument,proxy started corrently\");\n A.areNotEqual(proxyHostMsg, 'localhost:' + minPort, 'Proxy host should not match');\n A.areEqual(proxyHostMsg, localhostip + ':' + minPort, 'Proxy host doesn\\'t match');\n callback();\n\n });\n }\n\n createProxyServerRequest(minPort, maxPort, hostName, function () {\n\n\n options = {\n host: hostName,\n port: minPort,\n path: '/proxyCoverage?sid=12345',\n method: 'GET'\n };\n\n function sentToCoverage(method, data) {\n options.method = method;\n req = http.request(options, function (res) {\n res.setEncoding('utf8');\n res.on('data', function (chunk) {\n console.log('BODY: ' + chunk);\n });\n });\n\n req.on('error', function (e) {\n console.log('problem with request: ' + e.message);\n });\n\n // write data to request body\n req.write(data);\n req.end();\n }\n\n sentToCoverage(\"GET\", \"\\n\");\n sentToCoverage(\"OPTIONS\", \"\\n\");\n sentToCoverage(\"POST\", \"\\n\"); // should be catch\n sentToCoverage(\"POST\", JSON.stringify({coverage: {}, sid: \"12345\", origin: \"nourl\"}) + \"\\n\");\n sentToCoverage(\"GET\", \"\\n\"); // get again\n\n setTimeout(function () {\n proxyManager.proxyServer.close();\n }, 2000);\n });\n\n\n }", "function subscribe(context) {\n watcher = chokidar\n .watch(context.fileSet.origins, {cwd: config.cwd, ignoreInitial: true})\n .on('error', done)\n .on('change', onchange);\n\n process.on('SIGINT', onsigint);\n\n function onchange(filePath) {\n config.files = [filePath];\n\n engine(config, done);\n }\n\n function onsigint() {\n // Hide the `^C` in terminal.\n process.stderr.write('\\n', noop$2);\n\n clean();\n\n // Do another process if `output` specified regeneration.\n if (output === true) {\n config.output = output;\n config.watch = false;\n engine(config, done);\n }\n }\n }", "function addListeners(useCapturing) {\r\r\n // get all div in list\r\r\n var divList = document.getElementsByTagName('div');\r\r\n // set event to each div\r\r\n for(var i = 0, len = divList.length; i < len; i++) {\r\r\n var element = divList[i];\r\r\n eventUtility.addEvent(element, \"click\", markDiv, useCapturing);\r\r\n }\r\r\n}", "function reportEvents(_events) {\n\t\t\tevents = _events;\n\t\t\trenderEvents();\n\t\t}", "function runTest(callback) {\n currentIncrement = testsToRun[0];\n odfeRunner.setTestIncrement(currentIncrement);\n odfeRunner.setDocsBaseDir(testClassesDirectory);\n\tcurrentTest = currentIncrement.test;\n console.log(\"\\nRun test \" + currentTest);\n\tfs.copy(srcDir + currentTest, trgDir + currentTest, function (err) {\n\t\tif (err) {\n\t\t\tcallback(err);\n\t\t} else {\n\t\t\tconsole.log(\"To Run Moved \" + srcDir + currentTest + \" to \" + trgDir + currentTest);\n\t\t\ttestsToRun.shift();\n async.series([\n cover,\n parseCoverage,\n odfe,\n deleteTrgTest,\n deleteTrgTestFromTarget\n ], function (err) {\n console.log(\"Run test done for \" + currentTest);\n callback();\n });\n\t\t}\n\t});\n}", "function fillCoverageView() {\n\n var $sequences = $(\"#sequences\");\n $($sequences).empty();\n\n $(\"#coverage-status-message\").empty();\n\n // only hsie syllabus supported\n var $selected = $(\"#teaching-group-select option:selected\").text();\n var $learning_area = \"\";\n if ($selected.indexOf(\"Geography\") != -1) {\n $learning_area = \"geography\";\n }\n if ($selected.indexOf(\"History\") != -1) {\n $learning_area = \"history\";\n }\n\n if (($learning_area != \"history\") && ($learning_area != \"geography\")) {\n $(\"#coverage-status-message\").append(\"<p>Syllabus coverage not available for this Learning Area</p>\");\n return\n }\n\n if (!$n3data.Syllabus) {\n $(\"#coverage-status-message\").append(\"<p>Syllabus coverage not available for this Learning Area</p>\");\n return \n }\n\n // if no lesson sequences have been created\n if (!$n3data.LessonSequence) {\n $(\"#coverage-status-message\").append(\"<p>No Lesson Sequences created for this Learning Area</p>\");\n return \n }\n\n // add column header\n $sequences.append($(\"<p><h6>Course Attendance</h6></p>\"));\n $.each($n3data.LessonSequence, function() {\n var $lessonBlock = $('<div>');\n $lessonBlock.append($(\"<p><h6>\" +\n this.thecourse +\n \" (\" + this.thedescription +\n \", taught by: \" + this.userId + \"), \" +\n \"</h6></p>\"));\n var $list = $('<ul>').addClass(\"collection\");\n $.each(this.lessonList, function() {\n var $listItem = $(\"<li>\").addClass(\"collection-item\");\n $listItem.append(makeCheckbox(this.summary));\n // $listItem.text(this.summary);\n $($list).append($listItem);\n });\n $lessonBlock.append($list);\n $sequences.append($lessonBlock)\n });\n\n}", "function sink() {}", "function sink() {}", "runnerEnd(runner) {\n const specData = this.moduleName ? this.specHashData[this.moduleName] : this.specHashData;\n Object.values(specData).forEach((spec) => {\n const revSpecs = Object.values(spec);\n revSpecs.forEach((test, i) => {\n if (test.parent === test.title) {\n const { title, parent, ...rest } = revSpecs[i];\n revSpecs[i] = {\n title,\n spec: runner.specs[0],\n ...rest,\n };\n }\n if (test.parent !== test.title) {\n const parentIndex = revSpecs.findIndex(\n (item) => item.title === test.parent,\n );\n\n if (parentIndex > -1) {\n if (!revSpecs[parentIndex].suites) {\n revSpecs[parentIndex].suites = [];\n }\n revSpecs[parentIndex].suites.push(test);\n // eslint-disable-next-line no-param-reassign\n delete test.parent;\n }\n }\n // eslint-disable-next-line no-param-reassign\n delete test.parent;\n });\n if (this.moduleName) {\n const filePathLocation = path.join(\n this.resultsDir,\n `${this.fileName}.json`,\n );\n this.resultJsonObject.specs[this.moduleName] = revSpecs.shift();\n this.writToFile(this.resultJsonObject.specs[this.moduleName], filePathLocation);\n } else {\n this.nonMonoRepoResult.push(revSpecs.shift());\n }\n });\n if (!this.moduleName) {\n this.resultJsonObject.specs = this.nonMonoRepoResult;\n const filePathLocation = path.join(\n this.resultsDir,\n `${this.fileName}.json`,\n );\n this.writToFile(this.resultJsonObject, filePathLocation);\n }\n this.screenshots = [];\n this.specHashData = {};\n }", "function reportEvents(_events) {\n\t\tevents = _events;\n\t\trerenderEvents();\n\t}", "function concertThis() {\n // var bandsInTown = new BandsInTown(keys.bandsInTown);\n // If no artists is entered, it will default to 'Red Hot Chili Peppers'\n if (!liriSearchTerm) {\n var artist = \"Red Hot Chili Peppers\";\n }\n else {\n var artist = liriPrintSearchTerm;\n }\n // Create a request and recieve a response from BandsInTown, supplying an artist and retrieving event information\n bandsInTown.getArtistEventList(artist).then(function (events) {\n // console.log(events);\n // Create a cariable to hold the event data for the first event\n var jsonData = events[0];\n if (jsonData === undefined) {\n console.log(\"There are no upcoming events for \"+artist);\n var concertData = [\"There are no upcoming events for \"+artist];\n }\n else {\n // Create an array to store the data to be stored in log.txt\n var concertData = [\n \"Artist: \" + artist,\n \"Venue Name: \" + jsonData.venue.name,\n \"Venue Location: \" + jsonData.formatted_location,\n \"Event Date: \" + jsonData.formatted_datetime\n ].join(\"\\n\");\n }\n // Write Concert Data to terminal window\n console.log(concertData);\n\n // Write Concert Data to log.txt\n updateLogFile(concertData);\n }\n );\n}", "function postProcessing() {\n return gulp.src([\n path.join(testResultsDir, testResultFile),\n path.join(testResultsDir, coverageResultFile)\n ], {\n dot: true\n })\n .pipe(replace(__dirname, \"\"))\n .pipe(gulp.dest(testResultsDir));\n}", "function reportEventChange() {\n\t\trenderEvents();\n\t}", "function reportEventChange() {\n\t\trenderEvents();\n\t}", "function reportEventChange() {\n\t\trenderEvents();\n\t}", "function trackEvent({events, event}) {\n events.counts = events.counts || {};\n events.log = events.log || [];\n\n addEventCounts(events.counts, event);\n // just log useful comparison details\n events.log.push({\n code: event.code,\n level: event.level,\n details: event.details\n });\n }", "static generateReport() {\n let data = [];\n console.info(\"Processing Json Report Files\");\n let files = fs.readdirSync(intermediateJsonFilesDirectory);\n for (let i in files) {\n let f = `${intermediateJsonFilesDirectory}/${files[i]}`;\n console.log(`Processing file ${f}`);\n try {\n let fileContent = fs.readFileSync(f, 'utf-8');\n data.push(JSON.parse(fileContent)[0]);\n }catch (err) {\n if (err) {\n console.error(`Failed to process file ${f}`);\n console.error(err);\n }\n }\n }\n\n console.info(\"Writing consolidated json file\");\n try {\n fs.writeFileSync('./e2e/reports/combinedJSON/cucumber_report.json', JSON.stringify(data));\n } catch (err) {\n if (err) {\n console.error(\"Failed to generate the consolidated json file.\");\n console.error(err);\n throw err;\n }\n }\n\n console.info(\"Generating Final HTML Report\");\n try {\n reporter.generate(cucumberReporterOptions);\n } catch (err) {\n if (err) {\n console.error(\"Failed to generate the final html report\");\n console.error(err);\n throw err;\n }\n }\n }", "function reportChange(event){\n console.log(`File ${event.path} was ${event.type}, running tasks...`);\n}", "function updateCodeCoverageDecorators(coverageDecoratorConfig) {\n // These defaults are chosen to be distinguishable in nearly any color scheme (even Red)\n // as well as by people who have difficulties with color perception.\n // It appears that the contributions in package.json are only used to check what users\n // put in settings.json, while the defaults come from the defaults section of\n // go.coverageDecorator in package.json.\n decoratorConfig = {\n type: 'highlight',\n coveredHighlightColor: 'rgba(64,128,128,0.5)',\n coveredBorderColor: 'rgba(64,128,128,1.0)',\n uncoveredHighlightColor: 'rgba(128,64,64,0.25)',\n uncoveredBorderColor: 'rgba(128,64,64,1.0)',\n coveredGutterStyle: 'blockblue',\n uncoveredGutterStyle: 'slashyellow'\n };\n // Update from configuration.\n if (typeof coverageDecoratorConfig !== 'object') {\n vscode.window.showWarningMessage(`invalid go.coverageDecorator type, expected an 'object'`);\n }\n else {\n for (const k in coverageDecoratorConfig) {\n if (coverageDecoratorConfig.hasOwnProperty(k)) {\n decoratorConfig[k] = coverageDecoratorConfig[k];\n }\n else {\n vscode.window.showWarningMessage(`invalid coverage parameter ${k}`);\n }\n }\n }\n setDecorators();\n vscode.window.visibleTextEditors.forEach(applyCodeCoverage);\n}", "function Track() {}", "constructor() {\n this.testableFiles = [];\n this.testFiles = [];\n this.testConfig = {\n parallel: true,\n coverage: true\n };\n // nothing here\n }", "function reportChange(event){\n console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');\n}", "function reportChange(event){\n console.log('File ' + event.path + ' was ' + event.type + ', running tasks...');\n}", "function jestTestsAndCoverage() {\n return gulp.src(SPEC_DIR)\n .pipe(jest(jestConfig));\n}", "function track(test_case, pass){\n//\tconsole.log(\"track (Test, \" + test_case + \", \" + pass + \")\");\n\t\n\t_gaq.push(['_trackEvent', \"Test\", test_case, (pass ? \"Pass\" : \"Fail\")]);\n}", "function task() {\n agent.get(`/api/api/where/agencies-with-coverage.json?key=${KEY}&format=json`)\n .end();\n }", "function _attachListeners (done, runner) {\n var dummyFunc = function () {}\n\n runner.on('runStart', _collectOutput.bind(null, 'runStart', dummyFunc))\n runner.on('suiteStart', _collectOutput.bind(null, 'suiteStart', dummyFunc))\n runner.on('testStart', _collectOutput.bind(null, 'testStart', dummyFunc))\n runner.on('testEnd', _collectOutput.bind(null, 'testEnd', dummyFunc))\n runner.on('suiteEnd', _collectOutput.bind(null, 'suiteEnd', dummyFunc))\n\n // Only when the runEnd event is emitted we can notify Mocha that we are done.\n runner.on('runEnd', _collectOutput.bind(null, 'runEnd', done))\n}", "function post() {\n var idoc,\n iframe,\n body = document.body,\n me = ui.browserscope,\n key = me.KEY,\n name = 'browserscope-' + (cache.counter++) + '-' + now(),\n snapshot = createSnapshot();\n\n cache.lastAction = 'post';\n clearTimeout(cache.timers.post);\n\n if (key && snapshot && !/Simulator/i.test(Benchmark.platform)) {\n // create new beacon\n try {\n iframe = createElement('<iframe name=' + name + '>');\n } catch(e) {\n (iframe = createElement('iframe')).name = name;\n }\n // inject beacon\n body.insertBefore(iframe, body.firstChild);\n idoc = frames[name].document;\n iframe.style.display = 'none';\n\n // expose results snapshot\n me.snapshot = snapshot;\n setMessage(me.POST_TEXT);\n\n // perform inception :3\n idoc.write(interpolate(\n '<html><body><script>' +\n 'with(parent.ui.browserscope){' +\n 'var _bTestResults=snapshot,' +\n '_bC=function(){clearTimeout(_bT);parent.setTimeout(load,#{refresh}*1e3)},' +\n '_bT=setTimeout(function(){_bC=function(){};render()},#{timeout}*1e3)' +\n '}<\\/script>' +\n '<script src=//www.browserscope.org/user/beacon/#{key}?callback=_bC><\\/script>' +\n '<\\/body><\\/html>',\n {\n 'key': key,\n 'refresh': me.REFRESH_DELAY,\n 'timeout': me.REQUEST_TIMEOUT\n }\n ));\n\n idoc.close();\n }\n }", "function reportEventChange() {\n renderEvents();\n }", "async function generateEmptyCoverage(\n source,\n filename,\n globalConfig,\n config,\n changedFiles,\n sourcesRelatedToTestsInChangedFiles\n) {\n const coverageOptions = {\n changedFiles,\n collectCoverage: globalConfig.collectCoverage,\n collectCoverageFrom: globalConfig.collectCoverageFrom,\n coverageProvider: globalConfig.coverageProvider,\n sourcesRelatedToTestsInChangedFiles\n };\n let coverageWorkerResult = null;\n if ((0, _transform().shouldInstrument)(filename, coverageOptions, config)) {\n if (coverageOptions.coverageProvider === 'v8') {\n const stat = fs().statSync(filename);\n return {\n kind: 'V8Coverage',\n result: {\n functions: [\n {\n functionName: '(empty-report)',\n isBlockCoverage: true,\n ranges: [\n {\n count: 0,\n endOffset: stat.size,\n startOffset: 0\n }\n ]\n }\n ],\n scriptId: '0',\n url: filename\n }\n };\n }\n const scriptTransformer = await (0, _transform().createScriptTransformer)(\n config\n );\n\n // Transform file with instrumentation to make sure initial coverage data is well mapped to original code.\n const {code} = await scriptTransformer.transformSourceAsync(\n filename,\n source,\n {\n instrument: true,\n supportsDynamicImport: true,\n supportsExportNamespaceFrom: true,\n supportsStaticESM: true,\n supportsTopLevelAwait: true\n }\n );\n // TODO: consider passing AST\n const extracted = (0, _istanbulLibInstrument().readInitialCoverage)(code);\n // Check extracted initial coverage is not null, this can happen when using /* istanbul ignore file */\n if (extracted) {\n coverageWorkerResult = {\n coverage: (0, _istanbulLibCoverage().createFileCoverage)(\n extracted.coverageData\n ),\n kind: 'BabelCoverage'\n };\n }\n }\n return coverageWorkerResult;\n}", "function reportEventChange() {\n\t\t\trenderEvents();\n\t\t}", "onTestEnd(test) {\n if (this._results.length === 0) {\n console.warn(\"No test cases were matched. Ensure that your tests are declared correctly and matches TRxxx\");\n return;\n }\n this.qaTouch.publish(this._results);\n }", "function TestReport() {\n\t\"use strict\";\n\tvar data = this.data = {\n\t\ttotal: 0,\n\t\tfail: 0,\n\t\tinconclusive: 0,\n\t\tsuccess: 0,\n\t\ttests: {}\n\t};\n\tthis.toString = function () {\n\t\treturn JSON.stringify(data, null, '\\t');\n\t};\n\tthis.start = function () {\n\t\tdata.start = new Date();\n\t\tdata.end = null;\n\t\tdata.duration = \"measuring\";\n\t};\n\tthis.stop = function () {\n\t\tdata.end = new Date();\n\t\tdata.duration = data.end - data.start;\n\t};\n\tthis.addTest = function (name) {\n\t\tdata.total += 1;\n\t\tdata.inconclusive += 1;\n\t\tvar testResultData = {\n\t\t\tname: name,\n\t\t\toutcome: \"inconclusive\"\n\t\t}\n\t\t\t, testResult = {\n\t\t\tstart: function () {\n\t\t\t\ttestResultData.start = new Date();\n\t\t\t\ttestResultData.end = null;\n\t\t\t\ttestResultData.duration = \"measuring\";\n\t\t\t},\n\t\t\tstop: function () {\n\t\t\t\ttestResultData.end = new Date();\n\t\t\t\ttestResultData.duration = testResultData.end - testResultData.start;\n\t\t\t},\n\t\t\tfailed: function (ex) {\n\t\t\t\tdata.fail += 1;\n\t\t\t\tdata.inconclusive -= 1;\n\t\t\t\ttestResultData.outcome = \"failed\";\n\t\t\t\ttestResultData.ex = ex;\n\t\t\t\ttestResultData.message = ex.toString();\n\t\t\t},\n\t\t\tsucceeded: function () {\n\t\t\t\tdata.success += 1;\n\t\t\t\tdata.inconclusive -= 1;\n\t\t\t\ttestResultData.outcome = \"success\";\n\t\t\t}\n\t\t};\n\t\tdata.tests[name] = testResultData;\n\t\treturn testResult;\n\t};\n}", "function onAllFinished() {\n //we're finished crawling so we set the endtime to the current time and still crawling to false\n endTime = new Date().getTime();\n stillCrawling = false;\n //clear the console for final output since stillCrawling is now false reportCrawling will not write again\n console.clear();\n //output how many urls wer crawld and how long it took\n console.log(`Finished crawling ${crawler.crawledUrls.length} urls in ${(endTime - startTime) / 1000} seconds\\n`);\n //if pages have been added to errorPages we will print them\n if (errorPages.length > 0) {\n console.log('The Following Pages Had Errors:');\n printErrors();\n } \n //else we congratulate the user\n else {\n console.log('Congratulations There Were No Errors!');\n }\n}", "async function startTests() {\n console.log(\"🎸 Built Source Code\");\n const time = new Date().getTime();\n const nodeTest = spawn(`${process.execPath}`, [`build/_tests/tests/test.js`]);\n\n nodeTest.stdout.on(\"data\", (data) => {\n console.log(`[TEST]: ${data}`);\n });\n\n nodeTest.stderr.on(\"data\", (data) => {\n console.error(`[TEST ERROR]: ${data}`);\n });\n\n nodeTest.on(\"close\", () => {\n console.log(`🎸 Test run finished in ${new Date().getTime() - time}ms`);\n if (!cliopts.watch) {\n process.exit();\n }\n });\n}", "async generateReportLoop() {\n while ( true ) { // eslint-disable-line no-constant-condition\n try {\n winston.info( 'Generating Report' );\n const testNameMap = {};\n this.snapshots.forEach( snapshot => snapshot.tests.forEach( test => {\n testNameMap[ test.nameString ] = test.names;\n } ) );\n const testNameStrings = _.sortBy( Object.keys( testNameMap ) );\n const testNames = testNameStrings.map( nameString => testNameMap[ nameString ] );\n\n const elapsedTimes = testNames.map( () => 0 );\n const numElapsedTimes = testNames.map( () => 0 );\n\n const snapshotSummaries = [];\n for ( const snapshot of this.snapshots.slice( 0, MAX_SNAPSHOTS ) ) {\n snapshotSummaries.push( {\n timestamp: snapshot.timestamp,\n shas: snapshot.shas,\n tests: testNames.map( ( names, i ) => {\n const test = snapshot.findTest( names );\n if ( test ) {\n const passedTestResults = test.results.filter( testResult => testResult.passed );\n const failedTestResults = test.results.filter( testResult => !testResult.passed );\n const failMessages = _.uniq( failedTestResults.map( testResult => testResult.message ).filter( _.identity ) );\n test.results.forEach( testResult => {\n if ( testResult.milliseconds ) {\n elapsedTimes[ i ] += testResult.milliseconds;\n numElapsedTimes[ i ]++;\n }\n } );\n\n const result = {\n y: passedTestResults.length,\n n: failedTestResults.length\n };\n if ( failMessages.length ) {\n result.m = failMessages;\n }\n return result;\n }\n else {\n return {};\n }\n } )\n } );\n await sleep( 0 ); // allow other async stuff to happen\n }\n\n const testAverageTimes = elapsedTimes.map( ( time, i ) => {\n if ( time === 0 ) {\n return time;\n }\n else {\n return time / numElapsedTimes[ i ];\n }\n } );\n const testWeights = [];\n for ( const names of testNames ) {\n const test = this.snapshots[ 0 ] && this.snapshots[ 0 ].findTest( names );\n if ( test ) {\n testWeights.push( Math.ceil( test.weight * 100 ) / 100 );\n }\n else {\n testWeights.push( 0 );\n }\n await sleep( 0 ); // allow other async stuff to happen\n }\n\n const report = {\n snapshots: snapshotSummaries,\n testNames: testNames,\n testAverageTimes: testAverageTimes,\n testWeights: testWeights\n };\n\n await sleep( 0 ); // allow other async stuff to happen\n\n this.reportJSON = JSON.stringify( report );\n }\n catch( e ) {\n this.setError( `report error: ${e}` );\n }\n\n await sleep( 5000 );\n }\n }", "function reportChange( event ) {\n console.log( \"File \" + event.path + \" was \" + event.type + \", running tasks...\" );\n}", "trackDependency(telemetry) {\n this.defaultClient.trackDependency(telemetry);\n }", "function trackEvent (strEventName, objProperties, fncCallback) {\r\n providers.forEach(function _trackEvent (provider) {\r\n if (typeof provider.obj.trackEvent === 'function') {\r\n provider.obj.trackEvent(strEventName, helpers.extend({}, objProperties), fncCallback);\r\n }\r\n });\r\n}", "function calculateCoverage(scriptCoverage) {\n //const src = 'https://paulirish.disqus.com/count.js';\n\n // const scriptCoverage = res.result.find(script => script.url === src);\n // console.log(res);\n // if (!scriptCoverage) {\n // console.log(`:coverage() > ${src} not found on the page.`);\n // return new Error(`Couldn't locat script ${src} on the page.`);\n // }\n\n if (scriptCoverage && scriptCoverage.functions && scriptCoverage.functions.length) {\n const coverageData = scriptCoverage.functions.reduce(\n (fnAccum, coverageStats) => {\n const functionStats = coverageStats.ranges.reduce(\n (rangeAccum, range) => {\n return {\n total: range.endOffset > rangeAccum.total ? range.endOffset : rangeAccum.total,\n unused:\n rangeAccum.unused + (range.count === 0 ? range.endOffset - range.startOffset : 0)\n };\n },\n {\n total: 0,\n unused: 0\n }\n );\n\n return {\n total: functionStats.total > fnAccum.total ? functionStats.total : fnAccum.total,\n unused: fnAccum.unused + functionStats.unused\n };\n },\n {\n total: 0,\n unused: 0\n }\n );\n\n return Object.assign(coverageData, {\n percentUnused: coverageData.unused / coverageData.total\n });\n }\n return Error('unexpected');\n}", "function MochaReporter(runner) {\n Base.call(this, runner);\n\n var self = this,\n stats = this.stats,\n total = runner.total,\n indentation = -1,\n suiteTitle,\n currentTest;\n\n MochaReporter.console.log = function consoleLogShim() {\n var args = Array.prototype.slice.call(arguments),\n message = TestAgent.format.apply(TestAgent, arguments);\n //real console log\n log.apply(this, arguments);\n\n //for server\n\n var stack, messages = args.map(function(item) {\n if (!item) {\n return item;\n }\n return (item.toString) ? item.toString() : item;\n });\n\n try {\n throw new Error();\n } catch (e) {\n stack = e.stack;\n }\n\n //re-orgnaize the stack to exlude the above\n stack = stack.split('\\n').map(function(e) {\n return e.trim().replace(/^at /, '');\n });\n\n stack.splice(0, 1);\n stack = stack.join('\\n');\n\n //this is temp\n MochaReporter.send(\n JSON.stringify(['log', {messages: [message], stack: stack}])\n );\n };\n\n runner.on('suite', function onSuite(suite) {\n indentation++;\n MochaReporter.send(\n JSON.stringify(\n ['suite', jsonExport(suite, { indentation: indentation })]\n )\n );\n });\n\n runner.on('suite end', function onSuiteEnd(suite) {\n MochaReporter.send(\n JSON.stringify(\n ['suite end', jsonExport(suite, { indentation: indentation })]\n )\n );\n indentation--;\n });\n\n runner.on('test', function onTest(test) {\n MochaReporter.send(JSON.stringify(['test', jsonExport(test)]));\n });\n\n runner.on('test end', function onTestEnd(test) {\n MochaReporter.send(JSON.stringify(['test end', jsonExport(test)]));\n });\n\n runner.on('start', function onStart() {\n MochaReporter.send(JSON.stringify(['start', { total: total }]));\n });\n\n runner.on('pass', function onPass(test) {\n MochaReporter.send(JSON.stringify(['pass', jsonExport(test)]));\n });\n\n runner.on('fail', function onFail(test, err) {\n MochaReporter.send(\n JSON.stringify(\n ['fail', jsonExport(test, {err: TestAgent.exportError(err) })]\n )\n );\n });\n\n runner.on('end', function onEnd() {\n MochaReporter.send(JSON.stringify(['end', self.stats]));\n });\n }", "function addListenersForRecording() {\n var events = params.events;\n for (var eventType in events) {\n var listOfEvents = events[eventType];\n for (var e in listOfEvents) {\n listOfEvents[e] = true;\n document.addEventListener(e, processEvent, true);\n }\n }\n}", "function Cruncher(){\n\tthis.data = false; // The data from the server\n\tthis.crunch_number = 0; // The thread number\n\t\n\tthis.endCallback = this.end; // The callback which runs when the crunching is done.\n\t\n\tthis.results = {};\n}", "function collectCoins() {\n playAudioCoin();\n this.classList.add('coin-collected');\n coins += 1;\n getCoins();\n checkPowerUps();\n score += 10;\n getScore();\n }", "function processFile(data, lcov) {\n\tvar lines = data.split('\\n'),\n\t\tcurrentFileName = '',\n\t\tcurrentCoverageFile = null;\n\n\tfor(var i = 0, l = lines.length; i < l; i++) {\n\t\tvar line = lines[i];\n\t\tif(line === 'end_of_record' || line === '') {\n\t\t\tcurrentFileName = '';\n\t\t\tcurrentCoverageFile = null;\n\t\t\tcontinue;\n\t\t}\n\n\t\tvar prefixSplit = line.split(':'),\n\t\t\tprefix = prefixSplit[0];\n\n\t\tif(prefix === 'SF') {\n\t\t\tcurrentFileName = prefixSplit[1];\n\t\t\tcurrentCoverageFile = findCoverageFile(lcov, currentFileName);\n\t\t\tif(currentCoverageFile) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tcurrentCoverageFile = new coverageFile(currentFileName);\n\t\t\tlcov.push(currentCoverageFile);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif(prefix === 'DA') {\n\t\t\tvar numberSplit = prefixSplit[1].split(','),\n\t\t\t\tlineNumber = parseInt(numberSplit[0], 10),\n\t\t\t\thits = parseInt(numberSplit[1], 10);\n\t\t\tvar existingDA = findDA(currentCoverageFile.DARecords, lineNumber);\n\t\t\tif(existingDA) {\n\t\t\t\texistingDA.hits += hits;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar newDA = new DA(lineNumber, hits);\n\t\t\tcurrentCoverageFile.DARecords.push(newDA);\n\t\t\tcontinue;\n\t\t}\n\n\t\tif(prefix === 'BRDA') {\n\t\t\tvar numberSplit = prefixSplit[1].split(','),\n\t\t\t\tlineNumber = parseInt(numberSplit[0], 10),\n\t\t\t\tblockNumber = parseInt(numberSplit[1], 10),\n\t\t\t\tbranchNumber = parseInt(numberSplit[2], 10),\n\t\t\t\thits = parseInt(numberSplit[3], 10);\n\t\t\tvar existingBRDA = findBRDA(currentCoverageFile.BRDARecords, blockNumber, branchNumber, lineNumber);\n\t\t\tif(existingBRDA) {\n\t\t\t\texistingBRDA.hits += hits;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tvar newBRDA = new BRDA(lineNumber, blockNumber, branchNumber, hits);\n\t\t\tcurrentCoverageFile.BRDARecords.push(newBRDA);\n\t\t\tcontinue;\n\t\t}\n\t\t//We could throw an error here, or, we could simply ignore it, since we're not interested.\n\t\t//throw new Error('Unknown Prefix \"' + prefix + '\"');\n\t}\n\treturn lcov;\n}", "subscribeEvents()\n {\n on('debug.log', event => {\n this.screen.log(event.text);\n });\n\n // Check for battle after moving\n on('move.finish', () => { \n if (this.checkStartFight())\n {\n // switch to Battle state\n this.battleState();\n }\n });\n\n // Handle postbattle event; go to world screen after postbattle screen\n on('battle.over.win', args => { this.postBattleState(args) });\n }", "function emitRoundEventAndResults(io, round_in_progress, room)\n {\n if (round_in_progress)\n {\n io.emit('round_started', (SECS_IN_COMPLETE_CYCLE - SECS_IN_LOBBY));\n console.log('EMIT: round_started');\n return;\n }\n\n io.emit('round_ended', SECS_IN_LOBBY);\n console.log('EMIT: round_ended');\n\n if (round_results[room].length)\n {\n io.emit('room_round_results', round_results[room]);\n console.log('EMIT: room_round_results - \\t' + round_results[room]);\n }\n }", "async writeFull() {\n const MAX_BRANCHES_PER_TYPE = 500;\n const MAX_BRANCHES_PER_FAILED = 1000;\n\n this.reportTime = new Date();\n\n // Generate report data file\n let reportData = 'onReportData(String.raw`' + utils.escapeBackticks(JSON.stringify({\n tree: this.tree.serialize(MAX_BRANCHES_PER_TYPE, MAX_BRANCHES_PER_FAILED),\n runner: this.runner.serialize(),\n reportTime: this.reportTime,\n reportDomain: this.reportDomain\n })) + '`);';\n\n // Generate passed data file\n let passedData = this.tree.serializePassed();\n\n // Write report, report data, and passed data to disk\n await Promise.all([\n new Promise((res, rej) => fs.writeFile(REPORT_FILENAME, this.reportTemplate, err => err ? rej(err) : res())),\n new Promise((res, rej) => fs.writeFile(REPORT_DATA_FILENAME, reportData, err => err ? rej(err) : res())),\n new Promise((res, rej) => fs.writeFile(PASSED_DATA_FILENAME, passedData, err => err ? rej(err) : res()))\n ]);\n\n // Notify all connected websockets that new data is available on disk\n if(this.isReportServer && this.wsServer) {\n this.wsServer.clients.forEach(client => {\n client.send(`{ \"dataUpdate\": true }`);\n });\n }\n\n // Have this function get called again in a certain period of time\n if(!this.stopped) {\n // The more branches there are, the longer it takes to serialize, the less often this function should get called\n let timeout = this.tree.branches.length <= 100000 ? 30000 : 300000; // every 30 secs or 5 mins\n this.timerFull = setTimeout(() => this.writeFull(), timeout);\n }\n }", "function run_TestFwCs(strBldFldr, rptObj, strBldType, strFlags)\n{\n\tvar fso = new ActiveXObject(\"Scripting.FileSystemObject\");\n\tvar strBldCmdStr = fso.BuildPath(strBldFldr, \"bin\\\\report_cs_tests.bat\");\n\trptObj.reportProgress(\"Starting \" + strBldType + \" C# tests...\");\n\trptObj.closeLog();\t// Close so the external process can append to the log file.\n\ttry\n\t{\n\t\tmisc_RunExtProg(strBldCmdStr, strFlags, null, rptObj, rptObj.strLogFileName, true);\n\t} catch (err)\n\t{\n\t\trptObj.reopenLog (); // Re-open the log file for appending.\n\t\t//rptObj.reportFailure(strBldType + \" C# tests returned: \" + err.number, false);\n\t\tvar strMailCmdStr = fso.BuildPath(strBldFldr, \"bin\\\\OverniteFailNotify.bat\");\n\t\trptObj.reportFailure(strBldType + \" C# tests failed, \" + err.description, false);\n\t\tvar strErr = \"4\";\n\t\trptObj.reportProgress(\"Sending email message \" + strErr +\".\");\n\t\tmisc_RunExtProg(strMailCmdStr, strErr, null, rptObj, null, true);\n\t}\n\trptObj.reopenLog(); // Re-open the log file for appending\n\trptObj.reportProgress(\"Finished \" + strBldType +\" C# tests.\");\n}", "async runTests({tests} = {}) {\n const vizTargetRoot = document.getElementById('vizTargetRoot');\n\n for (const {screenshotOutputPath, testName, suiteName} of tests) {\n // This is to call out tests that may be 'hung', which is helpful for debugging\n const hungConsoleWarningTimeout = setTimeout(\n () => {\n console.log(`${suiteName}/${testName} being slow.`);\n },\n 5 * 1000\n );\n\n const target = vizTargetRoot.appendChild(document.createElement('div'));\n const {testRunner} = this.registeredTests.find((test) => test.testName === testName && test.suiteName === suiteName);\n const testInitializer = this.registeredTestInitializers[suiteName] || noop;\n const testFinalizer = this.registeredTestFinalizers[suiteName] || noop;\n\n // Run the test to render something to the viewport\n let screenshotTarget;\n\n try {\n await testInitializer();\n screenshotTarget = await testRunner(target);\n } catch (e) {\n console.error(`Error running test ${suiteName}/${testName}`, e);\n }\n\n if (!screenshotTarget) {\n throw new Error(`No screenshot target returned from test ${suiteName}/${testName}. Did you forget to 'return'?`);\n }\n\n let targetRect = screenshotTarget.getBoundingClientRect();\n\n // If the screenshot target has a parent, add the parent's padding to the clipping rectangle.\n if (screenshotTarget.parentElement && screenshotTarget.parentElement !== target) {\n const {\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n } = window.getComputedStyle(screenshotTarget.parentElement);\n\n const paddingTopPx = parseInt(paddingTop.replace('px', '')) || 0;\n const paddingRightPx = parseInt(paddingRight.replace('px', '') || 0);\n const paddingBottomPx = parseInt(paddingBottom.replace('px', '') || 0);\n const paddingLeftPx = parseInt(paddingLeft.replace('px', '') || 0);\n\n targetRect = {\n x: targetRect.x - paddingLeftPx,\n y: targetRect.y - paddingTopPx,\n width: targetRect.width + paddingLeftPx + paddingRightPx,\n height: targetRect.height + paddingTopPx + paddingBottomPx,\n };\n }\n\n await window.takeScreenshot({\n targetRect,\n screenshotOutputPath,\n });\n\n try {\n await testFinalizer(target);\n } catch (e) {\n console.error(`Error calling afterEach for test ${suiteName}/${testName}`, e);\n }\n\n vizTargetRoot.removeChild(target);\n\n await window.resetMouse();\n\n clearTimeout(hungConsoleWarningTimeout);\n }\n }", "function receive(data) {\n console.log('response:', Object.keys(data));\n // extract stats property\n // transform Object to text\n // call writeFile function\n writeFile(JSON.stringify(data.stats));\n}", "replay() {\n for (let event of this.log) {\n console.log(event);\n }\n }", "function retrieveDescribeCoverage(serverIndex, coverageIndex) {\n\tTi.API.info('WcsCoverageMetadata.js - serverIndex: ' + serverIndex);\n\tTi.API.info('WcsCoverageMetadata.js - coverageIndex: ' + coverageIndex);\n\n\t// activity indicator for entertainment\n\tvar indicatorStyle;\n\tif (Ti.Platform.name === 'iPhone OS'){\n\t \tindicatorStyle = Ti.UI.iPhone.ActivityIndicatorStyle.DARK;\n\t}\n\telse {\n\t \tindicatorStyle = Ti.UI.ActivityIndicatorStyle.DARK;\n\t}\n\tvar actInd = Ti.UI.createActivityIndicator({\n \t\tcolor: 'black',\n \t\tfont: {fontFamily:'Helvetica Neue', fontSize:26, fontWeight:'bold'},\n \t\tmessage: 'Loading data...',\n \t\tstyle: indicatorStyle,\n \t\t//top: 10,\n \t\t//left: 10,\n \t\theight: Ti.UI.SIZE,\n \t\twidth: Ti.UI.SIZE\n\t});\n\twin.add(actInd);\n\tactInd.show();\n\n\t//Verify if describeCoverage response is null for the server with index choosen\n\tvar addedServers = [];\n\tif (Ti.App.Properties.hasProperty('addedServers')) {\n\t\taddedServers = Ti.App.Properties.getList('addedServers');\n\t};\n\t\n\tif (addedServers[serverIndex].describeCoverageArray[coverageIndex] == null) {\n\t\t//Inoltriamo la richiesta\n\t\tgetDescribeCoverage(addedServers, serverIndex, function(xmlText) {\n\t\t\t//now we have to use the variable `returnedData` any any other normal returned variable\n\n\t\t\tif (xmlText == null) {\n\t\t\t\talert(\"error\");\n\t\t\t} else {\n\t\t\t\t//Update the addedArray and then the property\n\t\t\t\taddedServers[serverIndex].describeCoverageArray[coverageIndex] = xmlText;\n\t\t\t\tTi.App.Properties.setList('addedServers', addedServers);\n\n\t\t\t\tactInd.hide();\n\n\t\t\t\twin2.xmlText = addedServers[serverIndex].describeCoverageArray[coverageIndex];\n\t\t\t\tif (Ti.App.isAndroid == true) {\n\t\t\t\t\twin2.open();\n\t\t\t\t} else {\n\t\t\t\t\twin.padre.openWindow(win2);\t\n\t\t\t\t};\n\t\t\t};\n\t\t});\n\t} else {\n\t\t//alert(\"Xml già presente\");\n\t\t//Set the xmlText win2 property\n\t\tactInd.hide();\n\t\twin2.xmlText = addedServers[serverIndex].describeCoverageArray[coverageIndex];\n\t\tif (Ti.App.isAndroid == true) {\n\t\t\twin2.open();\n\t\t} else {\n\t\t\twin.padre.openWindow(win2);\t\n\t\t};\n\t};\n}", "function set_output_listeners(progress_container) {\n var qc_output_collapse = progress_container.find('#qc_output_collapse');\n var quant_output_collapse = progress_container.find('#quant_output_collapse');\n var diff_output_collapse = progress_container.find('#diff_output_collapse');\n\n var qc_ul = progress_container.find('#qc_list');\n var quant_ul = progress_container.find('#quant_list');\n var diff_ul = progress_container.find('#diff_list');\n\n var qc_textarea = progress_container.find('#qc_textarea');\n var quant_textarea = progress_container.find('#quant_textarea');\n var diff_textarea = progress_container.find('#diff_textarea');\n\n var qc_status_badge = progress_container.find('#qc_status_badge');\n var quant_status_badge = progress_container.find('#quant_status_badge');\n var diff_status_badge = progress_container.find('#diff_status_badge');\n\n set_output_listener_for_collapse(qc_output_collapse, 'qc', qc_textarea,\n qc_ul, qc_status_badge);\n set_output_listener_for_collapse(quant_output_collapse, 'quant',\n quant_textarea, quant_ul, quant_status_badge);\n set_output_listener_for_collapse(diff_output_collapse, 'diff', diff_textarea,\n diff_ul, diff_status_badge);\n}", "runTests() {\n return __awaiter(this, void 0, void 0, function* () {\n let done = plugins.smartq.defer();\n // print some info\n plugins.beautylog.log(`---------------------------------------------\\n`\n + `-------------------- tapbuffer ----------------------\\n`\n + `-----------------------------------------------------`);\n plugins.beautylog.info(`received ${this.testableFiles.length} modulefile(s) for testing`);\n plugins.beautylog.info(`received ${this.testFiles.length} test files`);\n plugins.beautylog.info(`Coverage will be provided by istanbul`);\n // handle testableFiles\n let testableFilesMessage = {};\n for (let file of this.testableFiles) {\n testableFilesMessage[file.path] = file.contents.toString();\n }\n // handle testFiles\n let testFilesMessage = {};\n for (let file of this.testFiles) {\n testFilesMessage[file.path] = file.contents.toString();\n }\n // prepare injection handoff\n let testableFilesJson = JSON.stringify(testableFilesMessage);\n let testFilesJson = JSON.stringify(testFilesMessage);\n let parentEnv = JSON.stringify(process.env);\n let parentShellPath = (yield plugins.smartshell.execSilent(`echo $PATH`)).stdout;\n parentShellPath = parentShellPath.replace(/\\r?\\n|\\r/g, ''); // remove end of line\n plugins.smartipc.startSpawnWrap(plugins.path.join(__dirname, 'spawnhead.js'), [], {\n 'TESTABLEFILES_JSON': testableFilesJson,\n 'TESTFILES_JSON': testFilesJson,\n 'PARENT_ENV': parentEnv\n });\n let testPromiseArray = [];\n let testCounter = 0;\n for (let testFile of this.testFiles) {\n testCounter++;\n let testThread = new plugins.smartipc.ThreadSimple(testFile.path, [], { silent: true, env: { TESTNUMBER: `${testCounter.toString()}` } });\n let parsedPath = plugins.path.parse(testFile.path);\n console.log('=======');\n plugins.beautylog.log(`-------------- ${parsedPath.name} --------------`);\n console.log('=======');\n let testPromise = testThread.run().then((childProcess) => {\n let done = plugins.smartq.defer();\n childProcess.stdout.pipe(tapMochaReporter('list'));\n childProcess.on('exit', function () {\n done.resolve();\n });\n return done.promise;\n });\n // wait for tests to complete if not running parallel\n if (!this.testConfig.parallel) {\n yield testPromise;\n }\n testPromiseArray.push(testPromise);\n }\n Promise.all(testPromiseArray).then(() => __awaiter(this, void 0, void 0, function* () {\n let Collector = new plugins.istanbul.Collector();\n let Reporter = new plugins.istanbul.Reporter();\n let fileArray = yield plugins.smartfile.fs.fileTreeToObject(process.cwd(), 'coverage/**/coverage-final.json');\n if (this.testConfig.coverage) {\n // remap the output\n let remapArray = [];\n for (let smartfile of fileArray) {\n remapArray.push(smartfile.path);\n }\n let remapCoverage = plugins.remapIstanbul_load(remapArray);\n let remappedCollector = plugins.remapIstanbul_remap(remapCoverage, {\n readFile: (filePath) => {\n let localSmartfile = this.testableFiles.find(itemArg => {\n if (itemArg.path === filePath) {\n return true;\n }\n });\n return localSmartfile.contents.toString();\n }\n });\n let remappedJsonPath = plugins.path.resolve('coverage-final.json');\n yield plugins.remapIstanbul_write(remappedCollector, 'json', remappedJsonPath);\n Collector.add(plugins.smartfile.fs.toObjectSync(remappedJsonPath));\n yield plugins.smartfile.fs.remove(remappedJsonPath);\n Reporter.addAll(['text', 'lcovonly']);\n Reporter.write(Collector, true, () => {\n let lcovInfo = plugins.smartfile.fs.toStringSync(plugins.path.join(process.cwd(), 'coverage/lcov.info'));\n plugins.smartfile.fs.removeSync(plugins.path.join(process.cwd(), 'coverage'));\n done.resolve(lcovInfo);\n });\n }\n })).catch(err => {\n console.log(err);\n });\n return yield done.promise;\n });\n }" ]
[ "0.5422264", "0.5340424", "0.5225791", "0.5195218", "0.5153757", "0.5134406", "0.50448984", "0.49608773", "0.49254733", "0.48867014", "0.48514178", "0.48264694", "0.4826133", "0.4797085", "0.475698", "0.47049302", "0.46799612", "0.4679131", "0.4669305", "0.46680975", "0.46537185", "0.4633862", "0.4633811", "0.46247762", "0.46189302", "0.45965242", "0.4592262", "0.45894957", "0.45833284", "0.45654082", "0.45646405", "0.45477825", "0.45250875", "0.4494783", "0.44685793", "0.44659796", "0.4450896", "0.44412667", "0.44412667", "0.44412667", "0.44412667", "0.44412667", "0.44412667", "0.44412667", "0.44412667", "0.443519", "0.44227535", "0.44159836", "0.44091988", "0.4406025", "0.44050267", "0.4402064", "0.4402064", "0.4400962", "0.43999267", "0.43880472", "0.43819976", "0.43655914", "0.43655914", "0.43655914", "0.43571538", "0.43561086", "0.43539864", "0.43536434", "0.43464676", "0.43430054", "0.43428698", "0.43428698", "0.43389088", "0.43374732", "0.43371302", "0.4334758", "0.43344474", "0.4324473", "0.43232584", "0.4316597", "0.430907", "0.43049836", "0.4292351", "0.4281453", "0.4275673", "0.4252308", "0.42510012", "0.42501527", "0.42472956", "0.42462108", "0.4241863", "0.4226853", "0.42225653", "0.42200246", "0.4218344", "0.42177746", "0.42160958", "0.42127413", "0.42123717", "0.42120716", "0.42110983", "0.42101485", "0.4208684", "0.42078477" ]
0.55255824
0
get all the workouts done
async getAll(){ return await conn.query("SELECT * FROM Fitness_Workouts"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getWorkouts(){\n $.ajax({\n method: \"GET\",\n url: \"/api/workout\"\n }).then( resp => {\n console.log(resp)\n allWorkouts = resp;\n populateWorkouts();\n })\n }", "function getWorkouts() {\n\t\t\t\tworkout.getWorkouts().then(function(result) {\n\t\t\t\t\t// returned as $resource with workout property as a string\n\t\t\t\t\tvm.workoutPlan = result.data;\n\t\t\t\t\t// list of JSON parsed workouts\n\t\t\t\t\tvm.workObject = vm.workoutPlan.listWorkouts();\n\n\t\t\t\t\t//console.log(\"vm.workoutPlan\");\n\t\t\t\t\t//console.log(vm.workoutPlan);\n\t\t\t\t\t//console.log(\"vm.workObject\");\n\t\t\t\t\t//console.log(vm.workObject);\n\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "function getWorkouts() {\n $.get(\"/api/workouts\", renderWorkoutList);\n }", "function getworkouts() {\n $.get(\"/api/workouts\", renderworkoutList);\n }", "function getWork(){\n //self.works = workService.getWork();\n }", "function findAllWorkouts(res, cb){\n db.Workout.find({}).sort({day:1}) \n .then((data)=>{\n cb(data);\n })\n}", "function getAllCompletedWorkoutsByUserName(res, user) { //get complete workouts\n Log.find({author:user}, function (err, workout) {\n if (err) res.send(err);\n res.json(workout);\n },{}).where({completed:true});\n}", "function getCompletedWorkouts(res, mysql, context, userID, complete){\n var sql = \"SELECT Workouts.workoutName, Workouts.bodyPart, Workouts.linkToVideo, UserWorkouts.sets, UserWorkouts.reps FROM UserWorkouts, Workouts WHERE userID=? and UserWorkouts.completed=`Y`\";\n var inserts = [userID];\n mysql.pool.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.completedWorkouts = results;\n complete();\n });\n }", "function populateWorkouts(params){\n $(\"#workouts-list\").empty();\n const ul = $(\"<ul>\");\n allWorkouts.forEach( (workout, idx) => {\n console.log(workout);\n const li = $(\"<li>\");\n li.addClass(\"workout-item\");\n li.attr(\"data-workout-id\", workout._id);\n li.attr(\"data-workout-idx\", idx);\n li.html(\"<span>\" + workout.day + \"</span>\" + workout.name);\n ul.append(li);\n });\n $(\"#workouts-list\").append(ul);\n if( params && params.selectLatest === true ){\n $(\"#workouts-list li:last-child\").addClass(\"selected\");\n }\n }", "workoutList(){\n return this.state.workouts.map((currentWorkout, i) => {\n return (<Workout workout={currentWorkout} key={currentWorkout._id} />)\n })\n }", "function getPresetWorkouts(preset) {\n\tvar workouts = [];\n\tfor (var i = 0; i < presets.length; i++) {\n\t\tif (presets[i].presetType == preset) {\n\t\t\tvar jsonWorkouts = presets[i].workouts;\n\t\t\tfor (jsonWorkout of jsonWorkouts) {\n\t\t\t\tvar workout = new Workout();\n\t\t\t\tworkout.name = jsonWorkout.name;\n\t\t\t\tworkout.points = jsonWorkout.points;\n\t\t\t\tworkout.description_long = jsonWorkout.description_long;\n\t\t\t\tworkout.description_short = jsonWorkout.description_short;\n\t\t\t\tworkouts.push(workout);\n\t\t\t}\n\t\t}\n\t}\n\treturn workouts;\n}", "fetchWorkouts(context, localStorageWorkouts) {\n if (localStorageWorkouts == null) {\n context.commit('setWorkouts', []);\n context.commit('updateWorkouts');\n } else {\n context.commit('setWorkouts', localStorageWorkouts);\n }\n }", "getAll(req, res){\n Workout.find({})\n .then(workout => {\n res.json(workout);\n })\n .catch(err => {\n res.json(err);\n });\n }", "_renderWorkout_FromLocalStorageToMap() {\r\n this.#workouts.forEach(workout => this._renderWorkoutOnMap(workout));\r\n }", "function getAllJobInfoFromServer() {\r\n\tMoCheck.aktJobs = new Array();\r\n\tif(MoCheck.getJobCoords().length > 0) {\r\n\t\t$each(MoCheck.getJobCoords(), function(jobCoords, index) {\r\n\t\t\tMoCheck.getJobInfoFromServer(jobCoords.pos.x, jobCoords.pos.y);\r\n\t\t});\r\n\t} else {\r\n\t\t/* MotivationWindow muss ggf. neu geladen werden, auch wenn die aktuelle Liste keine Jobs hat */\r\n\t\tMoCheck.reloadWindow();\r\n\t}\r\n}", "function getDailyWorkouts(res, mysql, context, userID, complete){\n var sql = \"SELECT Workouts.workoutName, Workouts.bodyPart, Workouts.linkToVideo, UserWorkouts.sets, UserWorkouts.reps FROM UserWorkouts, Workouts WHERE userID=? and UserWorkouts.completed=`N`\";\n var inserts = [userID];\n mysql.pool.query(sql, inserts, function(error, results, fields){\n if(error){\n res.write(JSON.stringify(error));\n res.end();\n }\n context.dailyWorkouts = results;\n complete();\n });\n }", "function generateWorkout(user) {\n const workouts = [{\n user: user._id,\n name: \"Morning\"\n }, {\n user: user._id,\n name: \"Afternoon\"\n }, {\n user: user._id,\n name: \"Evening\"\n }, {\n user: user._id,\n name: \"Best\"\n }];\n return workouts[0];\n}", "getPaddleWorkers(cb) {\n let sites = [];\n\n for (let site in this.workers) {\n sites.push({ site: this.workers });\n }\n\n if (sites.length > 0) {\n cb(null, this.workers);\n } else {\n cb(null, \"No Workers Running\");\n }\n }", "getOptions(val) {\n var list = []\n\n // These clauses identify which types of workouts are included in the day,\n // and push the three levels for each into the return list\n if (this.state.temp.hasOwnProperty('swimWorkout')) {\n list.push({\n title: 'SWIM: Beginner',\n workout: this.state.temp.swimWorkout[0]\n })\n list.push({\n title: 'SWIM: Intermediate',\n workout: this.state.temp.swimWorkout[1]\n })\n list.push({\n title: 'SWIM: Advanced',\n workout: this.state.temp.swimWorkout[2]\n })\n }\n if (this.state.temp.hasOwnProperty('bikeWorkout')) {\n list.push({\n title: 'BIKE: Beginner',\n workout: this.state.temp.bikeWorkout[0]\n })\n list.push({\n title: 'BIKE: Intermediate',\n workout: this.state.temp.bikeWorkout[1]\n })\n list.push({\n title: 'BIKE: Advanced',\n workout: this.state.temp.bikeWorkout[2]\n })\n }\n if (this.state.temp.hasOwnProperty('runWorkout')) {\n list.push({\n title: 'RUN: Beginner',\n workout: this.state.temp.runWorkout[0]}\n )\n list.push({\n title: 'RUN: Intermediate',\n workout: this.state.temp.runWorkout[1]\n })\n list.push({\n title: 'RUN: Advanced',\n workout: this.state.temp.runWorkout[2]\n })\n }\n return list\n }", "function LatestWorkout({workouts, user, isLoading}) {\n\n const getLatestWorkout = () => {\n let latestWorkout = {};\n for (let i = 0; i < workouts.length; i++) {\n if (workouts[i].user_id === user.id) {\n latestWorkout = workouts[i];\n\n break\n }\n } \n\n return (\n <div className=\"inner-container\">\n\n <h5>Your last workout:</h5>\n <p>\n <a href={\"/workouts/\" + latestWorkout.id}>{latestWorkout.workout_name} </a> \n </p>\n <DateTime dateTime={latestWorkout.date_time}/>\n </div> \n )\n\n }\n\n if (!isLoading) {\n \n return (\n getLatestWorkout()\n )\n\n } else {\n return (\n\n <p>Loading... </p>\n )\n }\n }", "function getAllWorkshops(req, res) {\n res.json(workshops);\n}", "function listAllTasks() {\n for (var ix = 0; ix < toDoList.length; ix++) {\n console.log(ix + 1 + \": \" + toDoList[ix]);\n }\n}", "function _getTasksFromWorkspaces(counter, context) {\n $.ajax({\n method: 'GET',\n url: 'https://app.asana.com/api/1.0/workspaces/' + window.workspaces[counter]['id'] + '/tasks?assignee=me&completed_since=now',\n beforeSend: function(xhr) {\n xhr.setRequestHeader(\"Authorization\", \"Basic \" + window.localStorage._authKey);\n },\n success: function(resp) {\n for (var i = 0; i < resp.data.length; i++) {\n if (resp.data[i].name.length) {\n window.memory.save({\n text: resp.data[i].name,\n page: 'ASANA',\n id: resp.data[i].id\n });\n window.asanaIDs.push(resp.data[i].id);\n }\n }\n if (counter === window.workspaces.length - 1) {\n window.localStorage._asanaIDs = JSON.stringify(window.asanaIDs);\n closeSpinner.call(context);\n _createAppView.call(context);\n } else {\n _getTasksFromWorkspaces.call(context, counter + 1, context);\n }\n },\n error: function(err) {\n closeSpinner.call(context);\n console.log(\"ERR:\", err);\n }\n }); \n}", "getWorkouts(list, past) {\n var workoutList = list.map((workout, day) => {\n // Identify the current week, day of the week, and completion status\n var weekday = workout.day % 7\n var weekdayPrint\n if (!weekday) {\n weekdayPrint = 7\n } else if (weekday === 1) {\n weekdayPrint = '1 of this week'\n } else {\n weekdayPrint = weekday\n }\n var week = workout.day / 7\n var complete = workout.completed\n\n // Determine whether the day is a rest day or not\n if (!workout.swim && !workout.bike && !workout.run) {\n // If on a rest day, determine whether the rest day has been completed\n // or not and render the day's entry\n var containerStyle = complete ? styles.restDayWorkoutContainer : styles.futureRestDayWorkoutContainer\n var textStyle = complete ? styles.restDayWorkoutText : styles.futureRestDayWorkoutText\n return (\n <TouchableOpacity\n key={day}\n style={containerStyle}\n onPress={complete ? null : () => this.switch(workout.day)}>\n <Text style={textStyle}>REST DAY</Text>\n </TouchableOpacity>\n )\n } else {\n // Again, determine completion and render the entry accordingly\n var containerStyle = complete ? styles.completedWorkoutContainer : styles.workoutContainer\n var textStyle = complete ? styles.completedWorkoutDate : styles.workoutDate\n var iconName = Platform.OS === 'ios' ? `ios-create${'-outline'}` : 'md-create'\n return (\n <View key={day}>\n {weekday === 1 ? <Text style={styles.week}>WEEK {Math.ceil(week)}</Text> : null}\n <TouchableOpacity\n style={containerStyle}\n onPress={() => complete ? this.openPastModal(workout.day) : this.openFutModal(workout.day)}>\n <Text style={textStyle}>DAY {workout.day} ({weekdayPrint})</Text>\n {/* If complete, render yellow entry with text indicating the\n difficulty level the user chose that day and an icon for\n whether a journal entry is attached; if not, render green\n entry with just the icons */}\n {complete ?\n <View style={styles.workoutPlanContainer}>\n {(workout.hasOwnProperty('swimDifficulty')) ?\n <View style={styles.eachWorkoutContainer}>\n <Image\n source={require('../assets/images/swim.png')}\n style={styles.activityIcon}/>\n <Text style={styles.workoutWorkout}>{workout.swimDifficulty.substring(0, 5)}.</Text>\n </View> : null\n }\n {(workout.hasOwnProperty('bikeDifficulty')) ?\n <View style={styles.eachWorkoutContainer}>\n <Image\n source={require('../assets/images/bike.png')}\n style={styles.activityIcon}/>\n <Text style={styles.workoutWorkout}>{workout.bikeDifficulty.substring(0, 5)}.</Text>\n </View> : null\n }\n {(workout.hasOwnProperty('runDifficulty')) ?\n <View style={styles.eachWorkoutContainer}>\n <Image\n source={require('../assets/images/run.png')}\n style={styles.activityIcon}/>\n <Text style={styles.workoutWorkout}>{workout.runDifficulty.substring(0, 5)}.</Text>\n </View> : null\n }\n {(workout.hasOwnProperty('journal')) ?\n <View style={styles.imageContainer}>\n <Ionicons\n name={iconName}\n size={28}\n style={{ marginBottom: -3 }}\n color={Colors.ourYellow}/>\n </View> : null\n }\n </View> :\n <View style={styles.workoutPlanContainer}>\n {(workout.swim) ?\n <View style={styles.eachWorkoutContainer}>\n <Image\n source={require('../assets/images/swim.png')}\n style={styles.activityIcon}/>\n </View> : null\n }\n {(workout.bike) ?\n <View style={styles.eachWorkoutContainer}>\n <Image\n source={require('../assets/images/bike.png')}\n style={styles.activityIcon}/>\n </View> : null\n }\n {(workout.run) ?\n <View style={styles.eachWorkoutContainer}>\n <Image\n source={require('../assets/images/run.png')}\n style={styles.activityIcon}/>\n </View> : null\n }\n </View>\n }\n </TouchableOpacity>\n </View>\n )\n }\n })\n return workoutList\n }", "function displayWork() {\n\nfor (job in work.jobs) {\n\t$(\"#workExperience\").append(HTMLworkStart);\n\n\tvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n\n\tvar formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\n\n\tvar formattedEmployerTitle = formattedEmployer + formattedTitle;\n\n\t$(\".work-entry:last\").append(formattedEmployerTitle);\n\n\tvar formattedworkDates = HTMLworkDates.replace (\"%data%\",work.jobs[job].dates);\n\n\tvar formattedworkLocation = HTMLworkLocation.replace (\"%data%\", work.jobs[job].location);\n\n \tvar formattedworkDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n\n \t$(\".work-entry:last\").append(formattedworkDates);\n \t$(\".work-entry:last\").append(formattedworkLocation);\n \t$(\".work-entry:last\").append(formattedworkDescription);\n\n\t}\n}", "function getTaskLists() {\n\n}", "getStakeOuts() {\n return this.stakeOuts;\n }", "function getWorkout() {\n\tvar list = JSON.parse(localStorage.exercises); // parsed list of exercises\n\tvar index = (localStorage.total - count) % list.length;\n\tvar workoutType = list[index]; // current exercise type\n\tvar ex = Workout.instances[workoutType]; // list of corresponding exercises\n\treturn ex[getRandomInt(0, ex.length)];\n}", "function get_works(req){\n var q = datastore.createQuery(WORK).limit(5);\n var results = {}; //returned to user\n if(Object.keys(req.query).includes(\"cursor\")){ //If there is a cursor\n q.startVal = (req.query.cursor).replace(/ /g, \"+\"); //Set start of retrieval at cursor in URI format\n }\n // console.log(\"QUERY\");\n // console.log(q);\n\n //Retrieve works from datastore\n return datastore.runQuery(q).then( entities => {\n results.works = entities[0];\n\n //Add next if necessary\n if(entities[1].moreResults !== Datastore.NO_MORE_RESULTS){\n results.next = \"https://\" + req.get(\"host\") + \"/works?cursor=\" + entities[1].endCursor;\n }\n\n //Add ID's and selfLinks\n results.works.map( function(x){\n return addIDandSelfLink(req,x);\n });\n\n //Add total\n return getTotal(results, WORK);\n\n }).catch( errr => {\n console.log(errr);\n return false;\n });\n}", "async fetchWorkouts() {\n await axios//get all workouts and set to data\n .get(ROUTES.get_workouts)\n .then(results => {\n console.log(results);\n this.setState({data: results.data, loading: false});\n })\n .catch(error => {\n console.log(error.response);\n this.setState({loading: false});\n });\n }", "function getWork(){\n workEl.innerHTML='';\n fetch(urlWork)\n .then(response => response.json())\n .then(data => {\n data.worklist.forEach(work =>{\n workEl.innerHTML +=\n `\n <div class=\"workContent\">\n <li>${work.title} --${work.company}</li> \n </div>\n `; \n })\n })\n}", "function displayWork() {\n for (job in work.jobs) {\n $(\"#workExperience\").append(HTMLworkStart);\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\",\n work.jobs[job].employer);\n var formattedTitle = HTMLworkTitle.replace(\"%data%\",\n work.jobs[job].title);\n var formattedEmployerTitle = formattedEmployer + formattedTitle;\n\n $(\".work-entry:last\").append(formattedEmployerTitle);\n\n var formattedDates = HTMLworkDates.replace(\"%data%\",\n work.jobs[job].dates);\n $(\".work-entry:last\").append(formattedDates);\n\n var formattedDescription = HTMLworkDescription.replace(\"%data%\",\n work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n }\n}", "function getMyWorkouts(){\n fetch(`/get_my_workouts`)\n .then(response => response.json())\n .then(myWorkouts => {\n let cardContainer = document.getElementById('my-workouts-container');\n \n let templateFunction = Handlebars.compile(myWorkoutCardTemplate);\n console.log(myWorkouts)\n if (myWorkouts.length >1){\n myWorkouts.forEach(function(workout,n) {\n console.log(workout)\n let workoutTime = 0;\n workout.exercises.forEach(x => {workoutTime += x.time_to_complete})\n\n let newDiv = document.createElement('div')\n newDiv.setAttribute(\"id\", `my-workout-${n}`)\n\n newDiv.innerHTML = templateFunction({myWorkoutX:`${n}`,workoutName:workout.name, workoutDescription: 'placeholder', workoutLength:workoutTime, currentWorkout:JSON.stringify(workout.exercises), likes: JSON.stringify(workout.likes) });\n\n cardContainer.appendChild(newDiv);\n\n newDiv.addEventListener('click',function(){setCurrentWorkout(workout, workout.name)},false );\n $(`#my-workout-${n}`).click( function(e) {\n e.preventDefault();\n \n });\n })\n } else {\n let noWorkouts = document.createElement('h2');\n noWorkouts.innerHTML = 'No Workouts Saved!'\n noWorkouts.style.textAlign = 'center';\n cardContainer.innerHTML += noWorkouts;\n }\n \n\n \n })\n}", "getJobs () {\n }", "workFinishCall() {\n\t\t// all nodes have been downloaded\n if (this.finishCount === this.worklist.length) {\n this.state = 'finish'\n this.finishDate = utils.formatDate()\n userTasks.splice(userTasks.indexOf(this), 1)\n finishTasks.unshift(this)\n clearInterval(this.countSpeed)\n sendMessage()\n this.recordInfor(`${this.name} 下载完成`)\n this.finishStore()\n } else {\n\t\t\t// running next\n this.updateStore()\n this.downloadSchedule()\n }\n }", "function nextWorkout(){\n var next = response.workout.shift();\n if (next) {\n return next\n } \n //if no more workouts, count log completions and redirect to menu page\n else {\n $.post(\"/logCompletion\", {routineUsed: location.pathname.slice(1)})\n .done(function(res){\n // send data <- hint\n res.send(res)\n // var log = {location.pathname.slice(1)}\n // console.log(log, \"log\");\n //window.location.pathway\n\n });\n window.location.href = redirect;\n }\n}", "function get_closed_tasks() {\n fill_task_list($(\"#closed_tasks\"), true);\n}", "function getMyData(workspaces, type, ws_name) {\n var params = {};\n if (!ws_name) {\n var ws_ids = [], obj_count = 0;\n for (var i in workspaces) {\n ws_ids.push(workspaces[i].id);\n obj_count = workspaces[i].count + obj_count;\n }\n\n params.ids = ws_ids;\n } else\n params.workspaces = [ws_name];\n\n if (type) params.type = type;\n\n if (obj_count > maxObjFetch)\n console.error(\"user's object count for owned workspaces was\", obj_count);\n\n //console.log('total owned data is', obj_count)\n\n var req_count = Math.ceil(obj_count/10000);\n\n var proms = [];\n proms.push( ws.list_objects(params) );\n for (var i=1; i < req_count; i++) {\n params.skip = 10000 * i;\n proms.push( ws.list_objects(params) );\n }\n\n var p = ws.list_objects(params);\n return $.when(p).then(function(d) {\n // update model\n myData = [].concat.apply([], arguments);\n render(myData, minePanel, mineSelected);\n });\n }", "function createWorklistHelper() {\n var pfs = {\n maxResults : $scope.clusterCt,\n startIndex : $scope.skipClusterCt,\n sortField : $scope.sortOrder\n };\n\n // Create worklist\n workflowService.createWorklist($scope.selected.project.id, $scope.bin.id, $scope.clusterType,\n pfs).then(\n // Success\n function(data) {\n // workflowService.fireWorklistChanged(data);\n $scope.completionMessage += data.name;\n $scope.completionMessage += ' completed. \\n';\n $scope.worklistsCompleted++;\n if ($scope.worklistsCompleted < $scope.numberOfWorklists) {\n createWorklistHelper();\n } else {\n $uibModalInstance.close();\n }\n },\n // Error\n function(data) {\n $scope.errors[0] = data;\n utilService.clearError();\n });\n }", "runWorkshops(map, callback) {\n // No workshops\n if (this._workshops.length == 0) {\n if (callback) { callback(); }\n return;\n }\n\n // Start with first workshop\n this.nextWorkshop(map, 0, callback);\n }", "async getAllWorkspaces(){\n const workspaceRepository = locator.get('iworkspaceRepository');\n var workspaces = await workspaceRepository.getAllWorkspaces();\n return workspaces;\n\n }", "function displayWork() {\n\tfor (job in work.jobs) {\n\t\t//create new div for work experience\n\t\t$(\"workExperience\").append(HTMLworkStart);\n\t\t// concat employer and title\n\t\tvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n\t\tvar formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job])\n\t}\n}", "function getStories(iterationRef, iterationName) {\n\tconsole.log(notificationQueue);\n\trestApi.query({\n\t\ttype: 'HierarchicalRequirement',\n\t\tquery: queryUtils.where('TaskStatus', '=', 'DEFINED')\n\t\t\t\t.or('TaskStatus', '=', 'IN_PROGRESS')\n\t\t\t\t.or('TaskStatus', '=', 'COMPLETED')\n\t\t\t\t.or('TaskStatus', '=', 'NONE')\n\t\t\t\t.and('Iteration.Name', '=', iterationName),\n\t\tfetch: ['Name', 'Blocked', 'BlockedReason', 'TaskStatus'],\n\t\tscope: {\n\t\t\tproject: '/project/' + config.rally.projectid,\n\t\t\tup: false,\n\t\t\tdown: true\n\t\t},\n\t}, function(error, result) {\n\t\tif(error) {\n\t\t\tconsole.log(error);\n\t\t} else {\n\t\t\tvar i = 0;\n\t\t\twhile(i < result.Results.length){\n\t\t\t\tinsertDoc(result.Results[i], storiesDb);\n\t\t\t\ti++;\n\t\t\t}\n\t\t};\n\t});\n}", "function getTaskList(indice) \n{\n RMPApplication.debug(\"begin getTaskList\");\n c_debug(dbug.task, \"=> getTaskList\");\n id_index.setValue(indice);\n var query = \"parent.number=\" + var_order_list[indice].wo_number;\n\n var options = {};\n var pattern = {\"wm_task_query\": query};\n c_debug(dbug.task, \"=> getTaskList: pattern = \", pattern);\n id_get_work_order_tasks_list_api.trigger(pattern, options, task_ok, task_ko);\n RMPApplication.debug(\"end getTaskList\");\n}", "async function listWorks (ctx) {\n const { language, subtitle } = ctx.state;\n\n const works = await Work.query()\n .modify('setLocale', 'public_work_names', 'work_id', 'public_works.id', language, subtitle)\n .select('slug', 'cat_id', 'is_unlock', 'price')\n .modify('currencyName', 'public_works', language);\n\n if (works.length > 0) {\n ctx.status = 200;\n ctx.body = {\n data: works,\n };\n } else {\n ctx.status = 404;\n ctx.body = {\n message: 'Could not find any public works.',\n };\n }\n}", "function getAllTask() {\n clearAll(); // clears innerHTML \n\n taskManager.tasks.forEach(function (task) {\n return addTaskToPage(task);\n }); // displays each task from the array\n\n totalNumber.innerHTML = \"\".concat(taskManager.tasks.length); // All Tasks total number is the length of the array\n} // Counter for Done", "getAllCurrentJobs() { \n return this.items.map(ele=>ele.element);\n }", "async getWorkoutsInRange() {\n const res = await fetch(`/api/workouts/range`);\n const json = await res.json();\n return json;\n }", "function getWorks(res, mysql, context, complete) {\n mysql.pool.query(\"SELECT Employees.id as eid, fname, lname, title, Dogs.id as did, name FROM Employees INNER JOIN Works ON Employees.id = Works.EmployeeID INNER JOIN Dogs ON Dogs.id = Works.DogID\", function (error, results, fields) {\n if (error) {\n res.write(JSON.stringify(error));\n res.end();\n }\n context.works = results; //define the results as \"works\"\n complete(); //call the complete function to increase callbackcount\n });\n }", "function getWorkOrder() {\n return workOrder;\n }", "function listUpcomingHomework() {\n\n // GETS TODAY'S DATE\n var todayDate = new Date(),\n d = todayDate.getDate(),\n m = todayDate.getMonth() + 1,\n today;\n\n if (d < 10) {\n d = \"0\" + d;\n }\n if (m < 10) {\n m = \"0\" + m;\n }\n\n today = m + \"-\" + d;\n console.log('Today is: ' + today);\n\n\n var request = gapi.client.calendar.events.list({\n 'calendarId': 'primary',\n 'timeMin': (new Date()).toISOString(),\n 'showDeleted': false,\n 'singleEvents': true,\n 'maxResults': 20,\n 'orderBy': 'startTime'\n });\n\n request.execute(function(resp) {\n var events = resp.items;\n \n if (events.length > 0) {\n for (i = 0; i < events.length; i++) {\n\n var event = events[i];\n var when = event.start.date;\n if (!when) {\n when = event.start.date;\n }\n \n // EVENT NAME\n var str = event.summary;\n var strLength = str.length;\n \n // IF CATCHES HOMEWORK EVENT\n if (str.indexOf('HOMEWORK') > -1) {\n console.log(str.substring(11, strLength) + '\\nDue on ' + when.substring(5, 100));\n writeHomework(str.substring(11, strLength) + ' Due on ' + when.substring(5, 100));\n \n // ALERT IF HOMEWORK IS DUE TODAY\n if(when.substring(5,100) == today && isHomework != 1){\n alert(\"You Have Homework due today!\");\n }\n\n isHomework = 1;\n }\n }\n }\n\n // IF NO HOMEWORK EVENT IS FOUND\n if (isHomework != 1) {\n console.log(\"no homework found\");\n writeHomework('No upcoming homework found!');\n }\n \n });\n}", "function displayWork() {\n\n for(job in work.jobs){\n $(\"#workExperience\").append(HTMLworkStart); \n //create new div for Work sektion\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\n var formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\n var formattedEmployerTitle = formattedEmployer + formattedTitle;\n $(\".work-entry:last\").append(formattedEmployerTitle);\n var formattedDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates);\n $(\".work-entry:last\").append(formattedDates);\n var formattedLocation = HTMLworkLocation.replace(\"%data%\", work.jobs[job].location);\n $(\".work-entry:last\").append(formattedLocation);\n var formattedDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n }\n }", "async getLastWorkout() {\n let res;\n try {\n res = await fetch(\"/api/workouts\");\n } catch (err) {\n console.log(err)\n }\n const json = await res.json();\n return json[json.length - 1];\n }", "function displayWork() {\n\nfor(job in work.jobs){\n\n$(\"#workExperience\").append(HTMLworkStart);\n\nvar formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer);\nvar formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title);\nvar formattedEmployerTitle = formattedEmployer + formattedTitle;\n$(\".work-entry:last\").append(formattedEmployerTitle);\n\nvar formattedDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates);\n$(\".work-entry:last\").append(formattedDates);\n\nvar formattedDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n$(\".work-entry:last\").append(formattedDescription);\n\n};\n\n}", "async getWorkoutsInRange() {\n const res = await fetch(`/api/workouts/range`);\n const json = await res.json();\n\n return json;\n }", "function locationizer(work_obj) {\n var locations = [];\n for(job in work_obj.jobs) {\n \tvar newLocation = work_obj.jobs[job].location;\n locations.push(newLocation);\n\n }\n return locations;\n}", "getChoice(val) {\n var list = []\n\n // These if statements determine which types of workouts are included in the\n // day\n if (this.state.temp.hasOwnProperty('swimWorkout')) {\n // If the swim workout exists, add each level to the list\n list[0] = {\n title: 'SWIM: Beginner',\n workout: this.state.temp.swimWorkout[0],\n chosen: false\n }\n list[1] = {\n title: 'SWIM: Intermediate',\n workout: this.state.temp.swimWorkout[1],\n chosen: false\n }\n list[2] = {\n title: 'SWIM: Advanced',\n workout: this.state.temp.swimWorkout[2],\n chosen: false\n }\n // This clause modifies the list entry for the difficulty level that was\n // chosen\n if (this.state.tempChoice.swimDifficulty === \"Beginner\") {\n list[0]['chosen'] = true\n } else if (this.state.tempChoice.swimDifficulty === \"Intermediate\") {\n list[1]['chosen'] = true\n } else {\n list[2]['chosen'] = true\n }\n }\n // The following two sections work the same as the one above\n if (this.state.temp.hasOwnProperty('bikeWorkout')) {\n list[3] = {\n title: 'BIKE: Beginner',\n workout: this.state.temp.bikeWorkout[0],\n chosen: false\n }\n list[4] = {\n title: 'BIKE: Intermediate',\n workout: this.state.temp.bikeWorkout[1],\n chosen: false\n }\n list[5] = {\n title: 'BIKE: Advanced',\n workout: this.state.temp.bikeWorkout[2],\n chosen: false\n }\n if (this.state.tempChoice.bikeDifficulty === \"Beginner\") {\n list[3]['chosen'] = true\n } else if (this.state.tempChoice.bikeDifficulty === \"Intermediate\") {\n list[4]['chosen'] = true\n } else {\n list[5]['chosen'] = true\n }\n }\n if (this.state.temp.hasOwnProperty('runWorkout')) {\n list[6] = {\n title: 'RUN: Beginner',\n workout: this.state.temp.runWorkout[0],\n chosen: false\n }\n list[7] = {\n title: 'RUN: Intermediate',\n workout: this.state.temp.runWorkout[1],\n chosen: false\n }\n list[8] = {\n title: 'RUN: Advanced',\n workout: this.state.temp.runWorkout[2],\n chosen: false\n }\n if (this.state.tempChoice.runDifficulty === \"Beginner\") {\n list[6]['chosen'] = true\n } else if (this.state.tempChoice.runDifficulty === \"Intermediate\") {\n list[7]['chosen'] = true\n } else {\n list[8]['chosen'] = true\n }\n }\n return list\n }", "function locationizer(work_obj) {\n var locationArray = [];\n for (var i = 0; i < work.jobs.length; i++) {\n var newLocation = work_obj.jobs[i].location;\n locationArray.push(newLocation);\n }\n return locationArray;\n}", "async getLastWorkout() {\n let res;\n try {\n res = await fetch(\"/api/workouts\");\n } catch (err) {\n console.log(err)\n }\n const json = await res.json();\n\n return json[json.length - 1];\n }", "async getLastWorkout() {\n let res;\n try {\n res = await fetch(\"/api/workouts\");\n } catch (err) {\n console.log(err)\n }\n const json = await res.json();\n\n return json[json.length - 1];\n }", "renderWorkouts() {\n if (this.state.output.results != null) {\n const workouts = this.state.output.results.map((result) => {\n const exercises = []\n result.exercises.forEach((ex) => {\n exercises.push([ex.name, ex.time, ex.reps, ex.mType])\n })\n\n return{\n name: result.name, id: result.workoutID, time: result.workoutTime, difficulty: result.workoutDifficulty,\n targets: result.targetAreas, equipment: result.equipment, exercises: exercises,\n cycles: result.numCycles\n }\n })\n\n let workoutDivs = []\n for (const workout of workouts) {\n\n const workoutPreview = new WorkoutPreview(\n {name: workout.name, id: workout.id, time:workout.time, difficulty: workout.difficulty,\n targets:workout.targets, equipment: workout.equipment, exercises: workout.exercises,\n cycles: workout.cycles})\n\n //create workout thumbnail with associated Preview component\n const workoutDiv = new WorkoutDiv( {open: this.openWorkoutPreview.bind(this),\n preview: workoutPreview});\n\n workoutDivs.push(workoutDiv.renderWorkout({\n className: \"Workout\", name: workout.name, time:workout.time,\n difficulty: workout.difficulty, targets:workout.targets, equipment: workout.equipment,\n openWorkout: this.openWorkoutPreview\n }))\n\n }\n return workoutDivs\n }\n }", "getWorkout(req, res) {\n Workout.findById({})\n .then(data => {\n res.json(data);\n });\n }", "function displayWork(){\n for (job in work.jobs) {\n $(\"#workExperience\").append(HTMLworkStart);\n\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].position);\n var formattedWorkTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].company);\n \n var formattedEmployerTitle = formattedEmployer + formattedWorkTitle;\n\n //The \"last\"is jQuery element which return last(newly added) position\n $(\".work-entry:last\").append(formattedEmployerTitle);\n\n // add a formatted date\n var formattedWorkDate = HTMLworkDates.replace(\"%data%\", work.jobs[job].years);\n $(\".work-entry:last\").append(formattedWorkDate);\n\n // add a formatted description\n var formattedDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description);\n $(\".work-entry:last\").append(formattedDescription);\n }\n}", "async createWorkout(data = {}) {\n const res = await fetch(\"/api/workouts\", {\n method: \"POST\",\n body: JSON.stringify(data),\n headers: { \"Content-Type\": \"application/json\" }\n });\n\n const json = await res.json();\n return json;\n }", "load() {\n var user = firebase.auth().currentUser\n var maxDays = 70\n var currDay;\n\n // Retrieve the relevant data from the user\n database.ref('/users/' + user.uid).once('value').then(snapshot => {\n currDay = snapshot.val().day\n this.setState({\n day: snapshot.val().day\n })\n\n var workouts = snapshot.val().selectedWorkouts\n var chosen = {}\n var past = []\n var future = []\n // If the user has selected workouts previously, store them in either the\n // past or future array based on its relation to the current day\n if (workouts) {\n // Identify if user has already chosen a workout for the current day\n chosen = workouts[currDay] || {}\n // Load past array\n for (var i = 1; i < currDay; i++) {\n var item = workouts[i]\n if (item && item.day) {\n past[item.day] = item\n }\n }\n // Load future array\n for (var i = currDay + 1; i < 70; i++) {\n var item = workouts[i]\n if (item && item.day) {\n future[item.day] = item\n }\n }\n }\n this.setState({\n pastWorkouts: past,\n futureWorkouts: future,\n todaysChoice: chosen\n })\n })\n .then(response => {\n // Retrieve the entire workout for the current day\n database.ref('/workouts/' + currDay).once('value').then(snapshot => {\n this.setState({todaysWorkout: snapshot.val()})\n })\n })\n .then(response => {\n var past = this.state.pastWorkouts\n var future = this.state.futureWorkouts\n // Check the workouts from the database and fill in all the gaps for the\n // days that the user has not chosen a workout for\n database.ref('/workouts/').once('value').then(snapshot => {\n var allWorkouts = snapshot.val()\n allWorkouts.forEach(item => {\n if (item.day < this.state.day && !past[item.day]) {\n past[item.day] = item\n } else if (item.day > this.state.day && !future[item.day]) {\n future[item.day] = item\n }\n })\n this.setState({\n pastWorkouts: past,\n futureWorkouts: future\n })\n })\n })\n }", "function startWorkout () {\n //gets data & starts session from backend\n //sends data to populate exercise objects, update GUI and \"start\" the workout.\n\n var wo_ID = $(\"#workoutselect\").find(\"option:selected\").val();\n var wo_Name = $(\"#workoutselect\").find(\"option:selected\").text();\n\n if (wo_Name != \"Select workout\"){\n //send wo_ID to backend to create new session\n $.get(\"/start\", {wo_ID:wo_ID, startbool:true}, function( data ){\n\n //pull apart session_id and routine\n session_id = data[0][0]['session_id'];\n const routine = data[1];\n\n //make exercise objects\n makeObjectArray(routine);\n\n //change start container UI to reflect active workout\n var lbl1 = $(\"<label></label>\").text(wo_Name.toUpperCase());\n var timer1 = $(\"<strong id='workout_timer'><strong>\").text('00:00:00');\n\n\n $(\"#workoutselect\").detach();\n $(\"#startbutton\").detach();\n $(\"#selectdiv\").prepend(lbl1);\n $(\"#startdiv\").prepend(timer1);\n\n timer.start();\n timer.addEventListener('secondsUpdated', function (e) {\n timer1.html(timer.getTimeValues().toString());\n });\n\n //Create/Display minimized exercises\n var bigdiv = $('#bigdiv');\n for (var j = 0; j < ex_array.length; j++){\n ex_array[j].display_min_container(bigdiv);\n }\n\n //create/hide finish div\n jQuery('<div/>', {\n class: \"row border rounded\",\n id: \"finishdiv\"\n }).appendTo(bigdiv).hide();\n $('<button type=\"button\" id=\"finishbutton\" onclick=\"endWorkout()\">End Workout</div>').appendTo('#finishdiv');\n\n //show current exercise, start tracking\n $('#currentexercise').show();\n $('#pausediv').show();\n ex_array[0].populate_exercise();\n\n });//AJAX\n}}//startWorkout", "function getTasks () {\n $.get('/api/getTodaysTasks', function (data) {\n todaysTasks = data;\n renderTasks(); // Show today's tasks\n });\n $.get('/api/getPreviousTasks', function (data) {\n previousTasks = data;\n // Sort so the MOST recent is first \n previousTasks.sort((a, b) => b.deadline.localeCompare(a.deadline));\n });\n $.get('/api/getFutureTasks', function (data) {\n futureTasks = data;\n // Sort so the LEAST recent is first \n futureTasks.sort((a, b) => a.deadline.localeCompare(b.deadline));\n });\n }", "getAll () {\n const openWindows = this.getOpen().toArray()\n const closedSavedWindows = this.bookmarkIdMap.toIndexedSeq().filter((w) => !(w.open)).toArray()\n return openWindows.concat(closedSavedWindows)\n }", "async createWorkout(data = {}) {\n const res = await fetch(\"/api/workouts\", {\n method: \"POST\",\n body: JSON.stringify(data),\n headers: { \"Content-Type\": \"application/json\" }\n });\n\n const json = await res.json();\n\n return json;\n }", "async createWorkout(data = {}) {\n const res = await fetch(\"/api/workouts\", {\n method: \"POST\",\n body: JSON.stringify(data),\n headers: { \"Content-Type\": \"application/json\" }\n });\n\n const json = await res.json();\n\n return json;\n }", "function listJobs (done) {\n let sql = 'Select * FROM application';\n db.getPool().query(sql, (err, results, fields) => {\n if (err) {\n return done({\n 'message': err,\n 'status': 500,\n }, results);\n }\n return done(err, results);\n });\n}", "mixItFunction() {\n const promiseArray = [];\n const currentDate = new Date().toString().split(' ').slice(1, 4).join('-');\n\n this.retrieveWorkouts();\n\n this.state.workoutTypeId.forEach((id) => {\n promiseArray.push(fetch(`https://wger.de/api/v2/exercise/?limit=100&status=2&language=2&category=${id}`)\n .then((results) => results.json())\n .then((result) => result.results.slice(0, 5))\n .catch((err) => console.log(err.message)))\n });\n\n // grabs all workout data and from online DB and formats it to how I want it to be set to State\n Promise.all(promiseArray)\n .then((result) => {\n const concatResults = result.reduce((acc, val) => [...acc, ...val]);\n const numOfSets = Math.floor(concatResults.length / 2);\n\n const randomWorkouts = getRandom(concatResults, numOfSets)\n\n this.setState({\n currentDate: currentDate,\n generatedWorkout: randomWorkouts,\n modalShow: false,\n numOfSets: numOfSets,\n })\n }).catch((error) => {\n console.log(error)\n })\n }", "static async getAllJobs(data={}) {\n let res = await this.request('jobs/', data);\n return res.jobs;\n }", "function getTasks(iterationRef, iterationName) {\n\tconsole.log(notificationQueue);\n\trestApi.query({\n\t\ttype: 'task',\n\t\tquery: queryUtils.where('State', '=', 'Defined')\n\t\t\t\t.or('State', '=', 'In-Progress')\n\t\t\t\t.or('State', '=', 'Completed')\n\t\t\t\t.and('Iteration.Name', '=', iterationName),\n\t\tfetch: ['FormattedID', 'Name', 'State', 'Blocked', 'BlockedReason'],\n\t\tscope: {\n\t\t\tproject: '/project/' + config.rally.projectid,\n\t\t\tup: false,\n\t\t\tdown: true\n\t\t},\n\t}, function(error, result) {\n\t\tif(error) {\n\t\t\tconsole.log(error);\n\t\t} else {\n\t\t\tvar i = 0;\n\t\t\twhile(i < result.Results.length){\n\t\t\t\tinsertDoc(result.Results[i], tasksDb);\n\t\t\t\ti++;\n\t\t\t}\n\t\t};\n\t});\n}", "function renderWorkoutList(data) {\n if (!data.length) {\n window.location.href = \"/workouts\";\n }\n var rowsToAdd = [];\n for (var i = 0; i < data.length; i++) {\n rowsToAdd.push(createWorkoutRow(data[i]));\n }\n workoutSelect.empty();\n console.log(rowsToAdd);\n console.log(workoutSelect);\n workoutSelect.append(rowsToAdd);\n workoutSelect.val(workoutId);\n }", "function allDone() {\n pub.stop();\n console.info('Alle Tests beendet.');\n console.info(app.persistence.getResults());\n $(document).trigger('testQueueDone');\n }", "function locationizer(work_obj) {\r\n var locationArray = [];\r\n\r\n for(job in work_obj.jobs) {\r\n \tvar newlocation = work_obj.jobs[job].location;\r\n \tlocationArray.push(newlocation);\r\n }\r\n\r\n return locationArray;\r\n \r\n}", "function detectLeadingFinishedGoals(){\n var finishedGoals = [];\n var previousGoal = undefined;\n for(var x=0;x<backlog.items.length;x++){\n var item = backlog.items[x];\n if(item.kind==\"goal\"){\n if(previousGoal){\n finishedGoals.push(previousGoal);\n }\n previousGoal = item;\n } else if(item.kind!=\"story\" || !item.isComplete){\n if(previousGoal) finishedGoals.push(previousGoal);\n break;\n }\n }\n return finishedGoals;\n }", "function displayWork() {\n if (work['jobs'].length > 0) {\n for (job in work.jobs) {\n $(\"#workExperience\").append(HTMLworkStart)\n var formattedEmployer = HTMLworkEmployer.replace(\"%data%\", work.jobs[job].employer)\n var formattedTitle = HTMLworkTitle.replace(\"%data%\", work.jobs[job].title)\n var formattedEmployerTitle = formattedEmployer + formattedTitle\n var formattedWorkDates = HTMLworkDates.replace(\"%data%\", work.jobs[job].dates)\n var formattedWorkLocation = HTMLworkLocation.replace(\"%data%\", work.jobs[job].location)\n var formattedWorkDescription = HTMLworkDescription.replace(\"%data%\", work.jobs[job].description)\n $(\".work-entry:last\").append(formattedEmployerTitle, formattedWorkDates, formattedWorkLocation, formattedWorkDescription,HTMLaccompstart)\n if (work.jobs[job].accomplishments) {\n if (work.jobs[job].accomplishments.length > 0) {\n for (accomp in work.jobs[job].accomplishments){\n var formattedAccomplishment = HTMLaccomplishment.replace(\"%data%\",work.jobs[job].accomplishments[accomp])\n $('.accomp-start:last').append(formattedAccomplishment)\n };//end for accomp\n };//end if accomp.lenghth\n };//end if accomplishment\n };\n };\n}", "function getAllFinishedTutorials(req, res) {\n\t// Create query to find all finished tutorials of a specific project\n\tconst {projectID, studentID} = req.params;\n\tconst query = Progress.find({studentID, projectID}, {tutorialID: 1, _id: 0});\n\n\t// Execute query and return array of projects\n\tquery.exec((err, tutorials) => {\n\t\tif (err) {\n\t\t\tres.status(400).json({message: `Following error was encountered: ${err}`});\n\t\t} else if (!tutorials) {\n\t\t\tres.status(404).send('No finished tutorials found.');\n\t\t} else {\n\t\t\tres.status(200).json(tutorials);\n\t\t}\n\t});\n}", "function getTaskList(){\n\t$.ajax({\n\t\tmethod: 'GET',\n\t\turl : 'http://localhost:8080/task',\n\t\tsuccess: function(result){\n\t\t\t$('#todo-list').empty();\n\t\t\t$('#completed-list').empty();\n\t\t\tfor(i = 0; i < result.length; i++){\n\t\t\t\taddTaskList(result[i]);\n\t\t\t}\n\t\t}\n\t})\n}", "function getTasks() {\n fetch(\"api/tasks/\")\n \n .then(response => {\n \n if (response.status != 200) {\n console.log(\"Something went wrong!\");\n }\n \n return response.json()\n })\n \n .then(data => {\n taskToState(data);\n \n });\n \n \n }", "function getMachines() {\n var currentLastSeen = new Date();\n cMachines.findAndModify(\n self.findObject,\n [],\n {'$set':{'lastseen':currentLastSeen,'alive':true}, '$inc':{'timesseen':1}},\n {'new':false, 'upsert':true, 'fields': {'jobs':{'$slice':5},'jobs.tasks':{'$slice':5},'lastseen':1}},\n function(famErr, famMachine) {\n if (famErr && !famErr.ok) {\n log('Error in findAndModify');\n self.res.json(self.taskOut);\n delete inProgress[self.mac];\n return;\n }\n\n if (famMachine==null) {\n log('Could not find the machine.');\n self.res.json(self.taskOut);\n delete inProgress[self.mac];\n return;\n }\n\n self.machine = famMachine;\n\n var previousLastSeen = self.machine.lastseen ? self.machine.lastseen : currentLastSeen;\n\n self.machine.lastseen = currentLastSeen;\n self.machine.timesseen++;\n\n// Our actual latency ;)\n//log(currentLastSeen.getTime()-previousLastSeen.getTime());\n\n if (!self.machine.jobs) {\n var updateObject = new Object();\n updateObject['$set'] = new Object();\n\n self.machine.jobs = new Array();\n updateObject['$set'].jobs = new Array();\n\n cMachines.update(self.findObject,updateObject,function() {});\n }\n\n// Every request from the client, we need to do up to here. ^^^^^^^^^^^^^\n self.doyourthang();\n\n// And after here. vvvvvvvvvv\n });\n }", "getAllWorkstations(knex) {\n return knex\n .select('*')\n .from('itmanager_workstations')\n }", "get jobs () {\n return this._mem.jobs;\n }", "function locationizer(work_obj) {\n\tvar locationArray = [];\n\n\tfor (job in work_obj.jobs) {\n\t\tvar newLocation = work_obj.jobs[job].location;\n\t\tlocationArray.push(newLocation);\n\t}\n\treturn locationArray;\n}", "function locationizer(work_obj) {\n var locArray = [];\n for (job in work_obj.jobs) {\n var newLocation = work_obj.jobs[job].location;\n locArray.push(newLocation);\n }\n return locArray;\n}", "function locationizer(work_obj) {\n var locationArray = [];\n\n for (job in work_obj.jobs) {\n var newLocation = work_obj.jobs[job].location;\n locationArray.push(newLocation);\n }\n return locationArray;\n}", "function locationizer(work_obj) {\n\tvar locationArray = [];\n\twork_obj.jobs.forEach(function(job) {\n\t\tvar newLocation = job.location;\n\t\tlocationArray.push(newLocation);\n\t});\n\treturn locationArray;\n}", "function pollForData() {\n $.getJSON(\"/workout\",\n function (json) {\n updateWorkoutInfo(json);\n if (json['deadline'] - json['server_time'] <= 0) {\n cancelPoll();\n //turn the input fields back on\n toggleAllowInput(true);\n }\n });\n }", "selectWork() {\n for (let jobF of [this.workWriteCode, this.workTrainStats, this.workCommitCrimes, this.workJoinCities, this.workForFactions, this.workForCompanies, this.workJoinCompanies]) {\n let job = jobF.bind(this)();\n if (job != null) return job;\n }\n\n return new WorkItem('nothing', null, false);\n }", "function joblist() {\n jobFactory.joblist()\n .then (\n function(jobs) { \n self.joblist = jobs;\n for(var [job] in self.joblist) {\n // console.log(self.bloglist[blog].postDate);\n self.joblist[job].postDate = new Date(self.joblist[job].postDate[0],self.joblist[job].postDate[1] - 1,self.joblist[job].postDate[2]);\n // console.log(self.bloglist[blog].postDate);\n }\n console.log(self.joblist);\n },\n function(errResponse) {\n console.log('Failure!');\n }\n );\n }", "getcurrentprojects() { }", "function locationizer(work_obj) {\n var locationArray = [];\n\n for (job in work_obj.jobs) {\n var newLocation = work_obj.jobs[job].location;\n locationArray.push(newLocation);\n }\n\n return locationArray;\n}", "function getsprintStories(){\n \n \nlet options = {\n method: 'GET',\n url: `https://cmpe272.atlassian.net/rest/agile/1.0/sprint/${2}/issue`,\n auth: { username: '[email protected]', password: '4oNotFMGrXuCUQeGjEUhEC10' },\n headers: {\n 'Accept': 'application/json'\n }\n };\n var outString=\"\";\nreturn new Promise((resolve, reject) => {\n request(options, function (error, response, body) {\n if (error){\n reject(error)}\n console.log(\n 'Response: ' + response.statusCode + ' ' + response.statusMessage\n );\n \n let temp=JSON.parse(body);\n //console.log(temp.issues[1]);\n let len=temp.issues.length;\n \n for (var i=0 ; i<temp.issues.length-1; i++){\n // console.log(\"inside\");\n outString+=temp.issues[i].fields.summary+\" with id \"+ temp.issues[i].key +\" ,\"\n }\n outString+=temp.issues[len-1].fields.summary+\" with id \"+ temp.issues[len-1].key ;\n //console.log('iii',outString);\n var display=\"The stories in active sprint are : \" + outString + \" Would you also like to know about the status of any of these stories ? \";\n resolve(display);\n });\n \n})\n\n}", "async getLastWorkout() {\n let res;\n try {\n // The await expression causes async function execution to pause until a Promise is settled (that is, fulfilled or rejected), and to resume execution of the async function after fulfillment. When resumed, the value of the await expression is that of the fulfilled Promise.\n\n // The Fetch API accesses resources across the network. You can make HTTP requests (GET, POST), download and upload files.\n res = await fetch(\"/api/workouts\");\n } catch (err) {\n console.log(err)\n }\n const json = await res.json();\n\n return json[json.length - 1];\n }", "function viewAllStations(){\n console.log(\"Viewing All stations \\n\");\n connection.query(\"SELECT * FROM station\",function(err, res){\n if (err) throw err;\n console.table(res);\n lastQuestion()\n });\n}", "function displayWork() {\n $(\"#workExperience\").append(HTMLworkStart);\n for (key in work.work){\n if (work.work.hasOwnProperty(key)) {\n var employerHTML = HTMLworkEmployer.replace(\"%data%\", work.work[key].employer);\n $(\".work-entry:last\").append(employerHTML);\n\n var titleHTML = HTMLworkTitle.replace(\"%data%\", work.work[key].title);\n $(\"a:last\").append(titleHTML);\n\n var datesHTML = HTMLworkDates.replace(\"%data%\", work.work[key].dates);\n $(\".work-entry:last\").append(datesHTML);\n\n var locationHTML = HTMLworkLocation.replace(\"%data%\", work.work\n [key].location);\n $(\".work-entry:last\").append(locationHTML);\n\n var descriptionHTML = HTMLworkDescription.replace(\"%data%\", work.work\n [key].description);\n $(\".work-entry:last\").append(descriptionHTML);\n }\n }\n\n}", "function getJobs() {\n return this.__jobs__ = this.__jobs__ || {};\n }", "function locationizer(workObj) {\n\tlocsFromWork = [];\n\tfor (job in workObj.jobs) {\n\t\t\tlocsFromWork.push(workObj.jobs[job].location);\n\t}\n\treturn locsFromWork;\n}" ]
[ "0.7685858", "0.74962", "0.7266663", "0.7128185", "0.6585461", "0.6556664", "0.64830023", "0.63982046", "0.6372542", "0.6093816", "0.60836196", "0.59818107", "0.59263635", "0.58761317", "0.5863386", "0.5841633", "0.5841422", "0.5840251", "0.5803869", "0.574553", "0.56637937", "0.5657565", "0.5640423", "0.56214786", "0.55787086", "0.555263", "0.55218565", "0.552166", "0.5518213", "0.5517736", "0.55055225", "0.5501105", "0.5489768", "0.54866993", "0.5466419", "0.5438762", "0.5435275", "0.5434565", "0.5422426", "0.5413949", "0.54123545", "0.5406031", "0.5403073", "0.5389408", "0.5385493", "0.53757054", "0.53588676", "0.5343859", "0.5340984", "0.5335245", "0.53323644", "0.5326499", "0.5323881", "0.5318166", "0.53167903", "0.53106064", "0.5307409", "0.5306561", "0.5291758", "0.5291758", "0.52692604", "0.52671796", "0.5246343", "0.5246195", "0.5240896", "0.5225126", "0.52243114", "0.5223573", "0.52228385", "0.52228385", "0.5214965", "0.5213618", "0.52033293", "0.5190349", "0.5178851", "0.51770353", "0.5157646", "0.51439697", "0.51383656", "0.5134511", "0.51290834", "0.5126726", "0.5125232", "0.51190394", "0.51173234", "0.510437", "0.5101604", "0.51010776", "0.5100821", "0.5099573", "0.50942576", "0.50889146", "0.5088884", "0.50871843", "0.5076997", "0.50672466", "0.50597125", "0.50524586", "0.50463253", "0.5045018" ]
0.5757452
19
get a certain workout by person id
async get(input){ const data = await conn.query("SELECT * FROM Fitness_Workouts INNER JOIN Fitness_Exercises ON Fitness_Workouts.Fitness_Exercises_exercise_id=Fitness_Exercises.exercise_id WHERE Fitness_Persons_person_id=?", input.Fitness_Persons_person_id); if(!data) { throw Error('No workouts have been added') } return data; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getWorkout(req, res) {\n Workout.findById({})\n .then(data => {\n res.json(data);\n });\n }", "function get_work(req, id){\n console.log(\"INSIDE GET_WORK\");\n const key = datastore.key([WORK, parseInt(id,10)]);\n return datastore.get(key).then( result => {\n var work = result[0];\n req.route.path = \"/works\"; //Confirm path is set for selflink\n addIDandSelfLink(req, work);\n console.log(\"EXITING GET_WORK\");\n return work;\n\n }).catch( err => {\n return false;\n });\n}", "function getWorkout(id) {\n\t\t\t\tworkout.clientWorkout(id).then(function(result) {\n\t\t\t\t\tvm.clientProgram = result.data;\n\t\t\t\t\tconsole.log(vm.clientProgram);\n\t\t\t\t\tvar JSONstring = JSON.parse(result.data.workout);\n\t\t\t\t\tconsole.log('JSON string');\n\t\t\t\t\tconsole.log(JSONstring);\n\t\t\t\t\tvm.clientProgram.program = JSONstring;\n\t\t\t\t\tconsole.log(vm.clientProgram);\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "getOne(req, res, next) {\n workoutDB.findById(req.params.id)\n .then((workouts) => {\n res.locals.workouts = workouts;\n next();\n })\n .catch(err => next(err));\n }", "function GetPerson(params){\n\n for(i in people) {\n\n let person = people[i];\n\n if(person.id == params.id){\n\n return person;\n\n }\n\n }\n\n return null;\n\n}", "function one(id) {\n\n return lessonPlan.lessons[id]\n\n}", "function getPerson(id) {\n for (var i = 0; i < peopleArray.length; i++) {\n if (peopleArray[i].id == id) {\n return peopleArray[i];\n }\n }\n return '404';\n}", "function getPerson(pid) {\n for (i = 0; i< allResources.length; i++) {\n tempPerson = allResources[i];\n if (tempPerson.id == pid) {\n return tempPerson;\n }\n }\n}", "function generateWorkout(user) {\n const workouts = [{\n user: user._id,\n name: \"Morning\"\n }, {\n user: user._id,\n name: \"Afternoon\"\n }, {\n user: user._id,\n name: \"Evening\"\n }, {\n user: user._id,\n name: \"Best\"\n }];\n return workouts[0];\n}", "function getWorkout() {\n\tvar list = JSON.parse(localStorage.exercises); // parsed list of exercises\n\tvar index = (localStorage.total - count) % list.length;\n\tvar workoutType = list[index]; // current exercise type\n\tvar ex = Workout.instances[workoutType]; // list of corresponding exercises\n\treturn ex[getRandomInt(0, ex.length)];\n}", "workitemWithId (baseUrl,username,spacename,id){\n browser.get(baseUrl + username + \"/\" + spacename +\"/plan/detail/\" +id);\n }", "async findByGoal(goalID){ \n let data = await schema.find({associatedGoal: goalID}) \n return data;\n }", "async function getPersonById(id) {\n let cnt = 0;\n while (cnt < 3) {\n let res = await DL.read(\"Persons\", { \"person_id\": id })\n if (res.length) {\n return res[0];\n }\n cnt++;\n id = 9999\n }\n return {}\n }", "findPersonInShipByID(theID){\n for (var i = 0; i < this.people.length; i++){\n if (this.people[i].id == theID){\n return this.people[i];\n }\n }\n //otherwise, return null: this CAN happen (usually if the person has died)\n return null;\n }", "getThoughtById({params}, res) {\n const myID = params.id.slice(1) \n thoughts.findOne({ _id: myID })\n .then(dbThoughtData => res.json(dbThoughtData))\n .catch(err => res.json(err)); \n }", "getExistingPerson (per) {\r\n console.log(\"Searching in records...\");\r\n let id = per.PersonalUniqueID;\r\n let promise = fetch (`http://localhost:4070/api/person/${id}`, {\r\n method: \"GET\",\r\n headers: {\r\n \"Content-Type\": \"application/json\"\r\n }\r\n });\r\n return promise;\r\n }", "getContributedStory({id}) {\n\n return this._getCollection()\n .then(collection => collection.findOne({\n _id: MongoDb.ObjectId(id)\n }));\n }", "function get_rental(id)\n{\n for(var j=0; j<rentals.length;j++)\n {\n if(id==rentals[j].id)\n {\n return rentals[j];\n }\n }\n return;\n}", "function findStoryFromStoryId(storyId) {\n for (let story of storyList.stories) {\n if (story.storyId === storyId) {\n return story;\n }\n }\n}", "function getMeetingByMeetingID()\r{\r\taa.print(\"--------------this getMeetingByMeetingID method-------------\");\r\t//var calendarID = \"1106\" ;\r\t//var meetingID = \"22449\" ;\r var calendarID = \"1706\" ;\r\tvar meetingID = \"29494\" ;\r\tvar result = aa.meeting.getMeetingByMeetingID(calendarID,meetingID);\r\taa.print(\"Meeting Name:\" + result.output.getMeetingName());\r\r\tvar template =result.output.getTemplate();\r\r getTemplateForSimple(template);\r\t\r}", "function findMostRecentWorkout(res, cb){\n db.Workout.findOne({}).sort({day:-1}) \n .then((data)=>{\n // cb(data);\n res.json(data);\n })\n}", "function saveSelectedWorkout(){\n $.ajax({\n method: \"POST\",\n url: \"/api/workout\",\n data: selectedWorkout\n }).then(function(resp){\n console.log(resp);\n if( resp && resp._id ){\n selectedWorkout._id = resp._id;\n }\n });\n }", "function getInvoice(idWork, cb) {\n invoiceDB.find({ id_work: idWork }).sort({ timestamp: 1 }).exec(function (err, data) {\n if (err) {\n return cb(err);\n } else {\n return cb(data);\n }\n });\n}", "async function initExercise() {\n let workout;\n\n if (location.search.split(\"=\")[1] === undefined) {\n workout = await API.createWorkout()\n console.log(workout)\n }\n if (workout) {\n location.search = \"?id=\" + workout._id;\n }\n}", "function getSavedMatchById() {\n var urlParams = new URLSearchParams(window.location.search);\n var idParam = urlParams.get(\"id\");\n\n getById(idParam).then(function (detail) {\n showSavedDetail(detail);\n });\n}", "function getOne(id) {\n return skills[id];\n}", "function obtenerPersonaje(id, callback) {\n const API_URL = 'https://swapi.co/api/';\n const PEOPLE_URL = 'people/:id/';\n\n fetch(`${API_URL}${PEOPLE_URL.replace(':id', id)}`)\n .then(response => response.json())\n .then(data => {\n console.log(`Hola soy ${data.name}`);\n if (callback) {\n callback();\n }\n });\n}", "function mapExperts (id){\n for(var i = 0; i < $scope.project.projectSpecificExperts.length; i++){\n if($scope.project.projectSpecificExperts[i].objectId === id) {\n return i;\n }\n }\n return -1;\n }", "function getEmployerById(req, res) {\n Employer.findById(req.params.id).exec(function (err, employer) {\n if (err)\n return res.send(err);\n res.status(200).json(employer);\n });\n}", "function findPuzzle(controller, teamId, num) {\n // console.log(puzzle);\n var found;\n controller.storage.teams.get(teamId, function(err, team) {\n // console.log(team.puzzles)\n // console.log(galaxy);\n // console.log(_.findWhere(team.puzzles, { roomId: num }));\n found = _.findWhere(team.puzzles, { room: num });\n console.log(found);\n });\n return found;\n\n}", "function getWork(){\n //self.works = workService.getWork();\n }", "function getWorkouts(){\n $.ajax({\n method: \"GET\",\n url: \"/api/workout\"\n }).then( resp => {\n console.log(resp)\n allWorkouts = resp;\n populateWorkouts();\n })\n }", "function getTask(taskID)\n{\n for (i = 0; i<data.length; i++)\n {\n if (data[i].id == taskID)\n {\n return data[i];\n }\n }\n return -1;\n}", "function findOneByTask(req, res) {\r\n Agenda.findOne({'taken._id': new mongoose.Types.ObjectId(req.query.id) }, function(err, data) {\r\n return res.json(data);\r\n });\r\n}", "function LatestWorkout({workouts, user, isLoading}) {\n\n const getLatestWorkout = () => {\n let latestWorkout = {};\n for (let i = 0; i < workouts.length; i++) {\n if (workouts[i].user_id === user.id) {\n latestWorkout = workouts[i];\n\n break\n }\n } \n\n return (\n <div className=\"inner-container\">\n\n <h5>Your last workout:</h5>\n <p>\n <a href={\"/workouts/\" + latestWorkout.id}>{latestWorkout.workout_name} </a> \n </p>\n <DateTime dateTime={latestWorkout.date_time}/>\n </div> \n )\n\n }\n\n if (!isLoading) {\n \n return (\n getLatestWorkout()\n )\n\n } else {\n return (\n\n <p>Loading... </p>\n )\n }\n }", "async function initExercise() {\n let workout;\n // if this is a new workout\n if (location.search.split(\"=\")[1] === undefined) {\n // send API request to create a new workout\n workout = await API.createWorkout()\n console.log(workout)\n }\n // using newly created workout or existing workout, \n // set url with workout id as search parameter\n if (workout) {\n location.search = \"?id=\" + workout._id;\n }\n\n}", "function showOne(id){\n return skills[id-1];\n}", "function FindProjNote(id){\n\t\t//add notes\n\t\t\tfor(key in projNotes){\n\t\t\t\tif(projNotes[key].id==id){\n\t\t\t\t\treturn key;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\treturn false;\n\t}", "function getById(arr, id) {\n for (var d = 0, len = arr.length; d < len; d += 1) {\n if (arr[d].team_id == id) /* Bilo je 3 === */ {\n return arr[d];\n }\n }\n }", "function obtenerPersonaje(id) {\n return new Promise((resolve, reject) => {\n const URL = `${API_URL}${PEOPLE_URL.replace(':id', id)}`\n $\n .get(URL, opts, function (data) {\n resolve(data)\n })\n .fail(() => reject(id))\n })\n\n}", "function obtenerPersonaje(id) {\n return new Promise((resolve, reject) => {\n const URL = `${API_URL}${PEOPLE_URL.replace(':id', id)}`\n $\n .get(URL, opts, function (data) {\n resolve(data)\n })\n .fail(() => reject(id))\n })\n\n}", "function obtenerPersonaje(id) {\n return new Promise((resolve,reject) => {\n const url = `${API_URL}${PEOPLE_URL.replace(':id', id)}`\n $\n .get(url,opts,function(data){\n resolve(data)\n })\n .fail(() => reject(id))\n })\n}", "function getParticipantObj(match, pid) {\n var participants = match['participants'];\n for(i = 0; i < participants.length; i++) {\n if(participants[i]['participantId'] == pid) {\n return participants[i];\n }\n }\n}", "function getPersonById(id) \n{\n return new Promise(\n (resolve, reject) => {\n connection.query(`SELECT * FROM final WHERE id = ?`,\n [id],\n (err, rows, cols) => {\n if (err)\n reject(err)\n else\n resolve(rows)\n })\n }\n )\n}", "function obtenerPersonaje(id){\n const lukeUrl = `${API_URL}${PEOPLE_URL.replace(':id',id)}`\n $.get(lukeUrl,opts,response);\n}", "async getTrainingGoalById(id) {\n try {\n let returnTrainingGoal = null;\n if (id) {\n let goals = await queryHelper.getTrainingGoalDetailsById(id);\n if (goals && goals.length) {\n returnTrainingGoal = _.first(goals);\n return returnTrainingGoal;\n }\n } else {\n return returnTrainingGoal;\n }\n } catch (error) {\n console.error(\"Error in getTrainingIntencityById\", error);\n }\n }", "function GetLessonByHouseId(house_id) {\n return $resource(_URLS.BASE_API + 'lesson/by_house/' + house_id + _URLS.TOKEN_API + $localStorage.token).get().$promise;\n }", "getThoughtById({ params }, res) {\n Thought.findOne({ _id: params.id })\n .then(dbThoughtData => {\n if (!dbThoughtData) {\n res.json(404).json({ message: \"No thought found with this id!\" });\n return;\n }\n res.json(dbThoughtData);\n })\n .catch(err => { res.status(400).json(err) });\n }", "getPersona(id) {\n let persona = this.personas.filter(persona => persona.id === id)[0];\n\n /*\n Si encuentra una persona que cumpla con la propiedad, retornara un objeto\n si no retornara undefined\n */\n return persona;\n }", "function getWorkouts() {\n\t\t\t\tworkout.getWorkouts().then(function(result) {\n\t\t\t\t\t// returned as $resource with workout property as a string\n\t\t\t\t\tvm.workoutPlan = result.data;\n\t\t\t\t\t// list of JSON parsed workouts\n\t\t\t\t\tvm.workObject = vm.workoutPlan.listWorkouts();\n\n\t\t\t\t\t//console.log(\"vm.workoutPlan\");\n\t\t\t\t\t//console.log(vm.workoutPlan);\n\t\t\t\t\t//console.log(\"vm.workObject\");\n\t\t\t\t\t//console.log(vm.workObject);\n\n\t\t\t\t}, function(error) {\n\t\t\t\t\tconsole.log(error);\n\t\t\t\t});\n\t\t\t}", "async getById(id) {\n const data = await conn.query(\"SELECT * FROM Fitness_RoutineExercises WHERE routineExercises_id=?\", id);\n if(!data) {\n throw Error('There are no responses')\n }\n return data[0]\n }", "function getUser(id){\n for (i in users){\n if (i.userId === id){\n return i\n }\n }\n return null\n}", "function getOne(id){return skills[id]}", "function getPersonsByHobby(hobby) {\n return fetch(URL + \"hobby/\" + hobby)\n .then(res => res.json()\n )\n \n}", "function getWorkspace(id) {\n return workspaces[id];\n}", "function getTask(taskId){\n console.log(\"getTask\");\n return todoItems.find(({ id }) => id === taskId);\n}", "findWorkshopById(workshopId) {\n searchWorkshopByIdFirebase({workshopId}).\n then((workshop) => {\n this.single = this.mapDataToModel(workshop);\n console.log('INFO: Found workshop by ID!');\n console.log(workshop);\n });\n\n getWaitlistByWorkshop({workshopId}).then((waitlist) => {\n // console.log('waitlist', waitlist);\n this.singleWaitlist = waitlist;\n });\n\n /*\n let pageVal = this.getPageNum(workshopId);\n\n searchWorkshops({\n page: pageVal\n }).then((response) => {\n if (response.data.Results.length === 0) {\n this.single = this.mapDataToModel(data.workshops.find((w) => w.WorkshopId == workshopId));\n } else {\n this.single = this.mapDataToModel(\n response.data.Results.find((workshop) => {\n\n return workshop.WorkshopId == workshopId;\n })\n ); \n }\n }).catch((error) => {\n console.log(error);\n });*/\n }", "async delete(id) {\n return await conn.query(\"DELETE FROM Fitness_Workouts WHERE workout_id=?\", id);\n }", "async getLastWorkout() {\n let res;\n try {\n res = await fetch(\"/api/workouts\");\n } catch (err) {\n console.log(err)\n }\n const json = await res.json();\n return json[json.length - 1];\n }", "getThoughtById({ params }, res) {\n Thought.findOne({ _id: params.thoughtId})\n .then(dbThoughtData => {\n if (!dbThoughtData) {\n res.status(404).json({ msg: `No thought found with this Id` });\n return;\n }\n res.json(dbThoughtData)\n })\n .catch(err => res.status(400).json(err));\n }", "function findSpouse(person, people){\n\n let foundSpouse = people.filter(function(spouseID){\n if(spouseID.id === person[0].currentSpouse){\n return true;\n } else {\n return false;\n }\n })\n\n return foundSpouse[0].firstName + \" \" + foundSpouse[0].lastName;\n }", "findWorkflow(workflowName, customId) {\n const url = this.getInstanceWebsiteUrl();\n\n const params = Object.assign(\n {\n [ATTR_ID]: customId,\n [ATTR_NAME]: workflowName,\n [ATTR_PROG]: PROG,\n [API_TOKEN]: credentials.apiToken,\n },\n this.getAppEnv(),\n );\n\n return http\n .get(url, { params })\n .then((body) =>\n workflowManager.getWorkflow(workflowName, body.data.properties),\n );\n }", "async getLastWorkout() {\n let res;\n try {\n res = await fetch(\"/api/workouts\");\n } catch (err) {\n console.log(err)\n }\n const json = await res.json();\n\n return json[json.length - 1];\n }", "async getLastWorkout() {\n let res;\n try {\n res = await fetch(\"/api/workouts\");\n } catch (err) {\n console.log(err)\n }\n const json = await res.json();\n\n return json[json.length - 1];\n }", "function obtenerPersonaje(id) { //funcion que recibe un id como parametro\n const url = `${API_URL}${PEOPLE_URL.replace(':id', id)}`; //cambiamos el id de la url dependiendo de cual queremos ver\n $.get(url, opts, onPeopleResponse); //metodo del jquery para hacer el request\n}", "function searchByID(people) {\n let idNumber = promptFor(\"What is the person's ID number?\", integer);\n\n let foundPerson = people.filter(function (person) {\n if (person.id == idNumber) {\n return true;\n } else {\n return false;\n }\n });\n return foundPerson;\n}", "function findById(id) {\n return lesson\n .where({ id })\n .first();\n}", "function getAllCompletedWorkoutsByUserName(res, user) { //get complete workouts\n Log.find({author:user}, function (err, workout) {\n if (err) res.send(err);\n res.json(workout);\n },{}).where({completed:true});\n}", "function getMealbyId (mealId){\n fetch(`https://www.themealdb.com/api/json/v1/1/lookup.php?i=${mealId}`)\n .then(res=> res.json())\n .then(data =>{\n const meal = data.meals[0]\n addMealToDom(meal)\n\n })\n }", "function findStory(storyId) {\n let foundStory;\n for (let story of storyList.stories) { //.find() finds first element that satisifies callback function and returns it\n if (story.storyId === storyId) {\n foundStory = story;\n }\n }\n return foundStory;\n}", "function findPerson (name, people) {\n var result = false;\n for (var i = 0; i < people.length; i++) {\n if(people[i].name === name) {\n result = people[i].hobby;\n }\n }\n return result;\n}", "function getMenteeIdByProjectId(id,callback) {\n // jQuery AJAX call for JSON\n $.getJSON( '/projects/getMenteeIdByProjectId/'+ id, function( data ) {\n callback(data);\n });\n}", "function findAllWorkouts(res, cb){\n db.Workout.find({}).sort({day:1}) \n .then((data)=>{\n cb(data);\n })\n}", "getPersona(id) {\n let persona = this.personas.filter(persona => {\n return persona.id === id;\n })[0];\n //filter() retorna un nuevo arreglo y nosotros buscamos la posicion 0 de ese arreglo\n\n //si no se encuentra ninguna persona con el id, retorna undefined por defecto\n return persona;\n }", "function getRoomById(id) {\n for (let i = 0; i < rooms.length; i++) {\n const room = rooms[i];\n if (room.id == id) {\n return room;\n }\n }\n return null;\n}", "function lookup(id, ...params) { // takes remaing params and bundles into an array, indefinitely\n return db.lookup(\n \"people-records\", id, ...params // spreads an array out as individual items\n );\n}", "function getThePage(id) {\n getStoryData().then((pages) => {\n for (let page of pages) {\n if (page.id == id) {\n storyPrint(page);\n }\n }\n })\n}", "static async findEmployee(id) {\n const user = await pool5.query(\n `\n select * from supervisor left join personal_information on personal_information.employee_id=supervisor.supervisor_id where personal_information.employee_id = $1`,\n [id]\n );\n return user.rows[0];\n }", "function findTask(id){\n return db(\"tasks\")\n .select('tasks.description','tasks.notes','projects.name')\n .join('projects','projects.id','tasks.project_id')\n .where(\"project_id\", id);\n}", "function lookupRecord(store = \"person-records\", id= -1) {\n // ..\n}", "function GetById(id, response) {\n\t\"use strict\";\n\tmongoClient.connect(connectionString, function (err, db) {\n\t\tif (err) {\n\t\t\tconsole.log('Connection Failed. Error: ', err);\n\t\t} else {\n\t\t\tvar idNumber = parseInt(id);\n\t\t\tif (idNumber) {\n\t\t\t\tvar collection = db.collection(TASKS_COLLECTION);\n\t\t\t\tcollection.findOne({\n\t\t\t\t\t'id': idNumber\n\t\t\t\t}, function (err, result) {\n\t\t\t\t\tif (err) {\n\t\t\t\t\t\tresponse.status(500).send(err.message);\n\t\t\t\t\t}\n\t\t\t\t\tif (result) {\n\t\t\t\t\t\t//A task was found.\n\t\t\t\t\t\t//Parse date to a legible format\n\t\t\t\t\t\tresult.registrationDate = ParseDate(result.registrationDate);\n\t\t\t\t\t\tresult.deadline = ParseDate(result.deadline);\n\t\t\t\t\t\tresponse.status(200).send(result);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t//Task not found.\n\t\t\t\t\t\tresponse.status(404).send(\"Task not found\");\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t} else {\n\t\t\t\t//Parse Error\n\t\t\t\tresponse.status(400).send('Id must be a number.');\n\t\t\t}\n\n\t\t\tdb.close();\n\t\t}\n\t});\n}", "static borrowUserIdea(user, id, borrowedTo) {\n if (isNaN(id)) {\n // convert to number\n id = ideas[user].indexOf(id);\n } else {\n id -= 1;\n }\n let idea = ideas[user][id];\n // todo borrow mark\n return idea;\n }", "function findJobById (id) {\r\n return state.jobs.find(job => job.id === id);\r\n}", "function getTaskById(req, res, done) {\n task.findTaskById(req.params.taskId, (e, r) => {\n if(e) return done(new HttpError(500, e));\n if(!r) return done(new HttpError(400, 'Task with this id does not exists'));\n\n res.send({\n id: r._id,\n name: r.name,\n desc: r.desc,\n shortInfo: r.shortInfo,\n chatType: r.chatType,\n character: {\n name: r.character.name,\n desc: r.character.desc,\n image: r.character.image\n },\n location: {\n name: r.location.name,\n desc: r.location.desc,\n lon: r.location.lon,\n lat: r.location.lat,\n image: r.location.image\n },\n dueDate: r.dueDate,\n chat: _.map(r.chat, (e) => {\n return {\n _type: e._type,\n text: e.text,\n audioId: e.audioId,\n answers: e.answers\n }\n })\n })\n })\n}", "function getTeam() {\n // Ambil nilai query parameter (?id=)\n let urlParams = new URLSearchParams(window.location.search);\n let idParam = urlParams.get(\"id\");\n\n fetch(`${base_url}competitions/${idParam}/teams`, {\n headers: {\n 'X-Auth-Token': authToken\n }\n })\n .then(res=>{\n return res.json()\n })\n .then(resjson=>{\n showTeam(resjson)\n })\n}", "function getWorkOrderInternalId(woNumber) {\r\n\tvar fils = [];\r\n\tfils.push(new nlobjSearchFilter('type', null, 'is', 'WorkOrd'));\r\n\tfils.push(new nlobjSearchFilter('mainline', null, 'is', 'T'));\r\n\tfils.push(new nlobjSearchFilter('tranid', null, 'is', woNumber));\r\n\tvar internalId = null;\r\n\tvar recs = nlapiSearchRecord('transaction', null, fils);\r\n\tif(!!recs && recs.length > 0) {\r\n\t\tinternalId = recs[0].getId();\r\n\t}\r\n\treturn internalId;\r\n}", "findTaskById(id) {\n return this.addTask.filter(task => task.id === id)[0]\n }", "async getMyHousehold(req, res, next) {\n try {\n const myHousehold = await householdsService.getMyHousehold(req.userInfo.id)\n res.send(myHousehold)\n } catch (error) {\n next(error)\n }\n }", "getPersonaById(id) {\n //BUSCO DENTRO DEL ARREGLO PERSONAS Y SI ENCUENTRA UNA\n //DEVUELVE ESA PERSONA, SI NO, DEVUELVE UNDEFINED\n let persona = this.personas.filter(persona => {\n return persona.id === id;\n })[0];\n\n return persona;\n }", "function getOpponentTeamId(myTeamId) {\n if(myTeamId == 100) {\n return 200;\n }\n else {\n return 100;\n }\n}", "function getHowtoById(id) {\n return db('howtos')\n .where('id', id)\n}", "function getWorkspaceStudy(studyId, studyPropertiesById) {\n\n return studyPropertiesById.get(studyId);\n}", "static async findById(req, res, next) {\n try {\n const data = await ToDo.findByPk(+req.params.id, {\n where: { UserId: +req.decoded.id },\n })\n if (data) {\n res.status(200).json(data)\n return\n } else {\n throw { status: 404 }\n }\n } catch (err) {\n next(err)\n }\n }", "function findOwnNote(req, res) {\n var scoreId = req.params.scoreId;\n noteModel\n .findOwnNote(scoreId)\n .then(function (score) {\n res.json(score);\n });\n }", "function getPerson(){\n const personID = document.getElementById(\"getPersonByIdText\").value\n personFacade.getPerson(personID).then(person =>{\n document.getElementById(\"getPersonByIdDiv\").innerHTML =\n `<h5 style = \"margin-top:20px\">Her er personen</h5>\n <table>\n <tr><td>Id:</td><td>${person.id}</td></tr>\n <tr><td>Fornavn:</td><td>${person.firstName}</td></tr>\n <tr><td>Efternavn:</td><td>${person.lastName}</td></tr>\n <tr><td>Email:</td><td>${person.email}</td></tr>\n <tr><td>Telefon nummer:</td><td>${person.phones[0].number}</td></tr>\n <tr><td>Telefon beskrivelse:</td><td>${person.phones[0].description}</td></tr>\n <tr><td>Adresse</td>:</td><td>${person.address.street}</td></tr>\n <tr><td>Mere info:</td><td>${person.address.addInfo}</td></tr>\n <tr><td>By:</td><td>${person.address.cityInfo.city}</td></tr>\n <tr><td>Postnummer:</td><td>${person.address.cityInfo.zipCode}</td></tr>\n <tr><td>Hobby navn:</td><td>${person.hobbies[0].name}</td></tr>\n <tr><td>Hobby link:</td><td>${person.hobbies[0].wikiLink}</td></tr>\n <tr><td>Hobby kategori:</td><td>${person.hobbies[0].category}</td></tr>\n <tr><td>Hobby type:</td><td>${person.hobbies[0].type}</td></tr>\n </table>`\n console.log(person)\n })\n .catch(error => errorHandling(error))\n}", "function getUser(id) {\n // return the one user with that id\n const user = users.find(user => user.id === id);\n return user;\n}", "function viewGroupWorkoutDetails(workout_id ,date) {\n //let's go ahead and parse the workout_id on the client side\n var group_id = workout_id.substring(1, workout_id.indexOf(\"_\"))\n var wid = workout_id.substring(workout_id.indexOf(\"_\") + 1);\n\n console.log(\"group: \" + group_id + \", wid: \" + wid);\n\n $.ajax({\n type: \"POST\",\n url: \"/CRUD/challenge_calendar/getGroupWorkoutDetails.php\",\n data: {\"group_id\":group_id, \"wid\":wid, \"date\": date},\n dataType: \"html\",\n success: function(response) {\n $(\"#dialog-modal\").dialog('close');\n $(\"#dyn_content\").html(response);\n }\n });\n}", "async function singleListWork (ctx) {\n const { language, subtitle } = ctx.state;\n const cat = ctx.params.id;\n\nconst works = await Work.query()\n .modify('setLocale', 'public_work_names', 'work_id', 'public_works.id', language, subtitle)\n .select('slug', 'cat_id', 'is_unlock', 'price')\n .modify('currencyName', 'public_works', language)\n .where('cat_id', cat);\n\n if (works.length > 0) {\n ctx.status = 200;\n ctx.body = {\n data: clothing,\n };\n } else {\n ctx.status = 404;\n ctx.body = {\n message: 'Could not find any public works.',\n };\n }\n}", "function getById(id) {\n const requestOptions = {\n method: \"GET\",\n headers: authHeader.get(),\n credentials: \"include\"\n };\n\n return fetch(baseUrl + \"workflows/\" + id + \"/\", requestOptions).then(\n handleResponse\n );\n}", "function getById(id) {\n const requestOptions = {\n method: \"GET\",\n headers: authHeader.get(),\n credentials: \"include\"\n };\n\n return fetch(baseUrl + \"workflows/\" + id + \"/\", requestOptions).then(\n handleResponse\n );\n}" ]
[ "0.65335226", "0.64334565", "0.63468903", "0.59582907", "0.5888346", "0.56193024", "0.5587572", "0.5584204", "0.55033445", "0.5471064", "0.5466124", "0.5449083", "0.5441754", "0.5431003", "0.54215634", "0.5418158", "0.5396519", "0.5390639", "0.5386139", "0.53400433", "0.53358513", "0.53343076", "0.5296326", "0.52933216", "0.52822095", "0.52789927", "0.5271456", "0.5271343", "0.52634144", "0.52629083", "0.52625954", "0.52581346", "0.5246963", "0.5246549", "0.5241797", "0.5239514", "0.5218331", "0.51977956", "0.5195375", "0.51911795", "0.51911795", "0.5186877", "0.51615375", "0.5160248", "0.51545995", "0.51524293", "0.51521844", "0.51486737", "0.5143062", "0.51310104", "0.51234806", "0.51196176", "0.5118975", "0.5118582", "0.511389", "0.5110387", "0.51035064", "0.50809306", "0.50762904", "0.50744116", "0.5069531", "0.50654644", "0.50584054", "0.50584054", "0.5052826", "0.5050807", "0.50479966", "0.50467247", "0.50440764", "0.5040392", "0.50398296", "0.5037901", "0.50373274", "0.5035522", "0.5034492", "0.50338376", "0.5030276", "0.5022273", "0.501606", "0.50097424", "0.49963874", "0.49916068", "0.49864072", "0.49854818", "0.49822155", "0.49810717", "0.49766254", "0.4974674", "0.49711585", "0.49649462", "0.49627802", "0.49621338", "0.49528548", "0.4952377", "0.4952321", "0.49474427", "0.4944039", "0.49427143", "0.49409267", "0.49409267" ]
0.58097047
5
delete a specific part of a workout by person id and exercise id
async delete(id) { return await conn.query("DELETE FROM Fitness_Workouts WHERE workout_id=?", id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteById(id) {\n id = parseInt(id)\n let exercise = findById(id);\n\n if (!exercise) \n throw new Error(`No exercise for id: ${id}`);\n\n exercises.delete(id)\n\n return exercise;\n}", "function deleteExercise(id) {\n $.ajax({\n method: \"DELETE\",\n url: \"/api/exercises/\" + id\n })\n .then(function () {\n $(`[data-exercise=${id}]`).remove();\n });\n }", "async deleteById(id) {\n return await conn.query(\"DELETE FROM Fitness_RoutineExercises WHERE routineExercises_id=?\", id);\n }", "function delete_work(id){\n console.log(\"INSIDE DELETE_WORK\");\n const key = datastore.key([WORK, parseInt(id,10)]);\n return datastore.get(key).then( result => {\n\n //Delete the artwork\n return datastore.delete(key).then(()=>{\n console.log(\"EXITING DELETE WORK\");\n return true;\n });\n }).catch( err => {\n return false;\n });\n}", "async deleteExercise(exercise_id) {\n try {\n let values = await this.getValuesID();\n let exercise = new ExerciseApi(values[0], values[1]);\n\n await exercise.deleteExercise(exercise_id);\n\n await this.getMyExercises();\n\n } catch (error) {\n console.log(error);\n }\n }", "deleteWorkoutExercise() {\n\n new TrainingAPI().deleteWorkoutExercise(this.state.exercise.planId, this.state.exercise.workoutId, this.state.exercise.id).then((data) => {\n\n // Send EVENT\n TRC.TotoEventBus.bus.publishEvent({name: config.EVENTS.workoutExerciseDeleted, context: {exerciseId: this.state.exercise.id}});\n\n });\n\n }", "function filterid(work, worksetid) {\n for (var ids of worksetid) {\n work.delete(ids);\n }\n return work;\n }", "function deleteEvaluation(id){\n\n}", "function removePart(tool_id) {\n axios.post(props.url + \"/delete?tool_id=\" + tool_id).then((response) => {\n window.location.reload()\n });\n }", "deleteExercise(id) {\n // mando richiesta delete al backend per eliminare l'exercise\n axios.delete('http://localhost:5000/exercises/' + id)\n // visualizzo il responso dell'operazione trasmesso dal backend\n .then(res => console.log(res.data));\n // aggiorno l'array dello state filtrandolo\n // con i soli elementi con campo _id diverso da quello eliminato\n this.setState({\n exercises: this.state.exercises.filter(el => el._id !== id)\n })\n }", "function del(id){\n\t\t\t$(\"[data-eid=\"+ id +\"]\").each(function(){\n\t\t\t\tvar action = makeJsonFromNode(this);\n\t\t\t\tvar idArr = action.id.split('-');\n\n\t\t\t\t// Find object and reset start/end data\n\t\t\t\tvar p = getObjInArr(experiments[idArr[2]].protocols, 'id', idArr[3]);\n\t\t\t\tvar s = getObjInArr(p.steps, 'id', idArr[4]);\n\t\t\t\tvar a = getObjInArr(s.actions, 'id', action.id);\n\t\t\t\t\n\t\t\t\ta.start = a.end = \n\t\t\t\taction.start = action.end = 0;\n\n\t\t\t\t// Save and remove\n\t\t\t\tsaveAction.enqueue(action);\n\t\t\t\t$('#calendar').fullCalendar(\"removeEvents\", this.getAttribute(\"data-fc-id\"));\n\t\t\t});\n\t\t\t$(\"[data-id=\"+ id +\"]\").removeClass('disabled');\n\t\t}", "function deleteInterview(id, interview) {\n return (\n axios.delete(`/api/appointments/${id}`, { interview })\n .then((response) => {\n dispatchState({ type: SET_INTERVIEW, id, interview })\n })\n )\n }", "addOrRemoveExercise(exercise) {\n let index = this.homework.exercises.indexOf(exercise._id);\n if (index > -1) {\n this.homework.exercises.splice(index, 1);\n } else {\n this.homework.exercises.push(exercise._id);\n this.maxPoints += exercise.points;\n }\n }", "function removeFromExperiment(i, appointment) {\n if(i<appointment.experiments.length) {\n Experiment.findById(appointment.experiments[i]).exec(function(err,experiment){\n if(experiment.appointments.indexOf(appointment._id) !== -1){//If an experiment on the Database does contain this appointment remove this appointment ID from its appointment list.\n experiment.appointments.splice(experiment.appointments.indexOf(appointment._id), 1);\n experiment.save();\n }\t \n removeFromExperiment(i+1,appointment);\n });\n } else {\n return;\n }\n}", "function deletePuzzle(puzzle) {\n return fetch(PUZZLE_URL + '/' + puzzle.id, {\n method: 'DELETE'\n })\n }", "function deleteInterview(id){\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n return axios.delete(`http://localhost:8001/api/appointments/${id}`)\n .then(response => {\n setState({\n ...state,\n appointments\n })\n updateSpots(id)\n }\n )\n }", "[DELETE_EXPERIENCE](state, {id}) {\n state.experiences.splice(state.experiences.indexOf(id), 1)\n }", "function deleteTask(id) {\r\n let Note = document.getElementById(id); \r\n //removes note from page\r\n document.getElementById(\"shoeNotesFromLS\").removeChild(Note); \r\n let indexOfTaskToRemove = tasks.findIndex(task => task.id === id);\r\n //removes from array of tasks\r\n tasks.splice(indexOfTaskToRemove, 1);\r\n //removes from array in local storage\r\n if (tasks.length != 0) {\r\n localStorage.tasks = JSON.stringify(tasks);\r\n }\r\n else {\r\n localStorage.removeItem(\"tasks\");\r\n }\r\n \r\n}", "function handleDelete(exercise){\n fetch(`http://localhost:3000/exercises/${exercise.id}`,{ \n method: \"DELETE\"\n })\n let exercisesRemaining = exerciseLibrary.filter(eachExercise => eachExercise.id !== exercise.id);\n console.log(exercisesRemaining)\n setExerciseLibrary([...exercisesRemaining])\n }", "function removeThisExam(id) {\n vm.selectedExams.splice(id, 1);\n setTotal();\n }", "async deleteLesson(body){\n let gymId = body.gymId;\n let lesson_id = body.lesson_id;\n \n console.log(lesson_id)\n return Gym.findByIdAndUpdate(\n {_id: gymId},\n { $pull: { lessons: lesson_id } });\n }", "function DeleteNoteFromList(id){\n\t\t//this.projNotes[];\n\t\tvar noteIndex = FindProjNote(id);\n\t\t\n\t\tif(typeof noteIndex != \"boolean\"){\n\t\t\tprojNotes.splice(noteIndex, 1);\n\t\t\tnoteListChanged=true;\n\t\t}\n\t\t\n\t\t\n\t}", "deleteNote(id) {\n if(this.locations.hasOwnProperty(id)) {\n delete this.locations[id];\n }\n this.dirtyNotesId.delete(id);\n\n for(let i in this.notes) {\n if(this.notes[i].id === id) {\n this.notes.splice(i,1)\n break;\n }\n }\n }", "static delete(id) {\r\n // const coursList = [];\r\n // for (let index = 0; index < coursExtent.length; index++) {\r\n // if(coursExtent[index].id != id){\r\n // coursList.push(coursExtent[index]);\r\n // }\r\n // }\r\n // coursExtent.splice(0,coursExtent.length);\r\n\r\n // for (let indexx = 0; indexx < coursList.length; indexx++) {\r\n // coursExtent.push(coursList[indexx]); \r\n // }\r\n // return coursExtent;\r\n return db.execute('DELETE FROM Kurs WHERE Id_kurs = ?', [id]);\r\n }", "deleteTrainee(id) {\n axios.delete(\"http://localhost:5000/trainee/\" + id).then((response) => {\n console.log(response.data);\n });\n\n this.setState({\n exercises: this.state.trainee.filter((el) => el._id !== id),\n });\n }", "removeWorkout(context, workoutId) {\n context.commit('removeWorkout', workoutId);\n context.commit('updateWorkouts');\n }", "static async deleteById(id) { // also deletes the user from the courses and the lessons\n\n // deletes the user from the courses teachers and the courses students\n \n let courses = await this.coursesDatastore.read()\n\n let changedCourses = { }\n\n for (let courseId in courses) {\n courseId = Number(courseId)\n\n if (courses[courseId].teacher === id) {\n if (!changedCourses[courseId]) changedCourses[courseId] = {}\n changedCourses[courseId].teacher = -1\n }\n\n let index = courses[courseId].students.findIndex(st => st === id )\n if (index > -1) {\n if (!changedCourses[courseId]) changedCourses[courseId] = {}\n courses[courseId].students.splice(index, 1)\n changedCourses[courseId].students = courses[courseId].students\n }\n\n }\n\n let courseUpdatePromises = []\n if (Object.keys(changedCourses).length) {\n for (let id in changedCourses) {\n courseUpdatePromises.push(this.coursesDatastore.update({ id }, { ...changedCourses[id] }))\n }\n }\n await Promise.all(courseUpdatePromises)\n\n\n\n // deletes the user from the lesson completion\n\n let lessons = await this.lessonsDatastore.read()\n\n let lesUpdatePromises = []\n for (let lessonId in lessons) {\n let index = lessons[lessonId].completed.findIndex(st => st === id)\n if (index > -1) {\n lessons[lessonId].completed.splice(index)\n lesUpdatePromises.push(this.lessonsDatastore.update({ id: lessonId }, { completed: lessons[lessonId].completed }))\n }\n }\n await Promise.all(lesUpdatePromises)\n\n\n\n return super.deleteById(id)\n }", "deleteNote(id) {\n return this.getNotes()\n .then((notes)=>notes.filter((note)=>note.id !== id))\n .then((filteredNotes)=>this.write(filteredNotes));\n }", "deleteProblem(response, pathname, accountID) {\n //let problemName = Server.getSentID(pathname.substr(this.databaseActions[0].length)); //not sure why this is here...\n return this.database.deleteProblem(this, response, accountID, pathname.substr(this.databaseActions[0].length));\n }", "function deleteTask(x){\n console.log(x.id)\n let iden = (x.id).substring(4, x.id.length)\n console.log(iden)\n let identify ={\n id : iden\n }\n let xhttp = new XMLHttpRequest();\n \n /* replace https://note-it-keeper.herokuapp.com/ to http://localhost:8000 when running locally */\n xhttp.open(\"POST\" , \"https://note-it-keeper.herokuapp.com/rmtask\" , true);\n xhttp.setRequestHeader(\"Content-Type\",\"application/json; charset=utf-8\");\n xhttp.send((JSON.stringify(identify)));\n xhttp.onreadystatechange = function(){\n if (this.readyState == 4 && this.status == 200) {\n /* If the task is successfully removed from server, update the data on tasks */\n updateData(tabTracker);\n document.getElementById(\"details-tab\").style.width = \"0%\";\n document.getElementById(\"main-display\").style.width = \"100%\";\n }\n }\n}", "deletehsCourse(hscourse){\n var choice = confirm('Are you sure you want to delete this?');\n if (choice) {\n var index = this.get('courseModel').indexOf(hscourse);\n var restemp = this.get('courseModel').objectAt(index);\n console.log(restemp);\n restemp.deleteRecord();\n restemp.save();\n }\n }", "function removeInterview(id) {\n //temporarily keeps the removed interview in case of database query error\n const oldAppt = {\n [id]: state.appointments[id]\n };\n\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n\n return axios.delete(`http://localhost:8001/api/appointments/${id}`)\n .then((response) => {\n console.log(\"Deleted \" + response.status);\n dispatch({ type: SET_INTERVIEW, value: appointments, spots: 1})\n })\n .catch((error) => {\n console.log(error);\n dispatch({ type: SET_INTERVIEW, value: oldAppt})\n })\n }", "handleDeleteExercise(id) {\n console.log(\"deleted button\")\n console.log(id)\n\n fetch('https://strengthstr-mobile.herokuapp.com/workouts/' + this.state.workoutId + \"/exercises/\" + id, {\n method: 'DELETE',\n }).then(res => {\n console.log(\"deleted exercise\")\n }).then(res => {\n this.componentDidMount()\n })\n\n }", "function deleteInterview(id) {\n return axios.delete(`./api/appointments/${id}`, null)\n .then(() => {\n const appointment = {\n ...state.appointments[id],\n interview: null\n };\n const appointments = {\n ...state.appointments,\n [id]: appointment\n };\n const days = [\n ...state.days\n ]\n days[getIdByDays(state.day)].spots += 1; \n dispatch({\n type: SET_INTERVIEW,\n appointments: appointments,\n })\n dispatch({\n type: SET_SPOTS,\n days: days,\n })\n })\n }", "function deleteGoalNote(worker, noteId) {\n if (noteId != null) {\n datastore.deleteNote(noteId);\n worker.port.emit(\"GoalNoteDeleted\", noteId);\n }\n}", "deleteEffort (effortId) {\n console.log('deleteEffort:', effortId);\n let user = Auth.requireAuthentication();\n \n // Validate the data is complete\n check(effortId, String);\n \n // Load the effort to authorize the edit\n let effort = Efforts.findOne(effortId);\n \n // Validate that the current user is an administrator\n if (user.managesContributor(effort.contributorId) || user.isAdmin() || (user.contributor() || {})._id === effort.contributorId) {\n // Delete the effort\n Efforts.remove(effortId);\n } else {\n console.error('Non-authorized user tried to delete an effort:', user.username, effortId);\n throw new Meteor.Error(403);\n }\n }", "function deleteAppointment() {\n\n transition(\"DELETING\", true)\n \n // Async call to initiate cancel appointment\n props.cancelInterview(props.id).then((response) => {\n\n transition(\"EMPTY\")\n }).catch((err) => {\n\n transition(\"ERROR_DELETE\", true);\n });\n }", "deleteGoal(id) {\n this.db.remove({ _id: id }, {}, function (err, docsRem) {\n if (err) {\n console.log(\"Error deleting document.\");\n } else {\n console.log(docsRem, \"Document(s) removed from database.\");\n }\n });\n }", "function deleteLessonFromMain(id) {\n API.deleteLessonFromMain(id)\n .then(res => loadLessonsMain())\n .catch(err => console.log(err));\n }", "DeleteGuidedTour(e, guidedTourId) {\r\n db.collection(\"GuidedTours\").doc(guidedTourId).delete()\r\n .then(() => {\r\n this.setState({\r\n deleteModal: false\r\n });\r\n this.display();\r\n });\r\n }", "async function clearWork(req, artwork){\n\n if(artwork.artist.id){ //If there is an attached artist, iterate through works and remove work\n await get_artist(req, artwork.artist.id).then((a)=>{\n for( var i = 0; i < a.works.length; i++){\n console.log(a.works[i].id);\n if ( a.works[i].id === artwork.id) {\n a.works.splice(i, 1);\n break;\n }\n }\n console.log(a.works);\n //Edit artist\n edit_artist(a.id, a.name, a.nationality, a.style, a.works);\n });\n }\n\n\n}", "deleteNote(id) {\n// get the notes, filter and grab out the one in the id\nreturn this.getNotes()\n.then(notes => (notes.filter(note => note.id !== parseInt(id))))\n.then(newNoteSet => asyncWriteFile(\"db/db.json\", JSON.stringify(newNoteSet)))\n }", "removeIt(docID) {\n this.assertDefined(docID);\n // remove the Answers associated with this question\n MentorAnswers.removeQuestion(docID);\n // OK, clear to delete.\n super.removeIt(docID);\n }", "function onDelete(work_item_id) {\n // Use Ajax to start deleting task from the database\n $.ajax({\n url: `https://localhost:5001/api/v1/WorkItem?workItemId=${work_item_id}`,\n type: 'DELETE',\n cache: false,\n data: JSON.stringify({\n \"Title\": \"delete\",\n \"Content\": \"delete\",\n \"DateCreated\": \"delete\"\n }),\n contentType: \"application/json\",\n success: function (responseData) {\n // At this point, task is deleted in the database, we will now need to remove it from\n // current list of tasks (work item)\n $(\"div\").remove(`#${work_item_id}`);\n }\n })\n}", "function deleteGoal(goal_id) {\n console.log(goal_id)\n axios.delete(`/api/goals/${goal_id}`).then(response => {\n console.log(response);\n loadGoals()\n })\n }", "function removeHowto(id){\n return db('howtos')\n .where('id', id)\n .del()\n .then(response => (!response ? null : response))\n}", "deletehsSubject(hssubject){\n var choice = confirm('Are you sure you want to delete this?');\n if (choice) {\n var index = this.get('subjectModel').indexOf(hssubject);\n var restemp = this.get('subjectModel').objectAt(index);\n console.log(restemp);\n restemp.deleteRecord();\n restemp.save();\n }\n }", "function deleteTask(id,deleteIds) {\n const path = location.pathname+\"/\"+deleteIds;\n axios.delete(path)\n .then(res => {\n setTasks(prevNotes => {\n return prevNotes.filter((noteItem, index) => {\n return index !== id;\n });\n });\n })\n .catch(err => {\n console.log(err);\n });\n }", "removeNote(id) {\n // use get notes function to acess array of notes\n return this.getNotes()\n // filter through notes array to get all notes besides the one with the matching ID\n .then(notes => this.write(notes.filter(note => note.id != id)))\n }", "function deleteToDoFromArr(id) {\n removeItem('toDoArray', id);\n}", "function _deleteHouse(req, cb) {\n var id = req.params.house;\n req.getConnection(function(err, connection){\n connection.query('DELETE FROM `apartments` WHERE `id` = ?', id, cb);\n });\n }", "deleteNote(id) {\n let index = this.jsonData().findIndex(element => parseInt(element.id) === parseInt(id));\n if (index !== -1) {\n let noteData = this.jsonData();\n noteData.splice(index, 1);\n this.storeData(noteData);\n }\n }", "function remove(id) {\n return db('sections')\n .where({ id })\n .del();\n}", "function deleteTask (e){\n for (var i = 0 ; i< loginUser.tasks.length; i ++){\n if(parseInt(loginUser.tasks[i].id) === parseInt(e.target.getAttribute('data-id'))){\n if(loginUser.tasks[i].status === false){\n taskToDo--;\n $('#countOfTask').text('').text('Task to do: '+ taskToDo);\n }\n loginUser.tasks.splice(i, 1);\n $('#task' + e.target.getAttribute('data-id')).remove();\n collectionOfUser.update(\n {\n id : loginUser.id,\n tasks : loginUser.tasks\n },\n function(user){\n loginUser = user;\n },\n error \n );\n }\n }\n }", "deleteNote(id) {\n // This uses the same kind of logic. It doesn't actually delete the note...\n return this.getNotes()\n // we find the note we want to delete by filtering throught notesArr by id \n .then(notesArr => notesArr.filter((note) => note.id !== id))\n // and create a NEW ARRAY with the new note inside\n .then(filteredNotesArr => this.write(filteredNotesArr))\n }", "function deleteNote(id) {\n // remove the note at index: id from the json array\n data.splice(id, 1);\n // Update the ids for every other note to match their updated position in the array\n for (let i = 0; i < data.length; i++) {\n data[i].id = i;\n }\n // Write the updated array to the json file\n fs.writeFile(dbPath, JSON.stringify(data), error => {\n if(error){\n throw error;\n }\n })\n}", "function deleteClient (room,taskId) {\n const taskKey = datastore.key([\n room,\n Number(taskId) //must be integer\n ]);\n\n datastore.delete(taskKey)\n .then(() => {\n console.log(`Task ${taskId} deleted successfully.`);\n })\n .catch((err) => {\n console.error('deleteClient ERROR:', err);\n });\n}", "handleDeleteWorkout(id) {\n console.log(\"deleted button\")\n console.log(id)\n\n fetch('https://strengthstr-mobile.herokuapp.com/workouts/' + id + \"/exercises\", {\n method: 'DELETE',\n }).then(res => {\n console.log(\"deleted exercises\")\n }).then(\n fetch('https://strengthstr-mobile.herokuapp.com/workouts/' + id, {\n method: 'DELETE',\n }).then(res => {\n console.log(\"deleted Workout\")\n this.componentDidMount()\n })\n )\n }", "function deletePerson3(person) {\n document.getElementById('tblPerson').removeChild(person);\n}", "function deleteHomework(homeworkID) {\n var url = apiURL + '/homework/' + homeworkID;\n $.ajax({\n url: url,\n type: 'delete',\n success: function(data, status) {\n if (data['message'] == 'Homework deleted successfully.') {\n $.snackbar({\n content: 'Aufgabe erfolgreich gel&ouml;scht'\n });\n loadContent(false);\n loadContent(true);\n } else {\n $.snackbar({\n content: 'Es ist ein Fehler aufgetreten. Bitte versuche es erneut.'\n });\n }\n },\n error: function(xhr, desc, err) {\n //console.log(xhr);\n //console.log(\"Details: \" + desc + \"\\nError:\" + err);\n },\n headers: { auth: store.get(activeUser).auth }\n });\n }", "function deletePersonFromRoom (room_name, id) {\n \tfor (var i=0; i<chatRooms.length; i++) {\n \t\tif (chatRooms[i]['roomname'] === room_name) {\n \t\t\tdelete chatRooms[i].people[id];\n \t\t}\n \t}\n }", "deleteEmployee(employee,timesheet){\n\t\tvar ts_index = this.getIndexTimesheet(timesheet);\n\t\tvar done=1;\n\t\tvar item=this.objTool.items[ts_index];\n\t\tif(item.employees.length>0){\n\t\t\tfor (var x=0; x < item.employees.length && done; x++){\n\t\t\t\tvar container = item.employees[x];\n\t\t\t\tif (container.employee==employee){\n\t\t\t\t\tthis.objTool.items[ts_index].employees.splice(x, 1);\n\t\t\t\t\t//ƒconsole.log(this.objTool.items[ts_index]);\n\t\t\t\t\tthis.objTool.update(this.objTool.items[ts_index]);\n\t\t\t\t\tthis.setState({items:this.objTool.items});\n\t\t\t\t\tdone=0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "function removeNote(id) {\n // find object (note) for which id equals the argument\n const noteIndex = notes.findIndex(function(note) {\n return note.id === id;\n });\n if (noteIndex > -1) {\n // delete that one object\n notes.splice(noteIndex, 1);\n }\n}", "remove(id, params) {}", "function deleteStipStep2 ()\r\n\r\n{\r\n\tdb.transaction(function(tx)\r\n\t{\r\n\t\tvar dataPerson = '';\r\n\t\tvar dataStip = '';\r\n\t\tvar stip = document.getElementById ('tijdStip');\r\n\t\tdataPerson = stip.getAttribute ('data-person');\r\n\t\tdataStip = stip.getAttribute ('data-stip');\r\n\t\ttx.executeSql('DELETE FROM tijden WHERE personID = ' + dataPerson + ' AND tijdID = ' + dataStip, [], function (tx, results)\r\n\t\t{\r\n\t\t\tvar dataPerson = '';\r\n\t\t\tvar dataStip = '';\r\n\t\t\tvar stip = document.getElementById ('tijdStip');\r\n\t\t\tdataPerson = stip.getAttribute ('data-person');\r\n\t\t\tdataStip = stip.getAttribute ('data-stip');\r\n\t\t\ttx.executeSql('DELETE FROM innames WHERE personID = ' + dataPerson + ' AND tijdID = ' + dataStip, [], function (tx, results)\r\n\t\t\t{\r\n\t\t\t\tstipCancel ();\r\n\t\t\t\trefreshDistribution ();\r\n\t\t\t}), function (tx, error)\r\n\t\t\t{\r\n\t\t\t\talert ('er is een fout opgetreden\\r\\n' + error.message);\r\n\t\t\t}, function ()\r\n\t\t\t{\r\n\t\t\t};\r\n\t\t}), function (tx, error)\r\n\t\t{\r\n\t\t\talert ('er is een fout opgetreden\\r\\n' + error.message);\r\n\t\t}, function ()\r\n\t\t{\r\n\t\t};\r\n\t});\r\n}", "function deleteSelectedTrainingRoom(){\n deleteTrainingRoom(trainingRoomId)\n\tsetTimeout( ()=>{\n\t\tlocation.reload();\n\t}, 200)\n\n}", "deleteNote(id) {\n // This retrieves all notes, remotes the note with the specified unique ID, and finally writes the filtered notes.\n return this.retrieveNotes()\n .then((notes) => notes.filter((note) => note.id !== id))\n .then((filteredNotes) => this.writeFile(filteredNotes));\n }", "'REMOVE_EMPLOYEE_BY_ID'(state, id) {\n const index = state.employees.findIndex(e => e.id === id);\n if (index > -1) {\n state.employees.splice(index, 1)\n }\n }", "function deleteItem(deleteItemtodo){\r\n var iteMId = deleteItemtodo.parentNode.id;\r\n db.collection(\"todo\").doc(iteMId).delete().then(function() {\r\n console.log(\"Document successfully deleted!\");\r\n }).catch(function(error) {\r\n console.error(\"Error removing document: \", error);\r\n });\r\n}", "static delete(to,t,p,op,couleur,cb){\n\t\tconsole.log(couleur.substr(couleur.length -1));\n\t\tquery.execute(conn, 'echec','delete data {:cell'+to+' rdf:type <'+op+'> . :cell'+to+' rdf:type <'+couleur+'>}',\n\t\t'application/sparql-results+json', {\n\t\t\toffset:0,\n\t\t\treasoning: true\n\t\t}).then(res =>{\n\t\t\tthis.getId(to,t,p,op,couleur.substr(couleur.length -1), cb);\n\t\t}).catch(e=> {console.log(e);});\t\n\t}", "function deleteTask(event) {\n\n let idDelete = event.target.getAttribute('data-id')\n\n let keyId = listTask.findIndex(element => {\n if (element.id == idDelete) {\n return element\n }\n })\n\n if (keyId != -1) {\n listTask.splice(keyId, 1)\n saveData()\n }\n\n openModalDel()\n}", "function deleteNote(id) {\n\n firebase\n .firestore()\n .collection(\"NoteApp\")\n .where('id', '==' ,id)\n .get()\n .then((querySnapshot) => {\n querySnapshot.forEach((doc) => doc.ref.delete());\n });\n // To delete that item, we filter out the item we don't want\n setNotes(notes.filter((item) => item.id !== id));\n }", "function deleteTriggerById(id){\n var parent = task.triggers[id].parent;\n\n if (parent == \"triggers\") {\n task.triggers = {};\n document.getElementById('triggersCard').innerHTML = '<br><button type=\"button\" class=\"btn btn-primary\" onclick=\"launchD2Assitant(\\'triggers\\')\">+</button>\\\n <button type=\"button\" class=\"btn btn-primary\" onclick=\"add(\\'and\\',\\'triggers\\')\">AND</button>\\\n <button type=\"button\" class=\"btn btn-primary\" onclick=\"add(\\'or\\',\\'triggers\\')\">OR</button>';\n } else {\n var index = task.triggers[parent].operation.indexOf(id);\n task.triggers[parent].operation.splice(index,1);\n delete task.triggers[id];\n loadTask();\n }\n}", "deleteContributedStory({id}) {\n\n return this._getCollection()\n .then(collection => collection.deleteOne({\n _id: MongoDb.ObjectId(id)\n }));\n }", "function deleteQuest() {\n db.collection(\"Student_Quests\").doc(questID)\n .delete()\n .then(() => {\n console.log(\"Quest successfully deleted!\");\n location.href = \"./student-choose-quest.html\";\n }).catch((error) => {\n console.error(\"Error deleting quest: \", error);\n });\n}", "async function deleteDetail(item) {\r\n try {\r\n const detail = details;\r\n detail.splice(detail.indexOf(item), 1);\r\n\r\n let newDetails = {};\r\n\r\n const { _id, titulo, descricao, projeto_id } = step;\r\n\r\n if (details.length === 0) {\r\n newDetails = {\r\n _id,\r\n titulo,\r\n descricao,\r\n projeto_id\r\n };\r\n } else {\r\n newDetails = {\r\n _id,\r\n titulo,\r\n descricao,\r\n projeto_id,\r\n detalhes: detail\r\n };\r\n }\r\n\r\n setShow(true);\r\n\r\n await api.put(`/etapas/${step._id}`, newDetails, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n\r\n // const data = response.data;\r\n const res = await api.get(`/etapas/${projeto_id}/${step._id}`, {\r\n headers: {\r\n authorization: `Bearer ${token}`\r\n }\r\n });\r\n const { data } = res;\r\n\r\n if (data) {\r\n setDetails(data.detalhes);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n } else {\r\n setDetails([]);\r\n\r\n StepCurrentAction({\r\n step: data\r\n });\r\n }\r\n\r\n setShow(false);\r\n } catch (err) {\r\n console.log('err', err);\r\n setErr(true);\r\n }\r\n }", "deleteNote(privateNote) {\n privateNote.deleteRecord();\n privateNote.save();\n }", "static deleteItem(description){//description iz faila index\n fs.readFile(pathToRegularTaskFile, (error, fileContent)=>{\n let tasks=[];\n if(!error){\n tasks=JSON.parse(fileContent);\n }\n for(let i=0; i<tasks.length; i++){\n if(tasks[i].description===description){\n console.log(tasks[i].description, \"deleted\");\n tasks.splice(i,1);//udalaet na kakom ind, skolko elementov\n break;\n }\n }\n fs.writeFile(pathToRegularTaskFile, JSON.stringify(tasks),(error)=>{\n console.log(\"Error while trying to delete\", error);\n })\n });\n\n }", "function deleteTrainingRoom(id){\n\n\tfetch(`http://localhost:5000/TrainingRoom/${id}`, {\n method: \"DELETE\",\n mode: \"cors\"\n })\n}", "function deleteTool(id) {\n return db('tools')\n .where('id', id)\n .del()\n}", "function deleteTask(e){\n const taskID = document.getElementById('id').value;\n http\n .delete(`http://localhost:3000/Tasks/${taskID}`)\n .then(task=>{\n //clearing field\n ui.clearFiled();\n //showing message\n ui.showAlertMessage('Task deleted','alert alert-warning');\n //getting task\n getTasks();\n })\n}", "function deleteTask(event)\n{\n //gets button id\n let id = event.target.id;\n\n //gets task position from button id\n let taskPosition = id.replace(/\\D/g,'');\n\n //removes task from task array\n taskArr.splice(taskPosition - 1, 1); \n\n //loop through task array to adjust position\n for(let i = 0; i < taskArr.length; i++)\n {\n taskArr[i].position = i + 1;\n };\n\n //rewrites task list\n rewritesList();\n}", "function delFunc(e){\n let id=e.target.parentNode.parentNode.id;\n let del=Math.random(101,200);\n const requestDel = {\n method: \"DELETE\",\n headers: {\n \"Content-Type\": \"application/json\"\n } \n };\n var proceed = window.confirm(\"Are you sure?\\nPress Ok to delete the record or press Cancel to finish?\");\n if (proceed) {\n fetch(`https://ontrack-team3.herokuapp.com/students/${id}`, requestDel) \n prop.addFreshFunc(del);\n \n } \n }", "function borrarEquipoParticipante(equipo) {\n wizardFactory.borrarEquipoParticipante(vm.torneoSelected.tor_id, equipo.eqp_id)\n .success(function () {\n obtenerEquiposParticipantes();\n createAlert('warning', equipo.eqp_nombre + ' fue retirado del torneo.');\n })\n .error( errorHandler );\n }", "function deleteIdeaFromDB(res, body) {\r\n fs.readFile(path.join(rootPath, 'database', body.user + '.json'), function (err, data) {\r\n if (err) {\r\n console.error(err);\r\n res.writeHead(404, { 'Content-Type': 'text/html' });\r\n } else {\r\n let ideas = JSON.parse(data);\r\n let ID = body.id;\r\n delete ideas[\"\" + ID];\r\n\r\n fs.writeFile(path.join(rootPath, 'database', body.user + '.json'), JSON.stringify(ideas), (err) => {\r\n if (err) {\r\n console.error(err);\r\n res.writeHead(404, { 'Content-Type': 'text/html' });\r\n res.write(\"1\");\r\n return;\r\n } else {\r\n res.writeHead(200, { 'Content-Type': 'text/html' });\r\n res.write(\"0\");\r\n }\r\n res.end();\r\n });\r\n }\r\n });\r\n}", "function completeAssignmentInDatabase(id) {\r\n if (confirm('Well done! Do you want to remove this assignment from your list?')) {\r\n var request = database.transaction([\"allAssignments\"], \"readwrite\")\r\n .objectStore(\"allAssignments\")\r\n .delete(id);\r\n request.onsuccess = () => {\r\n getAllFromDatabase();\r\n\r\n };\r\n\r\n //Show success Modal and start confetti\r\n document.getElementById('modal4').style.display = 'block';\r\n\r\n\r\n } else {\r\n // Do nothing!\r\n }\r\n}", "function deleteCertainRow(thisId) {\n console.log(thisId);\n document.getElementById('tableBody').removeChild(document.getElementById(thisId));\n }", "function deletedUserPuzzle(puzzle, saved) {\n return (dispatch, getState) => {\n const { userPuzzles } = getState()\n let newPuzzles = userPuzzles.filter(p => p.id !== puzzle.id)\n dispatch({ type: \"DELETED_USER_PUZZLE\", newPuzzles })\n }\n}", "function deleteMeetingByMeetingID()\r{\r\taa.print(\"--------------this deleteMeetingByMeetingID method-------------\");\r\tvar calendarID = \"1706\" ;\r\tvar meetingID = \"29494\" ;\r\tvar result = aa.meeting.deleteMeetingByMeetingID(calendarID,meetingID);\r\taa.print(\"Delete Meeting :\" + result.success);\r}", "function eliminar(i, e) {\n personas.splice(i, 1);\n guardar();\n mostrarEmpleados();\n}", "deleteTask(id) {\n var index = this.list.map(i => i.id).indexOf(id);\n this.list.splice(index, 1);\n ls.deleteItem(id);\n }", "function deleteTask(projectid, taskid) {\n data.projects[projectid].tasks.splice(taskid, 1);\n }", "handleIdeaDelete(id){\n const {deleteIdea}=this.props.actions\n deleteIdea(id);\n }", "function taskDeletor(idel) {\n\t\tconst currentTask = tasks.find( el => el.id == idel);\n\t\tlet taskIndex = tasks.indexOf(currentTask);\n\t\ttasks.splice(taskIndex, 1);;\n\t}", "function deleteNote(worker, noteId) {\n if (noteId != null) {\n datastore.deleteNote(noteId);\n worker.port.emit(\"NoteDeleted\", noteId);\n }\n}", "function delete_person(data) {\n\t\t$('#' + data['old_id']).remove();\n\t}", "function deleteCurrentRow(obj,partId,qnsID)\r\n\t\t{\r\n\t\t\tvar tbldel = document.getElementById(\"part\"+partId+\"Qns\");\r\n\t\t\tvar nextRow = tbldel.tBodies[0].rows.length;\r\n\t\t\tif (nextRow > 3)\r\n\t\t\t{\r\n\t\t\t\tvar divEleParent = document.getElementById('part'+partId+'Qns'+partId+'DISP');\r\n\t\t\t\tvar divEleDeleteChd = document.getElementById('part'+partId+'Qpara'+qnsID+'DISP'); \r\n\t\t\t\tdivEleParent.removeChild(divEleDeleteChd);\r\n\t\t\t\tvar delRow = obj.parentNode.parentNode;\r\n\t\t\t\tvar tbldelRow = delRow.parentNode.parentNode;\r\n\t\t\t\tvar rIndex = delRow.sectionRowIndex;\r\n\t\t\t\tvar rowArray = new Array(delRow);\t\t\t\r\n\t\t\t\tdeleteRows(rowArray);\r\n\t\t\t\treorderRows(tbldelRow, rIndex,partId,qnsID);\r\n\t\t\t\tdocument.getElementById('part'+partId+'_'+'TotalQns').value = (nextRow - 2); // Stores the total value\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\talert('Cannot delete. At least two options required !');\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}", "function deleteInt(id) {\n transition(DELETE);\n //Located in the hooks/useApplicationData.js\n cancelInterview(id)\n .then(() => transition(EMPTY))\n .catch(error => transition(ERR_DELETE, true));\n }", "function deleteStaff(n){\n var i;\n for(i = 0; i < staffs.length; i++){\n if(staffs[i].n == n){\n if(staffs.length == 1){\n document.getElementById(\"input\").innerHTML = staffDataChangeForm();\n document.getElementById(\"meiOutput\").value = createMEIOutput();\n createSVGOutput();\n return;\n }\n else if( i != 0){\n currentN = staffs[i-1].n;\n currentStaff = staffs[i-1];\n }\n else{\n currentN = staffs[i + 1].n;\n currentStaff = staffs[i + 1];\n }\n staffs.splice(i, 1);\n }\n }\n for(i = 0; i < syllables.length; i++){\n if(syllables[i].staff == n){\n syllables.splice(i, 1);\n i--;\n }\n }\n \n document.getElementById(\"input\").innerHTML = staffDataChangeForm();\n document.getElementById(\"meiOutput\").value = createMEIOutput();\n createSVGOutput();\n}", "function deleteElementFromObject(id){\n \n for(let i=0;i<notes.length;i++){\n if(notes[i].id===id){\n notes.splice(i,1);\n }\n}\nconsole.log(notes);\n}" ]
[ "0.6628909", "0.66095704", "0.66004413", "0.64749366", "0.6391989", "0.6390155", "0.6269487", "0.62081164", "0.61809963", "0.6055215", "0.6025428", "0.5984895", "0.5974039", "0.5972364", "0.59668887", "0.59131026", "0.58881885", "0.5886198", "0.58828473", "0.5863798", "0.5824757", "0.580873", "0.5800004", "0.5777322", "0.57695305", "0.5755213", "0.5715864", "0.5712401", "0.5703812", "0.5697715", "0.5692685", "0.56623614", "0.5637345", "0.5633843", "0.5624353", "0.5623426", "0.5618464", "0.56175673", "0.560946", "0.5601332", "0.5598468", "0.5595314", "0.55774015", "0.55615354", "0.5559137", "0.55583155", "0.55579257", "0.55505", "0.5546842", "0.5545609", "0.5542997", "0.55418515", "0.55285203", "0.55275935", "0.5517636", "0.5507356", "0.54922676", "0.5491818", "0.5490878", "0.54831487", "0.5481171", "0.5471671", "0.5468078", "0.54663986", "0.5462422", "0.5457294", "0.5455838", "0.5449724", "0.5440743", "0.54354703", "0.5430286", "0.5417547", "0.5413119", "0.54111737", "0.53982013", "0.53981256", "0.5390457", "0.53867954", "0.53841984", "0.5379093", "0.5376934", "0.53760946", "0.53733236", "0.5370284", "0.5368573", "0.5363808", "0.536136", "0.5360515", "0.53581303", "0.5351051", "0.53496945", "0.5347826", "0.5346892", "0.5344968", "0.53405476", "0.53404033", "0.53375876", "0.53362525", "0.5331282", "0.533073" ]
0.6402676
4
program will take three commandline arguments: m (month), d (day), and y (year). For m use 1 for January, 2 for February, and so forth. For output print 0 for Sunday, 1 for Monday, 2 for Tuesday, and so forth.
function day(date, month, year) { d = date; m = month; y = year; y0 = y - parseInt((14 - m) / 12); x = (y0 + parseInt(y0 / 4) - parseInt(y0 / 100) + parseInt(y0 / 400)); m0 = m + 12 * parseInt((14 - m) / 12) - 2; d0 = ((d + x + parseInt(31 * m0 / 12)) % 7); array = ['Sunday', 'Monday', 'tuesday', 'wednsday', 'thursday', 'friday', 'saturday']; console.log(array[d0]); return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function date (d, m, y) {\n return month[m-1]+\" \"+d+\", \"+y;\n }", "function daysInMonth(y, m) {\r\n var date = new Date();\r\n date.setDate(1);\r\n date.setFullYear(y);\r\n date.setMonth(m); // month after what we want (months start at 0 in js)\r\n date.setDate(0);\r\n return date.getDate();\r\n }", "function ymdToMdy(ymd){\n\t// first check that the input is not empty\n\tif(ymd==''){\n\t\treturn '';\n\t} else {\n\t\t// get year, month and day based on character positions\n\t\tvar year = ymd.slice(0,4)\n\t\tvar month = ymd.slice(5,7)\n\t\tvar day = ymd.slice(8,10)\n\t\t// get 3-letter month abbeviation\n\t\tvar mtm = monthString(month)\n\t\t// put the pieces together into a single string\n\t\treturn mtm+\" \"+day+\", \"+year\n\t}\n}", "function Zeller(D, M, Y) {\n var Day = \"\";\n\n if (M < 3) {\n M = M + 12;\n Y = Y - 1;\n }\n\n var C = Math.floor(Y / 100);\n var K = Y - (100 * C);\n\n var S = Math.floor(2.6 * M - 5.39) + Math.floor(K / 4) + Math.floor(C / 4) + D + K - (2 * C);\n\n var ans = S - (7 * Math.floor(S / 7));\n\n if (ans == 0) {\n Day = \"Sunday\";\n }\n else if (ans == 1) {\n Day = \"Monday\";\n }\n else if (ans == 2) {\n Day = \"Tuesday\";\n }\n else if (ans == 3) {\n Day = \"Wednesday\";\n }\n else if (ans == 4) {\n Day = \"Thursday\";\n }\n else if (ans == 5) {\n Day = \"Friday\";\n }\n else {\n Day = \"Saturday\";\n }\n return Day;\n}", "function Zeller(D, M, Y) {\n var Day = \"\";\n\n if (M < 3) {\n M = M + 12;\n Y = Y - 1;\n }\n\n var C = Math.floor(Y / 100);\n var K = Y - (100 * C);\n\n var S = Math.floor(2.6 * M - 5.39) + Math.floor(K / 4) + Math.floor(C / 4) + D + K - (2 * C);\n\n var ans = S - (7 * Math.floor(S / 7));\n\n if (ans == 0) {\n Day = \"Sunday\";\n }\n else if (ans == 1) {\n Day = \"Monday\";\n }\n else if (ans == 2) {\n Day = \"Tuesday\";\n }\n else if (ans == 3) {\n Day = \"Wednesday\";\n }\n else if (ans == 4) {\n Day = \"Thursday\";\n }\n else if (ans == 5) {\n Day = \"Friday\";\n }\n else {\n Day = \"Saturday\";\n }\n return Day;\n}", "function calendar(){\n var dateobj=document.getElementById('calendar').value;\n var dateobj= new Date(dateobj);\n var month = dateobj.getMonth() + 1;\n var year = dateobj.getFullYear();\n var day = dateobj.getDate()+1;\n console.log(month);\n console.log(year);\n console.log(day);\nvar montharray = ['January','February','March','April','May','June','July','August','September','October','November','December'];\nvar month1 = dateobj.getMonth();\nif(month1 ==0){\n month1 = montharray[0];\n console.log(month1);\n}\nelse if(month1 ==1){\n month1 = montharray[1];\n console.log(month1);\n}\nelse if(month1 ==2){\n month1 = montharray[2];\n console.log(month1);\n}\nelse if(month1 ==3){\n month1 = montharray[3];\n console.log(month1);\n}\nelse if(month1 ==4){\n month1 = montharray[4];\n console.log(month1);\n}\nelse if(month1 ==5){\n month1 = montharray[5];\n console.log(month1);\n}\nelse if(month1 ==6){\n month1 = montharray[6];\n console.log(month1);\n}\nelse if(month1 ==7){\n month1 = montharray[7];\n console.log(month1);\n}\nelse if(month1 ==8){\n month1 = montharray[8];\n console.log(month1);\n}\nelse if(month1 ==9){\n month1 = montharray[9];\n console.log(month1);\n}\nelse if(month1 ==10){\n month1 = montharray[10];\n console.log(month1);\n}\nelse if(month1 ==11){\n month1 = montharray[11];\n console.log(month1);\n}\nelse if(month1 ==12){\n month1 = montharray[12];\n console.log(month1);\n}\n\nif (year > 2020 || year < 2019){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" falls outside the range of dates for which data is available.\";\n}\nelse if (year==2019 && month>=1 && month<=8){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" falls outside the range of dates for which data is available.\";\n}\nelse if(year==2020 && month>8){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" falls outside the range of dates for which data is available.\";\n}\nelse if(month<9 && year==2019){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" falls outside the range of dates for which data is available.\";\n }\n else{\n console.log('valid');\n if(month>8 && year==2020){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" falls outside the range of dates for which data is available.\";\n }\n else {\n console.log('valid');\n }\n if(month==9){\n if(day==2){\n document.getElementById('output').innerHTML = \"September 2, 2019 is Labor Day. This is an NYU Holiday. No Classes Scheduled.\";\n document.images[4].src=\"img/laborday.jpg\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://www.grammarly.com/blog/why-do-we-call-it-labor-day/]\"\n }\n else{\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\";\n }\n }\n else if(month==10){\n if(day==14){\n document.getElementById('output').innerHTML = \"October 14, 2019 is Fall Recess. This is an NYU Holiday. No classes scheduled.\";\n document.images[4].src=\"img/fallrecess.jpg\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://www.swedesboro-woolwich.com/site/default.aspx?PageType=3&ModuleInstanceID=5611&ViewID=7b97f7ed-8e5e-4120-848f-a8b4987d588f&RenderLoc=0&FlexDataID=10845&PageID=1]\"\n }\n else{\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\"\n }\n }\n else if(month==11){\n if(day==27){\n document.getElementById('output').innerHTML = \"November 27, 2019 is Thanksgiving Recess. No Classes Scheduled.\";\n document.images[4].src=\"img/thanksgiving.jpg\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://www.theholidayspot.com/thanksgiving/]\"\n }\n else if(day == 28 || day == 29){\n document.getElementById('output').innerHTML = \"November \"+day+\", 2019 is Thanksgiving Recess. This is an NYU Holiday. No Classes Scheduled. \";\n document.images[4].src=\"img/thanksgiving.jpg\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://www.theholidayspot.com/thanksgiving/]\"\n }\n else {\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\"\n }\n }\n else if(month==12){\n if(day>20 && day<32){\n document.getElementById('output').innerHTML = \"December \"+day+ \", 2019 is Winter Recess. This is an NYU Holiday. No Classes Scheduled\";\n document.images[4].src=\"img/winter.png\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://www.smoothusa.com/2018/12/21/winter-recess-has-begun/]\"\n }\n else{\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\"\n\n }\n }\n else if(month==1){\n if(day==1){\n document.getElementById('output').innerHTML = \"January 1, 2019 is Winter Recess. This is an NYU Holiday. No Classes Scheduled.\";\n document.images[4].src=\"img/winter.png\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://www.smoothusa.com/2018/12/21/winter-recess-has-begun/]\"\n }\n else if(day>1 && day<6){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is Winter Recess. However, the University is open. No Classes Scheduled.\";\n document.images[4].src=\"img/winter.png\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://www.smoothusa.com/2018/12/21/winter-recess-has-begun/]\"\n }\n else if(day==20){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is Martin Luther King Day. This is an NYU Holiday. No Classes Scheduled.\";\n document.images[4].src=\"img/mlk.jpg\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://wpde.com/news/local/martin-luther-king-jr-day-local-events]\"\n }\n\n else{\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\";\n }\n }\n else if (month==2){\n if(day==17){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+ \" is President's Day. This is an NYU Holiday. No Classes Scheduled.\";\n document.images[4].src=\"img/presidents.jpeg\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://www.wflx.com/2019/02/18/heres-what-is-open-closed-presidents-day/]\"\n\n }\n else{\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\";\n }\n }\n else if (month==3){\n if (day>15 && day<23){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is Spring Break. No Classes Scheduled.\";\n document.images[4].src=\"img/spring.png\";\n document.getElementById('output2').innerHTML = \"[Image obtained from http://clipart-library.com/spring-break-cliparts.html]\"\n\n }\n else{\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\";\n }\n\n }\n else if (month==4){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\";\n }\n else if (month==5){\n if (day ==25){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is Memorial Day. This is an NYU holiday. No classes scheduled.\";\n document.images[4].src=\"img/memorial.jpeg\";\n document.getElementById('output2').innerHTML = \"[Image obtained from http://mentalfloss.com/article/27858/10-things-remember-about-memorial-day]\"\n\n }\n else{\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\";\n }\n }\n else if (month==6){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\";\n }\n else if (month==7){\n if (day==3){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is the observance of Independence Day. This is an NYU holiday. No classes scheduled.\";\n document.images[4].src=\"img/independence.jpg\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://kvoa.com/news/local-news/2019/07/04/list-of-4th-of-july-events/]\"\n\n }\n else if (day==4){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is Independence Day.\";\n document.images[4].src=\"img/independence.jpg\";\n document.getElementById('output2').innerHTML = \"[Image obtained from https://kvoa.com/news/local-news/2019/07/04/list-of-4th-of-july-events/]\"\n\n }\n else{\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\";\n }\n }\n else if (month==8){\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\";\n }\n else{\n document.getElementById('output').innerHTML = month1+\" \"+day+\", \"+year+\" is not a school holiday at NYU.\";\n }\n }\n\n }", "function datem(a)\n {\n month=a+month;\n \n if(month == \"0\")\n {\n \n month=12;\n document.getElementById(\"txt\").innerHTML=month;\n document.getElementById(\"month12\").innerHTML=\"December\";\n year=year-1;\n document.getElementById(\"year12\").innerHTML=year;\n }\n else if(month==\"13\")\n {\n \n month=1;\n document.getElementById(\"txt\").innerHTML=month;\n document.getElementById(\"month12\").innerHTML=\"January\";\n year=year+1;\n document.getElementById(\"year12\").innerHTML=year;\n \n }\n \n \n if(month==\"1\")\n {\n document.getElementById(\"month12\").innerHTML=\"January\";\n daychange();\n }\n \n else if(month==\"2\")\n {\n document.getElementById(\"month12\").innerHTML=\"February\";\n daychange();\n }\n else if(month==\"3\")\n {\n document.getElementById(\"month12\").innerHTML=\"March\";\n daychange();\n }\n \n else if(month==\"4\")\n {\n document.getElementById(\"month12\").innerHTML=\"April\";\n daychange();\n }\n else if(month==\"5\")\n {\n document.getElementById(\"month12\").innerHTML=\"May\";\n daychange();\n }\n else if(month==\"6\")\n {\n document.getElementById(\"month12\").innerHTML=\"June\";\n daychange();\n }\n else if(month==\"7\")\n {\n document.getElementById(\"month12\").innerHTML=\"July\";\n daychange();\n }\n else if(month==\"8\")\n {\n document.getElementById(\"month12\").innerHTML=\"August\";\n daychange();\n }\n else if(month==\"9\")\n {\n document.getElementById(\"month12\").innerHTML=\"September\";\n daychange();\n }\n else if(month==\"10\")\n {\n document.getElementById(\"month12\").innerHTML=\"October\";\n daychange();\n }\n else if(month==\"11\")\n {\n document.getElementById(\"month12\").innerHTML=\"November\";\n daychange();\n }\n else if(month==\"12\")\n {\n document.getElementById(\"month12\").innerHTML=\"December\";\n daychange();\n }\n \n \n }", "function getTotalDays(y, m){\r\n\t\t\treturn new Date(y, m, 0).getDate();\r\n\t\t}", "function yearValidation(year) {\r\n var text = /^[0-9]+$/;\r\n if (year != 0) {\r\n if ((year != \"\") && (!text.test(year))) {\r\n\r\n ErrMessage = 'Please Enter Numeric Values of Year Only';\r\n return false;\r\n }\r\n\r\n if (year.length != 4) {\r\n ErrMessage = 'Year is not proper. Please check';\r\n return false;\r\n }\r\n var current_year=new Date().getFullYear();\r\n if((year < 1980) || (year > current_year))\r\n {\r\n ErrMessage = 'Year should be in range 1980 to current year';\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n//to check if the value is a number, if not a number, return 0, if yes, return n\r\nfunction toNumeric(n) {\r\n if (!isNaN(parseFloat(n)) && isFinite(n)) {\r\n\treturn n;\r\n }\r\n else\r\n {\treturn 0;\r\n }\r\n}\r\n// to add prefix \"0\" base on the size\r\nfunction pad(num, size) {\r\n var s = num+\"\";\r\n while (s.length < size) s = \"0\" + s;\r\n return s;\r\n}\r\n\r\n//To convert date format from MMM-YYYY to YYYY-MM\r\nfunction dateconversion(vdate) {\r\n\tvar y = vdate.substr(5,8);\r\n\tvar m = vdate.substr(1,3);\r\n\tvar mSTR = 'JANFEBMARAPRMAYJUNJULAUGSEPOCTNOVDEC';\r\n\tvar mNumber = mSTR.indexOf(m) / 3 + 1;\r\n\t\r\n\treturn y + '-' + pad(nNumber,2);\r\n}\r\n\r\n//get arguments from input\r\nvar args = process.argv;\r\n//alert(args.length);\r\n\r\n//validation check on the parameters\r\n\r\nif (args.length != 6) {\r\n\tErrMessage = 'Please pass in correct number of parameters before run the program!\\nThe Syntax of the command is: node mas_api.js p1 p2 p3 p4\\np1 option value: FixedDeposits, SavingsDeposits\\np2 and p3 date format: MMM-YYYY\\np4 option value: Months, Average';\r\n\tValidationOK = 0; \r\n}\r\n\r\nif (args[3] != 'FixedDeposits' && args[3] != 'SavingsDeposits') {\r\n\tErrMessage = 'Please pass in correct parameters before run the program!\\nThe Syntax of the command is: node mas_api.js p1 p2 p3 p4\\np1 option value: FixedDeposits, SavingsDeposits\\np2 and p3 date format: MMM-YYYY\\np4 option value: Months, Average';\r\n\t ValidationOK = 0;\r\n}\r\n\t\r\nStartDate = args[4].trim().toUpperCase();\r\nEndDate = args[5].trim().toUpperCase();\r\n\r\nif (StartDate.lenth != 8 || EndDate.length !=8 || StartDate.substr(4,1) !='-' || EndDate.substr(4,1) !='-' ) {\r\n\tErrMessage = 'Please input the Start/End date with the correct format <MMM-YYYY> ';\r\n\tValidationOK = 0;\r\n}\r\n\r\nif (validMon.indexOf(StartDate.substr(1,3)) / 3 + 1 == -1 || validMon.indexOf(EndDate.substr(1,3)) / 3 + 1 == -1) {\r\n\tErrMessage = 'Month is invalid! Please input the Start/End date with the correct format <MMM-YYYY> ';\r\n\tValidationOK = 0;\r\n}\r\n\r\nif (StartDate.substr(5,4)*100 + validMon.indexOf(StartDate.substr(1,3)) / 3 + 1 >EndDate.substr(5,4)*100 + validMon.indexOf(EndDate.substr(1,3)) / 3 + 1 ) {\r\n\tErrMessage = 'To Date cannot be earlier than Start Date! ';\r\n\tValidationOK = 0;\r\n}\r\n\r\nif (yearValidation(StartDate.substr(5,4)) == false) { \r\n\tValidationOK = 0;\r\n}\r\nif (yearValidation(EndDate.substr(5,4)) == false) { \r\n\tValidationOK = 0;\r\n}\r\n\r\nif (args[6].toUpperCase() != 'MONTHS' && args[6].toUpperCase() != 'AVERAGE') {\r\n\tErrMessage = 'Please pass in correct parameters before run the program! \\nThe Syntax of the command is: node mas_api.js p1 p2 p3 p4\\np1 option value: FixedDeposits, SavingsDeposits\\np2 and p3 date format: MMM-YYYY\\np4 option value: Months, Average';\r\n\tValidationOK = 0;\r\n}\r\n\r\nif (ValidationOK != 0) {\r\n\r\n StartDate1 = StartDate.substr(5,8) + '-'+parseInt(alidMon.indexOf(StartDate.substr(1,3)) / 3 + 1);\r\n EndDate1 = EndDate.substr(5,8) + '-'+parseInt(alidMon.indexOf(EndDate.substr(1,3)) / 3 + 1);\r\n//extract fields base on the deposit type\r\n if (DepositType == 'FixedDeposits') {\r\n\tcond = '&fields=end_of_month,banks_fixed_deposits_3m,banks_fixed_deposits_6m,banks_fixed_deposits_12m,fc_fixed_deposits_3m,fc_fixed_deposits_6m,fc_fixed_deposits_12m';\r\n}\r\nelse\r\n{\tcond = '&fields=end_of_month,banks_savings_deposits,fc_savings_deposits';\r\n}\r\n//add the period\r\n cond = cond + '&between[end_of_month]='+ StartDate1 + ','+ EndDate1;\r\n\r\n request.open('GET', URL + cond, true);\r\n // this following line is needed to tell the server this is a ajax request\r\n request.setRequestHeader(\"X-Requested-With\", \"XMLHttpRequest\");\r\n request.onload = function () {\r\n if (this.status >= 200 && this.status < 400) {\r\n \tvar json = JSON.parse(this.response);\r\n\tvar myArray = new Array(json.json.result.total); // this is to store the data into array for processing purpose\r\n\tvar i = 0;\r\n\t\r\n\tif (DepositType == 'FixedDeposits') {\r\n\t for (var key in json) {\r\n\t\ti++;\r\n \t\tif (json.hasOwnProperty(key)) {\r\n \t\tvar item = json[key];\r\n\t\tvar myArray[i] = new Array(7);\r\n \t\tmyArray[i].[1] = item.end_of_month;\r\n \t\tmyArray[i].[2] = toNumeric(item.banks_fixed_deposits_3m);\r\n \t\tmyArray[i].[3] = toNumeric(item.banks_fixed_deposits_6m);\r\n \t\tmyArray[i].[4] = toNumeric(item.banks_fixed_deposits_12m);\r\n \t\tmyArray[i].[5] = toNumeric(item.fc_fixed_deposits_3m);\r\n \t\tmyArray[i].[6] = toNumeric(item.fc_fixed_deposits_6m);\r\n \t\tmyArray[i].[7] = toNumeric(item.fc_fixed_deposits_12m);\r\n \t\t} \r\n\t }\r\n\t }\r\n\t // populate data\r\n\t var TrendBK3M = '-';\r\n\t var TrendBK6M = '-';\r\n\t var TrendBK12M = '-';\r\n\t var TrendFC3M = '-';\r\n\t var TrendFC6M = '-';\r\n\t var TrendFC12M = '-';\r\n\t if (QueryCategory.toUpperCase() == 'MONTHS') {\r\n\t console.log('end_of_month|banks_fixed_deposits_3m|banks_fixed_deposits_6m|banks_fixed_deposits_12m|fc_fixed_deposits_3m|fc_fixed_deposits_6m|fc_fixed_deposits_12m');\r\n\t for (j=1;j<=i;j++){\r\n \t\tconsole.log(myArray[j][1] + '|'+myArray[j][2]+ '|'+myArray[j][3]+ '|'+myArray[j][4]+ '|'+myArray[j][5]+ '|'+myArray[j][6]+ '|'+myArray[j][7]);\r\n\t }\r\n\t // check the trend of bank deposit and fc deposit\r\n\t if (myArray[1][2] > myArray[i][2]) { TrendBK3M = 'Down'; } \r\n\t else { \r\n\t\tif (myArray[1][2] < myArray[i][2]) { TrendBK3M = 'Up'; } \r\n\t\t}\r\n\r\n\t if (myArray[1][3] > myArray[i][3]) { TrendBK6M = 'Down'; } \r\n\t else { \r\n\t\tif (myArray[1][3] < myArray[i][3]) { TrendBK6M = 'Up'; } \r\n\t\t}\r\n\t if (myArray[1][4] > myArray[i][4]) { TrendBK12M = 'Down'; } \r\n\t else { \r\n\t\tif (myArray[1][4] < myArray[i][4]) { TrendBK12M = 'Up'; } \r\n\t\t}\r\n\t if (myArray[1][5] > myArray[i][5]) { TrendFC3M = 'Down'; } \r\n\t else { \r\n\t\tif (myArray[1][5] < myArray[i][5]) { TrendFC3M = 'Up'; } \r\n\t\t}\r\n\t if (myArray[1][6] > myArray[i][6]) { TrendFC6M = 'Down'; } \r\n\t else { \r\n\t\tif (myArray[1][6] < myArray[i][6]) { TrendFC6M = 'Up'; } \r\n\t\t}\r\n\t if (myArray[1][7] > myArray[i][7]) { TrendFC12M = 'Down'; } \r\n\t else { \r\n\t\tif (myArray[1][7] < myArray[i][7]) { TrendFC12M = 'Up'; } \r\n\t\t}\r\n \t console.log('Trend '+ '|' + TrendBK3M+ '|'+TrendBK6M+ '|'+TrendBK12M+ '|'+TrendFC3M+ '|'+TrendFC6M+ '|'+TrendFC12M);\r\n\t }\r\n\telse // QueryCategory is Average\r\n\t{\r\n\t var AveBK3M = 0;\r\n\t var AveBK6M = 0;\r\n\t var AveBK12M = 0;\r\n\t var AveFC3M = 0;\r\n\t var AveFC6M = 0;\r\n\t var AveFC12M = 0;\r\n\t var SumBK3M = 0;\r\n\t var SumBK6M = 0;\r\n\t var SumBK12M = 0;\r\n\t var SumFC3M = 0;\r\n\t var SumFC6M = 0;\r\n\t var SumFC12M = 0;\r\n\t console.log('From '+ myArray[1].[1] + ' to '+ myArray[i].[1]+'|banks_fixed_deposits_3m|banks_fixed_deposits_6m|banks_fixed_deposits_12m|fc_fixed_deposits_3m|fc_fixed_deposits_6m|fc_fixed_deposits_12m');\r\n\t for (j=1;j<=i;j++){\r\n \t\tSumBK3M = SumBK3M + myArray[i].[2];\r\n \t\tSumBK6M = SumBK6M + myArray[i].[3];\r\n \t\tSumBK12M = SumBK12M + myArray[i].[4];\r\n \t\tSumFC3M = SumFC3M + myArray[i].[5];\r\n \t\tSumFC6M = SumFC6M + myArray[i].[6];\r\n \t\tSumFC12M = SumFC12M + myArray[i].[7];\r\n\t }\r\n\t AveBK3M = (SumBK3M/i).toFixed(2);\r\n\t AveBK6M = (SumBK6M/i).toFixed(2);\r\n\t AveBK12M = (SumBK12M/i).toFixed(2);\r\n\t AveFC3M = (SumFC3M/i).toFixed(2);\r\n\t AveFC6M = (SumFC6M/i).toFixed(2);\r\n\t AveFC12M = (SumFC12M/i).toFixed(2);\r\n\r\n\t console.log('Average|' + AveBK3M+ '|' + AveBK6M + '|' + AveBK12M + '|' + AveFC3M+'|'+AveFC6M+'|'+ AveFC12M+'|');\r\n\t}\r\n \t}\r\n\telse\r\n\t{\t// DepositType is 'SavingsDeposits'\r\n\t for (var key in json) {\r\n \t\tif (json.hasOwnProperty(key)) {\r\n \t\tvar item = json[key];\r\n\t\tvar myArray[i] = new Array(3);\r\n \t\tmyArray[i].[1] = item.end_of_month;\r\n \t\tmyArray[i].[2] = toNumeric(item.banks_savings_deposits) ;\r\n \t\tmyArray[i].[3] = toNumeric(item.fc_savings_deposits);\r\n \t\t} \r\n\t \t} \r\n \t }\r\n\t\r\n\t // populate data\r\n\t var TrendBK = '-';\r\n\t var TrendFC = '-';\r\n\t if (QueryCategory.toUpperCase() == 'MONTHS') {\r\n\t console.log('end_of_month|banks_savings_deposits|fc_savings_deposits');\r\n\t for (j=1;j<=i;j++){\r\n \t\tconsole.log(myArray[j][1] + '|'+myArray[j][2]+ '|'+myArray[j][3]+ '|');\r\n\t }\r\n\t // check the trend of bank savings and fc savings\r\n\t if (myArray[1][2] > myArray[i][2]) { TrendBK = 'Down'; } \r\n\t else { \r\n\t\tif (myArray[1][2] < myArray[i][2]) { TrendBK = 'Up'; } \r\n\t\t}\r\n\t if (myArray[1][3] > myArray[i][3]) { TrendFC = 'Down'; } \r\n\t else { \r\n\t\tif (myArray[1][3] < myArray[i][3]) { TrendFC = 'Up'; } \r\n\t\t}\r\n \t console.log('Trend '+ '|' + TrendBK+ '|'+TrendFC+ '|');\r\n\r\n\t}\r\n\telse // QueryCategory is Average\r\n\t{\r\n\t var AveBK = 0;\r\n\t var AveFC = 0;\r\n\t var SumBK = 0;\r\n\t var SumFC = 0;\r\n\t console.log('From '+ myArray[1].[1] + ' to '+ myArray[i].[1]+'|banks_savings_deposits|fc_savings_deposits|');\r\n\t for (j=1;j<=i;j++){\r\n \t\tSumBK = SumBK + myArray[i].[2];\r\n \t\tSumFC = SumFC+ myArray[i].[3];\r\n\t }\r\n\t AveBK = (SumBK/i).toFixed(2);\r\n\t AveFC = (SumFC/i).toFixed(2);\r\n\t console.log('Average|' + AveBK+ '|' + AveFC+'|');\r\n\t}\r\n\t}\r\n }\r\n }", "dayOfWeek(m,d,y){\n var year = (y-(Math.floor(14-m)/12));\n var x = year+Math.floor((year/4))-Math.floor((year/100))+Math.floor((year/400));\n var month = m+12 *(Math.floor((14-m)/12))-2;\n day = Math.ceil(((d+x+Math.floor(31*month/12))%7));\n return day;\n }", "function calendar(year, month) {\n let day = new Date(year, month - 1, 1).getDay();\n let firstLine =\n year +\n ' ' +\n [\n 'January',\n 'February',\n 'March',\n 'April',\n 'May',\n 'June',\n 'July',\n 'August',\n 'September',\n 'October',\n 'November',\n 'December'\n ][month - 1];\n let secondLine = 'SUN MON TUE WED THU FRI SAT';\n firstLine = ' '.repeat((27 - firstLine.length) >> 1) + firstLine;\n\n let days = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];\n if (month == 2 && (year % 400 == 0 || (year % 100 && year % 4 == 0))) days++;\n\n let rest = ' '.repeat(4 * day + 1);\n for (let i = 1; i <= days; ++i) {\n rest += i;\n if (day == 6 && i < days) rest += '\\n ';\n else if (i < 10) rest += ' ';\n else if (i < days) rest += ' ';\n day = (day + 1) % 7;\n }\n return [firstLine, secondLine, rest].join('\\n');\n}", "function firstDay(m,y){\n return new Date(y,m,1).getDay();\n}", "function createMonth(inputMonth, inputYear, inputDay)\n{\n var leapYear = false;\n\t\tmonthName = months[inputMonth];\n yearName = inputYear.toString();\n\t\tcellsHTML = \"\";\n numBlankDays = inputDay;\n\t\t//figure out if the year is a leap year\n\t\tif(inputYear%4 == 0)\n\t\t{\n\t\t \tif(inputYear%100 != 0)\n \t\t\t{\n\t\t\t\tleapYear = true;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(inputYear%400 == 0)\n\t\t\t\t\tleapYear = true;\n\t\t\t\telse\n\t\t\t\t\tleapYear = false;\n\t\t\t}\n\t\t}\n\n\n\t\t//figure out the number of days in the month\n\t\t//if month is NOT february, april, june, september, nor november then it has 31 days\n\t\tif(inputMonth != 2 && inputMonth != 4 && inputMonth != 6 && inputMonth != 9 && inputMonth != 11)\n\t\t{\n\t\t\tnumberOfDays = 31;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//if month is NOT february, then it has 30 days\n\t\t\tif(inputMonth != 2)\n\t\t\t{\n\t\t\t\tnumberOfDays = 30;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if month is a leap year, then it has 29 days. if not, it has 28\n\t\t\t\tif(leapYear)\n\t\t\t\t{\n\t\t\t\t\tnumberOfDays = 29;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tnumberOfDays = 28;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tpostDay = (numberOfDays + numBlankDays) % 7; // day after end of month\n}", "function monthDays(_m, _y) { return new Date(_y, _m + 1, 0).getDate(); }", "function print(months){\n let res=\"\";\n switch(months){\n case \"jan\":res=\"there are 30days in january\";\n break;\n case \"feb\":res=\"there are 28days in february\";\n break;\n case \"mar\":res=\"there are 31days in march\"\n break;\n case \"apr\":res=\"there are 30days in april\"\n break;\n case \"may\":res=\"there are 30days in may\"\n break;\n case \"june\":res=\"there ares 30days in june\"\n break;\n case \"july\":res=\"there ares 31days in july\"\n break;\n case \"aug\":res=\"there are 31days in augest\"\n break;\n case \"sep\":res=\"there are 30days in september\"\n break;\n case \"oct\":res=\"there are 31days in october\"\n break;\n case \"nov\":res=\"there are 30days in november\"\n break;\n case \"dec\":res=\"there are 31 in december\"\n break;\n default:res=\"no such month found\"\n }\n return res;\n}", "function setCal(yyyy, mm) {\n let today = new Date(yyyy + '-' + mm)\n today = new Date(yyyy, mm, 0);\n console.log(today.getDate());\n}", "function dayOfWeek(dd, mm, yy) {\n if (dd > 31 || dd < 1 || mm > 12 || mm < 1) {\n System.err.println(\"Invalid date!\");\n rl.close();\n }\n\n // Formulas for Gregorian calendar to determine the day of the week\n var y = yy - Math.floor((14 - mm) / 12);\n var x = (y + Math.floor(y / 4) - Math.floor(y / 100) + Math.floor(y / 400));\n var m = mm + 12 * Math.floor((14 - mm) / 12) - 2;\n var d = (dd + x + Math.floor(31 * m / 12)) % 7;\n\n //Array to store the names of days of the week.\n // var days = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n // console.log(\"The day on \" + dd + \"/\" + mm + \"/\" + yy + \" is: \" + d + \" (\" + days[d] + \")\");\n return d;\n rl.close();\n}", "function DiM (month) {\n var Y = new Date().getFullYear();\n return new Date(Y, month, 0).getDate();\n}", "function numOfDaysInMon(y,m) {\n return new Date(y,m,0).getDate();\n}", "function FindDate(message, haiku = false) //Not Thanks to Jeremy's Link\n{\n\tvar outps = message.toLowerCase().replace(\"!baba\", \"\") //there is no point to this, i did it because i wanted too\n\t\t.replace(\"wednesday\", \"\")\n\t\t.replace(\"days\", \"\")\n\t\t.replace(\"until\", \"\")\n\t\t.replace(\"next\", \"\")\n\t\t.split(\" \");\n\n\tvar day = 0;\n\tvar month = 0;\n\tvar year = 0;\n\n\tfor ( var i = 0; i < outps.length; i++) //loop all the text\n\t{\n\t\tvar item = outps[i];\n\t\tif (month == 0) //set month to a detected month\n\t\t{\n\t\t\tif (item == \"\")\n\t\t\t\tmonth = 0;\n\t\t\telse if (\"january\".includes(item))\n\t\t\t\tmonth = 1;\n\t\t\telse if (\"february\".includes(item))\n\t\t\t\tmonth = 2;\n\t\t\telse if (\"march\".includes(item))\n\t\t\t\tmonth = 3;\n\t\t\telse if (\"april\".includes(item))\n\t\t\t\tmonth = 4;\n\t\t\telse if (\"may\".includes(item))\n\t\t\t\tmonth = 5;\n\t\t\telse if (\"june\".includes(item))\n\t\t\t\tmonth = 6;\n\t\t\telse if (\"july\".includes(item))\n\t\t\t\tmonth = 7;\n\t\t\telse if (\"august\".includes(item))\n\t\t\t\tmonth = 8;\n\t\t\telse if (\"september\".includes(item))\n\t\t\t\tmonth = 9;\n\t\t\telse if (\"october\".includes(item))\n\t\t\t\tmonth = 10;\n\t\t\telse if (\"november\".includes(item))\n\t\t\t\tmonth = 11;\n\t\t\telse if (\"december\".includes(item))\n\t\t\t\tmonth = 12;\n\t\t}\n\n\t\tvar isDay = false;\n\t\tif (day == 0) //set year to first day\n\t\t{\n\t\t\tvar iv = parseInt(item);\n\t\t\tif (iv <= 31)\n\t\t\t{\n\t\t\t\tday = iv;\n\t\t\t\tisDay = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (year == 0 && !isDay) //set year to first year found\n\t\t{\n\t\t\tvar iv = parseInt(item);\n\t\t\tif (iv < 100)\n\t\t\t{\n\t\t\t\tyear = iv + 2000;\n\t\t\t}\n\t\t\tif (iv >= 2018)\n\t\t\t{\n\t\t\t\tyear = iv;\n\t\t\t}\n\t\t}\n\t}\n\n\tvar months = [ //Another lookup table - Hank likes these :)\n\t\t[29, 2],\n\t\t[30, 4, 6, 9, 11]\n\t]\n\n\tfor ( var i = 0; i < months.length; i++) \n\t{\n\t\tvar limit = months[i][0]; //limit moth checker\n\t\tfor ( var j = 1; j < months[i].length; j++) \n\t\t{\n\t\t\tif (months[i][j] == month) //month checked = motnh got\n\t\t\t{\n\t\t\t\tif (day > limit)\n\t\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\t}\n\tif (month == 0 && !haiku)\n\t\treturn null;\n\n\tif (day == 0 && !haiku)\n\t\treturn null;\n\n\tif (year == 0 && !haiku)\n\t\tyear = new Date().getFullYear();\n\n\tvar item = {};\n\titem.name = \"date\"; //picture lookup value\n\titem.mode = 5; //date calc value\n\n\titem.day = day;\n\titem.month = month;\n\titem.year = year;\n\t\n\treturn item;\n}", "function birthday(month,day){\n if (month===7 && day===7){\n console.log(\"How did you know?\");\n } else console.log(\"Just another day....\")\n}", "function dayofweek(d,m,y){\n let t = [ 0, 3, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4 ];\n y -= m < 3;\n return ( y + y/4 - y/100 + y/400 + t[m-1] + d) % 7;\n}", "function printDay(num) {\r\n if (num == 1) {\r\n return \"Sunday\";\r\n }\r\n if (num == 2) {\r\n return \"Monday\";\r\n }\r\n if (num == 3) {\r\n return \"Tuesday\";\r\n }\r\n if (num == 4) {\r\n return \"Wednesday\";\r\n }\r\n if (num == 5) {\r\n return \"Thursday\";\r\n }\r\n if (num == 6) {\r\n return \"Friday\";\r\n }\r\n if (num == 7) {\r\n return \"Saturday\";\r\n }\r\n}", "function format_date_mdy(d) {\r\n var m_names = new Array(\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\");\r\n var curr_date = d.getDate();\r\n var curr_month = d.getMonth();\r\n var curr_year = d.getFullYear();\r\n return m_names[curr_month] + \" \" + curr_date + \", \" + curr_year;\r\n}", "function dateBuilder(d){ \n let monthss =[\"january\" , \"february\" , \"March\" , \"april\" , \"Mai\" , \"june\" , \"july\" , \"august\" , \"September\" , \"october\" , \"november\" , \"december\"] ; \n let days = [ \"sunday\" , \"Monday\" , \"tuesday\" , \"wednesday\" , \"thursday\" , \"friday\" , \"saturday\", \"sunday\"]; \n let day = days[d.getDay()]; \n let date = d.getDate() ;\n let monthh = monthss[d.getMonth()] ; \n let year = d.getFullYear(); \n return `${day} ${date} ${monthh} ${year}` ; //incrementer \n\n}", "function findDay(userInput) {\n var day = [\"SUN\",\"MON\",\"TUE\",\"WED\",\"THU\",\"FRI\",\"SAT\"];\n var month_day = userInput.split(\" \");\n var sum = 0;\n\n for(var i = 1; i < month_day[0] ; i++ ){\n if(i === 1 || i === 3 ||\n i === 5 || i === 7 ||\n i === 8 || i === 10 ||\n i === 12)\n sum += 31;\n else if(i === 2)\n sum += 28;\n else\n sum += 30;\n }\n\n sum += Number.parseInt(month_day[1]);\n\n return day[sum % 7];\n\n}", "dayOfWeek(day, month, year) {\n var y0 = year - Math.floor((14 - month) / 12);\n var x = y0 + Math.floor((y0 / 4)) - Math.floor((y0 / 100)) + Math.floor((y0 / 400));\n m0 = month + 12 * Math.floor((14 - month) / 12) - 2;\n var d0 = (day + x + Math.floor((31 * m0) / 12)) % 7;\n console.log(d0);\n var res = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wendsday\", \"Thursday\", \"Friday\", \"saturday\"];\n if (d0 <= res.length) {\n console.log(\"The day falls on :\" + res[d0])\n } else {\n console.log(\"Invalid day \")\n }\n }", "function drawMonth() {\n console.log(\"Drawing month for \" + selectedDay.toISOString());\n $('#jump_month_title').html(selectedDay.toString(\"MMM yyyy\"));\n\n days.reset();\n var startTime = new Date();\n startTime.setTime(selectedDay.getTime());\n startTime.moveToFirstDayOfMonth();\n var endTime = new Date();\n endTime.setTime(selectedDay.getTime());\n endTime.moveToLastDayOfMonth();\n // Loop from start to end\n for (loopCount = 1; loopCount <= endTime.getDate(); loopCount += 1) {\n var dateText = loopCount + \".\" + (startTime.getMonth() + 1) + \".\" + startTime.getFullYear();\n //console.log(\"Draw day \" + loopCount + \":\" + dateText);\n var loopDate = Date.parseExact(dateText, \"d.M.yyyy\");\n var day = new Day({id:loopCount, day_no:loopCount, date:loopDate.toString(\"d.M.yyyy\")});\n days.add(day);\n }\n}", "function calendar(month, yr){\n\n\tvar daysInWeek = 7; //Used to create a loop for the days in the week.\n\tvar calendarDrawing; //Variable used later to create the calendar.\n\n\t// Setting the value of the date if user has choosen a different month or year.\n\tif (month || yr){\n\t\tnewDate = new Date(month + day + yr);\n\t}\n\telse{\n\t\tnewDate = new Date();\n\t}\n\n\tvar tempYear = newDate.getFullYear(); //Getting the year of newDate \n\n\tvar tempDate = new Date((newDate.getMonth()+1) +' 1 ,'+tempYear); //Creating a temp date to find first day of month\n\tvar startDay = tempDate.getDay();\n\tvar w = startDay; //copying startDay value for use in while loop to draw calendar\n\t\n\tvar newMonth = newDate.getMonth();\n\tvar newYear = newDate.getFullYear();\n\n\t//Leap year check (extra day in February?)\n\tvar daysInFeb = leapYear(tempYear);\n\n\tvar totalDays = [\"31\", \"\"+daysInFeb+\"\",\"31\",\"30\",\"31\",\"30\",\"31\",\"31\",\"30\",\"31\",\"30\",\"31\"] //Array of the days in each month.\n\n\tcalendarDrawing = \"<table class='calendar'>\";\n\n\t//Header for calendar\n\tcalendarDrawing += \"<tr class='daysOfCurrentMonth'>\";\n\tcalendarDrawing += \"<th><span onclick='calendar(date.getMonth(), date.setFullYear(date.getFullYear()-1))'>&lt;&lt;&nbsp;</span></th>\";\n\tcalendarDrawing += \"<th><span onclick='calendar(date.setMonth(date.getMonth()-1),date.getFullYear())'>&lt;&nbsp;</span></th>\";\n\tcalendarDrawing += \"<th colspan='3'>\" + monthNames[newMonth] + \" \" + newYear + \"</th>\";\n\tcalendarDrawing += \"<th><span onclick='calendar(date.setMonth(date.getMonth()+1), date.getFullYear())'>&nbsp;&gt;</span></th>\";\n\tcalendarDrawing += \"<th><span onclick='calendar(date.getMonth(), date.setFullYear(date.getFullYear()+1))'>&nbsp;&gt;&gt;</span></th></tr>\";\n\n\t//Header for weekdays\n\tcalendarDrawing += \"<tr class='weekdays'> <th>Sun</th> <th>Mon</th> <th>Tues</th> <th>Wed</th> <th>Thu</th> <th>Fri</th> <th>Sat</th> </tr>\";\n\n\t//START OF PRINTING OF DAYS IN MONTH\n\n\tcalendarDrawing += \"<tr>\";\n\n\t//Getting the total amount of days in the previous month\n\t//\t for Figuring out number of cells to fill with &nbsp in order for appropriate weekday position for first day of month\t\n\n\tvar prevMonth = (newMonth-1);\n\tvar prevMonthdays = totalDays[prevMonth];\n\n\tif (prevMonth < 0){\n\t\tvar previousMonthDaysFromLastWeek = 31 - startDay +1;\n\t}\n\telse{\n\t\tvar previousMonthDaysFromLastWeek = prevMonthdays - startDay + 1;\n\t}\n\n\tif (startDay != 0){\n\t\twhile (startDay > 0){\n\t\t\tcalendarDrawing += \"<td>&nbsp;</td>\";\n\t\t\tpreviousMonthDaysFromLastWeek++;\n\t\t\tstartDay --;\n\t\t}\n\t}\n\n\t//PRINTING DAYS OF MONTH\n\n\tvar i = 1 //Setting the counter to 1 to loop through the days of the month.\n\n\twhile (i<=totalDays[newMonth]){\n\n\n\t\t//Checking if the 7 days in a week have been filled for one row/week\n\t\tif (w > 6){\n\t\t\tw = 0;\n\t\t\tcalendarDrawing += \"</tr><tr>\";\n\t\t}\n\n\t\t// If calendar is displaying current month and year, current date will be highlighted\n\t\tif (i == defaultDay && newMonth == defaultMonth && newYear == defaultYear){\n\t\t\tcalendarDrawing += \"<td class='currentDate' onMouseover='this.style.background=\\\"#7EC0EE\\\"; this.style.color=\\\"#FFFFFF\\\"' \"\n\t\t\t\t\t\t\t+ \"onMouseOut='this.style.background=\\\"#7EC000\\\"; this.style.color=\\\"#000000\\\"' \"\n\t\t\t\t\t\t\t+ \"onclick =\\\"events(\"+i+\",\"+newMonth+\",\"+newYear+\")\\\"> \" +i+ \"<ul id=\\\"desc_\"+i+\"\\\">\"\n\t\t\t\t\t\t\t+ \"</ul></td>\";\t\t\t\t\t\t\t\n\t\t}\n\t\telse{\n\t\t\tcalendarDrawing += \"<td class='daysOfCurrentMonth' onMouseOver='this.style.background=\\\"#7EC0EE\\\"; this.style.color=\\\"#FFFFFF\\\"' \"\n\t\t\t\t\t\t\t+ \"onMouseOut='this.style.background=\\\"#FFFFFF\\\"; this.style.color=\\\"#000000\\\"' \"\n\t\t\t\t\t\t\t+ \"onclick =\\\"events(\"+i+\",\"+newMonth+\",\"+newYear+\")\\\"> \" +i+ \"<ul id=\\\"desc_\"+i+\"\\\">\"\n\t\t\t\t\t\t\t+ \"</ul></td>\";\n\t\t}\n\n\n\t\ti++;\t//go to next ith day\n\t\tw++;\t//increase number of days to check for filled week (7 days)\n\t}\n\n\t//Finish padding the month with the start of the following month\n\twhile (w <= 6){\n\t\tcalendarDrawing += \"<td>&nbsp;</td>\";\n\t\tw++;\n\t}\n\n\t\t$.getJSON(\"/appointments\",function(data){\n\t\t\tfor (var j=0; j<data.length; j++) {\n\t\t\t\tif(data[j].year == newYear && data[j].month-1 == newMonth){\n\t\t\t\t\t$(\"#desc_\"+data[j].day).append(data[j].time + \" \" + data[j].description + \"<br><br>\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\n\n\t//Closing the table cleanly.\n\tcalendarDrawing += \"</tr></table>\";\n\n\tdocument.getElementById('calendar').innerHTML = calendarDrawing;\n}", "function diaS() {\r\n\r\n var month = document.getElementById(\"selMonth\").selectedIndex;;\r\n var year = document.getElementById(\"tfYear\").value;\r\n var iday = document.getElementById(\"tfDay\").value;\r\n var setdays = document.getElementById(\"setDay\").value;\r\n\r\n if ((isValidDays(iday)) && (isValidYear(year) && (isValidSetDays(setdays)))){\r\n printCalendar(year, month, iday, setdays);\r\n }\r\n \r\n}", "function ydtodays($d) {\n return ymdtodays(strcat(substr($d,0,4),'-01-01'))-1+substr($d,5,3);\n}", "function _Date(_month, _day, _year) {\n return {\n // Integer month (0...11)\n month: parseInt(_month, 10),\n // Integer day (0...30)\n day: parseInt(_day, 10),\n // Integer year (/\\d{4}/)\n year: parseInt(_year, 10),\n \n // Returns the day of the year that a date is.\n doy: function() {\n var yd = 0;\n for(var m = 1; m < this.month; ++m)\n yd += this.daysInMonth(m, this.year);\n yd += this.day - 1;\n return yd;\n },\n \n // Returns the day of the week that a specified date is. Year\n // must be 2000 or later. Do not confuse with the destinction\n // between weekend and weekday.\n weekday: function() {\n // Works for year >= 2000\n // from http://www.gregmiller.net/astro/dow.html\n var yrnum = ((this.year % 100) / 4 + (this.year % 100)) >> 0;\n var month_conversions = [6, 2, 2, 5, 0, 3, 5, 1, 4, 6, 2, 4];\n var daynum = this.day + yrnum + month_conversions[this.month - 1];\n if ( this.month <= 2 && this.daysInMonth(2, this.year) == 29 )\n --daynum;\n // normalize daynum to 1..7:\n daynum %= 7;\n daynum = daynum >> 0;\n // 0 = sunday, 1 = monday, 2 = tuesday, ... 6 = saturday\n if ( daynum === 0 )\n return Day.Sunday;\n else\n return daynum - 1;\n },\n \n // Walks forward to a new date a certain number of days.\n addDays: function(days) {\n for(var d = 0; d < days; ++d) {\n this.day++;\n if (this.day > this.daysInMonth(this.month, this.year)) {\n this.day = 1;\n this.month++;\n if (this.month > 12) {\n this.month = 1;\n this.year++;\n }\n }\n }\n },\n \n // Returns this date in iCal format.\n toICal: function() {\n return \"\" + this.year\n + (this.month<10?\"0\"+this.month:\"\"+this.month)\n + (this.day<10?\"0\"+this.day:\"\"+this.day);\n },\n \n // Returns a string representation of this date.\n toString: function() {\n return month_names[this.month+1] + \" \"\n + this.day + \", \" + this.year;\n },\n \n // Returns true if this date occurred before some other date.\n lessThan: function(other) {\n if ( this.year < other.year )\n return true;\n else if ( this.year > other.year )\n return false;\n // years equal\n if ( this.month < other.month )\n return true;\n else if ( this.month > other.month )\n return false;\n // months equal\n if ( this.day < other.day )\n return true;\n else if ( this.day > other.day )\n return false;\n // all equal\n return false;\n },\n \n // Returns the number of days in a month.\n daysInMonth: function(m, y) {\n switch (m) {\n case 1:\n case 3:\n case 5:\n case 7:\n case 8:\n case 10:\n case 12:\n return 31;\n case 2:\n if ( y % 4 === 0 && (y % 100 !== 0 || y % 400 === 0) )\n return 29;\n else\n return 28;\n break;\n case 4:\n case 6:\n case 9:\n case 11:\n return 30;\n }\n },\n \n // Returns the number of a month given its short name.\n // See month_names.\n month_num: function(m) {\n var lower_month = m.toLowerCase();\n for(var i = 0; i < 12; i++)\n if ( lower_month == month_names[i] )\n return i + 1;\n }\n };\n}", "function createDate(y) {\n var M = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n var d = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 1;\n var h = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var m = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 0;\n var s = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;\n var ms = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : 0;\n var date = new Date(y, M, d, h, m, s, ms);\n\n if (y < 100 && y >= 0) {\n date.setFullYear(y);\n }\n\n return date;\n}", "function calcD(y,m,d) {\n\n\t\t\tvar msPerDay = 86400.0*1000; //miliseconds per day\n\n\t\t\tvar targetDate = new Date(y,m,d).getTime()/msPerDay; \t//desired date obj in seconds\n\t\t\tvar timeLineEndDate = new Date().getTime()/msPerDay; \t\t //todays date in seconds from january 1 1970\n\t\t\tvar timeLineStartDate = new Date(1993,09,1).getTime()/msPerDay; // date for which the timeline begins\n\n\t\t\t\n\t\t\tvar daysSinceBeginning = Math.floor( timeLineEndDate - timeLineStartDate); //the number of days since the timelineStartDate\n\n\n\n\t\t\t//return the difference in days as a unit\n\t\t\treturn ( (daysSinceBeginning - Math.floor(timeLineEndDate - targetDate)) / (daysSinceBeginning/100.0) ) ;\n\t\t}", "function setDay(month, dayArg){\n\tvar numOfDays = dayArg;\n\n\tif(month > 1){\n\t\tnumOfDays += 31;\n\t}\n\tif(month > 2){\n\t\tnumOfDays += 28;\n\t}\n\tif(month > 3){\n\t\tnumOfDays += 31;\n\t}\n\tif(month > 4){\n\t\tnumOfDays += 30;\n\t}\n\tif(month > 5){\n\t\tnumOfDays += 31;\n\t}\n\tif(month > 6){\n\t\tnumOfDays += 30;\n\t}\n\tif(month > 7){\n\t\tnumOfDays += 31;\n\t}\n\tif(month > 8){\n\t\tnumOfDays += 31;\n\t}\n\tif(month > 9){\n\t\tnumOfDays += 30;\n\t}\n\tif(month > 10){\n\t\tnumOfDays += 31;\n\t}\n\tif(month > 11){\n\t\tnumOfDays += 30;\n\t}\n\tday = numOfDays;\n}", "function formatY(d) {\n if (d == 0) {\n return 0;\n }\n var l = ['G', 'M', 'k', ''];\n var s, j = 0\n for (var i = 1e9; i >= 1; i = i / 1e3) {\n s = d / i;\n if (s >= 1) {\n return s + l[j]\n }\n j++;\n }\n return '';\n }", "function daysInMonth(m,y){\n return 32 - new Date(y,m,32).getDate();\n}", "function formatdate(found) {\n if (!found) {\n return {};\n }\n found = found.replace('of ', '');\n found = found.replace('the ', '');\n found = found.replace('th ', ' ');\n found = found.replace('rd ', ' ');\n found = found.replace('1st ', '01');\n\n var month = /july|august|september|october|november|december|january|february|march|april|may|june/i.exec(found);\n month = '' + month;\n month = month.toLowerCase();\n var monthnum = 0;\n\n if (month == 'january') {\n monthnum = '01';\n }\n if (month == 'february') {\n monthnum = '02';\n }\n if (month == 'march') {\n monthnum = '03';\n }\n if (month == 'april') {\n monthnum = '04';\n }\n if (month == 'may') {\n monthnum = '05';\n }\n if (month == 'june') {\n monthnum = '06';\n }\n if (month == 'july') {\n monthnum = '07';\n }\n if (month == 'august') {\n monthnum = '08';\n }\n if (month == 'september') {\n monthnum = '09';\n }\n if (month == 'october') {\n monthnum = '10';\n }\n if (month == 'november') {\n monthnum = '11';\n }\n if (month == 'december') {\n monthnum = '12';\n }\n\n if (found.match('B.C.')) {\n var year = /[0-9]{3,4}/i.exec(found);\n year = year + '';\n if (year.length == 3) {\n year = '0' + year;\n }\n if (year.length == 2) {\n year = '00' + year;\n }\n year = '-' + year;\n return year;\n } //something bc\n else {\n var year = /[0-9]{4}/i.exec(found);\n } //normal years\n year = '' + year;\n found = found.replace(year, '');\n var date = /[0-9]{1,2}/i.exec(found);\n\n if (date != null) {\n if (date < 10) {\n date = '0' + date;\n } //turn 1 into 01\n }\n\n return {\n \"year\": year,\n \"month\": monthnum,\n \"day\": date\n };\n }", "function birthday(s, d, m) {\n // Corner case\n if (s.length === m && s[0] === d) return 1;\n\n let numOfWays = 0;\n\n for (let i = 0; i < s.length; i++) {\n let monthLength = 1;\n let sum = s[i];\n for (let j = i + 1; j < s.length; j++) {\n monthLength++;\n sum += s[j];\n if (sum === d && monthLength === m) {\n numOfWays++;\n }\n \n // To ignore irrelevant cases\n if (sum > d || monthLength > m) break;\n }\n }\n\n return numOfWays;\n}", "function printCalendar(year, month, iday, setdays) {\r\n var daysInMonth = getDaysInMonth(year, month + 1 ); // number of days\r\n var firstDayOfMonth = (new Date(year, month, 1)).getDay(); // 0-6 for Sun to Sat\r\n\r\n if(month > 11){\r\n month = 0;\r\n year++;\r\n }\r\ncMonth = getMonthByName(month);\r\n\r\n var tableInnerHTML = \"<caption class='heads'>\"+ year +\"</caption><caption>\"+ cMonth +\"</caption><tr><th class='heads'>Sun</th><th class='heads'>Mon</th><th class='heads'>Tue</th>\"\r\n + \"<th class='heads'>Wed</th><th class='heads'>Thu</th><th class='heads'>Fri</th><th class='heads'>Sat</th></tr>\";\r\n \r\n var tdCellCount = 0; // count of table's <td> cells\r\n var diasd = parseInt(iday);\r\n \r\n var setday = parseInt(setdays) -1;\r\n\r\n if ((isLeapYear(year)) && (month == 1)){\r\n daysInMonth = 29;\r\n } else if (month == 1){\r\n daysInMonth = 28;\r\n }\r\n \r\n if (firstDayOfMonth !== 0) { // Leave these cells blank\r\n tableInnerHTML += \"<tr><td colspan='\" + firstDayOfMonth + \"'></td>\";\r\n tdCellCount = firstDayOfMonth;\r\n }\r\n\r\n for (var day = 1 ; day <= daysInMonth; day++) {\r\n if (tdCellCount % 7 === 0) { // new table row\r\n tableInnerHTML += \"<tr>\";\r\n }\r\n if ((day < iday) || (day > diasd + setday )){\r\n tableInnerHTML += \"<td class ='disa'>\" + day + \"</td>\";\r\n } else if (day == 1){\r\n tableInnerHTML += \"<td class='firstday'>\" + day + \"</td>\";\r\n } else if ((tdCellCount % 7 === 0) || (tdCellCount % 7 === 6)){\r\n tableInnerHTML += \"<td class='weekend'>\" + day + \"</td>\";\r\n } else {\r\n tableInnerHTML += \"<td class='week'>\" + day + \"</td>\";\r\n } \r\n\r\n tdCellCount++;\r\n if (tdCellCount % 7 === 0) {\r\n tableInnerHTML += \"</tr>\";\r\n }\r\n }\r\n // print the remaining cells and close the row\r\n var remainingCells = 7 - tdCellCount % 7;\r\n if (remainingCells < 7) {\r\n tableInnerHTML += \"<td colspan='\" + remainingCells + \"'></td></tr>\";\r\n }\r\n\r\n var node = document.createElement(\"TABLE\"); \r\n var linebreak = document.createElement(\"p\");\r\n\r\n node.innerHTML = tableInnerHTML; \r\n linebreak.innerHTML = \" <br>Continue...<br><br> \";\r\n\r\n if (diasd + setday >daysInMonth){\r\n \r\n day = diasd + setday - daysInMonth; \r\n\r\n document.getElementById(\"tableCalendar\").appendChild(node); \r\n document.getElementById(\"tableCalendar\").appendChild(linebreak);\r\n printCalendar(year, month + 1, 1,day);\r\n\r\n } else {\r\n document.getElementById(\"tableCalendar\").appendChild(node);\r\n }\r\n\r\n}", "function zodiac(month, day) {\n if((month == 1 && day <= 19) ||(month == 12 && day >= 22 )){\n return \"capricorn\";\n }else if((month == 2 && day <= 18) ||(month == 1 && day >= 20 )){\n return \"aquaries\";\n }else if((month == 3 && day <= 20) ||(month == 2 && day >= 19 )){\n return \"pisces\";\n }else if((month == 4 && day <= 19) ||(month == 3 && day >= 21 )){\n return \"aries\";\n }else if((month == 5 && day <= 20) ||(month == 4 && day >= 20 )){\n return \"taurus\";\n }else if((month == 6 && day <= 20) ||(month == 5 && day >= 21 )){\n return \"gemini\";\n }else if((month == 7 && day <= 22 ) ||(month == 6 && day >= 21 )){\n return \"cancer\";\n }else if((month == 8 && day <= 22) ||(month == 7 && day >= 23 )){\n return \"leo\";\n }else if((month == 9 && day <= 22) ||(month == 8 && day >= 23 )){\n return \"virgo\";\n }else if((month == 10 && day <= 22) ||(month == 9 && day >= 23 )){\n return \"libra\";\n }else if((month == 11 && day <= 21) ||(month == 10 && day >= 23 )){\n return \"scorpio\";\n }else if((month == 12 && day <= 21) ||(month == 11 && day >= 22 )){\n return \"sagittarius\";\n }\n}", "function d(a,b,c){var d={mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"};return a+\" \"+g(d[c],a)}", "function date(time, date= '12th', month = 'August') {\n console.log({\n time: time,\n date: date,\n month: month\n })\n}", "function dateBuilder(d){ \r\n let months=[\"January\" , \"February\", \"March\", \"April\" ,\"May\" , \"June\" , \"July\" , \"August\" , \"September\" ,\"October\" , \"November\" , \"December\"];\r\n let days=[\"Sunday\" ,\"Monday\" , \"Tuesday\" , \"Wednesday\", \"Thursday\" ,\"Friday\" , \"Saturday\"];\r\n\r\n let day=days[d.getDay()];\r\n let date=d.getDate();\r\n let month=months[d.getMonth()];\r\n let year=d.getFullYear();\r\n return `${day} ${date} ${month} ${year}`;\r\n\r\n\r\n}", "function cal_to_jd( y, m, d )\r\n{\r\n var jy, ja, jm; //scratch\r\n if( y == 0 ) {\r\n alert(\"There is no year 0 in the Julian system!\");\r\n return \"invalid\";\r\n }\r\n if( y == 1582 && m == 10 && d > 4 && d < 15 && era == \"CE\" ) {\r\n alert(\"The dates 5 through 14 October, 1582, do not exist in the Gregorian system!\");\r\n return \"invalid\";\r\n }\r\n\r\n// if( y < 0 ) ++y;\r\n if( m > 2 ) {\r\n jy = y;\r\n jm = m + 1;\r\n } else {\r\n jy = y - 1;\r\n jm = m + 13;\r\n }\r\n\r\n var intgr = Math.floor( Math.floor(365.25*jy) + Math.floor(30.6001*jm) + d + 1720995 );\r\n\r\n //check for switch to Gregorian calendar\r\n var gregcal = 15 + 31*( 10 + 12*1582 );\r\n if( d + 31*(m + 12*y) >= gregcal ) {\r\n ja = Math.floor(0.01*jy);\r\n intgr += 2 - ja + Math.floor(0.25*ja);\r\n }\r\n\r\n return intgr;\r\n}", "function initialise(){\n\r\n\t/* Calculate the start month (current - 1)*/\r\n\tintMonthOffset = (12 - intMonth);\r\n\tvar intPreviousMonth = 99;\n\t\r\n\t/*Build the current date object*/\r\n\tdatCurrentDate.setDate(1);\r\n\tdatCurrentDate.setMonth(intMonth);\r\n\tdatCurrentDate.setFullYear(intYear);\r\n\t/* Build the end date one year on */\r\n\tendDate.setDate(1);\r\n\tendDate.setMonth(intMonth);\r\n\tendDate.setFullYear(datCurrentDate.getFullYear()+1);\r\n\tendDate.setDate(1);\r\n\tdocument.getElementById(\"yearDisplay\").innerHTML = \"\";\r\n\t/* Loop through the display 12 months and draw the plan */\r\n\twhile (datCurrentDate< endDate)\r\n\t\t{\n\t\t\r\n\t\t/*Test for new month */\r\n\t\tif (datCurrentDate.getMonth() != intPreviousMonth)\r\n\t\t\t{\r\n\t\t\t/* Clear all previous cell data */\r\n\t\t\tfor (var x = 1; x<=42; x++)\r\n\t\t\t\t{\r\n\t\t\t\tclrElid = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"date\" + x;\r\n\t\t\t\tdocument.getElementById(clrElid).innerHTML = \"\";\r\n\t\t\t\tdocument.getElementById(clrElid).className = \"dateExtra\";\r\n\t\t\t\t}\r\n\t\t\t/* Create the month jump controls and its title */\r\n\t\t\telid = \"monthHeader\" + (( datCurrentDate.getMonth() + intMonthOffset) % 12);\r\n\t\t\tdocument.getElementById(elid).onclick = function(){\tjumpMonthHead(this);\t};\r\n\t\t\tdocument.getElementById(elid).innerHTML = myMonths[datCurrentDate.getMonth()] + \" \" +datCurrentDate.getFullYear();\r\n\t\t\tintPreviousMonth = datCurrentDate.getMonth();\r\n\t\t\tintDayOffset = datCurrentDate.getDay() + 6;\r\n\t\t\t//alert(intDayOffset);\r\n\t\t\t}\r\n\t\t/* Draw the weekdays for the first seven days */\r\n\t\tif (datCurrentDate.getDate() < 8)\r\n\t\t\t{\r\n\t\t\tstrDateId = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"day\" + (( datCurrentDate.getDate() + intDayOffset) % 7);\r\n\t\t\tdocument.getElementById(strDateId).innerHTML = myShortDays[datCurrentDate.getDay()];\r\n\t\t\t//document.getElementById(strDateId).innerHTML = datCurrentDate.getDay();\r\n\t\t\t}\r\n\t\tstrDayId = \"month\" + (( datCurrentDate.getMonth() + intMonthOffset ) % 12) + \"date\" + ( datCurrentDate.getDate() + (intDayOffset %7));\r\n\t\tdocument.getElementById(strDayId).innerHTML = datCurrentDate.getDate();\r\n\t\tdocument.getElementById(strDayId).title = \"\";\r\n\t\tdocument.getElementById(strDayId).className = \"dateShow\";\r\n\t\tdocument.getElementById(strDayId).onclick = function(){\tjumpMonth(this);\t};\r\n\t\tdatCurrentDate.setDate(datCurrentDate.getDate()+1);\r\n\t\t}\r\n\tif (intYear == endDate.getFullYear())\r\n\t\t{\r\n\t\tdocument.getElementById(\"yearDisplay\").innerHTML = intYear;\r\n\t\tdocument.getElementById(\"imgLeft\").title = \"Go back to \" + intYear -1;\r\n\t\tdocument.getElementById(\"imgRight\").title = \"Go forward to \" + intYear+1;\r\n\t\t}\r\n\telse\r\n\t\t{\r\n\t\tdocument.getElementById(\"yearDisplay\").innerHTML = intYear + \"/\" + endDate.getFullYear();\r\n\t\tdocument.getElementById(\"imgLeft\").title = \"Go back to \" + (intYear * 1 -1) + \"/\" + (endDate.getFullYear() *1 -1);\r\n\t\tdocument.getElementById(\"imgRight\").title = \"Go forward to \" + (intYear * 1 + 1) + \"/\" + (endDate.getFullYear() * 1 +1);\r\n\t\t}\r\n\t//listReminders();\r\n\t\r\n\t\r\n\t}", "function daysInMonth() {\n var e = document.getElementById('numMonth').selectedIndex;\n switch (e) {\n case 2:\n {\n if (isLeap()) {\n numDays(29);\n } else numDays(28);\n break;\n }\n case 4:\n case 6:\n case 9:\n case 11:\n {\n numDays(30);\n break;\n }\n default:\n {\n numDays(31);\n break;\n }\n }\n}", "function buildDate(day,month,year){\n if (day<10){\n day=`${month}/0${day}/${year}`;\n }\n else {\n day=`${month}/${day}/${year}`;\n }\n return day;\n}", "function FechaInput() {\n var hoy = new Date();\n var dd = hoy.getDate();\n var mm = hoy.getMonth() + 1;\n var yyyy = hoy.getFullYear();\n if (dd < 10) {\n dd = '0' + dd\n }\n if (mm < 10) {\n mm = '0' + mm\n }\n return yyyy + '-' + mm + '-' + dd;\n}", "function daysInTheMonth(yyyy, mm) {\n return new Date(yyyy, mm+1, 0).getDate();\n }", "function calendar( year, month, day ){\n\t\tvar y = ( typeof year === \"undefined\" ) ? parseInt( new Date().getFullYear() ) : year,\n\t\t\tm = ( typeof month === \"undefined\" ) ? parseInt( new Date().getMonth() ) : month,\n\t\t\td = ( typeof day === \"undefined\" ) ? parseInt( new Date().getDate() ) : day;\n\t\tvar leapYear = ( ( y/4 == 0 && y/100 != 0 ) || ( y/400 == 0 ) );\n\t\tif( leapYear ){\n\t\t\tmonthLen[1] = 29;\n\t\t}\n\t\tvar startWeek = parseInt( new Date( y, m, 1).getDay() );\n\t\treturn createDynamicCalendar( startWeek, m, d);\n\t}", "function convertMonth(m){\n switch(m){\n case 'jan': return 01;\n case 'feb': return 02;\n case 'mar': return 03;\n case 'apr': return 04;\n case 'may': return 05;\n case 'jun': return 06;\n case 'jul': return 07;\n case 'aug': return 08;\n case 'sep': return 09;\n case 'oct': return 10;\n case 'nov': return 11;\n case 'dec': return 12;\n }\n}", "dateHelper(mo, yr) {\n var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\n return months[mo - 1] + '-' + yr;\n }", "function c(e,c,t){var n={mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"};return e+\" \"+o(n[t],e)}", "function dayOfProgrammer(year) {\r\n\r\n let index=1;\r\n let nbrOfDays=0;\r\n\r\n for(index=1;index<=12 && nbrOfDays+new Date(year, index,0).getDate()<256;index++){\r\n if(index==2 && year<=1917)\r\n nbrOfDays+=year%4==0?29:28;\r\n else if(index==2 && year==1918)\r\n nbrOfDays+=15;//28-14+1\r\n else \r\n nbrOfDays+=new Date(year,index,0).getDate();\r\n }\r\n\r\n let day=256-nbrOfDays<10?\"0\"+256-nbrOfDays:256-nbrOfDays;\r\n let month=index<10?\"0\"+index:index;\r\n\r\n return `${day}.${month}.${year}`;\r\n}", "monthof(m) { \n switch (m) {\n case 1: return 31;\n break;\n case 2: return 28;\n break;\n case 3: return 31;\n break;\n case 4: return 30;\n break;\n case 5: return 31;\n break;\n case 6: return 30;\n break;\n case 7: return 31;\n break;\n case 8: return 31;\n break;\n case 9: return 30;\n break;\n case 10: return 31;\n break;\n case 11: return 30;\n break;\n case 12: return 31;\n break;\n\n }\n }", "function formatDayMonth(d) {\n\tlet date = d.getDate();\n\tlet month = d.getMonth() + 1; // Since getMonth() returns month from 0-11 not 1-12\n\tlet year = d.getFullYear();\n\n\treturn date + '/' + month + '/' + year;\n}", "function Yd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "function Yd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "function Yd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "function Yd(a,b,c){var d={mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},e=\" \";return(a%100>=20||a>=100&&a%100===0)&&(e=\" de \"),a+e+d[c]}", "function Dd(a,b,c,d){var e={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[a+\" Tage\",a+\" Tagen\"],M:[\"ein Monat\",\"einem Monat\"],MM:[a+\" Monate\",a+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[a+\" Jahre\",a+\" Jahren\"]};return b?e[c][0]:e[c][1]}", "function Dd(a,b,c,d){var e={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[a+\" Tage\",a+\" Tagen\"],M:[\"ein Monat\",\"einem Monat\"],MM:[a+\" Monate\",a+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[a+\" Jahre\",a+\" Jahren\"]};return b?e[c][0]:e[c][1]}", "function Dd(a,b,c,d){var e={m:[\"eine Minute\",\"einer Minute\"],h:[\"eine Stunde\",\"einer Stunde\"],d:[\"ein Tag\",\"einem Tag\"],dd:[a+\" Tage\",a+\" Tagen\"],M:[\"ein Monat\",\"einem Monat\"],MM:[a+\" Monate\",a+\" Monaten\"],y:[\"ein Jahr\",\"einem Jahr\"],yy:[a+\" Jahre\",a+\" Jahren\"]};return b?e[c][0]:e[c][1]}", "function printDate() {\n const date = new Date();\n let mm = (date.getMonth() + 1);\n if (mm < 10) {\n mm = `0${mm}`; \n }\n let dd = (date.getDate());\n if (dd < 10) {\n dd = `0${dd}`; \n }\n const yyyy = date.getFullYear();\n\n console.log(`${mm}-${dd}-${yyyy}`);\n}", "function r(d,m,p){var w={mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"};return d+\" \"+a(w[p],d)}", "function getMonth()\n{\n // determine which font size to use for dates.\n var fontsize=1;\n\t\tif (document.CalendarSettings.fontsize[0].checked) fontsize=1;\n\t\tif (document.CalendarSettings.fontsize[1].checked) fontsize=3;\n\t\tif (document.CalendarSettings.fontsize[2].checked) fontsize=5;\n\t\tif (document.CalendarSettings.fontsize[3].checked) fontsize=7;\n\n\t\t//integer to keep track of how many days were added to the month in the html string\n\t\tcellCount = 0;\n\n\t\t//prints out blank cells needed to start off month calendar\n\t\tfor(var blanks = 0; blanks < numBlankDays; blanks++)\n\t\t{\n\t\t\t\tcellsHTML = cellsHTML + \"<TD vAlign=top align=left width=\\\"14%\\\" >&nbsp;<br><br><br><br></TD>\";\n cellsHTML += \"\\n\";\n\t\t\t\tcellCount++;\n\t\t}\n\n\t\t//prints out cells for each day of the month\n\t\tfor(var days = 1; days <= numberOfDays; days++)\n\t\t{\n\t\t\tcellsHTML = cellsHTML + \"<TD vAlign=top align=left width=\\\"14%\\\" ><font size=\\\"\"+fontsize+\"\\\" face=\\\"Verdana\\\">\" +days +\"</font><br><br><br><br></TD>\";\n cellsHTML += \"\\n\";\n \t\tcellCount++;\n\t\t\tif(cellCount % 7 == 0)\n\t\t\t{\n\t\t\t\tcellsHTML = cellsHTML + \"</tr><tr>\";\n cellsHTML += \"\\n\";\n\t\t\t}\n\t\t}\n\n\t\t//prints out blank cells needed to end off month calendar\n\t\twhile (cellCount % 7 != 0)\n\t\t{\n\t\t\tcellsHTML = cellsHTML + \"<TD vAlign=top align=left width=\\\"14%\\\" >&nbsp;<br><br></TD>\";\n cellsHTML += \"\\n\";\n \t\tcellCount++;\n\t\t}\n\n\t\t//returns full html code for the month\n\t\treturn begTags + monthName + \" \" + yearName + \"\\n\" + columnHeaders() + \"\\n\" + cellsHTML + endTags;\n}", "function yi(e,t,n){var a=e+\" \";switch(n){case\"ss\":return a+=1===e?\"sekunda\":2===e||3===e||4===e?\"sekunde\":\"sekundi\";case\"m\":return t?\"jedna minuta\":\"jedne minute\";case\"mm\":return a+=1===e?\"minuta\":2===e||3===e||4===e?\"minute\":\"minuta\";case\"h\":return t?\"jedan sat\":\"jednog sata\";case\"hh\":return a+=1===e?\"sat\":2===e||3===e||4===e?\"sata\":\"sati\";case\"dd\":return a+=1===e?\"dan\":\"dana\";case\"MM\":return a+=1===e?\"mjesec\":2===e||3===e||4===e?\"mjeseca\":\"mjeseci\";case\"yy\":return a+=1===e?\"godina\":2===e||3===e||4===e?\"godine\":\"godina\"}}", "function birthday(bday, bMonth)\r\n{\r\n if (bday == 5 || bMonth == 9)\r\n {\r\n console.log(\"How did you know?\")\r\n }\r\n else \r\n {\r\n console.log(\"Just another day....\")\r\n }\r\n\r\n}", "function sundey1January(){\nfor (var year = 2014; year <= 2050; year++)\n {\n var d = new Date(year, 0, 1);\n if ( d.getDay() === 0 )\n alert(\"1st January will be a Sunday \" + year);\n }\n}", "function dateBuilder(d) {\n let months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n let days = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n let day = days[d.getDay()];\n let date = d.getDate();\n let month = months[d.getMonth()];\n let year = d.getFullYear();\n // console.log(d.getDay());\n return `${day} ${date} ${month} ${year}`;\n\n}", "function display_todays_date()\r\n {\r\n var today = new Date();\r\n var numerical_day=today.getDay();\r\n var numerical_month=today.getMonth();\r\n var date=today.getDate();\r\n var year=2000;\r\n var weekday_array = new\r\n Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');\r\n var day_of_the_week = weekday_array[numerical_day];\r\n var month_array = new\r\n Array('January','February','March','April','May','June','July','August','September','October','November','December');\r\n var month_name = month_array[numerical_month];\r\n var date_string=day_of_the_week+', '+month_name+' '+date+', '+year;\r\n document.write(date_string)\r\n }", "function out() {\n const monthFull = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n let input = document.getElementById(\"load\").value.toLowerCase();\n let output = \"\";\n let today = \"\";\n\n switch (input) {\n /* ----- TU/UWE CLASSMATES ----- */\n case \"0321343\": output = \"Nice number right?\"; break;\n\n case \"0311385\": output = \"Stanlee Sim Leiber\"; break; // STANLEY SIM\n case \"0311783\": output = \"Color changing only doesn't count, aite!?\"; break; // LIM YU HENG\n case \"0313696\": output = \"I like him. He reminds me about me actually.\"; break; // HAO QIN\n case \"0313836\": output = \"DO NOT ANGER THE JOHN!\"; break; // JOHN HO\n case \"0313936\": output = \"He only didn't have a semester together with my batch's gang in 082017.\"; break; // NG JIA SHIN\n case \"0314193\": output = \"I hope you're doing fine.\"; break; // FREDERICK CHOO\n case \"0315264\": output = \"He doesn't mingle around that much, even with the senior batch.\"; break; // PRASONG PUNYAWAN\n case \"0315302\": output = \"He's probably the more hardworking one than I am.\"; break; // WONG TIN WOOI\n case \"0315649\": output = \"Between you and Darshan, thanks for opening up first.\"; break; // OOI YING CHIING\n case \"0315747\": output = \"He knows me, he knows my cousin.. next thing will proly be me teddy.\"; break; // IAN GAN\n case \"0316175\": output = \"Have you got a large wardrobe at home?\"; break; // DARSHAN RAVICHANDRAN\n case \"0316253\": output = \"Quick wits. Correct me if I'm wrong.\"; break; // IFANDI SALIM\n case \"0316270\": output = \"One of those I know in class who's quick to getting Apple stuff.\"; break; // EDMOND TAN\n case \"0316275\": output = \"I still can't add you on Facebook.\"; break; // VIMALNATH NAMBIAR\n case \"0316421\": output = \"He's nice. Didn't talk a lot to him tho.\"; break; // LIM MING JOON\n case \"0316698\": output = \"You know a little more about cars than an average software engineer.\"; break; // CHAN WAI HOE\n case \"0316703\": output = \"Mimi, Prishtee and I still talk about you sometimes.\"; break; // ANCHALI RENGANATHEN\n case \"0316902\": output = \"I predicted I'd see him again after his first sem. I was right, kinda. Twice?\"; break;// AHMED YOUSEF\n case \"0317818\": output = \"I'm pretty sure your priorities weren't set right back then.\"; break; // SYED ARSHAN\n case \"0317824\": output = \"Has he graduated yet?\"; break; // ADEEL USMAN\n case \"0317887\": output = \"Traquer\"; break; // TING SHI JIN\n case \"0317911\": output = \"Deer Pudding\"; break; // DHEERSHREYHAN PUDDOO\n case \"0318109\": output = \"I think he has a start-up recently.\"; break; // JULIUS HO\n case \"0318222\": output = \"Markuses\"; break; // MARCUS LOKE\n case \"0318225\": output = \"Mason.. buddy. Need a hug with that?\"; break; // LEWIS LIEW\n case \"0318365\": output = \"Where art Sheng? 'You know you want her.'\"; break; // LIEW WANN SHENG\n case \"0318686\": output = \"His scar on his foot still scares the heck out of me just by thinking.\"; break; // ALVIN LIOW\n case \"0318691\": output = \"Press 'X' for Jason\"; break; // JASON TEH\n case \"0318770\": output = \"Ermm.. hi. Sorry I didn't add you in the Crypto Whatsapp group at first.\"; break; // MOHAMED AKRAM IBRAHIM\n case \"0318941\": output = \"Most of your horizontal-like handwriting strokes are right to left right?\"; break; // KAVINTHERAN KUMAR\n case \"0319137\": output = \"Day by day after seeing your photos your body would make a great T shape.\"; break; // TAN DE REN\n case \"0319138\": output = \"The last I remember about him from convo is him looking like a bellhop.\"; break; // ABDULLAH HARITH\n case \"0319226\": output = \"We talked a bit.. if only I knew what. My mind kong liao!\"; break; // KONG SHIEN NIE\n case \"0319297\": output = \"The only righty out of the five.\"; break; // KEVIN YEAP\n case \"0319493\": output = \"Her art's good. You should go check her out.\"; break; // STELLA PHUA\n case \"0319504\": output = \"I think after all this, you'll be the last of us to graduate.\"; break; // LIYAU YU HAO\n case \"0319601\": output = \"I'll be honest, I can still read your handwriting.\"; break; // ALEX HO\n case \"0319639\": output = \"I'm sure your height stature ain't that bad.\"; break; // JANE WEE\n case \"0319663\": output = \"Honestly I was surprised he hadn't graduated yet after my third semester.\"; break; // RUSHAB UPADHYAYA\n case \"0319723\": output = \"She may have got a group of friends in many batches now.\"; break; // NURAFIQAH HASNUL JAFRI\n case \"0319736\": output = \"Out of everyone in his gang, he's the one I talked to the most after Alvin.\"; break; // TAN KAE PHERNG\n case \"0319826\": output = \"He's probably the most fluent out of the five.\"; break; // JUSTIN LING\n case \"0319848\": output = \"She seems to hate the lecturer I really like. Idk, I digress.\"; break; // BALREEN KAUR\n case \"0319888\": output = \"Timonopod. The only one from Foundation I never teamed up with.\"; break; // TIMOTHY DANIEL LIM\n case \"0319937\": output = \"I'm pretty sure you're living under the radar for now.\"; break; // DEEPAK SINGH\n case \"0320015\": output = \"Alas, his oust was sprinkled with facepalms.\"; break; // LIEW JENN YAO\n case \"0320261\": output = \"I lost count how many times her name got roasted by lecturers. Hint: X\"; break; // XUE QI\n case \"0320339\": output = \"Eloquence is a gift, not a way out of trouble.\"; break; // DANISH NOORANI\n case \"0320381\": output = \"Um.. care to explain how your hair works again?\"; break; // MWALE NTAMBO\n case \"0320395\": output = \"The gods of re-sits smile upon him every single semester.\"; break; // VINCENT FOO\n case \"0320448\": output = \"Putang ina mo!\"; break; // JAKE LEONG\n case \"0320534\": output = \"An emcee for rent. He'll interest you with his cards. :)\"; break; // DUNCAN TSEN\n case \"0320811\": output = \"There were two classes when a junior's name is pronounced similarly.\"; break; // JONATHAN FUNG\n case \"0320818\": output = \"The beard, bro. Super thicc.\"; break; // SHAHER YAR GHOURI\n case \"0320868\": output = \"If only they knew why people can't stop not seeing him.\"; break; // AMIRUL ADAM\n case \"0320883\": output = \"Liang-zai!\"; break; // LEE WEI LIANG\n case \"0320933\": output = \"What's a double rainbow again? I digress.\"; break; // ONG ANDRE\n case \"0320951\": output = \"Vi-sion has it that she's got an unstoppable 4.00.\"; break; // TAN VI LYNN\n case \"0320957\": output = \"Mrs Lum\"; break; // OH LEAN LYNN\n case \"0320981\": output = \"Stitch doesn't know what happened to the dead body.\"; break; // ALDRICH\n case \"0321045\": output = \"Future Mr (and Mrs)\"; break; // LUM CHUN LAM\n case \"0321095\": output = \"Very vocal. Screw it, he finished the last sem first out of everyone else!\"; break; // TEOH JOO FONG\n case \"0321150\": output = \"He.. slow.\"; break; // KABIRDEV SINGH\n case \"0321227\": output = \"I can safely say you're better in video ideas than me now.\"; break; // ANDREW NG\n case \"0321255\": output = \"wylw\"; break; // WAYNE LOW\n case \"0321268\": output = \"Do you not pronounce the 'J' as 'Y'?\"; break; // JOHANN WONG\n case \"0321341\": output = \"MIA Adam's family member. We could've formed 0321341, 0321342 and 0321343!\"; break; // WAN AZIM\n case \"0321342\": output = \"Ya peeping here now dahling?\"; break; // SYAMIMI\n case \"0321412\": output = \"At first I thought your e-mail was hot chocolate.\"; break; // HAZMAN HISHAM\n case \"0321584\": output = \"This fella has no idea how weak his vocab is, or how strong his punch is.\"; break; // TAN LIK MING\n case \"0322087\": output = \"If Roy sees this, let's just rejoice again like in .NET again, alright?\"; break; // JORDAN WEE\n case \"0322119\": output = \"Ooh gawd forbid. Have you smelt yourself? The first time I inhaled too much.\"; break; // MD MIZANUR RAHMAN\n case \"0322849\": output = \"Makes Unity vids. I remember Dr Raja jokingly wanting to whack you one time.\"; break; // OMAR ABOBAKR OMAR BALFAQIH\n case \"0323299\": output = \"Thanks for the MAD exam tips. They really helped.\"; break; // JONATHAN TAN YI GUAN\n case \"0323308\": output = \"お母さん!\"; break; // NISA ANGELINA\n case \"0323400\": output = \"Your first name reminds me of someone. It's that, minus the last A.\"; break; // LAKSHANA BUNGHOO\n case \"0323401\": output = \"Prishtee's best friend Courser\"; break; // KAWTHUR FAATIMAH BIBI CHOTOYE\n case \"0323445\": output = \"You + Ruby.. since when?\"; break; // BRANDON CHIN\n case \"0323534\": output = \"Unlike typical fashion, he studied Forensics instead of opening a bank.\"; break; // HO HONG LEONG\n case \"0323724\": output = \"I remember trying to intervene when Jia Sheng was talking to you in broken BM.\"; break; // RAMZAN ASHRAF\n case \"0323740\": output = \"Numbers used to scare him. Programming never did. It just never translated.\"; break; // JOSEPH SAW\n case \"0323791\": output = \"Yeah, I remember being confused for a bit with you looking Chinese and all.\"; break; // SYUKRINA KAMILIA\n case \"0323875\": output = \"They don't call you anything else other than the 2 nicknames right?\"; break; // HOESNI ABDUL AZIZ\n case \"0324006\": output = \"I asked her why she was in my class one time. 1 year later she asked me the same thing.\"; break; // YAP LI TENG\n case \"0324339\": output = \"Only teamed up in Technopreneurship. He seems okay.\"; break; // STANSON YAN VEN HENG\n case \"0324451\": output = \"Oh right. \\\"FLENCH!\\\" Dahling's super-pal. Merci-beacoup.\"; break; // PRISHTEE\n case \"0324513\": output = \"Try to guess why she chose that nickname she goes by now. \"; break; // JOHNY CHAN\n case \"0324570\": output = \"King's great buddy. Word is Audi still doesn't know how you got to that size.\"; break;// SUBOWO\n case \"0324776\": output = \"This guy has no idea where he is or what's happening. Just kidding.\"; break; // LI JIE\n case \"0324782\": output = \"The class did wonder where you disappeared off to.\"; break; // NUR AQILAH\n case \"0324822\": output = \"I can't remember when we stopped calling you Big Teoh.\"; break; // NARICK TEOH\n case \"0324856\": output = \"Care or no care? I'm confused.\"; break; // ABIRUL ISLAM\n case \"0324957\": output = \"The first time I saw your picture, your face was wider.\"; break; // RASHIK TASIN UDDIN\n case \"0325030\": output = \"Louis Karlo Haimeh Araojo. Tony for short.\"; break; // LUIS CARLOS (TONY)\n case \"0325184\": output = \"He shouldn't sit still. Literally.\"; break; // WILLY GHOZALI\n case \"0325535\": output = \"I might be wrong, but you tend to act before thinking at times right?\"; break; // LING SU WYNN\n case \"0325827\": output = \"Couldn't catch any fish in Australia.\"; break; // GOH SIAU EU\n case \"0325860\": output = \"How many senior batches has he mixed with already?\"; break; // YONG KIN PONG\n case \"0325999\": output = \"私はこの言語わからないよ!〜\"; break; // CHAN CHIEW KING\n case \"0326017\": output = \"mm\"; break; // TAN MAY SHUEN\n case \"0326036\": output = \"Kak Naz daily.\"; break; // NAZLYN AMELIA \n case \"0326175\": output = \"Next time we go out together, forget Willy's phone.\"; break; // MONTE\n case \"0326235\": output = \"While Li Jie's the more crude one, her act is usually the opposite.\"; break; // KANG XIAOXI\n case \"0326710\": output = \"Popped out of nowhere in sem 2, but she's a fun friend to be with!\"; break; // AFSANA ISLAM\n case \"0326711\": output = \"I never had a class with him in uni. He and I go way back is all.\"; break; // HP CHAMODE ANJANA\n case \"0326800\": output = \"Thank you for telling me about DigitalOcean. How's Australia?\"; break; // CHONG JIA SHENG\n case \"0327005\": output = \"Acute Holiday. Brave girl for taking ADS.\"; break; // ABIGAIL ACHIAMMA JOSHUA\n case \"0327087\": output = \"I read your blog. Don't let anyone or anything make you belittled in any way.\"; break;// LIM SHU EN\n case \"0327159\": output = \"We met in Data Mining class. I'm sure both of us have regrets taking it.\"; break; // OLIVER SIM CHOO HOWE\n case \"0327250\": output = \"Acute Holiday\"; break; // YAP LY DION\n case \"0327821\": output = \"We know each other, but we don't talk a lot to each other.\"; break; // CHAW SHEN MIN\n case \"0327893\": output = \"JY and I know but don't talk to each other a lot.\"; break; // LEE JIAN YI\n case \"0328168\": output = \"Smart friend of mine, but his language capability has issues.\"; break; // VICTOR TEH YANG JIE\n case \"0329471\": output = \"Mustang-kun! Enthusiastic programmer, definitely worth your time.\"; break; // ROY LING HANG YEW\n\n /* ----- TU STUDENTS ----- */\n case \"0326861\": output = \"I could've sworn you're the huggable type.\"; break; // TAN JIN SOON\n case \"0327114\": output = \"Never forget your friends that helped you in the tough spots.\"; break; // HARRIS CHAN CHI HIAN\n case \"0334135\": output = \"Half of you is opposite of your bro. Even handed-wise.\"; break; // ADELINE NG\n\n /* ----- SU CLASSMATES ----- */\n case \"13025382\": output = \"You will always be the best one out of all of us.\"; break; // NICHOLAS CHAN KHIN WHAI\n case \"13038567\": output = \"Your BF is the best out there. Cherish every moment with him nicely.\"; break; // CLAUDIA NG\n case \"19009109\": output = \"My only other companion in my Master's degree journey.\"; break; // CHAN CHIEW KING\n\n /* ----- MISCELLANEOUS ----- */\n case \"brainz\":\n output = \"Brainz.\";\n document.getElementById('sukhbir_' + (Math.floor(Math.random() * 2) + 4)).play();\n break;\n\n case \"crazydave\": case \"crazy dave\": case \"crzydv\": case \"davidblazing\": case \"david blazing\":\n output = \"Wabby wabbo.\";\n dave = Math.floor(Math.random() * 12);\n if (dave < 10) document.getElementById('dave_0' + dave).play();\n else document.getElementById('dave_' + dave).play();\n break;\n\n case \"date\":\n today = new Date();\n // output = today.getFullYear() + '-' + (today.getMonth() + 1) + '-' + today.getDate();\n output = monthFull[today.getMonth()] + \" \" + today.getDate() + \", \" + today.getFullYear();\n break;\n\n case \"datetime\": case \"date-time\": case \"date time\":\n today = new Date();\n output\n = monthFull[today.getMonth()] + \" \" + today.getDate() + \", \" + today.getFullYear()\n + \" \" + today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n break;\n\n case \"easteregg\": output = \"Oh you.\"; break;\n case \"eieio\": output = \"Now why the heck would '\" + clue + \"' be the passcode!?\"; break;\n\n case \"sukhbir\":\n output = \"Brainz?\";\n document.getElementById('sukhbir_' + (Math.floor(Math.random() * 6))).play();\n break;\n\n case \"time\":\n today = new Date();\n output = today.getHours() + \":\" + today.getMinutes() + \":\" + today.getSeconds();\n break;\n\n case \"top secret code lever\": output = \"I used to think putting all my games in a sub-sub-sub-subfolder was cool.\"; break;\n\n case \"x\": // press 'X' for Jason\n jason_count++;\n if (jason_count % 11 == 0) {\n document.getElementById('jason_11').play();\n output = \"Ja-mai-son, Jason (cries)\";\n } else if (jason_count % 11 < 10) {\n document.getElementById('jason_0' + (jason_count % 11)).play();\n if (jason_count % 11 <= 2) output = \"JASON?\"\n else if (jason_count % 11 == 3) output = \"JASON!?\";\n else if ((jason_count % 11 >= 4 && jason_count % 11 <= 6) || jason_count % 11 == 8) output = \"JASON!!\";\n else if (jason_count % 11 == 7 || jason_count % 11 == 9) output = \"JASON\";\n } else if (jason_count % 11 == 10) {\n document.getElementById('jason_' + (jason_count % 11)).play();\n output = \"J-J-JASON\";\n }\n break;\n\n /* ----- LINKS TO OTHER PAGES ----- */\n case \"about\": case \"about me\":\n window.location.replace(\"about/\");\n break;\n\n case \"blog\": case \"incoherent thoughts\":\n window.open(\"blog/\", \"_blank\");\n break;\n\n case \"csi\": case \"community service\":\n window.location.replace(\"community-service/\");\n break;\n\n case \"cv\": case \"curriculum vitae\":\n window.open(\"pdf/HHW_cv2019.pdf\", \"_blank\");\n break;\n\n case \"portfolio\":\n window.location.replace(\"portfolio/\");\n break;\n\n case \"results\": case \"transcript\": case \"transcripts\":\n window.location.replace(\"transcripts/\");\n break;\n\n case \"resume\":\n window.open(\"pdf/HHW_resume2019.pdf\", \"_blank\");\n break;\n\n case \"sukuru\":\n window.open(\"pdf/sukuru-report.pdf\", \"_blank\");\n break;\n\n default: // output = output;\n }\n document.getElementById(\"output\").innerHTML = output;\n\n /* actions that change page layout or redirects to another page */\n if (input == \"exit\") {\n document.getElementById('menu').style.display = \"\";\n document.getElementById('hide-me-first').style.display = \"none\";\n document.getElementById(\"load\").value = \"\";\n document.getElementById(\"output\").innerHTML = \"You have found the elusive, sub-par master mode!\";\n jason_count = 0;\n } else if (input == \"about\") {\n window.location.replace(\"about/\");\n } else if (input == \"dark\") {\n if (document.body.classList.contains(\"dark\")) {\n document.body.classList.remove(\"dark\");\n document.getElementById(\"dark-toggle\").checked = false;\n document.getElementById(\"output\").innerHTML = \"Dark mode is turned off.\";\n } else {\n document.body.classList.add(\"dark\");\n document.getElementById(\"dark-toggle\").checked = true;\n document.getElementById(\"output\").innerHTML = \"Dark mode is turned on.\";\n }\n }\n}", "function fecha (dia = 1, mes = 'enero'){\nreturn 'Hoy es '+ dia+ ' de '+ mes\n}", "function buildYear(){\r\n\tyear = Object.create(d); //so year is an object like Date, that we passed to this with 'd'\r\n\tyear.currentYear = d.getFullYear(); //just trying to make things quicker to get at\r\n\tyear.thisMonthNumber = d.getMonth();\r\n\r\n //month and day names.\r\n\tyear.monthNames = [\r\n\t\t\t\t\"January\",\r\n\t\t\t\t\"February\",\r\n\t\t\t\t\"March\",\r\n\t\t\t\t\"April\",\r\n\t\t\t\t\"May\",\r\n\t\t\t\t\"June\",\r\n\t\t\t\t\"July\",\r\n\t\t\t\t\"August\",\r\n\t\t\t\t\"September\" ,\r\n\t\t\t\t\"October\",\r\n\t\t\t\t\"November\",\r\n\t\t\t\t\"December\"\r\n\t\t\t],\r\n\tyear.dayNames = [\r\n\t\t\t\t\"Monday\",\r\n\t\t\t\t\"Tuesday\",\r\n\t\t\t\t\"Wednesday\",\r\n\t\t\t\t\"Thursday\",\r\n\t\t\t\t\"Friday\",\r\n\t\t\t\t\"Saturday\",\r\n\t\t\t\t\"Sunday\"\r\n\t\t\t],\r\n\r\n\tyear.currentDay = d.getDay(); //a number 0 -6\r\n\tyear.workingMonth = workingMonth;\r\n\tyear.workingDayName = workingDayName;\r\n\tyear.workingDayNum = workingDayNum;\r\n\tyear.workingDate = workingDate;\r\n\tyear.workingHour = workingHour;\r\n\tyear.daysInMonths = getDaysInMonths();//an array with each month's number of days.\r\n\r\n\tyear.weekdays = new Array(7);\r\n\t\tyear.weekdays[0] = \"Monday\";\r\n\t\tyear.weekdays[1] = \"Tuesday\";\r\n\t\tyear.weekdays[2] = \"Wednesday\";\r\n\t\tyear.weekdays[3] = \"Thursday\";\r\n\t\tyear.weekdays[4] = \"Friday\";\r\n\t\tyear.weekdays[5] = \"Saturday\";\r\n\t\tyear.weekdays[6]= \"Sunday\";\r\n\r\n\tyear.printYear = function(){\r\n\r\n\t\t$.each( year.monthNames, function( key, value ) {\r\n\t\t $(\"#rightBar\").append( \"<div id='\"+key + \"' class='mNamesRight'>\" + value.toUpperCase() + \"</div>\");\r\n\t\t $('#'+key).on(\"click\",dayBoxes);\r\n\t\t});\r\n\t};\r\n\r\n\r\n\treturn year\r\n}", "function monthCheck(month, leapYear = false){\n if(month === 'February' && leapYear === true){\n result = `${month} has 29 days in it`;\n }\n else if(month === 'February' && leapYear === false){\n result = `${month} has 28 days in it`;\n }\n else {\n switch(month) {\n case 'April':\n case 'June':\n case 'September':\n case 'November':\n result = `${month} has 30 days in it!`; \n break;\n\n case 'January':\n case 'March':\n case 'May':\n case 'July':\n case 'August':\n case 'October':\n case 'December':\n result = `${month} has 31 days in it`;\n } \n }\n console.log(result);\n}", "function returnDate() {\n var this_month = new Array(12);\n this_month[0] = \"January\";\n this_month[1] = \"February\";\n this_month[2] = \"March\";\n this_month[3] = \"April\";\n this_month[4] = \"May\";\n this_month[5] = \"June\";\n this_month[6] = \"July\";\n this_month[7] = \"August\";\n this_month[8] = \"September\";\n this_month[9] = \"October\";\n this_month[10] = \"November\";\n this_month[11] = \"December\";\n\n var this_day = new Array(7);\n this_day[0] = \"Sunday\";\n this_day[1] = \"Monday\";\n this_day[2] = \"Tuesday\";\n this_day[3] = \"Wednesday\";\n this_day[4] = \"Thursday\";\n this_day[5] = \"Friday\";\n this_day[6] = \"Saturday\";\n\n var today = new Date();\n var day = today.getDate();\n var month = today.getMonth();\n var year = today.getYear();\n var weekday = today.getDay();\n if (year< 1900) \n year += 1900;\n SrcStr = (this_day[weekday]+\", \"+day+\" \"+this_month[month]+\", \"+year);\n document.write(SrcStr);\t \n }", "function writeDate() {\n now = new Date();\n if (!now.getFullYear) now.getFullYear = _getFullYear;\n monthName = new makeMonthArray(); dayName = new makeDayArray();\n\n document.write (dayName[now.getDay() + 1] + \", \" + monthName[now.getMonth() + 1] + \" \" + now.getDate() + \", \" + now.getFullYear());\n}", "function EarthianDate() {\n // initialise date parts:\n this.year = 0;\n this.month = 0;\n this.day = 0;\n var nArgs = arguments.length;\n var paramsOk = false;\n var oDate;\n if (nArgs == 3) {\n this.year = parseInt(arguments[0], 10);\n this.month = parseInt(arguments[1], 10);\n this.day = parseInt(arguments[2], 10);\n paramsOk = true;\n } else if (nArgs == 1) {\n if (typeof arguments[0] == 'object' && arguments[0] !== null) {\n // array of values:\n oDate = arguments[0];\n // get the year:\n paramsOk = true;\n if (oDate.year !== undefined) {\n this.year = strtoint(oDate.year);\n } else if (oDate[0] !== undefined) {\n this.year = strtoint(oDate[0]);\n } else {\n paramsOk = false;\n }\n // get the month:\n if (paramsOk) {\n if (oDate.month !== undefined) {\n this.month = strtoint(oDate.month);\n } else if (oDate[1] !== undefined) {\n this.month = strtoint(oDate[1]);\n } else {\n paramsOk = false;\n }\n }\n // get the day:\n if (paramsOk) {\n if (oDate.day !== undefined) {\n this.day = strtoint(oDate.day);\n } else if (oDate[2] !== undefined) {\n this.day = strtoint(oDate[2]);\n } else {\n paramsOk = false;\n }\n }\n }\n // @todo test behaviour of preg_match here\n else if (typeof arguments[0] == 'string') {\n // this pattern matches -YYYY/MM/DD:\n var rx = '/^\\-?\\d{4}\\\\' + EarthianDate.sep + '\\d{2}\\\\' + EarthianDate.sep + '\\d{2}$/ig';\n if (preg_match(rx, arguments[0])) {\n oDate = explode(EarthianDate.sep, arguments[0]);\n this.year = strtoint(oDate[0]);\n this.month = strtoint(oDate[1]);\n this.day = strtoint(oDate[2]);\n paramsOk = true;\n }\n }\n }\n if (!paramsOk) {\n throw new Error('Invalid parameter(s) passed to EarthianDate constructor.');\n }\n}", "function agsdate(value)\n{\n\tvar ymddate = \"\"\n\tvar date = \"\"\n\tvar month = \"\"\n\tvar day = \"\"\n\tvar year = \"\"\n\tif (value == \"\")\n\t\treturn ymddate\n\tif (value == \" \")\n\t{\n\t\tymddate = \" \"\n\t\treturn ymddate\n\t}\n\tfor (var i = 0;i < value.length;i++)\n\t{\n\t\tif (value.charAt(i) >= \"0\" && value.charAt(i) <= \"9\")\n\t\t\tdate += value.charAt(i)\n\t}\n\tvar fullyear = (eval(value.length - value.lastIndexOf(\"/\") - 1) == 4) ? true : false\n\n\tif (date.length == 4)\n\t{\n\t\tmonth = date.substring(0,1)\n\t\tday = date.substring(1,2)\n\t\tyear = date.substring(2,4)\n\t}\n\tif (date.length == 5)\n\t{\n\t\tmonth = date.substring(0,1)\n\t\tday = date.substring(1,3)\n\t\tyear = date.substring(3,5)\n\t}\n\tif (date.length == 6)\n\t{\n\t\tif (fullyear)\n\t\t{\t\n\t\t\tmonth = date.substring(0,1)\n\t\t\tday = date.substring(1,2)\n\t\t\tyear = date.substring(2,6)\n\t\t}\n\t\telse\n\t\t{\t\n\t\t\tmonth = date.substring(0,2)\n\t\t\tday = date.substring(2,4)\n\t\t\tyear = date.substring(4,6)\n\t\t}\n\t}\n\tif (date.length == 7)\n\t{\n\t\tmonth = date.substring(0,1)\n\t\tday = date.substring(1,3)\n\t\tyear = date.substring(3,7)\n\t}\n\tif (date.length == 8)\n\t{\n\t\tmonth = date.substring(0,2)\n\t\tday = date.substring(2,4)\n\t\tyear = date.substring(4,8)\n\t}\n\tif (year.length == 2)\n\t{\n\t\tif (year < 70)\n\t\t\tyear = \"20\" + year\n\t\telse\n\t\t\tyear = \"19\" + year\n\t}\n\tif (month.length == 1)\n\t\tmonth = \"0\" + month\n\tif (day.length == 1)\n\t\tday = \"0\" + day\n\tymddate = \"\" + year + month + day\n\treturn ymddate\n}", "function DefDateDay(yy,mm,dd)\n{\nreturn Math.floor((Date2Days(yy,mm,dd)-2) % 7) + 1;\n}", "function birthday(day,month){\n var myDay = 20;\n var myMonth = 11;\n if(day == myDay && month == myMonth){\n console.log(\"How did you know!\");\n }\n else{\n console.log(\"Just another day.\");\n }\n}", "function dayOfTheWeekInTheMonth(yyyy, mm) {\n return new Date(yyyy, mm, 1).getDay();\n }", "function schedule_name(c){ // Input Day as integer\n // Shorten the day grabber 'cuz I ain't gonna type the whole thing out\n var o = Dates('d')\n // Condition for the Regular Schedule\n if(o == 1 || o == 3 || o == 4 || o == 5){\n // Long Version\n if(c == true){\n // Rereturn the schedule\n return(\"regular\")\n // Short Version\n }else if(c == false){\n // Returned\n return('r')\n // What happens when you don't listen\n }else{\n // Consequences of not working\n console.log(\"Not what I was expecting\")\n }\n // Condition for the Chapel/Pep Days\n }else if(o == 2){\n if(c == true){\n // \"Return to Sender\"\n return(\"chapel_pep\")\n // Condition for the short Chapel/Pep Days\n }else if(c == false){\n // The itty bitty version\n return('c')\n }else{\n // When I say Error, I mean Error\n console.log(\"Not what I was expecting\")\n }\n // THE WEEKEND\n }else if(o == 0 || o == 6){\n // Condition for the long weekend\n if(c == true){\n // Long Weekend\n return(\"Weekend\")\n // Condition for the short weekend\n }else if(c == false){\n // Shorter version of the weekend\n return('w')\n }else{\n // Sometimes referensed as an airbag\n console.log(\"Not what I was expecting\")\n }\n }else{\n // And the Errors go to this guy\n console.log(\"Error\")\n }\n }", "function shellDate(args)\n{\n var now = new Date(); \n _StdIn.putText(now.toLocaleString().split(\"(\")[0]);\n}", "function Fd(a,b,c,d){var e={s:[\"mõne sekundi\",\"mõni sekund\",\"paar sekundit\"],m:[\"ühe minuti\",\"üks minut\"],mm:[a+\" minuti\",a+\" minutit\"],h:[\"ühe tunni\",\"tund aega\",\"üks tund\"],hh:[a+\" tunni\",a+\" tundi\"],d:[\"ühe päeva\",\"üks päev\"],M:[\"kuu aja\",\"kuu aega\",\"üks kuu\"],MM:[a+\" kuu\",a+\" kuud\"],y:[\"ühe aasta\",\"aasta\",\"üks aasta\"],yy:[a+\" aasta\",a+\" aastat\"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}", "function Fd(a,b,c,d){var e={s:[\"mõne sekundi\",\"mõni sekund\",\"paar sekundit\"],m:[\"ühe minuti\",\"üks minut\"],mm:[a+\" minuti\",a+\" minutit\"],h:[\"ühe tunni\",\"tund aega\",\"üks tund\"],hh:[a+\" tunni\",a+\" tundi\"],d:[\"ühe päeva\",\"üks päev\"],M:[\"kuu aja\",\"kuu aega\",\"üks kuu\"],MM:[a+\" kuu\",a+\" kuud\"],y:[\"ühe aasta\",\"aasta\",\"üks aasta\"],yy:[a+\" aasta\",a+\" aastat\"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}", "function Fd(a,b,c,d){var e={s:[\"mõne sekundi\",\"mõni sekund\",\"paar sekundit\"],m:[\"ühe minuti\",\"üks minut\"],mm:[a+\" minuti\",a+\" minutit\"],h:[\"ühe tunni\",\"tund aega\",\"üks tund\"],hh:[a+\" tunni\",a+\" tundi\"],d:[\"ühe päeva\",\"üks päev\"],M:[\"kuu aja\",\"kuu aega\",\"üks kuu\"],MM:[a+\" kuu\",a+\" kuud\"],y:[\"ühe aasta\",\"aasta\",\"üks aasta\"],yy:[a+\" aasta\",a+\" aastat\"]};return b?e[c][2]?e[c][2]:e[c][1]:d?e[c][0]:e[c][1]}", "function dates() {\n var m = d.getMonth()+1;\n if(m<10) \n{\n m='0'+m;\n}\n var date = d.getDate();\n if(date<10) \n{\n date='0'+date;\n}\n var fy = d.getFullYear();\ndocument.getElementById(\"answer2\").innerHTML = m+\"-\"+date+\"-\"+fy;\nvar node = document.createElement(\"p\");\nnode.appendChild(document.createTextNode(m+\"/\"+date+\"/\"+fy));\ndocument.getElementById(\"answer2\").appendChild(node); \n\nvar node2 = document.createElement(\"p\");\nnode2.appendChild(document.createTextNode(date+\"/\"+m+\"/\"+fy));\ndocument.getElementById(\"answer2\").appendChild(node2); \n}", "function dayString(num){\r\n if (num == \"1\") { return \"Montag\" }\r\n else if (num == \"2\") { return \"Dienstag\" }\r\n else if (num == \"3\") { return \"Mittwoch\" }\r\n else if (num == \"4\") { return \"Donnerstag\" }\r\n else if (num == \"5\") { return \"Freitag\" }\r\n else if (num == \"6\") { return \"Samstag\" }\r\n else if (num == \"0\") { return \"Sonntag\" }\r\n}", "function calculatedayOfweek(){\n year = document.getElementById(\"year\").value;\n var CC = parseInt(year.substring(0,2));\n var YY = parseInt(year.substring(2,4));\n month = parseInt(document.getElementById(\"month\").value);\n day = parseInt(document.getElementById(\"date\").value);\n //Zellar Algorithms\n d = ( ( (CC/4) -2*CC-1) + ( (5*YY/4) ) + ((26*(month+1)/10) ) + day)%7;\n console.log(d);\n return (Math.floor(d));\n}", "function any(){\n\ttoday = new Date();\n \tstart = new Date(today.getFullYear(),00,01);\n \tdocument.write(today.getFullYear())\n}", "function dateWriter (year, month, day){\n return dateWriter.year;\n}", "function ud(a,b,c){var d={mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"};return a+\" \"+xd(d[c],a)}", "function ud(a,b,c){var d={mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"};return a+\" \"+xd(d[c],a)}", "function ud(a,b,c){var d={mm:\"munutenn\",MM:\"miz\",dd:\"devezh\"};return a+\" \"+xd(d[c],a)}", "function printCalendar(year = defaultYearValue, month = defaultMonthValue) { //set defaults for parameters to today's year and date if not provided\n var thisDate = new Date (year, month);\n var thisYear = thisDate.getFullYear();\n var thisMonth = thisDate.getMonth();\n var dateValue = thisDate.getDate(); //returns 1-31\n var dayValue = thisDate.getDay(); //returns 0-6\n var firstDate = new Date(year, month, 1);\n var firstDayValue = firstDate.getDay(); //to know which day on first row to start on\n var numberOfDaysInMonth = new Date(year, month + 1, 0).getDate();\n\n /*console.log(\"month in print cal: \" + month);\n console.log(\"year in print cal: \" + year);*/\n\t\n /*Print moth name & year*/\n document.getElementById(\"monthLabel\").innerHTML = monthNameArray[month];\n document.getElementById(\"yearLabel\").innerHTML = thisYear;\n /*Add an extra row to table if needed*/\n if(numberOfDaysInMonth + firstDayValue > 35){\n \tvar row = table.insertRow(6);\n \tvar cellIdBase = parseInt(35, 10);\n \tvar numberCellsToAdd = (numberOfDaysInMonth + firstDayValue) - 35;\n \tfor (var i=0; i< numberCellsToAdd; i++){\n \t\tvar newCellId = cellIdBase + i;\n \t\trow.insertCell(i).setAttribute(\"id\", \"c\" + newCellId);\n \t}\n }\n /*Populate calendar dates*/\n var i=0;\n do {\n document.getElementById(\"c\" + firstDayValue).innerHTML = i+1;\n dateHolder.push(i+1);\n i++;\n firstDayValue++;\n } while (i<numberOfDaysInMonth);\n}", "function UpdateDate(frequency, day, month, year){\n var yearWords = ['annual','annually', 'yearly', 'year']\n var quarterlyWords = ['quarterly', 'quarter', 'four months', '4 months']\n var monthlyWords = ['monthly', 'month']\n var int_year = Number(year)\n var int_month = Number(month)\n var updatedMonth\n var updatedYear\n var nextUpdated = day + ' ' + updatedMonth + ' ' + updatedYear\n\n function monthUpdates(int_month, frequency) {\n if (int_month + frequency > 12) {\n updatedYear = int_year + 1\n updatedMonth = `0${(int_month + frequency)% 12}`\n nextUpdated = day + ' ' + monthNames[updatedMonth] + ' ' + updatedYear\n } else if (int_month + frequency == 12) {\n nextUpdated = day + ' ' + monthNames['12'] + ' ' + year\n } else {\n updatedMonth = `0${(int_month + frequency)}`\n nextUpdated = day + ' ' + monthNames[updatedMonth] + ' ' + year\n }\n return nextUpdated\n }\n\n if (yearWords.includes(frequency.toLowerCase())) {\n updatedYear = int_year + 1\n nextUpdated = day + ' ' + monthNames[month] + ' ' + updatedYear\n } else if (quarterlyWords.includes(frequency.toLowerCase())) {\n monthUpdates(int_month, 4)\n } else if (monthlyWords.includes(frequency.toLowerCase())) {\n monthUpdates(int_month, 1)\n } else {\n nextUpdated = ''\n }\n return nextUpdated\n}", "function get_days_of_month()\r\n{\r\n var year = document.getElementById(\"year\").value;\r\n var month = document.getElementById(\"month\").value;\r\n var response = ajax_call_server( \"calculate-days.html\",\r\n \"?y=\"+year+\"&m=\"+month);\r\n eval(response);\r\n}", "function date(){\n var d = new Date();\n var date = d.getDate();\n var year = d.getFullYear();\n var month = d.getMonth();\n var monthArray = [\"January\", \"February\",\"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\",\"December\"];\n month = monthArray[month];\n document.getElementById(\"timer\").innerHTML= date +\". \"+month+\". \"+year + \" \";\n}" ]
[ "0.64971524", "0.57353896", "0.5728766", "0.5725707", "0.5725707", "0.5711261", "0.5647535", "0.56106144", "0.5603918", "0.5572516", "0.55444974", "0.5543262", "0.5528608", "0.55201995", "0.55159676", "0.5487437", "0.5484534", "0.54623497", "0.5448292", "0.5421737", "0.5385991", "0.53776", "0.53615004", "0.5356826", "0.53296036", "0.53267187", "0.53002673", "0.5296621", "0.5295012", "0.528009", "0.52799344", "0.52653265", "0.5263317", "0.5260798", "0.52427125", "0.52408683", "0.52277666", "0.5221399", "0.5218794", "0.521682", "0.5207404", "0.52014494", "0.5173158", "0.51717454", "0.5154292", "0.5153661", "0.51450855", "0.51386225", "0.5133198", "0.5132168", "0.51193285", "0.51105964", "0.510334", "0.5099361", "0.5094374", "0.50917286", "0.5084795", "0.50732696", "0.50732696", "0.50732696", "0.50732696", "0.5072525", "0.5072525", "0.5072525", "0.50674266", "0.5061998", "0.50511414", "0.5048", "0.5046697", "0.504406", "0.50383675", "0.50383323", "0.503113", "0.5030196", "0.5013776", "0.5013633", "0.50125945", "0.5012278", "0.49957865", "0.4995573", "0.49954033", "0.4957207", "0.49561208", "0.4953335", "0.49438205", "0.4936472", "0.4936472", "0.4936472", "0.49324805", "0.49323556", "0.49264547", "0.49247217", "0.49199936", "0.49180865", "0.49180865", "0.49180865", "0.4914257", "0.4914007", "0.49138927", "0.4912888" ]
0.5980034
1
N is a variable for storing the length of input string bubblesortstr is a user defind fucntion which takes the original string and sort it
function bubblesortstr(string1) { var N = string1.length; array1 = string1.split(""); for (i = 0; i < N; i++) { for (j = 0; j < N; j++) { if (array1[j + 1] < array1[j]) // comparing the adjacent element { temp = array1[j + 1]; array1[j + 1] = array1[j]; // interchanging the element array1[j] = temp; } } } console.log(array1); // prinring the sorted array return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sort1(str) {\n let ch = str.split('');\n for (let i = 0; i < str.length; i++) {\n for (let j = i + 1; j < str.length; j++) {\n if (ch[i] > ch[j]) {\n let t = ch[i];\n ch[i] = ch[j];\n ch[j] = t;\n }\n }\n }\n var sortedStr = \"\";\n for (let i = 0; i < ch.length; i++) {\n sortedStr += ch[i];\n }\n return sortedStr;\n }", "function sortByLength(strs) {\n let sortedArray = \n strs.sort((sortedArray, valueLength) => {return sortedArray.length - valueLength.length})\n return sortedArray;\n}", "function rearrange (str) {\n\tconst arrayStr = str.split(\" \");\n\t// console.log(arrayStr);\n\tvar n = str.match(/\\d/g);\n\t// console.log(n);\n\tnoNStr = str.replace(/\\d/g, \"\");\n\t// console.log(noNStr);\n\tconst arrayNoStr = noNStr.split(\" \");\n\t// console.log(arrayNoStr);\n\tlet arrangedArray = [];\n\tlet length = arrayNoStr.length;\n\t// console.log(length);\n\t// let newN = n.sort();\n\tconsole.log(n);\n\tfor (var ind = 0; ind <= arrayNoStr.length-1; ind++){\n\t//arrangedArray.splice(ind,0,`${arrayNoStr[`${n[(ind)]-1}`]}`);\n\t// console.log(n[ind])\n\t// console.log(arrayNoStr[ind])\n\tarrangedArray[parseInt(n[ind]) -1]= arrayNoStr[ind];\n\t// arrangedArray[2]= 4;\n\n\t// console.log(arrangedArray);\n\tconst arrangedStr = arrangedArray.join(\" \");\n\tconsole.log(arrangedStr);\n\n}\n\n\n}", "function sortString(str)\n{\n \n let arrayStr = str.toLowerCase().split('');\n let temp;\n for(let i = 0; i < arrayStr.length; i++)\n {\n for(let j = i + 1; j < arrayStr.length; j++){\n \n if(arrayStr[i] > arrayStr[j])\n {\n temp = arrayStr[i];\n arrayStr[i] = arrayStr[j];\n arrayStr[j] = temp;\n }\n }\n }\n return arrayStr.join('');\n }", "function bubbleSort(input) {\n\t\tfor (var i = input.length; i > 0; i--){\n\t\t\tfor (var j = input.length-i; j >= 0; j--){\n\t\t\t\tif (input[j] < input[j-1]){\n\t\t\t\t\tswap(input, j, j-1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn input;\n\t}", "function sort(str) {\n var Lowercase = str.toLowerCase()\n var arr = Lowercase.split('')\n for (var i = 0; i < arr.length; i++) {\n for (var j = 0; j < arr.length - 1 - i; j++) {\n if (arr[j] > arr[j + 1]) {\n\n var temp = arr[j]\n arr[j] = arr[j + 1]\n arr[j + 1] = temp\n\n }\n }\n }\n return arr.toString()\n}", "function bubbleSort(input){\n var length = input.length;\n for (var i = (length - 1); i >= 0; i--) {\n //Number of passes\n for (var j = (length - i); j > 0; j--) {\n //Compare the adjacent positions\n if (input[j] < input[j - 1]) {\n //Swap the numbers\n var temp = input[j];\n input[j] = input[j - 1];\n input[j - 1] = temp;\n }\n }\n }\n return input;\n}", "function sortLetters(inputString) {\n\t// your code goes here\n}", "function sortString(str){\nlet newString = str.split('').sort().join('');\nreturn newString;\n}", "function bubble_Sort(a) {\n var swapp;\n var n = a.length - 1; // 15\n var j = 0;\n var x = a;\n do {\n swapp = false;\n for (var i = 0; i < n; i++) {\n if (x[i] < x[i + 1]) {\n var temp = x[i];\n x[i] = x[i + 1];\n x[i + 1] = temp;\n swapp = true;\n }\n }\n n--;\n } while (swapp);\n return x;\n}", "function sortingHat(string){\n return string.length % house.length;\n}", "function sort_string(string){\n var stringArray = string.toLowerCase().split(' '); //lowercased array of strings separated by commas\n var sortedArray = stringArray.sort(function(a,b){\n return (a.length - b.length);\n });\n console.log(sortedArray);\n}", "function helperSort(str) {\n if (str.length < 2) {\n return str\n }\n let pivot = str[0]\n let front = ''\n let back = ''\n for (let i = 1; i < str.length; i++) {\n if (str[i] > pivot) {\n back += str[i]\n }\n else {\n front += str[i]\n }\n }\n return helperSort(front) + pivot + helperSort(back)\n}", "function urutkanAbjad(str) {\n // you can only write your code here!\n var huruf = 'abcdefghijklmnopqrstuvwxyz',\n sort = '';\n for (let a = 0; a < huruf.length; a++) {\n for (let b = 0; b < str.length; b++) {\n if (huruf[a] === str[b]) {\n sort += huruf[a];\n }\n }\n }\n return sort ;\n}", "function sortString(str) {\n return Array.from(str).sort();\n}", "bubbleSort(size) {\n try {\n var arr = [];\n for (let i = 0; i < size; i++) {\n arr[i] = readline.question(\"Enter the elements : \");\n\n }\n for (let i = 0; i < arr.length; i++) {\n for (let j = i + 1; j < arr.length; j++) {\n if (arr[i] > arr[j]) {\n var temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n }\n\n }\n console.log(arr);\n\n }\n catch (error) {\n console.log(error.message);\n\n }\n}", "function descendingOrder(n) {\n let str = n.toString();\n\n if (str.length === 1) {\n return n;\n } else {\n let array = str.split('');\n let counter = 0;\n for (let i = 1; i < array.length; i++) {\n if (array[i] === array[i - 1]) {\n counter++;\n }\n }\n if (counter === array.length) {\n return n;\n } else {\n let sortedArray = array.sort((a, b) => b - a);\n const result = sortedArray.join('').toString();\n return parseInt(result);\n }\n }\n\n // console.log(array);\n}", "function arrange()\r\n{\r\n var x,output=\"\";\r\n var str=document.getElementById(\"txt8\").value;\r\n var strArray=str.split(\",\");\r\n console.log(strArray);\r\n out=strArray.sort();\r\n console.log(out);\r\n for(x in strArray)\r\n {\r\n output+=strArray[x]+\"<br>\";\r\n }\r\n document.getElementById(\"output8\").innerHTML=output;\r\n}", "function bubbleSort(arr, n) {\n\n // Base case. important\n if (n === 1) return;\n\n // One pass of bubble\n // sort. After this pass,\n // the largest element\n // is moved (or bubbled)\n // to end.\n\n for (let i = 0; i < n - 1; i++) {\n // if current is more than next\n if (arr[i] > arr[i + 1]) {\n\n // swap arr[i], arr[i+1]\n let temp = arr[i];\n arr[i] = arr[i + 1];\n arr[i + 1] = temp;\n }\n }\n\n // Largest element is fixed, whicn is similar to iterative bubble sort after one pass\n // recur for remaining array\n // n - 1 will be used to restrict array size loop. similar to n - i - 1 in iterative version\n bubbleSort(arr, n - 1);\n}", "function order(str) { \r\n\r\n return str.split(\"\").sort().join(\"\");\r\n \r\n}", "function urutkanAbjad2(str) {\n return str.split('').sort().join('')\n}", "function bubbleSort(input){\n let swap;\n let endIndex = input.length;\n while (endIndex--){\n swap = false;\n for (let i = 0; i < endIndex; i++) {\n if (input[i] > input[i + 1]) {\n [input[i], input[i + 1]] = [input[i + 1], input[i]];\n swap = true;\n }\n }\n if (!swap) { break; }\n }\n return input;\n}", "function bubbleSort(input){\n let x;\n for (let j = 0; j < input.length; j++){\n for (let i = 0; i < input.length; i++){\n if (input[i] > input[i+1]){\n x = input[i];\n input[i] = input[i+1];\n input[i+1] = x;\n } \n }\n }\n console.log(input);\n}", "function solve(s, k){\r\n let sortedVar = s.split(\"\").sort().slice(0,k)\r\n console.log(sortedVar)\r\n for(let i=0; i<sortedVar.length; i++) s=s.replace(sortedVar[i],\"\");\r\n console.log(s)\r\n return s;\r\n}", "function lengthSort(arr) {\n const strLength = arr.sort((a, b) => {\n return a.length > b.length\n })\n return strLength\n}", "function shorterString(string1, string2, string3, string4, string5) {\r\n let strings = [string1, string2, string3, string4, string5];\r\n return console.log(strings.sort((a, b) => a.length - b.length)[0]);\r\n}", "function sortMyString(S) {\n var odds = []\n var evens = []\n var arr = S.split('')\n arr.forEach((val, i) => i%2 === 0 ? evens.push(val) : odds.push(val))\n return `${evens.join('')} ${odds.join('')}`;\n}", "function alphaSort(str)\n//converting the function into an array & converting back into string.\n {\nreturn str.split('').sort().join('');\n }", "function sortByLength(strings) {\n const stringClone = [...strings];\n\n stringClone.sort((a, b) => a.length - b.length);\n\n // stringClone.sort(function(a, b) {\n // return a.length - b.length;\n // });\n return stringClone;\n}", "function getSortedString(string){\n return string.split(\"\").sort().toString(); \n}", "function main() {\n var n = parseInt(readLine());\n var a = readLine().split(' ').map(Number);\n var totalSwaps = 0;\n for (var i = 0; i < n; i++) {\n var numberOfSwaps = 0;\n for (var j = 0; j < n - 1; j++) {\n if (a[j] > a[j + 1]) {\n var temp = a[j];\n a[j] = a[j + 1];\n a[j + 1] = temp;\n numberOfSwaps++;\n totalSwaps++;\n }\n }\n if (numberOfSwaps == 0) {\n break;\n }\n }\n console.log(\"Array is sorted in \" + totalSwaps + \" swaps.\");\n console.log(\"First Element: \" + a[0]);\n console.log(\"Last Element: \" + a[n - 1]);\n}", "function orderWeight(strng) {\n\n const sumOf = (str) => {\n let sum =0;\n for(n of str)\n sum=sum+parseInt(n)\n return sum\n }\n\n return strng\n .split(' ')\n .sort((a, b) => {return (\n sumOf(a) === sumOf(b) ?\n a - b : sumOf(a) - sumOf(b)\n )})\n .join(' ')\n}", "function getSortedString(string) {let sortStrin = string.split(\"\"); sortStrin.sort(); return sortStrin.join(\"\");\r\n}", "function descendingOrder(n){\n return Number((n + \"\").split(\"\").map(Number).sort((a,b)=>b-a).join(\"\"));\n}", "function bubble(){\n\n\talgorithm = \"bubbleSort\";\n\n\ttakeInputFromUser();\n\n\tcreateColumnFromUserInput();\n\n\tbubbleSort(digits);\n\n\n}", "function bubbleSort() {\n\t\n\tvar i, j, k, len;\n\n\tvar tempIndex = [];\n\tvar tempDigits = [];\n\tvar trackPosition = [];\n\n\tlen = inputDigits.length;\n\n\t/*---------- this array for keeping record of index ----------*/\n\t\n\tfor(i = 0; i < len; i++){\n\n\t\ttempIndex.push(i + 1);\n\t}\n\n\n\t/*---------- this array for tracking positions ----------*/\n\t\n\tfor(i = 0; i < len; i++){\n\n\t\ttrackPosition.push(i + 1);\n\t}\n\n\n\t/*---------- this array for copying inputDigits array ----------*/\n\t\n\ttempDigits = inputDigits;\n\n\n\n\tcontrolStripe.push(\"start\");\n\n\n\tcontrolStripe.push(\"start i\");\n\n\tfor(i = 0; i < len; i++){\n\n\n\t\tcontrolStripe.push(\"start j\");\n\n\t\tfor(j = 0; j < len-i-1; j++){\n\n\t\t\tcontrolStripe.push(\"swap check\");\n\t\t\tcontrolStripe.push(trackPosition);\n\n\t\t\t/*---------- send checking elements for better visualization ----------*/\n\t\t\tcontrolStripe.push([j, j+1]);\n\n\n\t\t\tif(tempDigits[j] > tempDigits[j + 1]){\n\n\t\t\t\ttempDigits.swap(j, j + 1);\n\t\t\t\ttempIndex.swap(j, j + 1);\n\n\t\t\t\t/*---------- create fresh trackPosition array & copy index from\n\t\t\t\t\t\t\t tempIndex to prevent js array tracking ----------*/\n\t\t\t\t\n\n\t\t\t\ttrackPosition = [];\n\n\t\t\t\tfor(k = 0; k < len; k++){\n\n\t\t\t\t\ttrackPosition.push(tempIndex[k]);\n\t\t\t\t}\n\n\n\n\t\t\t\tcontrolStripe.push(\"swap\");\n\t\t\t\tcontrolStripe.push(trackPosition);\n\n\t\t\t}\n\n\t\t\tcontrolStripe.push(\"mark j\");\n\t\t}\n\n\t\tcontrolStripe.push(\"mark i\");\n\t}\n\n\tcontrolStripe.push(\"end\"); console.log(controlStripe);\n}", "function descendingOrder(n){\n return Number(String(n).split('').sort((a,b) => b - a).join(''))\n\n}", "function tengerms() {\n document.getElementById(\"bubble\").innerHTML = bubbleSort([7, 5, 2, 4, 3, 9, 10, 2, 3, 4]); //[2, 3, 4, 5, 7, 9]\n}", "function urutkanAbjad(str) {\n var temp = [];\n var result = '';\n\n for(var i=0; i<str.length; i++) {\n temp.push(str[i]);\n }\n temp.sort(function(a,b) {return a>b});\n for(var i=0; i<temp.length; i++) {\n result += temp[i];\n }\n return result;\n}", "function swapChars(str, n = 3){\r\n\t\t\r\n\tlet arr = [];\r\n\r\n\tfor (let i = 0; i < str.length; i=i+n){\r\n\t\t\r\n\t\tarr.push(str.slice(i,i+n));\r\n\r\n\t}\r\n\t\r\n\tfor (let j = 0; j < arr.length; j++){\r\n\t\t\r\n\t\tif(arr[j].length==n){\r\n\t\t\r\n\t\t\tlet shrtStr = arr[j].split('')\r\n\t\t\tshrtStr.push(arr[j][0]);\r\n\t\t\tshrtStr.shift();\r\n\t\t\tarr[j]=shrtStr.join('');\r\n\t\t\t\r\n\t\t}\r\n\t}\r\n\r\n\treturn arr.join('');\r\n\r\n}", "function stringSortFunction(a, b) {\n if (a < b) {\n return -1\n } else if (a === b) {\n return 0\n } else {\n return 1\n }\n}", "function sortLength(arr){\n return arr.sort((a,b) => {\n if(a.length === b.length){\n return b.length - a.length\n }else{\n return a.localeCompare(b)\n }\n })\n}", "function descendingOrder(n) {\r\n return parseInt(n.toString().split(\"\").sort().reverse().join(\"\"));\r\n}", "function solve(inputStr){\r\n\r\n if(isNearPalindrome(inputStr) === false){\r\n var s = inputStr.split(\"\").sort();\r\n \r\n var nOperations = 0;\r\n var first = 0;\r\n var last = s.length -1;\r\n\r\n var incremented = 0;\r\n\r\n while(first < last){\r\n if(s[first] !== s[last]){\r\n incremented = Math.min(inputStr.charCodeAt(first++), inputStr.charCodeAt(last--)) + 1;\r\n nOperations++;\r\n }\r\n } \r\n return nOperations;\r\n }\r\n else {\r\n return -1;\r\n }\r\n}", "function descendingOrder(n){\n return parseInt(n.toString()\n .split('')\n .sort( function(a, b) {\n return a < b;\n })\n .join(''));\n}", "function descendingOrder(n){\n return +n.toString().split('').sort((a, b) => b-a).join('');\n}", "function descendingOrder(n) {\n return +n.toString().split('').sort().reverse().join('');\n}", "function intermediate2(input) {\n input += \"\";\n return parseInt(input.split(\"\").sort(function (a, b) { return b - a }).join(\"\"));\n}", "function createPerm(n) {\n if (n == 1) {\n   var repeat = false;\n   for (var x = 0; x < str.length; x++) {\n     if (str[x] == str[x+1]){repeat = true; break;}\n     }\n     if (!repeat) {count+=1;}\n   } else {\n   for (var i = 0; i < n; i++) {\n       createPerm(n-1);\n       if (n % 2 === 0) {swap(i, n-1);}\n       else {swap(0, n-1);}\n     }\n   }\n }", "function urutkanAbjad(str) {\n // you can only write your code here!\n var alphabet = 'abcdefghiklmnopqrstuvwxyz'\n var sortHuruf = ''\n var huruf = []\n for (var i = 0; i < str.length; i++) {\n sortHuruf = alphabet.indexOf(str[i])\n huruf.push(sortHuruf)\n }\n huruf.sort(function(value1, value2) { return value1 > value2 });\n \n var sortKata = ''\n for (var j = 0; j < huruf.length; j++) {\n sortKata = sortKata + alphabet[huruf[j]]\n }\n return sortKata\n }", "function chuckPushUps(string) {\n\nif (string !==string.toString() || string.length < 1) {\n return 'FAIL!!';\n }\n\n string = string.replace(/[^10 ]/g, '').split(' ');\n var newArr = [];\n\n for (var i = 0; i < string.length; i++) {\n if (string[i].length > 0) {\n \t\tnewArr.push(parseInt(string[i], 2));\n \t}\n }\n newArr.sort(function(a, b) {\n \treturn a-b;\n });\n\n if (newArr.length === 0) {\n return \"CHUCK SMASH!!\";\n }\n\n return newArr[newArr.length-1];\n }", "function sortString(str){\n\tvar sortedStr = str;\n\tvar isSorted = false;\n\tvar idx = 0;\n\twhile(!isSorted){\n\t\tvar swap = idx+1;\n\t\tif(idx === sortedStr.length){\n\t\t\tisSorted = true;\n\t\t}\n\t\telse if(sortedStr[swap] < sortedStr[idx]){\n\t\t\tvar newStr = sortedStr.substring(0, idx)+sortedStr[swap]+sortedStr[idx]+sortedStr.substring(swap+1); \n\t\t\tsortedStr = newStr;\n\t\t\tidx=0;\n\t\t}\n\t\telse{\n\t\t\tidx++;\n\t\t}\n\t}\n\n\treturn sortedStr;\n}", "function bubbleSort(num){\n for(let i = num.length; i >= 0; i--){\n for(let j = 0; j < i - 1; j++){\n console.log(num , num[j], num[j +1]);\n if(num[j] > num[j + 1]){\n let temp = num[j];\n num[j] = num[j + 1];\n num[j + 1] = temp;\n }\n }\n }\n return num\n}", "function sortByLength (array) {\n var temp = \"\";\n for (var i = 0; i < array.length ; i++){\n var j = i;\n while(j > 0 && array[j-1].length > array[j].length){\n temp = array[j]\n array[j] = array[j-1];\n array[j-1] = temp;\n j--\n }\n }\n return array;\n}", "function dataHandling2(str) {\n str.splice(1, 1, \"Roman Alamsyah Elsharawy\");\n str.splice(2, 1, \"Provinsi: Bandar Lampung\");\n str.splice(4, 1, \"Pria\", \"SMA Internasional Metro\");\n console.log(str);\n\n str.slice(3, 4);\n var irisan2 = str[3].split(\"/\");\n\n switch (irisan2[1]) {\n case('01'):\n irisan2[1] = 'januari';\n break;\n case('02'):\n irisan2[1] = 'februari';\n break;\n case('03'):\n irisan2[1] = 'maret';\n break;\n case('04'):\n irisan2[1] = 'april';\n break;\n case('05'):\n irisan2[1] = 'mei';\n break;\n case('06'):\n irisan2[1] = 'juni';\n break;\n case('07'):\n irisan2[1] = 'juli';\n break;\n case('08'):\n irisan2[1] = 'agustus';\n break;\n case('09'):\n irisan2[1] = 'september';\n break;\n case('10'):\n irisan2[1] = 'oktober';\n break;\n case('11'):\n irisan2[1] = 'november';\n break;\n case('12'):\n irisan2[1] = 'desember';\n break;\n}\n console.log(irisan2[1]);\n\n var sortArr = (str[3].split(\"/\")).sort(function(value1, value2) {return value2 - value1});\n\n console.log(sortArr);\n console.log((str[3].split('/')).join('-'));\n console.log(str[1].slice(0, 15));\n}", "function descendingOrder(n) {\n return parseInt(n.toString().split(\"\").sort().reverse().join(\"\"));\n }", "function processData(input) {\n //var sorted = [];\n //var unsorted = [];\n var swap;\n var swapCt = 0;\n var min;\n var size;\n var val;\n\n input = input.split('\\n');\n size = input[0];\n //unsorted\n arr = input[1].split(' ').map(Number);\n \n for (var i = 0 ; i < size - 1 ; i++ ) {\n \n if (arr[i] > arr[i + 1]) {\n // Splice out val that is out of order\n val = arr.splice(i + 1,1);\n \n // Find where val belongs in sorted portion of arr ([0] thru [i])\n j = 0;\n while ((val > arr[j]) && (j < i)) {\n j++ \n }\n arr.splice(j,0,val);\n swapCt++; \n }\n }\n \n console.log(swapCt);\n //process.stdout.write(swapCt);\n}", "function sortString(input) {\n\n var result = input.toLowerCase().split(\"\").sort().join(\"\");\n\n return result;\n}", "function descendingOrder(n){\n if (n < 10){\n return n;\n }\n\n var arr = (\"\"+n).split(\"\");\n var sorted = arr.sort();\n sorted = sorted.reverse();\n var result = sorted.join(\"\");\n return parseInt(result);\n}", "function BubbleSort(arr){\n var n = arr.length;\n while(n > 1){\n for (var i = 0; i < n - 1; i++){\n if (arr[i] > arr[i + 1]){\n var temp = arr[i];\n arr[i] = arr[i + 1];\n arr[i + 1] = temp;\n }\n }\n n--;\n }\n return arr;\n }", "function sortArr(arr, word){\n\n\tvar index = 1;\n\n\twhile((index<arr.length) && arr[arr.length-index].text.length > arr[arr.length-index-1].text.length) {\n\t\tvar temp = arr[arr.length-index];\n\t\tarr[arr.length-index] = arr[arr.length-index-1];\n\t\tarr[arr.length-index-1] = temp;\n\t\tindex++;\n\t}\n\n\tconsole.log(arr);\n\n}", "function sortLetter(newString) {\n var alphabet=newString.split('').sort().join('');\n console.log(alphabet);\n\n}", "function prizeStrings(n) {\n var i;\n //init state for n = 1\n var count = {\n //total prize string\n total: 3,\n //prize string with no A in the front\n nWOA: 2,\n //prize string with one A in the front\n nA: 1,\n //prize string with a L\n nL: 1,\n //prize string starts with no A, with one L\n nLWOA: 1,\n //prize string starts with one A, has one L\n nLA: 0\n };\n //new counts for the next iteration\n var total, nWOA, nA, nL;\n for (i = 2; i <= n; i++) {\n //iteratively add one day in front\n total = count.total + //starts with O\n count.nWOA + count.nA + //starts with A\n (count.total - count.nL); //starts with L\n nWOA = count.total + //starts with O\n (count.total - count.nL); //starts with L\n nA = count.nWOA; //starts with A \n nL = count.nL + //starts with O\n count.nLWOA + count.nLA + //starts with A\n (count.total - count.nL); //starts with L\n nLWOA = count.nL + //starts with O\n count.total - count.nL; //starts with L\n nLA = count.nLWOA; //starts with A\n\n count = {\n total: total,\n nWOA: nWOA,\n nA: nA,\n nL: nL,\n nLWOA: nLWOA,\n nLA: nLA\n };\n }\n return count.total;\n}", "function main(){\n var n=parseInt(readLine());\n a=readLine().split(' ');\n a=a.map(Number);\n var totalSwitches=0;\n \n for(var i=0;i<n;i++){\n var numberOfSwitches=0;\n for(var j=0;j<n-1;j++){\n if(a[j]>a[j+1]){\n switchIt(j,j+1,a);\n numberOfSwitches++;\n totalSwitches++;\n }\n }\n if(numberOfSwitches==0){break;}\n }\n console.log(\"Array is sorted in \" + totalSwitches+\" swaps.\");\n console.log(\"First Element: \"+a[0]);\n console.log(\"Last Element: \"+a[n-1]);\n\n}", "function sortByStrings(s, t) {\n let sortedArr = '';\n\n let i = 0;\n while (i < t.length) {\n for (let j = 0; j < s.length; j++) {\n if (s[j] === t[i]) {\n sortedArr += s[j]\n }\n }\n i++\n }\n\n return sortedArr\n}", "function bubbleSort(arr){\n // [9,8,7,6,5,4]\n for(var i = 0;i < (arr.length - 1);i++){\n // 循环 arr.length - 1 轮; 比如6个长度,要比较5次。\n for(var j = 0; j < (arr.length - (i + 1));j++){\n //第(i+1)轮时,在该轮下要 执行 length - (i+1) 次比较;\n // 比如: 第 1 轮(i = 0)时,要在第 1轮下, 比较 6 - ( 0+1) =5 次。\n //也就是说 i =0 时, j =5 , i =1 时,j =4.\n if (arr[j] > arr[j+1]){\n var temp = arr[j];\n arr[j] = arr[j+1];\n arr[j+1] = temp;\n }\n }\n }\n return arr;\n}", "function frequencySort(s) {\n\t\n}", "function KUniqueCharacters(str) { \nlet arr = [];\nlet longest = str[0];\n \nfor (let i=1; i<str.length; i++) {\n let table = {}\n let ans = \"\"\n let count = 0\n for (let j=i; j<str.length; j++) {\n if (table[str[j]] === undefined) { \n table[str[j]] = 1\n count++\n }\n if (count <= str[0]) {\n ans += str[j]\n }\n }\n if (ans.length > longest) {\n longest = ans.length\n arr.push(ans)\n }\n}\nreturn arr.sort(function(a,b) {return b.length-a.length})[0]\n}", "function descendingOrder(n) {\n return Number(\n String(n)\n .split(\"\")\n .sort((a, b) => b - a)\n .join(\"\")\n );\n}", "function alphabits(str) {\n let newArr = str.split(\"\");\n let alphaB = newArr.sort();\n let merge = alphaB.join(\"\");\n\n document.getElementById(\"output1\").innerHTML = str.split(\"\").sort().join(\"\");\n\n}", "function high(x){\n const alphabet = 'abcdefghijklmnopqrstuvwxyz';\n let strArray = x.split(' '); \n let wordSums = {};\n let sortable = [];\n\n strArray.forEach(function(word){\n let sum = 0;\n word.split('').forEach(function(letter){\n sum += alphabet.indexOf(letter) + 1; \n })\n wordSums[word] = sum;\n })\n\n for (let word in wordSums) {\n sortable.push([word, wordSums[word]]);\n }\n\n sortable.sort(function(a, b) {\n return b[1] - a[1];\n });\n console.log(sortable);\n return sortable[0][0]; \n}", "function bubble2Sort(values) {\n var count = backcount = 0;\n if (values.length <= 1) {\n return count;\n }\n function sort(list, index) {\n if (list[index + 1] < list[index]) {\n bubbles.push([index, list[index + 1], index + 1, list[index]]);\n var temp = list[index];\n list[index] = list[index + 1];\n list[index + 1] = temp;\n sorting = true;\n count++;\n }\n if (index < list.length - 2)\n sort(list, index + 1);\n else if (sorting) {\n sorting = false;\n backsort(list, index);\n }\n }\n function backsort(list, index) {\n if (list[index - 1] > list[index]) {\n bubbles.push([index, list[index - 1], index - 1, list[index]]);\n var temp = list[index];\n list[index] = list[index - 1];\n list[index - 1] = temp;\n sorting = true;\n backcount++;\n }\n if (index > 1)\n backsort(list, index - 1);\n else if (sorting) {\n sorting = false;\n sort(list, index);\n }\n }\n var sorting = true;\n sort(values, 0);\n return count + backcount;\n}", "function bubbleSort(a) {\n let timeStart = Date.now();\n let swapp;\n let n = a.length - 1;\n let x = a;\n do {\n swapp = false;\n for (var i = 0; i < n; i++) {\n if (x[i] > x[i + 1]) {\n var temp = x[i];\n x[i] = x[i + 1];\n x[i + 1] = temp;\n swapp = true;\n }\n }\n n--;\n } while (swapp);\n\n let timeEnd = Date.now();\n return { text: `bubble sort time ${timeEnd - timeStart}`, result: a };\n}", "function smooshSort(str) {\n return str\n .replace(/\\s+/g, '') // Remove whitespace\n .split('') // Turn the string into a list of characters\n .filter(char => char) // Filter out strange falsy characters\n .sort() // Sort the characters alphabetically\n .join(''); // Turn the sorted characters back into a string\n}", "function nonComparisonSortStrings(arr){\n let sortedArr = arr.slice();\n\n for (let i = arr.length - 1; i > - 1; i-- ){\n let buckets = new Array(26).fill(0).map(() => new Array());\n\n sortedArr.forEach(function(word) {\n let letter = word[i];\n let letterNum = letter.charCodeAt(0) - 97\n buckets[letterNum].push(word);\n })\n\n let updatingArr = []\n\n buckets.forEach(function(bucket) {\n bucket.forEach(function(word) {\n updatingArr.push(word)\n })\n })\n\n sortedArr = updatingArr;\n }\n\n return sortedArr;\n}", "function countSort(arr) {\n let half = Math.floor( arr.length / 2 );\n let sorted = [];\n // console.log(half, arr.length);\n for (let i = 0; i < arr.length; i++) {\n const element = arr[i];\n let word = element[1]; \n while(sorted.length <= element[0]){\n sorted.push([]);\n }\n if(i < half){\n word = '-';\n }\n sorted[element[0]].push(word);\n }\n console.log(sorted.flat().join(' '));\n}", "function _alphaNumSort(m,n) {\n var a = m.url.toLowerCase()\n var b = n.url.toLowerCase()\n if (a === b) { return 0 }\n if (isNaN(m) || isNaN(n)) { return (a > b ? 1 : -1) }\n else { return m-n }\n }", "function bubblesort(){\n\tfor(var i = 0; i < numbers.length - 1; i ++){\n\t\tif(numbers[i] > numbers[i+1]) {\n\t\t\tswap(numbers, i, i+1);\n\t\t}\n\t}\n}", "function bubbleSort(items){\n\tvar length = items.length;\n\tfor(var i = 0; i < length; i++){\n\t\tfor(var j = 0; j < (length - i); j++){\n\t\t\tif(items[j] > items[j+1]){\n\t\t\t\tvar tmp = items[j];\n\t\t\t\titems[j] = items[j+1];\n\t\t\t\titems[j+1] = tmp;\n\t\t\t}\n\t\t}\n\t} //number of passes\n}", "function bubbleSort(arr){\r\n\tlen=arr.length;\r\n\tfor (j=1; j<len;j++ ){\r\n\t\tfor (i=0; i<len-j;i++){\r\n\t\t\tif (arr[i]>arr[i+1]){\r\n\t\t\t\tx=arr[i];\r\n\t\t\t\tarr[i]=arr[i+1];\r\n\t\t\t\tarr[i+1]=x;\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\treturn arr;\r\n}", "makeSort(title) {\n if (!_.isString(title)) {\n return title;\n }\n\n // Pad numbers\n return title\n .toLowerCase()\n .replace(/([0-9]+)/g, (match, number) => {\n return number.padStart(8, '0');\n })\n .replace(/\\s+/g, ' ')\n .replace(/[^0-9a-z\\s]/gi, '');\n }", "shellsortDynamic() {\n const N = this.dataStore.length;\n let h = 1;\n\n while (h < N/3) {\n h = 3 * h + 1;\n }\n\n while (h >= 1) {\n for (let i = h; i < N; i++) {\n for (let j = i; j >= h && this.dataStore[j] < this.dataStore[j-h]; j -= h) {\n swap(this.dataStore, j, j-h);\n }\n }\n \n h = (h-1)/3;\n }\n }", "function flipEveryNChars(input, n){\n \n arr = input.split('');\n final = [];\n for (var i=0; i<arr.length-4; i=i+5){\n arr1 = arr.slice(i,n+i);\n arr1.reverse();\n final = final.concat(arr1);\n }\n \n final = final.concat(arr.slice(i,arr.length)); //concat the remainder as-is\n final = final.join('');\n \n return final;\n}", "function descendingOrder(n){\n n = String(n).split(''); // make from number aaray \n \n function compare(a, b) {\n if (a>b) return 1;\n if (a<b) return -1;\n }\n n = n.sort(compare); // sort the array\n n = n.reverse(); // \n n = n.join(''); // make string from array\n n = parseInt(n, 10); // \n return n;\n}", "function Sort() {}", "function bubbleSort(numbers) {\n for (var i=0; i<numbers.length-1; i++) {\n bubble(numbers);\n }\n}", "function moreThan(str, n) {\n var tr = str;\n var length = str.length;\n\n if (length >= n) {\n var first = tr.slice(0, Math.round(length / 2));\n var second = tr.slice(Math.round(length / 2));\n\n tr = first + '-' + second;\n }\n\n return tr;\n}", "static sort(arr) {\n const n = arr.length;\n \n for (let i = 1; i < n; i++) {\n for (let j = i; j > 0 && less(arr[j], arr[j - 1]); j--) {\n swap(arr, j, j - 1);\n }\n }\n }", "function sortString(s) {\n let input = s.split('');\n let result = [];\n\n let currentLetter;\n let getSmallest = true;\n\n while (input.length !== 0) {\n let index;\n\n if (getSmallest) {\n index = getNextLargestLetter(input, currentLetter);\n } else {\n index = getNextSmallestLetter(input, currentLetter);\n }\n\n if (index === undefined) {\n getSmallest = !getSmallest;\n currentLetter = undefined;\n } else {\n const lastLetter = input.splice(index, 1);\n currentLetter = lastLetter;\n result.push(currentLetter);\n }\n }\n\n return result.join('');\n}", "function sortByString(s,t) {\n let finalStr = [];\n for (let i = 0; i < t.length; i++) {\n let first = s.split('').filter(letter => letter === t[i]);\n finalStr = finalStr.concat(first);\n }\n return finalStr.join('');\n }", "function bubbleSort(arr){\n var length = arr.length;\n\n for (var i = length; i > 0; i--){\n\n for (var j = 0; j < i; j++){\n var tempHolder = 0;\n if (arr[j] > arr[j + 1]){\n tempholder = arr[j];\n arr[j] = arr[j + 1];\n arr[j + 1] = tempholder;\n }\n }\n\n }\nreturn arr\n}", "function descendingOrder(n){\r\n var arr = n.toString().split('').map(Number);\r\n var sortedArr = arr.sort((a,b) => b - a);\r\n var result = sortedArr.join('');\r\n var final = parseInt(result);\r\n return final;\r\n}", "sort() {\n const a = this.dict;\n const n = a.length;\n\n if( n < 2 ) { // eslint-disable-line \n } else if( n < 100 ) {\n // insertion sort\n for( let i = 1; i < n; i += 1 ) {\n const item = a[ i ];\n let j = i - 1;\n while( j >= 0 && item[ 0 ] < a[ j ][ 0 ] ) {\n a[ j + 1 ] = a[ j ];\n j -= 1;\n }\n a[ j + 1 ] = item;\n }\n } else {\n /**\n * Bottom-up iterative merge sort\n */\n for( let c = 1; c <= n - 1; c = 2 * c ) {\n for( let l = 0; l < n - 1; l += 2 * c ) {\n const m = l + c - 1;\n const r = Math.min( l + 2 * c - 1, n - 1 );\n if( m > r ) continue;\n merge( a, l, m, r );\n }\n }\n }\n }", "function bubbleSort(arr) {\n const n = arr.length;\n for (let i = 0; i < n - 1; i++) {\n let swapped = false;\n for (let j = 0; j < n - i - 1; j++) {\n if (arr[j] > arr[j + 1]) {\n [arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];\n swapped = true;\n }\n }\n if (swapped === false) break;\n }\n console.log(arr);\n}", "function insertionSort1(n, arr) {\n \n var un = arr[n-1]\n \n for(var i=0;i<n;i++) {\n if(arr[n-(i+2)]>un) {\n arr[n-(i+1)]=arr[n-(i+2)]\n console.log(arr.join(' '))\n } else {\n arr[n-(i+1)]=un\n console.log(arr.join(' '))\n break\n }\n \n }\n\n}", "function descendingOrder(n) {\n let newN = n.toString().split('').sort(function (a, b) {\n return b - a;\n }).join('');\n //transform string newN to an integer using + operator\n return +newN;\n}", "function descendingOrder(n){\n let nString = n.toString();\n let nSplit = nString.split(\"\");\n let nSort = nSplit.sort();\n let nReverse = nSort.reverse();\n let nJoin = nReverse.join(\"\")\n let nBackNumber = Number(nJoin);\n\n return nBackNumber;\n }", "function descendingOrder(n){\n //split number into array of individual nums, itterate through and compare each number to previous and sort in decending order,\n //join back the sorted array into string, and turn string into number\n return Number(n.toString().split('').sort((a,b) => {return b - a}).join(''))\n}", "function bubbleSort(arr) {\n const len = arr.length\n for (let i = 0; i < len; i++) { // 让思想重复五次\n let flag = false\n for (let j = 0; j < len - 1 - i; j++) {\n if (arr[j] > arr[j + 1]) { // 前后对比四轮\n [arr[j], arr[j + 1]] = [arr[j + 1], arr[j]]\n flag = true\n }\n }\n if (flag == false) return arr\n }\n return arr\n}", "function alphabetizedString(str) {\n let alphString = str.split(\"\").sort().join(\"\");\n console.log(\"The user string alphabetized is: \" + alphString);\n var box2El = document.getElementById('box2');\n box2El.innerHTML = alphString;\n }" ]
[ "0.64325565", "0.6428913", "0.6418866", "0.6244005", "0.62376136", "0.6189806", "0.61884594", "0.61314595", "0.6126883", "0.6090425", "0.60602653", "0.604549", "0.6025641", "0.6012491", "0.5975277", "0.59749675", "0.5952824", "0.5949403", "0.59107333", "0.590172", "0.58840454", "0.58820075", "0.58559173", "0.5853463", "0.5837871", "0.58299756", "0.5824033", "0.5820645", "0.5800323", "0.5798863", "0.579196", "0.5776962", "0.5754803", "0.5752072", "0.5749178", "0.5743784", "0.5739641", "0.5733081", "0.5726308", "0.5725178", "0.57079387", "0.57063365", "0.5702825", "0.57024884", "0.57008666", "0.5687593", "0.5684112", "0.56812125", "0.56783336", "0.5654207", "0.56456923", "0.56434685", "0.5620717", "0.56182945", "0.5600039", "0.5595949", "0.558516", "0.5581715", "0.5565959", "0.5561184", "0.55528146", "0.55401725", "0.55349845", "0.5528468", "0.55250406", "0.5522293", "0.55074203", "0.5507065", "0.5507041", "0.55004936", "0.54957986", "0.5493811", "0.54875904", "0.54869825", "0.5485365", "0.5476741", "0.54714644", "0.54663646", "0.54612046", "0.54572296", "0.54566324", "0.5454644", "0.545188", "0.5445991", "0.5441682", "0.5434135", "0.5433948", "0.543169", "0.5425796", "0.5418817", "0.5418125", "0.54162455", "0.5408153", "0.5404476", "0.54016334", "0.53994215", "0.5393405", "0.53894067", "0.53873366", "0.5384645" ]
0.73217493
0
c is a variable storing temperature in celsius
function convert(T, choice) { f = T; if (choice == 1) { f = (c * 9 / 5) + 32; console.log(`Temperature in Fahrenheit: ${f}`); } else if (choice == 2) { c = (f - 32) * 5 / 9; console.log(`Temperature in celsius: ${c}`); } else console.log("You have enter a wrong input"); return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function FtoC(temperature) {\n let celcius = Math.floor(((temperature - 32) * 5) / 9);\n return celcius;\n}", "function Celsius(celsius){\n\tthis.celsius = celsius;\n\tthis.getFahrenheitTemp = function(){\n\t\treturn 1.8 * this.celsius + 32; \n\t}\n\tthis.getKelvinTemp = function(){\n\t\treturn 273 + this.celsius;;\n\t}\n\n\tthis.isBelowFreezing = function(){\n\t\treturn this.celsius < 32;\n\t}\n}", "function Celsius(celsius){\n this.celsius = celsius\n this.getFahrenheitTemp = function(){\n return 1.8 * this.celsius + 32\n }\n this.getKelvinTemp = function(){\n return this.celsius + 273\n }\n}", "function temp_converter(celsius_value){\n let F = celsius_value + 32/1.8\n console.log(celsius_value+\"C\"+ \" = \"+ F+\"F\")\n}", "function changeToC() {\n\t\t// get numbers from temperature div\n\t\tvar currTempF = $('#temperature').text().match(/\\d+/),\n\t\t\ttempC = (currTempF - 32) / 1.8,\n\t\t\tupdateTemp = document.getElementById('temperature');\n\n\t\t//console.log(tempC);\n\t\t// Round temperature to 0 decimal places\n\t\ttempC = Number(tempC).toFixed(0);\n\t\t// Print temp in Celsius\n\t\tupdateTemp.innerHTML = '<p>' + tempC + '&#176;C</p>';\n\t}", "temp(celsius, fahrenheit)\n\n {\n const cTemp = celsius;\n const cToFahr = cTemp * 9 / 5 + 32;\n console.log(\"Celsius to Fahrenheit:\" + celsius + \"to\" + cToFahr); // (°C × 9/5) + 32 = °F\n const fTemp = fahrenheit;\n const fToCel = (fTemp - 32) * 5 / 9;\n console.log(\"Fahrenheit to Celsius:\" + fahrenheit + \"to\" + celsius);\n\n\n }", "function Celsius(celsius){\n this.celsius = celsius;\n}", "function Celsius(celsius) {\n this.celsius = celsius;\n}", "function Celsius(celsius) {\n this.celsius = celsius;\n}", "function celsiusToFah(temp_c) {\n\tvar temp_f = (9 * temp_c / 5) + 32;\n\treturn temp_f\n}", "function celsiusToFahrenheit (c) {\n var fahrenheit = ( c * ( 9 / 5) ) + 32;\n return fahrenheit;\n }", "calCelsius(temperature) {\n let celsius = Math.floor(temperature - 273.15)\n return celsius;\n }", "function c2f(celsius) {\n return celsius * 1.8 + 32;\n}", "function getTemperature() {\n local supplyVoltage = hardware.voltage();\n local voltage = supplyVoltage * Temperature.read() / 65535.0;\n local c = (voltage - 0.5) * 100 ;\n local celsius = format(\"%.01f\", c);\n return(celsius);\n}", "function Celcius(F) {\n console.log((F - 32) * 5 / 9 + 'C');\n}", "function fahrenheitTocelsius(temp){\n var tempInFahrenheit = temp;\n var tempInCelsius = (tempInFahrenheit - 32) * 5/9;\n return tempInFahrenheit + \"°F is \" + tempInCelsius+ \"°C\";\n }", "function celsiusToFahrenheit(c) {\n var f = c * 9 / 5 + 32;\n console.log(c + \"°C is \" + f + \"°F.\");\n}", "function handleCelsiusChange (e) {\n //debugger\n setScale('c')\n return setTemperature(e.target.value)\n }", "function fahrenheitToCelsius(celsius){\n\n\tcelsius = celsius - 32;\n\tcelsius = celsius * 5/9;\n\n\tconsole.log(\"Degrees in celcius: \" +celsius);\n\treturn celsius;\n\n\t}", "function toCelsius(f) {\n let celsius = ((f-32)/9)*5;\n console.log(celsius);\n}", "get temperature() {\n // convertimos los grados F a C\n this.temperature_F = 5 / 9 * (this.temperature_F - 32)\n return this.temperature_F;\n }", "function celsiusFarenheit(temp) {\n return temp * 9 / 5 + 32\n }", "function celsiusToFarenheit(c) {\n var farenheit = Math.round((c * 1.8) + 32);\n return (c + \" grados ceslsius son en farenheit \"+ farenheit);\n}", "function CtoF(temperature) {\r\n return (temperature * 9) / 5 + 32;\r\n}", "function fToC(fTemp) {\n return (fTemp - 32) * 5 / 9;\n}", "function toCelsius(f){\n\treturn (f-32) * (5/9);\n}", "function cDegrees(celcius){\n var fahrenheit = celcius * 1.8000 + 32;\n return fahrenheit;\n}", "function FtoC(temp){\n return Math.round(((temp-32)*5)/9);\n}", "function celcius(fvalue)\n{\n //Kelvin to Celcius\n var cvalue_unrounded = fvalue - 273.15;\n //shows 2 decimal places only\n cvalue = cvalue_unrounded.toFixed(2);\n //Returns results as \"cvalue\" outside of this function\n return cvalue;\n}", "function toCelsius(temperature) {\n temperature = Math.round((temperature - 32) / 1.8);\n return temperature;\n}", "function fahrenheitToCelsius(f) {\n var celsius = ( f - 32 ) * ( 9 / 5) ;\n return celsius;\n }", "function farenheitCelsius() {\n const fah = 10;\n const cel = ((fah - 32) * (5/9));\n console.log(cel);\n }", "function celciusToFarenheit(C){\n return 1.8*C + 32;\n \n}", "function getTemp(celsius, bool){\n var temp;\n if(bool == true){\n temp = celsius*1.8 + 32;\n }else{\n temp = celsius;\n }\n return temp.toFixed(1);\n }", "function CTempToF(val)\r\n{\r\n var CeltoFaren = val * 9 / 5 + 32;\r\n return CeltoFaren; \r\n}", "celsiusToFehrenheit(celsius){\n var f = (celsius * 9/5)+32;\n return f;\n }", "function c2k(celsius) {\n return celsius + 273.15;\n}", "function celsiusToFahrenheit(celsius) {\n var ctof = (celsius * 9)/5 + 32;\n console.log(\"\" + celsius + \"°C is \" + ctof + \"°F.\");\n}", "function convert (c) {\n \n var f=(9*c/5) + 32;\n return c + '°C is ' + f + '°F';\n \n \n}", "function toCelsius(fahrenheit) {\n\n var c = (5 / 9) * (fahrenheit - 32);\n\n gs.info(c);\n}", "get temperature() {\n return (5 / 9) * (this.fahrenheit - 32);\n }", "function toCelsius(temp) {\n let temperature = (((temp - 32) * 5) / 9).toFixed(0);\n\n return temperature;\n}", "function celsiusToFahrenheit(temperature){\n return (temperature*9/5)+32;\n}", "function celciusToFarenhite(temperature){\n return (temperature*9/5)+32;\n \n}", "function celsiusToFahrenheit(temperature)\n{\n return (temperature *9/5) +32;\n\n}", "function tempConvert(){\n\nlet celciusTemp = document.querySelector('input').value;\nlet C = parseInt(celciusTemp);\nlet F= (1.8 * C) + 32;\nalert(\"Temperature in Farenheit is \" + (F));\n}", "function celsiusToFahrenheit(celsiusTemp) {\n return (celsiusTemp * 9 / 5) + 32;\n }", "function convertCtoF(cTemp)\n{\n var fTemp = cTemp * 1.8 + 32;\n return fTemp;\n}", "function toCelcius(fahrenheit) {\n\treturn (fahrenheit - 32) * 5 /9;\n}", "function toCelsius(kelvin) {\r\n var tempInCelsius = Math.round(kelvin - 273.15);\r\n return tempInCelsius + '°C';\r\n }", "function celsiusToFahrenheit(temperature){\n return(temperature * 9/5)+32;\n}", "function celsiusToFahrenheit(temperature){\n return(temperature *9/5) + 32;\n}", "function FahrenheitToCelsius(fDegree){\n var celsius = (fDegree - 32)*5 / 9;\n console.log(celsius);\n }", "function calcTempC(tempK) {\n return Math.round(tempK - 273.15);\n }", "function convert (celsius){\n var fahrenheit = ((celsius * 9/5) +32);\n console.log(celsius +\" degrees celsius equates to: \"+fahrenheit + \" \"+ \"fahrenheit\");\n }", "function Celsius(celsius) {\n this.celsius = celsius;\n this.getFahrenheitTemp = function() {\n let temperature = 1.8 * this.celsius + 32;\n console.log(celsius);\n return temperature;\n };\n this.getKelvinTemp = function() {\n let temperature = this.celsius + 273;\n console.log(celsius);\n return temperature;\n };\n}", "function tempConvert(tempInput) {\n var celcius = parseFloat(tempInput);\n celcius = (celcius - 32) / 1.8;\n value = celcius.toFixed();\n return value;\n\n}", "function celsiusToFahrenheit(temperature){\n return (temperature * 9/5) + 32;\n}", "function farenheitCelsius(temp) {\n return temp - 32 * 5 / 9\n }", "function celsiusToFahrenheit(temp){\n return ((9/5) * temp) + 32;\n}", "function getCelcius(fahrenheit) {\nreturn(fahrenheit +\" Fahrenghit are \" +(fahrenheit-32)*5/9) + \" in Celcius\";\n}", "function celciusToKelvin(C){\n return parseInt(273) + parseInt(C);\n}", "function toCelsius() {\r\n var fah = document.getElementById('fah_value').value;\r\n var cel_result = (5/9) * (fah-32);\r\n if (!isNaN(cel_result)) {\r\n document.getElementById('cel_result').value = cel_result;\r\n }\r\n}", "function FPC() {\nvar F = parseInt(prompt(\"digite a temperatura em fahrenheit para celsius\"))\n\nvar C = (F - 32) * 5/9\n\nalert(\"a temperatura em é \"+ C +\" graus Celsius\") \n\nconsole.log(\"Fahrenheit \" + F,\"celsius \"+C)\n}", "function celsiusConversion(response) {\n let temperatureElement = document.querySelector(\"#temperature\");\n let temperature = temperatureElement.innerHTML;\n temperatureElement.innerHTML = Math.round(((temperature - 32) * 5) / 9);\n}", "function celsiusToFahrenheit(temp){\n var tempInCelsius = temp;\n var tempInFahrenheit = (tempInCelsius * 9/5 + 32);\n return tempInCelsius + \"°C is \" + tempInFahrenheit+ \"°F\";\n }", "function celsiusTOFahrenheit(temperature) {\n return (temperature * 9 / 5) + 32;\n}", "function celToFar(celsius) \n{\n let cTemperature = celsius;\n let celToFahr = cTemperature * 9 / 5 + 32;\n let message = cTemperature+'\\xB0C is ' + celToFahr + ' \\xB0F.';\n console.log(message);\n}", "function celsiusToFahrenheit(temperature){\n\treturn (temperature * 9/5) + 32;\n}", "function cToF(celsius) \n{\n var cTemp = celsius;\n var cToFahr = cTemp * 9 / 5 + 32;\n //var message = cTemp+'\\xB0C is ' + cToFahr + ' \\xB0F.';\n return cToFahr.toFixed(2);\n}", "function convertToCelsius(temperature) {\n return parseInt(temperature - 273.15);\n}", "function toCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5 / 9;\n}", "function toCelsius(fahrenheit) {\n return (fahrenheit - 32) * 5 / 9;\n}", "function convertCelsius(temperature) {\n temperature = Math.round(((temperature - 32) * 5) / 9);\n return temperature;\n}", "function celsiusToFahrenheit(temperature) {\n return (temperature * 9) / 5 + 32;\n}", "function FahrenheitConversion(f,c,t) {\n return c = (f - c)/ t;\n}", "function temperatureConverter(valNum) {\n valNum = parseFloat(valNum);\n document.getElementById(\"outputCelcius\").innerHTML=(valNum-32)/1.8;\n}", "function c(e,t){0}", "function temperatureCtoF(tempC) {\n return round((tempC * 1.8) + 32, 2);\n }", "function getC(name,un_name) //get capcitor value in F, (name, name-unit)\n{\n\tvar x=getVar(name);\n\tvar unit=getVtext(un_name);\n\tif(\"pF\"==unit) return x/=1e12;\n\tif(\"nF\"==unit) return x/=1e9;\n\tif(\"uF\"==unit) return x/=1e6;\n\treturn x;\n}", "function celsiusFarenheit() {\n const cel = 0;\n const fah = ((cel) * (9/5) + 32);\n console.log(fah);\n }", "function fToC(fahrenheit) \n{\n var fTemp = fahrenheit;\n var fToCel = (fTemp - 32) * 5 / 9;\n //var message = fTemp+'\\xB0F is ' + fToCel + '\\xB0C.';\n return fToCel.toFixed(2);\n}", "function celsiusToFahrenheit(temperature) {\n return (temperature * 9 / 5) + 32;\n}", "function convertTemp (celsius, decimalPlaces = 1) { // Here we are giving default value as 1 , if decimalPlaces is not defined\n const fahrenhite = celsius * 1.8 + 32;\n return Number(fahrenhite.toFixed(decimalPlaces));\n}", "function CelToFah(cDegree){\n var fah = (9/5 * cDegree)+ 32;\n console.log(fah);\n }", "function covertTemp(temp) {\n return{\n fahrenheit: temp,\n celsius: ((temp - 32)* (5/9)),\n kelvin: ((temp + 459.67)*(5/9))\n }\n}", "function cToF(celsius)\n {\n var cTemp = celsius;\n var cToFahr = cTemp * 9 / 5 + 32;\n var message = cTemp+'\\xB0C is ' + cToFahr + ' \\xB0F.';//for testing only\n console.log(message);//for testing only\n\n return cToFahr;\n }", "function changeToFahrenheit(celsius) \n {\n let celsiusTemp = celsius;\n let ToFar = celsiusTemp * 9 / 5 + 32;\n let msg = celsiusTemp + '\\xB0C is ' + ToFar + ' \\xB0F.';\n console.log(msg);\n }", "function toCelsius (fahrenheit) {\r\n var convertedTemp = (fahrenheit - 32) * .5556;\r\n return convertedTemp;\r\n}", "function fahrenheitToCelsius(fahrenheitTemp) {\n return (fahrenheitTemp - 32) * 5 / 9;\n }", "function convertFtoC(fahrenheit) {\n return (fahrenheit - 32) * 5/9\n}", "function celsiusToFahrenheit(cDegrees){\n var fahrenheit = (9/5 * cDegrees) + 32\n return fahrenheit\n}", "function toCelsius(fahrenheit) {\n\treturn (fahrenheit - 32) * 5 / 9;\n}", "function farenheitToCelsius(f) {\n var celsius = Math.round((f - 32) / 1.8);\n return (f + \" grados Farenheit son \" + celsius +\" en Celsius\");\n}", "static fromKelvinToCelsius(temperature) {\n return Math.trunc(Number(temperature) - 273.15) + '°';\n }", "function celciusToFahreneit(celcius){\n const temperatureInFahreneit = celcius * (9/5) + 32; // in Fahreneit\n console.log(\"Temperature in Fahreneit:\", temperatureInFahreneit);\n\n}", "function toCelsius(kelvin) {\n const celsius = kelvin - 273;\n return Math.round(celsius);\n\n}", "function fahrenheit(){\n var tempfar=(celsius*9/5)+32\n console.log('La temperatura en grados fahrenheit es: ')\n console.log(tempfar +' °F')\n}", "function fahrenheitToCelsius(cDegrees) {\n var fahrenheit=( 9 / 5 * cDegrees) + 32;\n fahrenheit = Math.round(fahrenheit);\n return fahrenheit;\n}", "function convertCtoF(celsius) {\n return (celsius * 9/5) + 32;\n}", "function convertCelciusToFahrenheit(number) {\n return oC * 1.8 + 32;\n}" ]
[ "0.74577415", "0.73127854", "0.7241598", "0.7183572", "0.7109102", "0.7104077", "0.70803005", "0.70607823", "0.70607823", "0.7046159", "0.70111895", "0.6950953", "0.6857308", "0.68371004", "0.68325955", "0.68131256", "0.68075746", "0.6807091", "0.6749704", "0.6694397", "0.6676422", "0.661733", "0.66106826", "0.65950304", "0.65667194", "0.6550091", "0.65480316", "0.6540084", "0.6528583", "0.65190566", "0.6518654", "0.65027404", "0.6501847", "0.6491442", "0.6470522", "0.6455558", "0.64475405", "0.6432238", "0.64314914", "0.6428546", "0.6416436", "0.6409598", "0.6406371", "0.638825", "0.63756216", "0.6373841", "0.63580513", "0.63571346", "0.6356656", "0.6350493", "0.6348478", "0.6328887", "0.63252145", "0.6312791", "0.6312065", "0.63035834", "0.6293808", "0.6291145", "0.6281487", "0.625046", "0.62495", "0.62477446", "0.62265366", "0.6224801", "0.6221017", "0.6214401", "0.6212374", "0.6211327", "0.6201278", "0.619665", "0.618277", "0.61668277", "0.61668277", "0.6157908", "0.6157336", "0.6155684", "0.6135179", "0.6131781", "0.6130876", "0.61302847", "0.6127391", "0.6124531", "0.6120261", "0.61103797", "0.6105701", "0.6104609", "0.610363", "0.6092816", "0.60829145", "0.6079215", "0.6077108", "0.60714245", "0.6063722", "0.60620147", "0.60294634", "0.60202557", "0.6017241", "0.60057646", "0.6005695", "0.5986621", "0.5974026" ]
0.0
-1
var c = 0;
function squareroot(c) { // c = number; // var epsilon = 10-15; t = 0.0001; //c=((c/t)+t)/2; while (Math.abs(t*t - c) >= Math.pow(10,-15) ) { t = ((c / t) + t) / 2; } console.log(`square Root of ${c} is ${t}`); return ""; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function c() {\n return 55;\n }", "function zero(){ return 0;}", "function n$c(){return [0,0,0,0]}", "function c(e,t){0}", "function num(){ var x = 0}", "function i(t, e) {\n 0;\n }", "function c() {\n}", "value() {return 0}", "function pgZero (){\n pgNumber=0;\n\n}", "function d() {\n\treturn c;\n}", "function i(t, e) {\n 0\n }", "function variavel(){\n return ++x;\n\n }", "function testIncrement(c) {\n c = c + 1; // add 1 to that number\n return c;\n}", "function g() {\n\t\treturn a++;\n\t}", "rawC () {\n return parseInt(this.C, 16);\n }", "function i(e, t) {\n 0\n }", "function i(e, t) {\n 0\n }", "wu_c(){\n return (1.2*(this.DL+this.SDL) + 1.6*this.LL)*(this.Sj/12)\n }", "function setCount(c){\n\tmaxAppend = c;\n}", "function c() {}", "function i(e, t) {\n 0\n }", "function i(e, t) {\n 0\n }", "function return0(a, b, c) { return 0; }", "function r(n,e){0}", "function n(e,a){0}", "function counter() {\n\n}", "function img_countp() { // function to increment c by 1 and keep its value between 0-6.\n \"use strict\";\n c += 1;\n c %= modVal;\n return c;\n}", "function a(n,t){0}", "function ca(a){this.c=Math.exp(Math.log(.5)/a);this.a=this.b=0}", "function cinco() {\n\t\t\t\t\treturn 5;\n\t\t\t\t}", "function myClock() {\r\n document.getElementById(\"demo\").innerHTML = --c;\r\n if (c == 0) {\r\n clearInterval(myTimer);\r\n alert(\"Reached zero\");\r\n }\r\n }", "function ca(a){this.c=Math.exp(Math.log(.5)/a);this.b=this.a=0}", "function ca(a){this.c=Math.exp(Math.log(.5)/a);this.b=this.a=0}", "function Nc(a,b){this.b=[];this.v=b||r;this.a=this.e=w;this.ea=n;this.h=this.d=w;this.c=0;this.f=r;this.k=0}", "function Co(t,e){0}", "UCB(c){\n //console.log(\"Victorias simulacion: \" + this.numVictoriasSimulacion + \"jugadas finales \" + this.numJugadasSimulacion + \"jugadas padre \" + this.padre.numJugadasSimulacion + \" jugadas simuladas \" + this.numJugadasSimulacion)\n return (this.numVictoriasSimulacion / this.numJugadasSimulacion) + c * Math.sqrt(Math.log(this.padre.numJugadasSimulacion) / this.numJugadasSimulacion)\n }", "function foo() {\n var a = b = 0;\n}", "function foo() {\n var a = b = 0;\n}", "function e(t,n){0}", "function e(t,n){0}", "function a(b,c) {\n for(var i=b; i<c; i++) {\n console.log(i);\n }\n return b*c;\n}", "function reestablece(){\n colector = \"0\";\n operacion = \"\";\n operador0 = 0;\n operador1 = 0;\n resultado = 0;\n iteracion = 0;\n }", "function funcC() {\n console.log(\"1\");\n}", "Cr(){\n return 0.721 + 0.00725*(this.Lj*12/this.Dj)\n }", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function am1(i,x,w,j,c,n) {\n while(--n >= 0) {\n var v = x*this.data[i++]+w.data[j]+c;\n c = Math.floor(v/0x4000000);\n w.data[j++] = v&0x3ffffff;\n }\n return c;\n}", "function main() {\n var n_temp = readLine().split(' ');\n var n = parseInt(n_temp[0]);\n var k = parseInt(n_temp[1]);\n c = readLine().split(' ');\n c = c.map(Number);\n \n let jumpCnt = n/k;\n let e = 100;\n let index = k;\n while (jumpCnt-->0) {\n if (c[index] == 0) {\n e -= 1;\n } else if (index == n) {\n if (c[0] == 0)\n e -= 1;\n else\n e -= 3;\n } else {\n e -= 3;\n }\n index += k;\n } \n console.log(e);\n}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}", "function i(e,t){0}" ]
[ "0.7166016", "0.6914711", "0.68134135", "0.6456734", "0.6372262", "0.6208078", "0.61331266", "0.6121612", "0.61194474", "0.6090367", "0.6078152", "0.607674", "0.60729736", "0.5954399", "0.5936286", "0.5891074", "0.5891074", "0.58887684", "0.58874583", "0.58646065", "0.58501464", "0.58501464", "0.5848641", "0.580303", "0.57308656", "0.5696334", "0.568387", "0.56810874", "0.5669063", "0.56683904", "0.5665114", "0.56551766", "0.56551766", "0.56384665", "0.56226057", "0.5622174", "0.5615998", "0.5615998", "0.5606635", "0.5606635", "0.5605031", "0.5604173", "0.5589113", "0.5588818", "0.5585608", "0.5585608", "0.5585608", "0.5585608", "0.5585608", "0.5585608", "0.5585608", "0.5585608", "0.5585608", "0.5570396", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133", "0.5563133" ]
0.0
-1
Creates a grid of a specified size by creating divs and appending them to a container div
function createGrid (num) { for( var i = 0; i < (num * num); i++) { var $grid = $('<div></div>'); $('#container').append($grid); } //Sets grid === to height and width of container //2 is used to account for the margin around the boxes. $('div div').height($('#container').height() / num - 2); $('div div').width($('#container').width() / num - 2); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGrid(numBox){\n var box = '<div class=\"box\"></div>';\n for(var i = 1; i <= numBox; i++){\n for(var j = 1; j <= numBox; j++){\n $('#container').append('<div class=\"box\"></div>');\n }\n }\n var size = (400 - (numBox * 2)) / numBox;\n $('.box').css({'height': size, 'width': size});\n }", "function createGrid(size) {\n\tif (gridBlocks.length > 0) {\n\t\tfor (let block = 0; block < gridBlocks.length; block++) {\n\t\t\tcontainer.removeChild(gridBlocks[block]);\n\t\t}\n\n\t\tgridBlocks = [];\n\t}\n\n\tcontainer.style['grid-template-columns'] = `repeat(${size}, 1fr)`;\n\n\tfor (let i = 0; i < (size * size); i++) {\n\t\tconst gridBlock = document.createElement('div');\n\t\tgridBlock.style.width = `${480 / size}`;\n\t\tgridBlock.style.height = `${480 / size}`;\n\t\tgridBlock.style.border = '1px solid rgba(0, 0, 0, 0.3)';\n\t\tcontainer.appendChild(gridBlock);\n\n\t\tgridBlocks.push(gridBlock);\n\t}\n\n\tcheckForClick();\n\n}", "function makeGrid(gridContainerSize) {\n for (let i = 0; i < gridContainerSize ** 2; i++) {\n cell = document.createElement('div');\n cell.classList.add('cell');\n cell.style.backgroundColor = 'white';\n gridContainer.appendChild(cell);\n }\n gridContainer.style.gridTemplateColumns = `repeat(${gridContainerSize}, auto)`;\n gridContainer.style.gridTemplateRows = `repeat(${gridContainerSize}, auto)`;\n}", "function createDivs(gridDimension, canvasSize) {\n $(\".container\").children().remove();\n $(\".container\").append(\"<table>\");\n for(i=0; i< gridDimension; i++) {\n $(\".container\").append(\"<tr>\");\n for(j=0; j < gridDimension; j++) {\n $(\".container\").append(\"<td></td>\")\n $(\"td\").css(\"height\", canvasSize/gridDimension);\n $(\"td\").css(\"width\", canvasSize/gridDimension);\n }\n $(\".container\").append(\"</tr>\");\n }\n $(\".container\").append(\"</table>\");\n drawOnCanvas(getColor());\n}", "function createGrid(gridSize) {\n const outerContainer = document.querySelector(\"#outer-container\");\n const container = document.createElement('div');\n container.setAttribute(\"id\", \"container\");\n outerContainer.appendChild(container);\n container.style = \"grid-template-columns: repeat(\"+ gridSize +\", 1fr)\";\n const informationBox = document.querySelector(\"#information-box\");\n outerContainer.insertBefore(container,informationBox);\n for (let i = 0; i < (gridSize * gridSize); i++) {\n const container = document.querySelector('#container');\n\n const div = document.createElement('div');\n div.className = 'grid-block';\n container.appendChild(div);\n }\n}", "function createGrid(size){\n gridContainer.style.display='grid';\n gridContainer.style.gridTemplateColumns=`repeat(${size},1fr)`;\n gridContainer.style.gridTemplateRows=`repeat(${size},1fr)`;\n createElement(size);\n}", "function createGrid(size = 4) {\n \n if ( size > 64 || isNaN(size)) return alert('the number has to be less than 64');\n \n for (let i = 0 ; i<size*size; i++){\n const createDivs = document.createElement('div');\n createDivs.style.width = `${(100/size)-0.4}%`;\n createDivs.classList.add('grid');\n main.appendChild(createDivs);\n}\n mouseOver();\n}", "function createChildDivs(gridSize) {\n for (let i = 1; i <= (gridSize * gridSize); i++) {\n squareDiv[i] = document.createElement(\"div\");\n }\n newGrid(gridSize)\n}", "function makeGrid(x, y) {\n for (var rows = 0; rows < x; rows++) {\n for (var columns = 0; columns < y; columns++) {\n $(\"#container\").append(\"<div class='grid'></div>\");\n };\n };\n $(\".grid\").height(960/x);\n $(\".grid\").width(960/y);\n}", "function createGrid(width, height) {\n\n}", "function buildBoard(){\n container = document.createElement(\"div\");\n container.classList.add(\"grid-container\");\n\n for(i=0; i < dims; i++){\n for(j = 0; j < dims; j++){\n let temp = makeGridEle(boardSize);\n container.appendChild(temp);\n }\n let br = document.createElement(\"br\");\n container.appendChild(br);\n }\n\n document.body.appendChild(container);\n}", "function makeGrid(number) {\nfor (i = 0; i < (number * number); i++) {\n container.style.gridTemplateColumns = `repeat(${number}, auto)`;\n const square1 = document.createElement('div');\n square1.classList.add('square1');\n let size = 700/number\n square1.style.width = size;\n square1.style.height = size;\n container.appendChild(square1);\n }\n}", "function createGrid() {\n for (let i = 0; i < DIMENSION; ++i) {\n const container = document.querySelector('#gridContainer');\n const row = document.createElement('div');\n\n row.classList.add('row');\n container.appendChild(row);\n\n for (let j = 0; j < DIMENSION; ++j) {\n const cell = document.createElement('div');\n cell.classList.add('cell');\n\n row.appendChild(cell);\n paint(cell);\n }\n }\n}", "function createGrid(size) {\n var wrapper = $('#wrapper'),\n squareSide = 600 / size;\n $(wrapper).empty();\n for (var i = 0; i < size; i++) {\n for (var j = 0; j < size; j++) {\n $(wrapper).append('<div class=square id=xy_' + i + '_' + j + '></div>');\n\n }\n }\n\n //Single square size setting\n $('.square').css({\n \"height\": squareSide + \"px\",\n \"width\": squareSide + \"px\"\n\n });\n }", "function generage_grid() {\n\n for (var i = 0; i < rows; i++) {\n $('.grid-container').append('<div class=\"grid-row\"></div>');\n }\n\n\n $('.grid-row').each(function () {\n for (i = 0; i < columns; i++) {\n $(this).append('<div class=\"grid-cell\"></div>')\n }\n });\n\n var game_container_height = (34.5 * rows)\n $('.game-container').height(game_container_height);\n var game_container_width = (34.5 * columns)\n $('.game-container').width(game_container_width);\n }", "function createGrid(size) {\n container.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${size}, 1fr)`;\n}", "function createGrid() {\n\t$('.header').append('<div class=\"container\"></div>'); //create container\n var $row = $(\"<div />\", {\n \tclass: 'row'\n\t});\n\tvar $square = $(\"<div />\", {\n \tclass: 'sq'\n\t});\n\n for (var i = 0; i < columns; i++) {\n $row.append($square.clone());\n }\n for (var i = 0; i < rows; i++) {\n $(\".container\").append($row.clone());\n }\n}", "function createGrid() {\n\t// create 2 rows\n // for (var rows = 0; rows < 2; rows++) {\n // $(document.body).append(\"<div class='cards'>khjhjh</div>\");\n // }\n\t// create 2 tiles inside each row\n\tfor (var columns = 0; columns < 4; columns++) {\n\t $('.cards').append(\"<div class='tile'></div>\");\n\t}\n}", "function createGrid() {\n for (let i=1; i<=gridSize; i++){\n var div = document.createElement(\"div\");\n div.id = 'n' + i;\n div.innerText = i;\n document.getElementById(\"target\").appendChild(div);\n }\n}", "function createNewDivGrid(divNumber){\n $(\"#inner-wrapper\").empty();\n for(i = 1; i <= divNumber; i++){\n $(\"#inner-wrapper\").append(columnDiv);\n for(j = 1; j <= divNumber; j++){\n $(\".row-wrapper\").last().append(gridDiv);\n }\n }\n}", "function createGrid(){\n for (let i=0; i<gridSize; i++) {\n const div = document.createElement('div');\n grid.appendChild(div);\n // Push elements to previously empty cells array\n cells.push(div);\n }\n createLife();\n generateTrees();\n }", "function createGrid(num){\n\tvar blockNum = num * num;\n\tvar blockSize = 600/num;\n\tfor(var j=0; j < num; j++){\n\t\tfor(var i=0; i < num; i++){\n\t\t\t$('<div />', {class: 'block',\n\t\t\t\twidth: blockSize + 'px',\n\t\t\t\theight: blockSize + 'px'\n\t\t\t}).appendTo('#screen');\n\t\t}\n\t}\n}", "function createGrid(){\n\tvar totalGridBlocks = totalImagesReturned + (expandedImages*3);\n\tif (totalGridBlocks%4 == 0){\n\t\ttotalClusters = totalGridBlocks/4;\n\t} else {\n\t\ttotalClusters = (totalGridBlocks/4) + 1;\n\t}\n\t$(\".gridContainer\").empty();\n\tfor (i=0;i<totalClusters;i++){\n\t\t$(\".gridContainer\").append(\"<div class='gridCluster' data-cluster='\"+i+\"'><div class='gridBlock block0' data-block='0'></div><div class='gridBlock block1' data-block='1'></div><div class='gridBlock block2' data-block='2'></div><div class='gridBlock block3' data-block='3'></div></div>\");\n\t}\n\tfillGrid();\n}", "function createGrid(gridSize){\n const gridWidth = 600 / gridSize;\n for (let rows = 0; rows < gridSize; rows++) {\n for (let columns = 0; columns < gridSize; columns++) {\n let div = document.createElement('div');\n div.className = \"grid\";\n div.style.width=(600 / gridSize) + 'px';\n div.style.height=(600 / gridSize) + 'px';\n container.appendChild(div);\n }\n }\n grids = document.querySelectorAll(\"#container div\");\n grids.forEach(grid => grid.addEventListener('mouseover', changeColor));\n}", "function makeGrid(cols, rows) {\n for (let i = 0; i < (cols * rows); i++) {\n const div = document.createElement('div');\n div.style.border = '1px solid black';\n container.style.gridTemplateColumns = `repeat(${cols}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${rows}, 1fr)`;\n container.appendChild(div).classList.add('box');\n }\n}", "function createGrid(num, colour){\n $('.wrapper > div').remove();\n for(var i = 0; i < num * num; i++){\n $newdiv = $('<div class=\"square\" />');\n $squareSize = 480 / num\n $('.wrapper').append($newdiv);\n $('.square').css(\"width\", $squareSize);\n $('.square').css(\"height\", $squareSize);\n $('.square').css(\"background-color\", \"#CFCFCF\");\n }\n}", "function createGrid(width, height) {\n for (let i = 0; i < height; i++) {\n let row = document.createElement('div');\n row.classList.add('row');\n\n for (let x = 0; x < width; x++) {\n let pixel = document.createElement('div');\n pixel.classList.add('pixel');\n row.appendChild(pixel);\n }\n grid.appendChild(row);\n }\n}", "function renderGrids(x){\n\t\tfor (var i = 0; i < x; i++){\n\t\t\tvar pixels = document.createElement('div');\n\t\t\tpixels.className = 'miniDiv';\n\t\t\tcontainer.appendChild(pixels);\n\t\t}\n\t}", "function createGrid(){\n\n etchContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n etchContainer.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n \n for (let i = 0; i < gridSize * gridSize; i++){\n let etchSquareDiv = document.createElement(\"div\");\n etchSquareDiv.className = 'etchSquare';\n\n //add listener to change the color, for the sketching purposes\n etchSquareDiv.addEventListener(\"mouseenter\", function(){\n etchSquareDiv.style.backgroundColor = 'black';\n })\n\n etchContainer.appendChild(etchSquareDiv);\n } \n}", "function createGrid(size){\n gridSquare.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n gridSquare.style.gridTemplateRows = `repeat(${size}, 1fr)`;\n for(i=0; i<size*size; i++){\n const div = document.createElement('div');\n div.addEventListener('mouseover', fillBlack);\n div.classList.add('square');\n gridSquare.appendChild(div);\n colorCnt = 0;\n }\n}", "function generateGrid(x) {\n \tfor (var rows = 0; rows < x; rows++) {\n \tfor (var columns = 0; columns < x; columns++) {\n \t$('#container').append(\"<div class='cell'></div>\");\n };\n };\n $('.cell').width(720/x);\n $('.cell').height(720/x);\n\t\tpaint();\n}", "function makeGrid(nCells) {\n sizeOfCells = getSizeOfCells(maxSize, nCells);\n\n container.style['grid-template'] = \n `repeat(${nCells}, ${sizeOfCells}) / repeat(${nCells}, ${sizeOfCells})`;\n\n for (let i = 0; i < nCells; i++) {\n for (let j = 0; j < nCells; j++) {\n div = document.createElement('div');\n div.classList.add('cell');\n div.setAttribute('data-counter', 10);\n container.appendChild(div);\n }\n }\n}", "function resizeGrid(gridSize){\n while(gridContainer.firstChild) {\n gridContainer.removeChild(gridContainer.firstChild);\n }\n gridContainer.style.gridTemplateColumns = `repeat(${gridSize}, ${600/gridSize}px)`;\n gridContainer.style.gridTemplateRows = `repeat(${gridSize}, ${600/gridSize}px)`;\n for(row = 1; row <= gridSize; row++) {\n for(col = 1; col <= gridSize; col++){\n div = document.createElement(\"div\");\n div.className = \"gridBox\";\n div.style.gridColumnStart = col;\n div.style.gridColumnEnd = (col + 1);\n div.style.gridRowStart = row;\n div.style.gridRowEnd = (row + 1);\n div.style.backgroundColor = 'rgb(255, 255, 255)';\n gridContainer.appendChild(div);\n }\n }\n }", "function GridCreate() {\r\n var elBody = document.querySelector('body');\r\n var elDiv = document.createElement('div');\r\n\r\n for (var i = 0; i < 3; i++) {\r\n var elDiv = document.createElement('div');\r\n elDiv.setAttribute('id', 'container');\r\n for (var j = 0; j < 3; j++) {\r\n var elBut = document.createElement('div');\r\n elDiv.appendChild(elBut);\r\n elBut.style.background = '#E0E1E1';\r\n elBut.style.padding = '50px';\r\n elBut.style.cursor = 'pointer';\r\n\r\n elBut.setAttribute('class', 'case');\r\n }\r\n elBody.appendChild(elDiv);\r\n\r\n elDiv.style.display = 'flex';\r\n elDiv.style.justifyContent = 'center';\r\n }\r\n}", "function createGrid(squaresPerSide) {\r\n for (i = 0; i < squaresPerSide * squaresPerSide; i++) {\r\n const square = document.createElement('div');\r\n square.classList.add('square');\r\n square.style.width = (750 / squaresPerSide - 2).toString() + 'px';\r\n square.style.height = (750 / squaresPerSide - 2).toString() + 'px';\r\n container.appendChild(square);\r\n }\r\n}", "function drawGrid(gridSize) {\n let gridArea = gridSize * gridSize;\n for (let i = 0; i < gridArea; i++) {\n const box = document.createElement('div');\n box.classList.add('box');\n box.attributes.width = 600/gridSize;\n box.attributes.length = 600/gridSize;\n gridContainer.appendChild(box);\n box.addEventListener('mouseover', function() {\n sketch(box);\n });\n }\n gridContainer.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n gridContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n}", "function buildGrid(size){\n \n let squareSize = document.getElementById('grid').clientWidth / size;\n //Creating the square and defining his size\n for(let i=1 ; i<=size*size;i++){ \n let square = document.createElement('div')\n grid.appendChild(square);\n square.classList.add('square-grid');\n square.style.width = squareSize + \"px\";\n square.style.height = squareSize + \"px\";\n //Rounding square grid corners\n if(i==1){\n square.style.borderTopLeftRadius = \"10px\";\n }else if(i==size){\n square.style.borderTopRightRadius = \"10px\";\n }else if(i==size*size-size+1){\n square.style.borderBottomLeftRadius = \"10px\";\n }else if(i==size*size){\n square.style.borderBottomRightRadius = \"10px\";\n }\n }\n \n}", "function makeGrid(sizeNum) {\n // remove previous grid?\n for(let i = 0; i < Math.pow(sizeNum, 2); i++) {\n const newDiv = document.createElement('div');\n container.append(newDiv);\n // add class to the new div, \n container.style.gridTemplateColumns = `repeat(${sizeNum}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${sizeNum}, 1fr)`;\n //remove the class from the div\n //on hover change the background color of the current div\n newDiv.addEventListener(\"mouseenter\", function( event ) {\n event.target.classList.add('grid');\n });\n }\n}", "function buildGrid() {\n gameArea.innerHTML = \"\";\n\n console.log('---------------[ GENERATING GRID ]---------------');\n\n for (var i = 0; i < Math.sqrt(config.gridSize); i++) {\n var row = document.createElement('div');\n row.classList.add('row');\n // console.log('ROW ' + i + \":\");\n for (var j = 0; j < Math.sqrt(config.gridSize); j++) {\n var cell = document.createElement('div');\n cell.id = `cell-${j}-${i}`;\n cell.setAttribute('row', i);\n cell.setAttribute('cell', j);\n cell.classList.add('cell');\n row.appendChild(cell);\n\n // console.log(' - Cell ' + j);\n }\n gameArea.appendChild(row);\n }\n console.log('---------------[ GENERATED GRID ]---------------');\n\n}", "function generateGrid(blocks){\n //subtracting by 10 due to the px values associated with the padding and margin properties\n var gridSquareHeightAndWidth = Math.floor(960/blocks)-10;\n var toAdd = document.createDocumentFragment();\n for(let x=1; x<=blocks; x++){\n for(let y=1; y<=blocks; y++){\n var gridSquare = document.createElement(\"div\");\n gridSquare.id = \"grid-square\";\n gridSquare.style.width = gridSquareHeightAndWidth + \"px\";\n gridSquare.style.height = gridSquareHeightAndWidth + \"px\";\n gridSquare.style.backgroundColor = \"white\";\n gridSquare.addEventListener(\"mouseover\", e => {\n e.target.style.backgroundColor = \"black\";\n })\n toAdd.appendChild(gridSquare);\n }\n }\n document.getElementById(\"container\").appendChild(toAdd); \n}", "function draw_grid(grid_size, cell_size) {\r\n\t//instantiate variables\r\n\tvar i;\r\n\tvar j;\r\n\r\n\t$(\"#grid\").empty();\r\n\r\n\t//iterate to create rows\r\n\tfor (i = 0; i < grid_size; i++) {\r\n\t\tfor (j = 0; j < grid_size; j++) {\r\n\t\t\t//draw row of divs, assinging them a class of \"cell\" and a css width and height\r\n\t\t\t$(\"#grid\").append(\"<div class='cell'></div>\").find(\"div:last\").css({\r\n\t\t\t\t\"width\": cell_size,\r\n\t\t\t\t\"height\": cell_size\r\n\t\t\t});\r\n\t\t}\r\n\t\t//end the line\r\n\t\t$(\"#grid\").append(\"<br>\");\r\n\t}\r\n}", "function createGrid(h, v){\n let width = 960 / h;\n for (var i = 1; i <= v * h; i++) {\n var div = document.createElement('div');\n div.className = 'cell';\n div.style.border = 'solid 1px black';\n container.appendChild(div);\n container.appendChild(br);\n }\n cellsEvent();\n container.style.display = 'grid';\n container.style.gridTemplateRows = 'repeat(' + v + ', ' + width + 'px)';\n container.style.gridTemplateColumns = 'repeat(' + h + ', ' + width + 'px)';\n container.style.justifyContent = 'center';\n}", "function makeGrid(newNum){\n userInptNum = newNum;\n container.style.gridTemplateRows = userInptNum;\n container.style.gridTemplateColumns = userInptNum;\n\n for (let i = 1; i <= userInptNum; i++){\n for(let j = 1; j <= userInptNum; j++){\n let square = document.createElement('div');\n square.classList.add('square');\n square.style.backgroundColor = \"rgb(250,250,250\";\n square.style.gridRow = i;\n square.style.gridColumn = j;\n container.appendChild(square);\n\n }\n \n }\n getColor();\n \n}", "function createGrid(playerStartPosition) {\n // Using for loop to create grid, because we can specify how long we want it to run for\n for (let i = 0; i < cellCount; i++) {\n const cell = document.createElement('div')\n // Set cell number based on i (Turn on for development reasons to see cell index)\n //cell.innerHTML = i\n // Add each div to parent grid as children\n grid.appendChild(cell)\n // adds's each cell to an array\n cells.push(cell)\n }\n\n addPlayer(playerStartPosition)\n }", "function createGrid(){\n for (var i = 0; i < 200; i++) {\n var div = document.createElement(\"div\");\n div.id = i;\n div.style.visibility = \"hidden\";\n document.getElementById(\"board\").appendChild(div);\n }\n if (!start) {\n for (var i = 0; i < 16; i++) {\n \t var div = document.createElement(\"div\");\n div.id = i.toString() + \"side\";\n div.style.visibility = \"hidden\";\n document.getElementById(\"upcoming\").appendChild(div);\n }\n }\n}", "function makeGrid() {\n var {width, height} = size_input();\n\n for (rowNum = 0; rowNum < height; rowNum++) {\n grid.append(\" <tr></tr>\");\n }\n for (colNum = 0; colNum < width; colNum++) {\n $(\"#pixel_canvas tr\").append(\" <td></td>\");\n }\n}", "function createCols(gridSize){\n for ( var i=1; i<gridSize+1; i++){\n var col = document.createElement(\"div\");\n col.className = \"col\";\n col.setAttribute('id', 'col-'+ i);\n document.getElementById(\"card-container\").appendChild(col);\n }\n}", "function fillGrid(size) {\n for (let i = 0; i < size * size; i++) {\n const gridElement = document.createElement(\"div\");\n gridElement.classList = \"grid-element\";\n gridElement.addEventListener(\"mouseover\", changeColor);\n gridContainer.appendChild(gridElement);\n }\n}", "function drawGrid(sizeIn) {\n\tvar boxDivs = [];\n\tsize = sizeIn;\n\tboxSize = Math.floor(960/size);\n\n\t$('#grid').off();\n\t$('#grid').html('');\n\n\t$box = \"<div class='box' style='width:\" + boxSize + \"px; height:\" + boxSize+\"px;'></div>\";\n\t$('#grid').css('width', boxSize*sizeIn);\n\tfor (var i = 0; i < sizeIn * sizeIn; i++){\n\t\tboxDivs[i] = $box;\n\t}\n\t$('#grid').append(boxDivs.join(''));\n\n\tclearGrid();\n\tdraw();\n\tgridLines();\n}", "function makeGrid(rows, cols) {\n container.style.setProperty('--grid-rows', rows);\n container.style.setProperty('--grid-cols', cols);\n for (c = 0; c < (rows * cols); c++) {\n let cell = document.createElement(\"div\");\n container.appendChild(cell).className = \"grid-item\";\n cells[c] = cell;\n cells[c].style.backgroundColor = \"white\"\n };\n}", "function displayGrid(n) {\n var viewportSize = $(window).height();\n var heightLimit = viewportSize*.75;\n $('.wrapper').width(heightLimit);\n // Hacky element here to remove the 2 pixels of border\n var boxSize = (heightLimit/n) - 2;\n var wrapper = $('.wrapper').html(\"\");\n for (var i=0;i<n;i++){\n for (var j=0;j<n;j++){\n wrapper.append($('<div></div>').addClass('tile').width(boxSize).css('padding-bottom', boxSize));\n }\n //wrapper.append($('<div></div>').css('clear', 'both'));\n }\n wrapper.append($('<div></div>').css('clear', 'both'));\n}", "function fillGrid(size) {\n for (let i = 0; i < size * size; i++) {\n const gridElement = document.createElement(\"div\");\n gridElement.classList = \"grid-element\";\n gridElement.addEventListener(\"mouseover\", changeColor);\n gridContainer.appendChild(gridElement);\n }\n}", "function newGrid(gridSize) {\n // Set parent style as grid\n removeAllChildNodes(squareDivContainer);\n squareDivContainer.style.grid = `repeat(${gridSize}, 1fr) / repeat(${gridSize}, 1fr)`;\n // Assign column and row numbers to each of the squares\n for (let column = 1; column <= gridSize; column++) {\n for (let row = 1; row <= gridSize; row++) {\n // Stylize each of the squares\n let sqNmbr = row + gridSize * (column - 1);\n squareDiv[sqNmbr].style.cssText = `grid-column: ${column}; \n grid-row: ${row}; border: 1px solid #E5EAF5; background-color: white`;\n squareDiv[sqNmbr].setAttribute(\"class\", \"square-div\");\n // Append the squares to the parent div container\n squareDivContainer.appendChild(squareDiv[sqNmbr]);\n }\n hoverColor();\n }\n}", "function populate() {\n\t\tvar temp = \"\";\n\t\tvar div = '<div class=\"squares\"></div>';\n\t\tvar input = parseInt(prompt(\"Choose a new grid size!\"), 10);\n\t\t$('.squares').remove();\n\t\tfor (var i = 1; i <= input * input; i++) {\n\t\t\ttemp += div;\n\t\t};\n\t\t$(\".wrapper\").append(temp);\n\t\tvar height = 640 / input;\n\t\t$('.squares').css('height', height);\n\t\t$('.squares').css('width', height);\n\t}", "function makeGrid() {\n const height = inputHeight.val();\n const width = inputWidth.val();\n\n for (let i = 0; i < height; i++) {\n const row = $('<tr></tr>');\n for (let j = 0; j < width; j++) {\n row.append('<td></td>');\n }\n canvas.append(row);\n }\n}", "function defineGrid(n){\n\t\tvar boardDiv = document.getElementsByClassName(\"boardCls\")[0] ;\n\t\t$(\"#board\").html(\"\")\n\t\tlet cnt=0 ;\n\t\tfor(let i=0;i<n;i++)\n\t\t{\n\t\t\tvar rowDiv = document.createElement(\"div\") ;\n\t\t\trowDiv.classList.add(\"row\") ;\n\t\t\trowDiv.style.height=(580/n)+\"px\";\n\n\t\t\tfor(let j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tvar singleDiv = document.createElement(\"div\") ;\n\t\t\t\tsingleDiv.classList.add(\"block\") ;\n\t\t\t\tsingleDiv.style.width=(580/n)+\"px\" ;\n\t\t\t\tvar para = document.createElement(\"p\") ;\n\t\t\t\tpara.classList.add(\"number\") ;\n\t\t\t\t\n\t\t\t\tsingleDiv.id=\"block-\"+cnt ;\n\t\t\t\tpara.id=\"blk-\"+cnt;\n\t\t\t\tcnt++ ;\n\t\t\t\tsingleDiv.appendChild(para) ;\n\t\t\t\trowDiv.appendChild(singleDiv) ;\n\t\t\t}\n\t\t\tboardDiv.appendChild(rowDiv) ;\n\t\t}\n\t}", "function grid(dimensions = 16) {\r\n for(let i = 0; i < dimensions; i++) {\r\n divRows[i] = document.createElement(\"div\");\r\n divRows[i].classList.add(\"rows\");\r\n divRows[i].style.height = `calc(100% / ${dimensions})`;\r\n container.appendChild(divRows[i]);\r\n }\r\n \r\n for(let i = 0; i < dimensions; i++) {\r\n for(let j = 0; j < dimensions; j++) {\r\n divCols[j] = document.createElement(\"div\");\r\n divCols[j].classList.add(\"cols\");\r\n divRows[i].appendChild(divCols[j]);\r\n \r\n divRows[i].children[j].onmouseover = function() {\r\n divRows[i].children[j].style.backgroundColor = setColor();\r\n }\r\n \r\n }\r\n }\r\n}", "function createGrid(num) {\n for(let i = 0; i < num **2; i++) {\n container.appendChild(cellNode.cloneNode(true));\n }\n gridFormat(container, num);\n startColor(color);\n \n \n}", "function createBoard(){\n for(let i=0; i<width*width; i++){\n const square = document.createElement('div');\n square.setAttribute('id', i);\n grid.appendChild(square);\n squares.push(square);\n }\n}", "function createGrid(squareNumber) {\n container.setAttribute('id', 'container');\n container.style.cssText = `margin: 0 auto; \n background-color: rgb(228, 166, 125);\n width: ${width}px;\n height: ${height}px;\n display: grid;\n cursor: crosshair;\n box-shadow: -1px 2px 12px 5px rgb(112, 80, 80);\n grid-template-columns: repeat(${squareNumber}, ${parseInt(height) / squareNumber}px);\n grid-template-rows: repeat(${squareNumber}, ${parseInt(width) / squareNumber}px);`;\n gameWindow.appendChild(container);\n\n for (let i = 1; i <= squareNumber; i++) {\n for (let j = 1; j <= squareNumber; j++) {\n const newDiv = document.createElement('div');\n newDiv.setAttribute('class', 'item');\n newDiv.style['text-align'] = 'center';\n newDiv.style['grid-area'] = `${i} / ${j} / span 1 / span 1`;\n newDiv.style.opacity = '0.0';\n //newDiv.style.border = '.5px dotted grey';\n container.appendChild(newDiv);\n console.log(`Created a div with row: ${i} and column: ${j}`);\n squares.push(newDiv);\n // puts an event listener on all divs that constantly listens for the paintSquare function on mouseenter\n newDiv.addEventListener('mouseenter', paintSquare);\n }\n }\n}", "function createGrid(numberElements) {\n if (numberElements === undefined) {\n numberElements = 5;\n } else {\n numberElements = verifyElementsNumbers(numberBoardSize.value);\n }\n for (let index = 0; index < (numberElements ** 2); index += 1) {\n const pixel = document.createElement('div');\n boardGrid.appendChild(pixel);\n boardGrid.style.display = 'grid';\n boardGrid.style.gridTemplateColumns = `repeat(${numberElements}, 40px)`;\n pixel.className = 'pixel';\n }\n}", "function gridSize(n) {\n const grid = document.getElementById('container');\n // Grid is adaptive and always equal on rows & columns using repeat & 1fr\n grid.style.gridTemplateColumns = `repeat(${n}, 1fr)`\n grid.style.gridTemplateRows = `repeat(${n}, 1fr)`\n let gridXY = n * n;\n\n // Creates divs to act as the rows/columns for the CSS Grid\n for (let i = 0; i < gridXY; i++) {\n const rows = document.createElement('div');\n rows.classList.add('rows');\n rows.style.opacity = '1';\n rows.addEventListener('mouseenter', bgColor);\n container.appendChild(rows);\n }\n}", "function resizeSmall (rows, columns) {\n container.style.gridTemplateRows = `repeat(${rows}, 25px`;\n container.style.gridTemplateColumns = `repeat(${columns}, 25px`;\n console.log(cSize);\n \n for(var i = 0; i < totalCells; i++) {\n var cell = document.createElement('div');\n container.appendChild(cell).className = 'item';\n console.log('Test1'); \n }\n}", "function makeGrid(height,width) {\n for (let r = 0; r < height; r++) {\n $('#pixel_canvas').prepend('<tr></tr>');\n for (let d = 0; d < width; d++) {\n $('tr').first().append('<td></td>')\n }\n }\n}", "function makeGrid(){\n var rowNumber = prompt(\"How many rows on the grid?\");\n var sideSize = 700 / rowNumber;\n var elementNumber = \" \";\n for (var i = 0; i < rowNumber * rowNumber; i++){\n elementNumber += \"<div class = 'square'></div>\";\n }\n $(document).ready(function() {\n $('.square').remove(); //clears grid \n $('body').find(\"#container\").append(elementNumber);\n $('.square').css({\"height\": sideSize + 'px', \"width\": sideSize + 'px'});\n $(document).on('mouseenter', '.square', function() {\n $(this).css(\"background-color\", \"#255E69\");\n });\n });\n}", "function makeGrid(height, width) {\r\n// Grid is cleared\r\n pixelCanvas.empty();\r\n// Create new grid\r\n// Create rows\r\n for (let row = 0; row < height; row++) {\r\n let tableRow = $('<tr></tr>');\r\n// Create columns\r\n for (let col = 0; col < width; col++) {\r\n let tableCell = $('<td></td>');\r\n// Append table data to create grid\r\n tableRow.append(tableCell);\r\n }// End col for loop\r\n pixelCanvas.append(tableRow);\r\n }// End row for loop\r\n }// End makeGrid function", "function makeGrid() {\n\n canvas.innerHTML = '';\n\t\n\t\n // This builds the rows and columns\n var fragment = document.createDocumentFragment();\n\t\n for (let a = 0; a < height.value; a++) {\n var tr = document.createElement('tr');\n\n for (let b = 0; b < width.value; b++) {\n var td = document.createElement('td');\n tr.appendChild(td);\n }\n\n tr.addEventListener('click', clickedBox);\n fragment.appendChild(tr);\n\t\n }\n \n \n \n // Push grid onto DOM\n canvas.appendChild(fragment);\n \n}", "function defaultGrid(){\n gridSize(24)\n createDivs(24)\n}", "function createGrid(n) {\n for (var i = 0; i < n * n; ++i) {\n const square = document.createElement(\"div\");\n square.classList.add(\"square\");\n\n // modify square size\n let squareWidth = 480 / n;\n square.style.width = squareWidth + \"px\";\n square.style.height = squareWidth + \"px\";\n\n console.log(square.style.width);\n\n square.addEventListener(\"mouseover\", (e) => {\n square.style.backgroundColor = \"black\";\n });\n container.style.gridTemplateColumns = \"repeat(\" + n + \", \" + square.style.width + \")\";\n container.appendChild(square);\n }\n}", "function makeGrid(squaresPerSide) {\n\n //Add div rows(basically tr), to act as rows\n for (var i = 0; i < squaresPerSide; i++) {\n $('#pad').append('<div class=\"row\"></div>');\n }\n\n //Add div squares(basically td), to ever row\n for (var i = 0; i < squaresPerSide; i++) {\n $('.row').append('<div class=\"square\"></div>');\n }\n\n //Set square size= giant grid div divided by sqperside\n var squareDimension = $('#pad').width() / squaresPerSide;\n $('.square').css({\n 'height': squareDimension,\n 'width': squareDimension\n });\n}", "function changeGridSize(){\n gridContainer.innerHTML = ''; //clear grid Container before adding new divs\n let gridSize = parseInt(slider.value,10);\n for (let i=1; i<=Math.pow(gridSize,2); i++){\n addElement();\n\n };\n gridContainer.style[\"grid-template-columns\"] = \"repeat(\" + gridSize + \", 1fr)\";\n}", "function createBoard() {\n for (let i = 0; i < width * width; i++) {\n //every time it loops we want to create a div\n //using .createElement\n const square = document.createElement('div');\n //we want to make the divs draggable. so we just use the\n //setAttribute function and set draggable to true\n square.setAttribute('draggable', true);\n //we also want to use setAttribute to give each square a unique ID\n square.setAttribute('id', i);\n //set a random number based on the candy colors length and a whole number\n let randomColor = Math.floor(Math.random() * candyColors.length);\n //set that color background for the square at this index\n square.style.backgroundImage = candyColors[randomColor];\n //next we add that div to the grid with appendChild\n grid.appendChild(square);\n //we also want to store these squares into an array\n squares.push(square);\n }\n }", "function populateContainer(value) {\n\tvar size = (960-((value-1)*2+2)*2)/value;\n\tfor (var x = 0; x < value; x++) {\n for (var y = 0; y < value; y++) {\n \t//adding cells\n $(\"<div></div>\").appendTo(\"#container\");\n }\n }\n //adding width, height and hanvle hover function\n $(\"#container > div\").css(\"width\",size);\n $(\"#container > div\").css(\"height\",size);\n $(\"#container > div\").hover(function(){\n $(this).css(\"background-color\", \"black\")\n });\n}", "function makeGrid(HEIGHT,WIDTH) {\n\n// Your code goes here!\nfor (let i = 0; i < HEIGHT; i++) {\n $PCANVA.append('<tr></td>');\n };\n\n for (let i = 0; i < WIDTH; i++) {\n $('tr').append('<td></td>');\n };\n}", "function fillGrid() {\n let grid = 9;\n\n let gridArr = [];\n for (let i = 0; i < grid; i++) {\n const newDiv = document.createElement(\"div\");\n newDiv.classList.add(\"gam-layout\");\n newDiv.setAttribute(\"id\", `${i}`);\n gridArr.push(newDiv);\n gridCont.appendChild(newDiv);\n }\n return gridArr;\n }", "function createGrids() {\n // Clear previous grids\n $(\"#inputGrid\").empty();\n $(\"#outputGrid\").empty();\n\n // Set size for new grids\n let columns = (new Array(parseInt($(\"#width\").val()))).fill(\"1fr\").join(\" \");\n let rows = (new Array(parseInt($(\"#height\").val()))).fill(\"1fr\").join(\" \");\n\n $(\"#inputGrid\").css(\"grid-template-columns\", `${columns}`);\n $(\"#inputGrid\").css(\"grid-template-rows\", `${rows}`);\n $(\"#outputGrid\").css(\"grid-template-columns\", `${columns}`);\n $(\"#outputGrid\").css(\"grid-template-rows\", `${rows}`);\n\n let grids = parseInt($(\"#width\").val()) * parseInt($(\"#height\").val());\n\n for (let i = 0; i < grids; i++) {\n $(\"#inputGrid\").append(`<div id=\"input${i}\" style=\"background-color: white;\" onmouseover=paint(this)></div>`);\n $(\"#outputGrid\").append(`<div id=\"output${i}\" style=\"background-color: white;\"></div>`);\n }\n\n NETWORK = new HopfieldNetwork(parseInt($(\"#width\").val()) * parseInt($(\"#height\").val()));\n}", "function createGrid(n) {\n for (var i = 0; i < n; i++) {\n for (var j = 0; j < n; j++) {\n $('.container').append('<div class=\"square\"></div>');\n }\n }\n //set dimensions\n $('.square').css('height', 960 / n + 'px');\n $('.square').css('width', 960 / n + 'px');\n //change colors of squares on hover\n $('.square').mouseenter(function() {\n $(this).css('background-color', randColor);\n });\n }", "function drawGrid(number){\n\tfor (var i = 0; i < number*number; i++) {\n\t\t$(\"#container\").append('<div class=\"pixel\"></div>');\n\t}\n\n\t$(\".pixel\").height($(\"#container\").height()/number);\n\t$(\".pixel\").width($(\"#container\").width()/number);\n\t$(\".pixel\").css({\"float\": \"left\", \"background-color\": \"#FFFFFF\"});\n}", "function createGrid() {\n for (let i = 0; i < gridCellCount; i++) { // this adds id number to each cell / div\n const cell = document.createElement('div')\n cell.setAttribute('id', i)\n // cell.textContent = i\n cells.push(cell)\n grid.appendChild(cell)\n }\n \n // console.log('cells', cells)\n }", "function createDivElem(size) {\n let boxWidth = width / size;\n let boxHeight = height / size;\n let boxStyle = `\n width:${boxWidth}px;\n height:${boxHeight}px;\n `;\n return $(`<div class=\"board_tile\" style=\"${boxStyle}\"></div>`);\n }", "function createEmptyGrid(id, parentDivElement){\n for (let i=0; i<10; i++){\n for (let j=0; j<10; j++){\n let div = document.createElement(\"div\");\n div.id = `${id},${i},${j}`;\n parentDivElement.appendChild(div);\n }\n }\n}", "function userGrid (userChoice) {\n let totalDivs = userChoice * userChoice;\n for (let i=0; i<totalDivs; i++) {\n let gridDiv = document.createElement('div');\n gridDiv.classList.add('gridDiv');\n let text = document.createTextNode(\"\");\n gridDiv.appendChild(text);\n containerDiv.appendChild(gridDiv); \n gridDiv.addEventListener('mouseover', whiteColors); \n }\n containerDiv.style.gridTemplateColumns = `repeat(${userChoice}, 1fr)`;\n containerDiv.style.gridTemplateRows = `repeat(${userChoice}, 1fr)`;\n}", "function CreateGraphicsGrid() {\n\tvar gridHTML = \"\";\n\tfor(i=0; i<100; i++) { // 10 x10\n\t\tgridHTML += '<div class=\"grid\" id=\"g' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"graphics-map\").innerHTML=gridHTML;\n\tvar gridHTMLz = \"\";\n\tfor(i=0; i<9; i++) { // 3x3\n\t\tgridHTMLz += '<div class=\"grid-z\" id=\"gz' + i +'\"></div>';\n\t}\n\tdocument.getElementById(\"graphics-map-z\").innerHTML=gridHTMLz;\n}", "function createGrid(row) {\n container.textContent = \"\";\n container.style.gridTemplateColumns = `repeat(${row}, 1fr)`;\n let square = row * row;\n for (var i = 0; i < square; i++) {\n cell = document.createElement(\"div\");\n cell.classList.add(\"content\");\n container.appendChild(cell);\n }\n}", "function createDivs(maxRow) {\n var wrapperDiv = document.getElementById('mazeWrapper');\n var rowDiv;\n\tfor (var i=0; i < maxRow; i++) {\n\t var thisDiv = document.createElement('div');\n thisDiv.id = 'mazeRow-' + i;\n thisDiv.className = 'row';\n \t wrapperDiv.appendChild(thisDiv);\n for (var j=0; j < maxColumn; j++) {\n rowDiv = document.getElementById('mazeRow-' + i);\n var thisColumnDiv = document.createElement('div');\n thisColumnDiv.id = (i*maxRow)+j;\n thisColumnDiv.className = 'mazehole';\n //if a shape other then square is chosen\n var shape = $('#shapeChoice').val();\n thisColumnDiv.classList.add(shape);\n rowDiv.appendChild(thisColumnDiv);\n }\n }\n}", "function createGame() {\n for (var i = 0; i < 3; i++) {\n var rowDiv = document.createElement(\"div\");\n rowDiv.classList.add(\"row\");\n\n for (var j = 0; j < 3; j++) {\n var gridDiv = document.createElement(\"div\");\n gridDiv.id = \"square_\" + i + \"_\" + j;\n gridDiv.classList.add(\"col-lg-4\");\n gridDiv.classList.add(\"col-sm-4\");\n gridDiv.classList.add(\"col-4\");\n gridDiv.classList.add(\"blank\");\n $('<img/>').attr('src', blankImg).addClass('img-responsive').appendTo(gridDiv);\n rowDiv.appendChild(gridDiv);\n }\n\n document.getElementById(\"playarea\").appendChild(rowDiv);\n if (i < 2) {\n $(\"<br>\").appendTo(document.getElementById(\"playarea\"));\n }\n }\n}", "function makeGrid(){\n\tconst inputHt=$('#inputHeight').val(); //Getting input value for row\n\tconst inputWt=$('#inputWidth').val(); //Getting input value for column\n\n\tfor(var i=0;i<inputHt;i++){\n\t\t$('#pixelCanvas').append(\"<tr id=row\" +i+ \"></tr>\"); //creating rows\n\t\tfor(var j=0;j<inputWt;j++){\n\t\t\t$('#row'+i).append(\"<td></td>\"); //creating columns\n\t\t}\n\t}\n}", "buildGrid() {\n const $game = $(this.selector);\n for (let row = 0; row < this.Rows; row++) {\n const $row = $(\"<div>\")\n .addClass(\"row\");\n //columns must be nested inside of the rows. for-loop will generate columns.\n for (let col = 0; col < this.Cols; col++) {\n const $col = $(\"<div>\")\n .addClass(\"empty column\")\n .attr(\"data-column\", col)\n .attr(\"data-row\", row)\n $row.append($col);\n }\n $game.append($row);\n }\n }", "function createDOM() {\n const container = document.getElementById('mineSweeper');\n for (let i = 0; i < sizeX; i++) {\n const div = document.createElement('div');\n div.classList.add('row');\n container.appendChild(div);\n }\n const rows = document.getElementsByClassName('row');\n for (let i = 0; i < rows.length; i++) {\n for (let j = 1; j <= sizeY; j++) {\n const div = document.createElement('div');\n div.setAttribute('data-position', (sizeY * i + j).toString());\n rows[i].appendChild(div);\n }\n }\n }", "function makeGrid(height,width,table){\n for(var r=0;r<height;r++){\n var newRow = table.insertRow(r);\n for(var c =0;c<width;c++){\n newRow.insertCell(c);\n }\n }\n}", "function createGrid( rows, cols ) {\n\n let html = '';\n const con = document.querySelector('.con');\n\n // Create and Store the Grid\n for( let i = 0; i < rows; i++ ) {\n\n grid[i] = [];\n let rowHtml = '';\n let rowConHtml = `<div class='row' id='${i}'></div>`;\n con.innerHTML += rowConHtml;\n let rowCon = document.getElementById(i.toString());\n\n for( let j=0; j < cols; j++ ) {\n\n let block = new Block(i, j);\n grid[i].push(block);\n rowHtml = `<div class='block' id=${block.id}>&nbsp</div>`\n rowCon.innerHTML += rowHtml;\n\n }\n\n }\n\n // Add each block's neighbors\n for( let i = 0; i < rows; i++ ) {\n\n for( let j = 0; j < cols; j++ ) {\n\n grid[i][j].addNeighbors();\n\n }\n\n }\n\n}", "function createGrid() {\r\n removeSquares(); // remove the previous squars\r\n let squares = [];\r\n let grid = prompt('How many squares you need in each direction?', 16);\r\n if(grid < 0 || grid > 64 || isNaN(grid)){ //Check if the input is a valid numbers\r\n\r\n alert(\"Please enter a valid number of grid more than 0 and less than or equal 64 grids.\")\r\n\r\n }else{\r\n let squareSize = (100 / grid) + '%';\r\n for (let i = 1; i <= grid ** 2; i++) {\r\n squares[i] = document.createElement('div');\r\n squares[i].id = 'square' + i;\r\n squares[i].className = 'squares';\r\n container.appendChild(squares[i]);\r\n }\r\n\r\n const squareStyle = document.querySelectorAll('.squares');\r\n squareStyle.forEach((e) => {\r\n e.setAttribute('style', `width:${squareSize};height:${squareSize};`);\r\n });\r\n keepColor();\r\n}\r\n}", "function makeGrid(height, width) {\n // Firstly clear canvas and then start again\n while (canvas.hasChildNodes()){\n canvas.removeChild(canvas.firstChild);\n }\n // Iterate with given height and width to create the clear canvas\n for(var x = 0; x<height; x++){\n var row = document.createElement('tr');\n canvas.appendChild(row);\n for(var y = 0; y<width; y++){\n var column = document.createElement('td');\n row.appendChild(column);\n }\n }\n\n}", "function createBoard() {\n for (let i = 0; i < width * width; i++) {\n const square = document.createElement(\"div\");\n //put this child into the gird\n grid.appendChild(square);\n squares.push(square);\n\n // Assigning a random colour to each div\n let randomColor = Math.floor(Math.random() * coloursOfCancy.length);\n square.style.backgroundImage = coloursOfCancy[randomColor];\n\n //To drag each square and give unique ID to each cell so we can see which square is actually moved.\n square.setAttribute(\"draggable\", \"true\");\n square.setAttribute(\"id\", i);\n }\n }", "function makeGrid(h,l) {\n // Remove previous grid if any\n $(grid).children().remove();\n // Loops to draw new Grid\n for (i=0 ; i<h ; i++){ // Loop on each row\n grid.append('<tr></tr'); //Add the row\n for (j=0 ; j<l ; j++){ //Loop on each column\n let currentRow =grid.find('tr').last();\n currentRow.append(\"<td></td>\"); // Add a cell at the end of the current row\n }\n }\n}", "function makeCells() {\n let rowsI = document.getElementById('rows-input');\n let columnsI = document.getElementById('columns-input');\n let cellAmount = rowsI.value * columnsI.value;\n console.log(rowsI.value);\n console.log(columnsI.value);\n board.style.gridTemplateRows = `repeat(${rowsI.value}, 1fr)`;\n board.style.gridTemplateColumns = `repeat(${columnsI.value}, 1fr)`;\n for (i = 0; i < cellAmount; i++){\n let cell = document.createElement('div');\n cell.className = 'cell';\n cell.id = `cell-${i}`;\n board.appendChild(cell);\n }\n}", "function makeGrid() {\n\tfor (y = 0; y < sizeY; y++ ){\n\t\t$('#pixelCanvas').append('<tr>');\n\t\t\tfor(x = 0; x< sizeX; x++ ){\n\t\t\t\t$('#pixelCanvas tr:last-child').append('<td></td>');\n\t\t\t}\n\t\t$('#pixelCanvas').append('</tr>');\n\t}\n}", "function generateGrid(squares) {\n\n container.style.setProperty(\"grid-template-columns\", \"repeat(\" + squares + \", 1fr)\");\n container.style.setProperty(\"grid-template-rows\", \"repeat(\" + squares + \", 1fr)\");\n \n //creates the ammount of divs necessary to fill the entire grid\n for (let i = 1; i <= squares * squares; i++) {\n const div = document.createElement(\"div\");\n div.classList.add(\"pixels\");\n div.style.border = \"1px solid rgba(0,0,0,0.5)\";\n \n container.appendChild(div);\n }\n \n //creates a nodelist as a global variable, of all the squares in the grid\n window.pixels = document.querySelectorAll(\".pixels\");\n\n //currentPen points to the function that determine the behavior of the pen\n pixels.forEach(currentPen);\n}", "function createBoard() {\r\n for(let i=0;i<width*width;i++)\r\n {\r\n square = document.createElement('div')\r\n square.innerHTML = 0\r\n gridDisplay.appendChild(square)\r\n squares.push(square)\r\n }\r\n generate()\r\n generate()\r\n\r\n\r\n }", "function makeGrid() {\n pixelCanvas.innerHTML = \"\";\n for (let i = 0; i < gridHeight;i++) {\n const tr = document.createElement(\"tr\");\n for(let j = 0; j < gridWidth; j++){\n const td = document.createElement(\"td\");\n tr.appendChild(td);\n }\n fragment.appendChild(tr);\n }" ]
[ "0.8303914", "0.8190042", "0.81818837", "0.81466657", "0.81367475", "0.80813336", "0.79506373", "0.7898219", "0.78980774", "0.7878136", "0.78282315", "0.78186977", "0.7719341", "0.77045834", "0.76863253", "0.7686205", "0.76425236", "0.7623618", "0.7623051", "0.7609457", "0.7577662", "0.7515941", "0.7515744", "0.7498565", "0.74967486", "0.74535733", "0.741843", "0.74042577", "0.7394905", "0.73918164", "0.7386269", "0.7376452", "0.7375114", "0.73738843", "0.73650795", "0.7362641", "0.7318687", "0.7289797", "0.7289417", "0.72732353", "0.7269915", "0.7266032", "0.7253181", "0.7236193", "0.7197357", "0.7196042", "0.7191982", "0.716647", "0.7159198", "0.7140857", "0.7140817", "0.7125447", "0.7104559", "0.71024615", "0.70838016", "0.70760256", "0.70755583", "0.70745933", "0.70737123", "0.70699364", "0.70608836", "0.70528346", "0.7039438", "0.70348877", "0.7021391", "0.70190907", "0.700843", "0.70084083", "0.70065385", "0.69973516", "0.6990598", "0.69879496", "0.69832116", "0.6962072", "0.695007", "0.69470316", "0.6909523", "0.69024175", "0.69022065", "0.6891609", "0.68796986", "0.6874191", "0.687258", "0.68661124", "0.686016", "0.68524444", "0.68416774", "0.6811369", "0.680371", "0.68028843", "0.67761785", "0.6773954", "0.67729807", "0.67668396", "0.6741963", "0.67373896", "0.6735546", "0.67353827", "0.67333126", "0.67310023" ]
0.7976004
6
Creates a color changing effect when the mouse enters one of the divs created in createGrid.
function changeColor() { $('div div').mouseenter(function() { $(this).toggleClass('hover'); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createGrid() {\nfor (i = 0; i < slider.value * slider.value; i++) {\n const gridItem = document.createElement('div');\n gridItem.classList.add('gridBox');\n gridItem.addEventListener('mouseenter', function(e) {\n e.target.style.backgroundColor = chosenColor;\n gridItem.classList.add('gridBoxOnHover');\n })\n // This is just a cool mouse tracking function I accidently made\n /*gridItem.addEventListener('mouseleave', function(e) {\n e.target.style.backgroundColor = 'white';\n gridItem.classList.remove('gridBoxOnHover');\n })*/\n gridWrapper.appendChild(gridItem);\n gridBoxesArray.push(gridItem);\n }\n}", "function hoverEffect(color) {\n let grids = document.querySelectorAll(\".grid-item\");\n let gridsArr = Array.from(grids);\n gridsArr.forEach(element =>\n element.addEventListener(\"mouseover\", ()=>{\n element.style.backgroundColor = color;\n }));\n}", "function draw() {\n Array.from(document.querySelectorAll('.grid-item')).forEach(gridItem => {\n gridItem.addEventListener('mouseenter', () => {\n gridItem.classList.add('colored');\n });\n });\n}", "function changeColor(color) {\n backColor = \"black\";\n let divs = document.querySelectorAll(\"#grid div\");\n divs.forEach(div =>\n div.addEventListener(\"mouseover\", e => {\n console.log(e.currentTarget);\n e.currentTarget.style.background = color;\n })\n );\n}", "function basicHoverEffect() {\nconst boxes = document.querySelector('.grid').querySelectorAll('div');\n//var x = document.getElementById(\"myDIV\").querySelectorAll(\".example\"); \nboxes.forEach(box => {\n box.addEventListener('mouseover', () => {\n box.setAttribute('style', 'background-color: black;');\n });\n});\n\n// Create onMouseLeave event to rever the colour back to origina state\nboxes.forEach(box => {\n box.addEventListener('mouseout', () => {\n box.setAttribute('style', 'background-color: white;');\n });\n});\n}", "function startingColor(){\n let divs = document.querySelectorAll('.square');\n divs.forEach(function(div) {\n div.addEventListener('mouseover', defaultColor);\n })\n }", "function drawOnGrid(gridItems, color) //something not right about this function\n{\n //taking the current HTML collection of grid items, making in array out of it. Giving each grid item the ability to be moused over...and have that colors classlist added to it\n Array.from(gridItems).forEach((item, idx) => item.addEventListener('mouseover', () =>\n {\n // colorGridItem(item, color)\n item.style.backgroundColor = `${color}`\n }))\n}", "function draw() {\n grid = document.querySelectorAll('.container > .cell');\n\n for (let i = 0; i < grid.length; i++) {\n grid[i].addEventListener('mouseover', function() {\n grid[i].style.backgroundColor = penColor;\n });\n }\n}", "function createGrid(rows, cols) {\n for (i=0; i < (rows * cols); i++) {\n let grid = document.createElement('div');\n newContainer.appendChild(grid).className = 'grid-item';\n \n grid.addEventListener('mouseover', () => {\n console.log('mouse over');\n grid.style.backgroundColor = \"purple\";\n })\n \n grid.addEventListener('mouseleave', () => {\n console.log('mouse leave');\n })\n \n };\n}", "function mouseOver (){\n const selectDivs = document.querySelectorAll('.main > div');\n \n selectDivs.forEach( divs => divs.addEventListener('mouseover',function(e){\n divs.style.background = `rgb(${changueColor()}, ${changueColor()}, ${changueColor()})`;\n}))}", "function startColor(event) {\n Array.prototype.forEach.call(canvasCells, function (cell) {\n cell.addEventListener(\"mousemove\", coloring);\n });\n}", "function firstContact() {\n\tlet gridItem = document.querySelectorAll('.gridItem');\n gridItem.forEach((div) => {\n div.addEventListener('mouseenter', colorIn);\n })\n}", "function gridOnHandler(){\r\n \r\n gridSimulatorVar.current_counter = 0\r\n paintGridOnHover(this)\r\n paintGridCounter(gridSimulatorVar.current_counter)\r\n\r\n}", "function canvas() {\nfor (i = 0; i < size; i++) {\n const row = document.createElement(\"div\");\n row.classList.add(\"row\");\n grid.appendChild(row);\n for (j = 0; j < size; j++) {\n const box = document.createElement(\"div\");\n box.classList.add(\"box\");\n row.appendChild(box);\n box.addEventListener(\"mouseover\", function(e) {\n e.target.style.background = 'black';\n e.target.style.opacity = \"1\";\n })\n}\n}\n}", "function fillGrid(count) {\n for (let i = 0; i < count * count; i++) {\n const gridDiv = document.createElement('div');\n gridDiv.className = 'grid-item';\n gridContainer.appendChild(gridDiv);\n\n gridDiv.addEventListener('mouseover', function(){\n const newColor = randomColor();\n gridDiv.style.backgroundColor = newColor;\n })\n } \n}", "function highlightGrid(e) {\n //if it is the computer's turn or the game is over do not highlight\n if (!playersTurn || gameOver) {\n return;\n }\n highlightCell(e.clientX, e.clientY);\n}", "function colorGrid(){\n\n const gridSquares = document.querySelectorAll('.grid');\n console.log(gridSquares);\n\n gridSquares.forEach((div) => {\n \n let light = 100;\n\n div.addEventListener('mouseover', () => {\n\n div.style.backgroundColor = getRandomColor();\n\n }, {once: true});\n\n div.addEventListener('mouseover', function removeOpacity(){\n\n div.style.opacity = `${light}%`\n light -= 10;\n if(light === -10){\n\n div.removeEventListener('mouseover', removeOpacity);\n\n }\n });\n\n });\n}", "function startColor(color) {\n switch(color) {\n case \"black\":\n for(let i = 0; i < cells.length; i++) {\n cells[i].addEventListener('mouseover', function(e) {\n if (isDrawing) {\n e.target.style.backgroundColor = \"black\";\n }\n \n });\n }\n break;\n\n case \"eraser\":\n for(let i = 0; i < cells.length; i++) {\n cells[i].addEventListener('mouseover', function(e) {\n if (isDrawing) {\n e.target.style.backgroundColor = \"white\";\n }\n \n });\n }\n break;\n \n case \"rainbow\":\n for(let i = 0; i < cells.length; i++) {\n let r = Math.random()*256;\n\t\t\t let g = Math.random()*256;\n\t\t\t let b = Math.random()*256;\n cells[i].addEventListener('mouseover', function(e) {\n if (isDrawing) {\n e.target.style.backgroundColor = `rgb(${r},${g},${b})`;\n }\n \n });\n }\n break;\n \n default:\n for(let i = 0; i < cells.length; i++) {\n cells[i].addEventListener('mouseover', function(e) {\n e.target.style.backgroundColor = \"red\";\n });\n }\n break;\n }\n}", "function createGrid(){\n\n etchContainer.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n etchContainer.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n \n for (let i = 0; i < gridSize * gridSize; i++){\n let etchSquareDiv = document.createElement(\"div\");\n etchSquareDiv.className = 'etchSquare';\n\n //add listener to change the color, for the sketching purposes\n etchSquareDiv.addEventListener(\"mouseenter\", function(){\n etchSquareDiv.style.backgroundColor = 'black';\n })\n\n etchContainer.appendChild(etchSquareDiv);\n } \n}", "function paintGrid(elem, color){ \n if(elem.buttons == 1){\n if(elem.target.classList == 'square-grid'){\n let square = elem.target; \n square.style.backgroundColor = color;\n } \n }else{\n //Exit condition if mouse is not clicked.\n return;\n }\n}", "function sketchGrid() {\n\t$('td').mouseover(function() {\n\t\t$(this).css(\"background-color\", \"white\");\n\t});\n}", "function hexBrush() {\n colorContainer.addEventListener(\"mouseover\", function (e) {\n e.target.style.backgroundColor = rainbowMode();\n // console.log(e.target);\n });\n}", "function highlightGrid(event) {\n if (!playerTurn || gameOver) {\n return;\n }\n\n highlightCell(event.x, event.y);\n}", "function turnColor() {\n let cells = document.querySelectorAll('div.cell')\n for (i=0; i < cells.length; i++)\n cells[i].addEventListener('mouseover', function() {\n cells[i].classList.add('color')\n })\n}", "function OnMouseEnter (event)\n{\n if (event.target != currSelCell && event.target.getAttribute ('CellState') != 'error')\n {\n event.target.style.backgroundColor = preselectedColour;\n }\n}", "function hoverEnter(e) {\n var $div = $(e.target).closest(\"div\");\n $div.css(BACKGROUND_COLOR, $div.data(BUTTON_NAME) ? \"#FFF\" : \"#FFC\");\n }", "function hoverColor(gridNum){\n document.getElementById(gridNum).style.backgroundColor = color;\n document.getElementById(\"selectedColor\").setAttribute(\"value\", color)\n}", "function createGrid(gridSize) {\n let tileDiv = document.querySelector('.tileDiv');\n tileDiv.style.setProperty(\"--colNum\", gridSize);\n tileDiv.style.setProperty(\"--rowNum\", gridSize);\n for (let row = 0; row < gridSize; row++) {\n for (let column = 0; column < gridSize; column++) {\n let newTileDiv = document.createElement('div');\n newTileDiv.setAttribute('class', 'tile');\n // newTileDiv.style.filter = 'brightness(100%)';\n tileDiv.appendChild(newTileDiv);\n newTileDiv.addEventListener('mouseenter', function () {\n let opacity = this.style.opacity;\n if (blackLine === true) {\n const opacity = Number(this.style.opacity);\n this.style.backgroundColor = 'black';\n this.style.opacity = opacity + 0.2;\n } else if (this.classList.contains('active')) {\n this.style.opacity = (Number(opacity) + 0.2);\n } else {\n this.classList.add('active');\n this.setAttribute('style', 'opacity:0.1');\n this.style.background = randomColor();\n };\n });\n }\n }\n}", "function divHoverIn(div){\n div.css({\n \"background-color\": \"rgb(130, 51, 98)\"\n });\n\n //activeDivArray.push(div);\n\n }", "function userGrid (userChoice) {\n let totalDivs = userChoice * userChoice;\n for (let i=0; i<totalDivs; i++) {\n let gridDiv = document.createElement('div');\n gridDiv.classList.add('gridDiv');\n let text = document.createTextNode(\"\");\n gridDiv.appendChild(text);\n containerDiv.appendChild(gridDiv); \n gridDiv.addEventListener('mouseover', whiteColors); \n }\n containerDiv.style.gridTemplateColumns = `repeat(${userChoice}, 1fr)`;\n containerDiv.style.gridTemplateRows = `repeat(${userChoice}, 1fr)`;\n}", "function changeRandomColor() {\n backColor = \"blue\";\n let divs = document.querySelectorAll(\"#grid div\");\n divs.forEach(div =>\n div.addEventListener(\"mouseover\", e => {\n let randomColor = Math.floor(Math.random() * 16777215).toString(16);\n e.currentTarget.style.background = `#${randomColor}`;\n })\n );\n}", "mouseEnter () {\r\n this.setState({bgColor: this.props.theme.headerMarketsHover})\r\n }", "handleMouseEnter(row, col) {\n if (!this.state.mouseIsPressed) return;\n const newGrid = getNewGridWithWallToggled(this.state.grid, row, col);\n this.setState({ grid: newGrid });\n }", "function makeGrid(){\n var rowNumber = prompt(\"How many rows on the grid?\");\n var sideSize = 700 / rowNumber;\n var elementNumber = \" \";\n for (var i = 0; i < rowNumber * rowNumber; i++){\n elementNumber += \"<div class = 'square'></div>\";\n }\n $(document).ready(function() {\n $('.square').remove(); //clears grid \n $('body').find(\"#container\").append(elementNumber);\n $('.square').css({\"height\": sideSize + 'px', \"width\": sideSize + 'px'});\n $(document).on('mouseenter', '.square', function() {\n $(this).css(\"background-color\", \"#255E69\");\n });\n });\n}", "handleMouseEnter(row, col) {\n if (!this.state.mouseIsPressed) return;\n const newGrid = getNewGridWithWallToggled(this.state.grid, row, col);\n this.setState({grid: newGrid});\n }", "function keepColor() {\r\nconst squareTarget = document.querySelectorAll('.squares');\r\nsquareTarget.forEach((e) => e.addEventListener('mouseover', function() {\r\n e.style.backgroundColor = randomColor();\r\n }));\r\n}", "function addHoverEffect() {\n $(\"#boxContainer\").on(\"mouseenter\", \".boxColumn .box\", function() {\n $(this).css(\"background-color\", genRandomColor());\n });\n}", "function mouseenterEventOn(square) {\n var _a;\n (_a = square.div) === null || _a === void 0 ? void 0 : _a.addEventListener('mouseenter', () => {\n square.b_rgb.brightness--;\n if (squareColor) {\n square.div.style.background = String(squareColor);\n }\n else {\n square.div.style.background = rgbToString(square.b_rgb);\n }\n });\n}", "function createGrid(gridSize){\n const gridWidth = 600 / gridSize;\n for (let rows = 0; rows < gridSize; rows++) {\n for (let columns = 0; columns < gridSize; columns++) {\n let div = document.createElement('div');\n div.className = \"grid\";\n div.style.width=(600 / gridSize) + 'px';\n div.style.height=(600 / gridSize) + 'px';\n container.appendChild(div);\n }\n }\n grids = document.querySelectorAll(\"#container div\");\n grids.forEach(grid => grid.addEventListener('mouseover', changeColor));\n}", "function createElement(size){\n let userClick = false;\n for(let i=0;i<size*size;i++){\n let newDiv=document.createElement('div');\n newDiv.classList.add('gridSquare');\n gridContainer.appendChild(newDiv);\n\n newDiv.addEventListener('mousedown',()=>{\n userClick=true;\n console.log(userClick);\n });\n newDiv.addEventListener('mouseup',()=>{\n userClick=false;\n console.log(userClick);\n });\n\n newDiv.addEventListener('mouseover',()=>{\n if(userClick===true){\n if(userColor==='black'){\n newDiv.style.backgroundColor='black';\n }\n else if(userColor==='red'){\n newDiv.style.backgroundColor=\"red\";\n }\n else if(userColor==='white'){\n newDiv.style.backgroundColor='white';\n }\n else if(userColor==='rainbow'){\n let red=Math.floor(Math.random()*255)+1;\n let green=Math.floor(Math.random()*255)+1;\n let blue=Math.floor(Math.random()*255)+1;\n newDiv.style.backgroundColor=`rgb(${red},${green},${blue})`;\n }\n } \n });\n }\n}", "function addHoverEffect(gridDiv, gridItem, totalNoOfCells) {\n let allCells = document.querySelectorAll(\".grid-item\");\n for (let i = 0; i < totalNoOfCells; i++) {\n allCells[i].addEventListener(\"mouseover\", draw);\n }\n}", "function setColorFunc() {\n newDivs = document.querySelectorAll('.newDiv');\n newDivs = Array.from(newDivs);\n if (black === true) {\n setColor.innerHTML = \"Rainbow\";\n setColor.style.color = \"blue\";\n setColor.style.backgroundColor = \"pink\";\n black = false;\n newDivs.forEach(div => {\n div.removeEventListener('mouseover', draw);\n div.addEventListener('mouseover',drawRainbow);\n });\n } else {\n setColor.innerHTML = \"Black\";\n setColor.style.color = \"white\";\n setColor.style.backgroundColor = \"black\";\n black = true;\n newDivs.forEach(div => {\n div.removeEventListener('mouseover', drawRainbow);\n div.addEventListener('mouseover',draw);\n });\n }\n}", "function mouseOverBox(){\n box.style.backgroundColor = \"blue\"\n}", "function coloring(event) {\n event.target.style.backgroundColor = pickColor();\n}", "function colorChanger(color){\n\n mouse.color = color;\n hold.style.background = color;\n\n\n\n\n}", "function drawing() {\n\n // For pencil-case\n Array.from(document.getElementsByClassName('grid-item')).forEach(function(item) {\n let hoverCount = 0;\n item.addEventListener('mouseenter', function(e) {\n if (e.shiftKey) {\n if (penColor === 'pencil') {\n \n // Assign black color with rgba(0,0,0,[add 0.1 with each step])\n e.target.style.backgroundColor = `rgba(0, 0, 0, 0.${hoverCount += 1})`;\n if (hoverCount >= 9) {\n hoverCount --;\n }\n } else if (penColor === 'rainbow') {\n\n // Assign random color\n e.target.style.backgroundColor = `rgb(${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)}, ${Math.floor(Math.random() * 256)})`;\n } else {\n\n // Assign black color\n e.target.style.backgroundColor = 'black';\n }\n }\n });\n});\n}", "function changeColor () {\n const sqrs = document.querySelectorAll('.square')\n const colorValue = document.getElementById('favcolor').value\n sqrs.forEach(square => {\n square.addEventListener('mouseenter',(event) => {\n event.target.style.backgroundColor = colorValue;\n });\n });\n}", "function makeGrid(sizeNum) {\n // remove previous grid?\n for(let i = 0; i < Math.pow(sizeNum, 2); i++) {\n const newDiv = document.createElement('div');\n container.append(newDiv);\n // add class to the new div, \n container.style.gridTemplateColumns = `repeat(${sizeNum}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${sizeNum}, 1fr)`;\n //remove the class from the div\n //on hover change the background color of the current div\n newDiv.addEventListener(\"mouseenter\", function( event ) {\n event.target.classList.add('grid');\n });\n }\n}", "function currentFieldMouseEnter() {\n if (gameState === 'playerWins') return;\n else if (currentField === 'leftField') {\n setLeftFieldStyle({\n border: '8px solid #abb2b9',\n backgroundColor: 'color',\n });\n } else {\n setRightFieldStyle({\n border: '8px solid #abb2b9',\n backgroundColor: 'color',\n });\n }\n }", "function gridInk(target) {\n target.style.backgroundColor = 'black';\n }", "function makeDivs(dimension){\n\n let container = document.querySelector(\".container\");\n\n let numDivs = dimension * dimension;\n\n for (i = 0; i < numDivs; i++) {\n\n let etchDiv = document.createElement(\"div\");\n \n etchDiv.classList.add(\"etch-div\");\n \n etchDiv.classList.add(\"color-new\");\n \n container.appendChild(etchDiv);\n\n }\n\n for(i = 0; i < numDivs; i++){\n\n document.querySelectorAll(\".etch-div\")[i].addEventListener(\"mouseover\", function (e) {\n\n e.target.classList.remove(\"color-new\");\n\n e.target.classList.add(\"color-drawn\");\n\n });\n }\n}", "function handleHover() {\n const innerDivArray = Array.from(document.querySelectorAll(\".innerDiv\"));\n innerDivArray.forEach((innerDiv) => {\n innerDiv.addEventListener(\"mouseover\", (event) => {\n event.target.style.backgroundColor = \"#91ff91\";\n });\n });\n}", "function addMouseoverEventListener() { \n for (let i = 0; i < paint.length; i++)\n {\n paint[i].addEventListener('mouseover', function() {\n this.style.backgroundColor = \"black\";\n });\n }\n }", "function holdMode(){\nfor(let i =1; i <= row; i++)\n{\n for(let j=1; j<= column; j++)\n {\n let columnID = \"row\"+ i + \"column\"+ j;\n document.getElementById(columnID).addEventListener(\"mouseover\",function(){\n if(filling == true)\n {\n document.getElementById(columnID).style.backgroundColor = color;\n }\n });\n }\n} \n}", "function makeRows(rows, cols) {\n\n container.style.setProperty('--grid-rows', rows);\n container.style.setProperty('--grid-cols', cols);\n for (c = 0; c < (rows * cols); c++) {\n let cell = document.createElement(\"div\");\n\n /*Mouseover event that will 'listen' or watch for an event where the\n mouse is over one of the grids. Then it will run the function and\n change the background color to black.*/\n cell.addEventListener(\"mouseover\", function() {\n cell.setAttribute(\"style\", \"background-color:black;\");\n });\n container.appendChild(cell).className = \"grid-item\";\n }\n}", "function opacityIncrease(){\n $('.wrapper > div').remove();\n var num = 10\n userGridSize(num);\n opa = 0.1\n $('.square').css(\"opacity\", opa);\n $('.square').css(\"background-color\", \"black\");\n $('.square').mouseenter(function(){\n opaval = $(this).css(\"opacity\");\n if (opaval < 1){\n $(this).css(\"opacity\", opaval*1.3);\n }\n });\n}", "function cellDraw() {\n if (pencilBtn.classList.contains(\"active\")) {\n cell = document.querySelectorAll(\".content\");\n for (let i = 0; i < cell.length; i++) {\n console.log(cell[i]);\n cell[i].addEventListener(\"mouseenter\", (e) => {\n e.target.style.backgroundColor = \"black\";\n });\n }\n } else if (rgbBtn.classList.contains(\"active\")) {\n cell = document.querySelectorAll(\".content\");\n for (let i = 0; i < cell.length; i++) {\n console.log(cell[i]);\n cell[i].addEventListener(\"mouseenter\", (e) => {\n e.target.style.backgroundColor =\n \"#\" + Math.floor(Math.random() * 16777215).toString(16);\n });\n }\n }\n}", "function mouseEnter() {\n const destinationText = document.querySelector('.content-destination');\n destinationText.addEventListener(\"mouseenter\", (e) => e.target.style.color = \"red\");\n}", "function createDivs(number){\n\n grid.empty();\n\n for (var i = 0; i < number; i++) {\n var divNew = $(\"<div id=grid-div-\" + i + \"></div>\").addClass(\"grid-div\");\n grid.append(divNew);\n }\n\n var gridDivs = $('.grid-div');\n // Place always the last hovered div at the end of this array\n //var activeDivArray = [];\n\n function divHoverIn(div){\n div.css({\n \"background-color\": \"rgb(130, 51, 98)\"\n });\n\n //activeDivArray.push(div);\n\n }\n\n function divHoverOut(div) {\n\n // if(activeDivArray.length >= tailLength) {\n // console.log(activeDivArray);\n //\n // activeDivArray[0].css({\n // \"background-color\": \"rgb(65, 156, 130)\"\n // });\n //\n // activeDivArray.shift();\n // console.log(activeDivArray);\n // }\n\n }\n\n gridDivs.hover(function() {\n divHoverIn( $( this ) );\n }, function() {\n divHoverOut( $( this ) );\n });\n }", "function randomGrid(v) {\n const content = document.createElement(\"div\");\n content.classList.add(\"box\");\n container.appendChild(content);\n for(var i = 0; i < v; i++){ \n var row = document.createElement(\"div\"); \n row.className = \"row\"; \n for(var j = 1; j <=v; j++){ \n var cell = document.createElement(\"div\"); \n cell.className = \"gridsquare\"; \n cell.addEventListener(\"mouseover\", changeColor);\n function changeColor(e) {\n const thisCell = e.target;\n var x = Math.floor(Math.random() * 256);\n var y = Math.floor(Math.random() * 256);\n var z = Math.floor(Math.random() * 256);\n var color = \"rgb(\" + x + \",\" + y + \",\" + z + \")\";\n thisCell.style.backgroundColor = color;\n thisCell.style.borderColor = color;\n }\n row.appendChild(cell); \n }\n content.appendChild(row); \n }\n}", "function setupMouseEvent(col, prefix, letters, rowId, columnId){\n col.onmouseover = function(){\n if (prefix !== 'P1') {return};\n for(var i = 1; i < 4; i++){\n var id = prefix + letters[columnId] + (rowId + i + 1);\n if (document.getElementById(id).style.backgroundColor !== \"blue\") {\n document.getElementById(id).style.backgroundColor = \"white\";\n }\n }\n if (document.getElementById(id).style.backgroundColor !== \"blue\") {\n col.style.backgroundColor = \"white\";\n }\n };\n col.onmouseout = function(){\n for(var i = 1; i < 4; i++){\n var id = prefix + letters[columnId] + (rowId + i + 1);\n if (document.getElementById(id).style.backgroundColor !== \"blue\") {\n document.getElementById(id).style.backgroundColor = \"transparent\";\n }\n }\n if (document.getElementById(id).style.backgroundColor !== \"blue\") {\n col.style.backgroundColor = \"transparent\";\n }\n };\n}", "function makeGridEle(ms) {\n let ediv = document.createElement(\"div\");\n ediv.classList.add('sketch');\n ediv.addEventListener('mouseover', function(e){ //mouseover changes color if hovered\n e.target.style.backgroundColor = 'black';\n console.log('hoover');\n });\n ediv.style.width = ms / dims + \"px\";\n console.log(Math.ceil(ms/dims));\n ediv.style.height = ms / dims + \"px\";\n\n return ediv;\n}", "function GridViewMouseEvents(objRef, evt) {\n var checkbox = objRef.getElementsByTagName(\"input\")[0];\n\n if (evt.type == \"mouseover\") {\n objRef.style.backgroundColor = \"#FFFF99\";\n }\n else {\n if (checkbox.checked) {\n objRef.style.backgroundColor = \"#FFFF99\";\n }\n else if (evt.type == \"mouseout\") {\n objRef.style.backgroundColor = \"#FFFFFF\";\n }\n }\n}", "function fillGrid(size) {\n for (let i = 0; i < size * size; i++) {\n const gridElement = document.createElement(\"div\");\n gridElement.classList = \"grid-element\";\n gridElement.addEventListener(\"mouseover\", changeColor);\n gridContainer.appendChild(gridElement);\n }\n}", "function makeRandomGrid(){\n var rowNumber = prompt(\"How many rows on the grid?\");\n var sideSize = 700 / rowNumber;\n var elementNumber = \" \";\n for (var i = 0; i < rowNumber * rowNumber; i++){\n elementNumber += \"<div class = 'square'></div>\";\n }\n function getRandomColor() { //generates random color\n function c() {\n var hex = Math.floor(Math.random()*256).toString(16);\n return (\"0\"+String(hex)).substr(-2); // pad with zero\n }\n return \"#\"+c()+c()+c();\n }\n $(document).ready(function() {\n $('.square').remove();\n $('body').find(\"#container\").append(elementNumber);\n $('.square').css({\"height\": sideSize + 'px', \"width\": sideSize + 'px'});\n $(document).on('mouseenter', '.square', function() {\n $(this).css(\"background-color\", getRandomColor);\n });\n });\n}", "function randomColor(){\n $('.wrapper > div').remove();\n var num = 10\n userGridSize(num);\n $('.square').css(\"background-color\", \"#CFCFCF\");\n $('.square').hover(function () {\n $(this).addClass(\"color\");\n randomColorMode();\n });\n}", "function changeGreenEnter() {\n $(this).css('background-color', 'green');\n }", "function draw() {\n let isClicked = false;\n const cells = document.querySelectorAll('.container-item');\n\n cells.forEach((item) => item.addEventListener('mousedown', () => {\n isClicked = true;\n }));\n\n cells.forEach((item) => item.addEventListener('mousemove', (event) => {\n if (isClicked === true) {\n event.target.style.background = colors[currentColor];\n }\n }));\n\n cells.forEach((item) => item.addEventListener('mouseup', () => {\n isClicked = false;\n }));\n}", "function addEvents(){\n\n\t$('table').mouseover(function(){\n //assign color to variable rgb\n\t\tvar color = \"rgb(\";\n\n //loop to assign new css color to table when mouseover\n\t\tfor (var i=0; i<3; i++){\n //assign random to a randome variable between 0 and 255\n\t\t\tvar random = Math.round(Math.random() * 255);\n\n\t\t\tcolor += random;\n //the else statement keeps running and only one value in rgb()\n\t\t\tif (i<2){\n\t\t\t\tcolor += \",\";\n\n\t\t\t} else {\n\t\t\t\tcolor += \")\";\n console.log(color)\n\t\t}};\n\n\n\t\t$(this).css('color', color);\n });\n //calls function clickme()\n clickme()\n\n\t}", "function pushColor(){\n\t\tvar showColor = document.getElementsByClassName('miniDiv');\n\t\tfor(var l = 0; l < showColor.length; l++){\n\t\t\tshowColor[l].addEventListener(\"click\", function(event){\n\t\t\tevent.target.style.backgroundColor = currColor;\n\t\t\t});\n\t\t}\n\n\t}", "function mouseOver(ref)\r\n{\r\n ref.style.background = \"#eeeeee\";\r\n}", "function mouseUpBox(){\n box.style.backgroundColor = \"yellow\"\n}", "function colorMe(now, event) {\n\tif(event.which != 1 && !now) {\n\t\treturn\n\t}\n\n\t// Draw the square\n\tevent.target.classList.replace(event.target.classList[1], document.querySelector(\"div.current-brush\").classList[1]);\n\n\tlet currentCoord = getCoords(event.target.id);\n\tif(lastCoord.length == 0) {\n\t\tlastCoord = currentCoord;\n\t}\n\n\tif(!disableLines && (Math.abs(lastCoord[0] - currentCoord[0]) > 1 || Math.abs(lastCoord[1] - currentCoord[1]) > 1)) {\n\t\t// Jumping occurred. Let's draw a line between the 2 points.\n\t\tconsole.log(\"Jump of \" + distance(currentCoord, lastCoord).toFixed(2) + \" squares occurred.\");\n\t\tlet line = calcLine(lastCoord[0], lastCoord[1], currentCoord[0], currentCoord[1]);\n\t\tline.shift();\n\n\t\tfor(coord of line) {\n\t\t\tsquare = document.getElementById(\"sq\" + getNum(coord));\n\t\t\tsquare.classList.replace(square.classList[1], document.querySelector(\"div.current-brush\").classList[1]);\n\t\t}\n\t}\n\n\tlastCoord = currentCoord;\n}", "function mouseReleased(){\n background(\"rgb(255, 24, 24)\");\n}", "function paint(cell) {\n cell.addEventListener('mouseover', () => {\n cell.style.backgroundColor = '#ff5733';\n });\n}", "onIntersectedByMouse(){\n }", "function addListeners(){\n \n\n Array.from(gridItem_div).forEach(function (e){\n e.addEventListener('mouseenter', function (e) {\n //console.log(e.target);\n this.classList.add(\"divChanged\");\n });\n });\n}", "function colorChosen(event) {\n\tbrush = document.querySelector(\"div.current-brush\");\n\tbrush.classList.replace(brush.classList[1], event.target.classList[1]);\n}", "function OnMouseEnter() {\n\tisMouseEnter = true;\n\t\n}", "function mousePressed() {\n background(\"rgb(233, 255, 232)\");\n\n}", "function createGridColor(size){\n gridSquare.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n gridSquare.style.gridTemplateRows = `repeat(${size}, 1fr)`;\n for(i=0; i<size*size; i++){\n const div = document.createElement('div');\n div.addEventListener('mouseover', fillColor);\n div.classList.add('square');\n gridSquare.appendChild(div);\n colorCnt = 0;\n }\n}", "function HandleMouseEnter(tag, event) {\n $(tag).css(\"border\", \"3px solid #967259\");\n}", "function paint() {\n\t$('.cell').hover(function() {\n\t\t$(this).css('background-color', 'hsl(0, 0%, 90%)');\n});\n}", "function handleMouseOver() { // Add interactivity\n// Use D3 to select element, change color and size\n\td3.select(this)\n\t\t.style(\"fill\", \"orange\")\n\t\t.attr(\"r\", 15);\n\t\n}", "function hoverColor() {\n colorful = !colorful;\n const squareDivs = document.querySelectorAll(\".square-div\");\n squareDivs.forEach(function(square) {\n square.addEventListener(\"mouseover\", function () {\n if (colorful) {\n square.style.backgroundColor = '#'+Math.floor(Math.random()*16777215).toString(16);\n colorButton.textContent = \"Greyscale\";\n }\n else {\n colorButton.textContent = \"Make it colorful!\";\n square.style.backgroundColor = \"grey\";\n }\n })\n square.addEventListener(\"click\", function () {\n square.style.backgroundColor = \"white\";\n })\n })\n}", "function mouseDownBox(){\n box.style.backgroundColor = \"red\"\n}", "function addGridListeners() {\n let gridCells = document.getElementsByClassName(\"gridCell\");\n\n for(i=0;i<gridCells.length;i++) {\n\n console.log(\"add listener\");\n\n gridCells[i].addEventListener('mouseover',changeCellColour, false); \n }\n}", "function box_1()\n{\n push()\n const left = box1.button_left\n const right = box1.button_left + box1.button_width + 200\n const top = box1.button_top\n const bottom = box1.button_top + box1.button_height \n\n const within_x = mouseX > left && mouseX < right\n const within_y = mouseY > top && mouseY < bottom\n box1.mouseIsOver = within_x && within_y\n\n let fill_colors = 220\n if(box1.mouseIsOver)\n {\n if(mouseIsPressed)\n {\n fill_colors = 50\n }\n else\n {\n fill_colors = 100\n }\n fill(fill_colors)\n }\n translate(box1.button_left, box1.button_top )\n rect(0, 0, box1.button_width, box1.button_height)\n pop()\n}", "function paint(event){\n event.target.style.backgroundColor = color;\n}", "function highlight(e){\neventobj=ns6? e.target : event.srcElement\nif (previous!=''){\nif (checkel(previous))\nprevious.style.backgroundColor=''\nprevious=eventobj\nif (checkel(eventobj))\neventobj.style.backgroundColor=highlightcolor\n}\nelse{\nif (checkel(eventobj))\neventobj.style.backgroundColor=highlightcolor\nprevious=eventobj\n}\n}", "function makeRows(rows, cols) {\n // change the css variable that holds rows/cols \n grid.style.setProperty('--grid-rows', rows);\n grid.style.setProperty('--grid-cols', cols);\n\n // create new divs inside of the main grid\n for(let i = 0; i < (rows * cols); i++) {\n let cell = document.createElement('div');\n // add event to change the color and add it to main div\n cell.addEventListener('mouseenter', colorize);\n grid.appendChild(cell).className = 'grid-item';\n }\n}", "function drawActiveGrid() {\n for (let a = 0; a < height; a++) {\n row = canvas.insertRow(a);\n // sets a click event listener and which sets color\n //from the user input\n row.addEventListener(\"click\", e => {\n //function setColor\n var clicked = e.target;\n color.addEventListener(\"change\", e =>\n //function onColorUpdate\n {\n selectedColor = e.target.value;\n }\n );\n clicked.style.backgroundColor = selectedColor;\n });\n for (let b = 0; b < width; b++) {\n cell = row.insertCell(b);\n }\n }\n }", "function drapal_mouseover() {\n if(mass_opener && (max_tab > 1)) {\n this.style.backgroundColor = \"rgba(255,255,255,0.7)\";\n this.style.color = \"black\";\n }\n}", "function fillGrid(size) {\n for (let i = 0; i < size * size; i++) {\n const gridElement = document.createElement(\"div\");\n gridElement.classList = \"grid-element\";\n gridElement.addEventListener(\"mouseover\", changeColor);\n gridContainer.appendChild(gridElement);\n }\n}", "function makeBlack() {\n const boxes = container.querySelectorAll('.box');\n black.textContent = 'Black';\n black.addEventListener('click', function () {\n boxes.forEach(box => box.addEventListener('mouseover', function () {\n this.style.background = 'black';\n }))\n })\n buttons.appendChild(black).classList.add('btn');\n}", "function handleMouseOverElement(e) {\n\t\t\te.currentTarget.addClassName('highlight');\n\t\t\ttheInterface.emit('ui:emphElement', {\n\t\t\t\tid : e.currentTarget.getAttribute('id'),\n\t\t\t\tlayer : e.currentTarget.getAttribute('data-layer')\n\t\t\t});\n\t\t}", "function draw() {\n\t$('div.box').hover(function() {\n\t\t$(this).css('background', 'black');\n\t});\n}", "function shadeCellUnderCursor(e){\n ctx.save();\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n var closestCell;\n var cellChanged = false;\n for (var i = 0; i < gridArray.length; i++) {\n cell = gridArray[i];\n if ((e.clientX + ((fullScreenWidth - currentScreenWidth) / 2) - 60 > cell.x && e.clientX + ((fullScreenWidth - currentScreenWidth) / 2) - 60 < (cell.x + 50)) && (e.clientY - 35 > cell.y && e.clientY - 35 < (cell.y + 50))) {\n if (closestCell != cell) {\n \n closestCell = cell;\n cellChanged = true;\n }\n }\n }\n ctx.fillStyle = \"rgba(50, 50, 50, 0.5)\";\n if (cellChanged == true) {\n ctx.fillRect(closestCell.x, closestCell.y, 50, 50);\n cellChanged = false;\n }\n drawBoard('dodgerblue', 'black', \"rgb(200, 200, 200)\");\n ctx.restore(); \n}", "function loadGrid(x){\n for (let i = 0; i < x; i++){\n let row = document.createElement('div');\n row.style.height = (640/x) + 'px';\n row.style.width = '640px';\n row.className = 'gridRows';\n gridContainer.appendChild(row); \n \n for (let j = 0; j < x; j++){\n let square = document.createElement('div');\n square.style.width = 640/x + 'px';\n square.style.height = 640/x + 'px';\n square.className = 'gridSquares';\n row.appendChild(square);\n square.onmouseover = function(){\n square.style.backgroundColor = whichColor;\n square.style.border = 'none';\n };\n } \n }\n}", "mouseEnter(event) {\n this.setHover();\n }" ]
[ "0.72700113", "0.7229293", "0.7220416", "0.71599734", "0.7148597", "0.7084653", "0.7040883", "0.7030561", "0.6970183", "0.69432956", "0.6924782", "0.6906458", "0.6903233", "0.6825146", "0.6822529", "0.6722741", "0.67190933", "0.6675205", "0.6655725", "0.66504765", "0.66392636", "0.6581957", "0.65705746", "0.65575945", "0.6503554", "0.65011823", "0.6494497", "0.6471447", "0.6463841", "0.64611393", "0.6450945", "0.6420623", "0.6419906", "0.6417874", "0.64122075", "0.640377", "0.63946694", "0.638438", "0.6378797", "0.63772106", "0.63709474", "0.6332439", "0.6322476", "0.632174", "0.63187546", "0.62999797", "0.62671727", "0.62655604", "0.6263408", "0.6258659", "0.62578017", "0.6255457", "0.62524205", "0.6237086", "0.6234064", "0.6227985", "0.6221396", "0.62166315", "0.6197072", "0.61929214", "0.6191544", "0.6178938", "0.61528003", "0.61515963", "0.6139482", "0.61394715", "0.61291337", "0.61284655", "0.61273277", "0.61264694", "0.61263937", "0.6124171", "0.61125016", "0.6089146", "0.60862964", "0.607511", "0.60676056", "0.60518175", "0.60458153", "0.60281205", "0.6017592", "0.60152364", "0.6013544", "0.60135096", "0.59949166", "0.5993997", "0.59917945", "0.59838957", "0.59786665", "0.5970748", "0.59680945", "0.5963059", "0.59583974", "0.5956972", "0.5942754", "0.59361994", "0.5929904", "0.5929195", "0.59262735", "0.59260863" ]
0.64983207
26
Prompts the user for a grid size when they click on the Create Grid button.
function gridPrompt() { var gprompt = prompt("Enter a number between 1 & 100 to create a grid." + " For example, 60 will create a 60 x 60 grid."); //If the user hits cancel, exits the prompt. if ( gprompt === null) { return; } else if ( gprompt > 100 || gprompt < 1 || isNaN(gprompt) === true) { alert("Please enter a number between 1 & 100"); gridPrompt(); } else { //Removes previous grid $('div div').remove(); createGrid(gprompt); changeColor(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function gridSize() {\n size = prompt(\"What size do you want the grid?\");\n createGrid(size, size);\n\n}", "function changeGridSize() {\n $(\"#gridSize\").click(function() {\n userDimension = prompt(\"Enter the grid size (i.e. enter 10 for a 10x10 grid)\")\n while (isNaN(userDimension) === true) {\n userDimension = prompt(\"Please enter a number for the grid size.\");\n }\n createDivs(userDimension, userSize);\n });\n}", "function customSize() {\n size.textContent = 'Grid Size';\n size.addEventListener('click', () => {\n let input = prompt('Please Enter a Grid Size');\n if (input === null || input < 1) {\n sizeSet();\n makeGrid(16, 16);\n makeGray();\n makeBlack();\n makeRGB();\n } else {\n sizeSet();\n makeGrid(input, input);\n makeGray();\n makeRGB();\n makeBlack();\n }\n })\n buttons.appendChild(size).classList.add('btn');\n}", "function changeSize() {\n row = prompt(\"Enter the amount of rows you want between 1 and 64.\");\n createGrid(row);\n}", "function resize(request) { \n if (request === 'resize') {\n let number = prompt(\"Please enter desired grid size (must be under 100)\", 16);\n }\n if (number <= 100) { \n makeGrid(number);\n } else {\n prompt(\"Invalid response! Grid size must be under 100!\");\n }\n \n}", "function selectGridSizeFunc() {\n container.innerHTML = \"\";\n const input = prompt(\"Please select a grid resolution. (input 64 for a 64 x 64 sketchpad)\", 16);\n setUpSketch(input);\n}", "function resizeGrid() {\n do {\n size = prompt(\"Enter a number from 1-125\");\n if (size === null || isNaN(size)) {\n return;\n }\n } while (size > 125);\n container.innerHTML = \"\";\n createGrid(size);\n draw();\n}", "function changeSize() {\n const minSize = 2;\n const maxSize = 64;\n let newSize = 0;\n\n while (newSize < minSize || newSize > maxSize) {\n newSize = prompt(`Enter a new size (${minSize}–${maxSize}):`, 0);\n\n // Stop if user cancels\n if (!newSize) {\n return;\n }\n }\n\n clear();\n createGrid(newSize);\n}", "function getGridSize () {\n let newSize = prompt (\"How many squares per side?\", \"64\");\n if (newSize > 64 || newSize === \" \") {\n warning ();\n // if user doesn't enter new gize, auto generate 16x16 grid \n } else if (newSize === null) {\n clearGrid();\n createGrid(16);\n }\n else {\n clearGrid();\n createGrid(newSize); \n } \n}", "function changeSize() {\n let newSize = prompt(\"Enter new size\");\n\n if (newSize !== null) {\n newSize = parseInt(newSize);\n if (newSize < 1 || newSize > 100 || Number.isNaN(newSize)) {\n alert(\"Enter a number from 1-100\");\n changeSize();\n } else {\n clearGrid();\n setGridSize(newSize);\n fillGrid(newSize);\n }\n }\n}", "function changeSize() {\n let newSize = prompt(\"Enter new size\");\n\n if (newSize !== null) {\n newSize = parseInt(newSize);\n if (newSize < 1 || newSize > 64 || Number.isNaN(newSize)) {\n alert(\"Enter a number from 1-64 range\");\n changeSize();\n } else {\n clearGrid();\n setGridSize(newSize);\n fillGrid(newSize);\n }\n }\n}", "function newSize() {\n\tvar newSize = prompt('Enter a number between 0 and 129.');\n\tif (newSize < 1 || newSize > 128) {\n\t\talert('That is definitely not between 0 and 129!');\n\t}\n\telse {\n\t\tdrawGrid(newSize);\n\t}\n}", "function createNewGrid() {\n let gridSide = prompt('How many squares per side ?');\n\n if (gridSide <= 64 && gridSide > 1) {\n etchySketchy = new GridSystem(gridSide);\n } else {\n alert('Side must be between 2 and 64 squares !');\n }\n}", "function setGridSize(){\n\t$('#squares-number-button').click(function(){\n\t\tvar gridSize = $('#squares-number-input').val();\n\t\tif(gridSize > 0){\n\t\t\t$('.squares').remove();\n\t\t\tcreateSquares(gridSize);\n\t\t\tcolorHover();\n\t\t\tgridSizeDisplay(gridSize);\n\t\t\t$('#squares-number-input').val('');\n\t\t}\n\t})\n}", "function userInput() {\n let gridSize = 1;\n while (gridSize < 2 || gridSize > 50) {\n gridSize = prompt(\"How many squares per side would you like your grid to have? Maximum of 50.\");\n }\n createChildDivs(gridSize);\n}", "function updateGrid(){\n //num = prompt(\"enter new grid dimensions\");\n clearGrid();\n newSizeGrid(num);\n}", "function gridSize(num){\n\n//if the original value given by the user is within the correct range\nif(num >= 2 && num <=64){\n//create square grid based on the argument assigned to the parameter num\nfor(x = 0; x < num; x++){\n for(let y = 0; y < num; y++){\n const boxDiv = document.createElement(\"div\")\n boxDiv.setAttribute(\"class\", \"boxDiv\")\n container.append(boxDiv)\n }\n } \n//add container id to body so that it can be manipulated using the DOM\n//style the container grid, ensuring the number of rows and columns is equal to the argument value\n body.append(container)\n document.querySelector(\".container\").style.gridTemplateColumns = `repeat(${num}, 1fr)`\n\n//else reprompt the user for a new number that is inbetween the correct range\n} else {\n\n //reprompt user for new argument value that fits within the range\n let updatedInput = prompt('Please choose a number between 2 and 64')\n\n //invoke the gridSize function again with the correct argument value\n gridSize(updatedInput)\n}\n\n\n\n}", "function promptInput() {\n var number = prompt(\"Enter a number to determine the size of the next grid\");\n if(parseInt(number)) {\n return number;\n } else {\n return 16;\n }\n}", "function userGridSize(num){\n var num = prompt(\"Please enter a number between 1 and 20\")\n while (num < 1 || num > 20 || isNaN(num)){\n alert(\"That's not a number between 1 and 20\")\n var num = prompt(\"Please enter a number between 1 and 20\")\n }\n createGrid(num);\n changeSquareColor();\n}", "function createGrid() {\r\n removeSquares(); // remove the previous squars\r\n let squares = [];\r\n let grid = prompt('How many squares you need in each direction?', 16);\r\n if(grid < 0 || grid > 64 || isNaN(grid)){ //Check if the input is a valid numbers\r\n\r\n alert(\"Please enter a valid number of grid more than 0 and less than or equal 64 grids.\")\r\n\r\n }else{\r\n let squareSize = (100 / grid) + '%';\r\n for (let i = 1; i <= grid ** 2; i++) {\r\n squares[i] = document.createElement('div');\r\n squares[i].id = 'square' + i;\r\n squares[i].className = 'squares';\r\n container.appendChild(squares[i]);\r\n }\r\n\r\n const squareStyle = document.querySelectorAll('.squares');\r\n squareStyle.forEach((e) => {\r\n e.setAttribute('style', `width:${squareSize};height:${squareSize};`);\r\n });\r\n keepColor();\r\n}\r\n}", "function checkSize(size) {\n\tif (typeof size !== 'number' || size <= 0 || size > 60) {\n\t\tsize = Math.floor(Math.random() * 60);\n\t\tsizeInput.value = `${size}`;\n\t}\n\tcreateGrid(size);\n}", "function operate(option) {\n\tif (option == 4) {\n\t\tclear();\n\t\treturn;\n}\npresent_option = option;\nvar size = prompt(\"Enter a Grid Size from 1 - 128.\");\nif ((size > 0) && (size < 128)) {\n\tpresent_size = size;\n\tclear();\n} else {\n\toperate(option);\n}\n}", "function buttonClicked() {\n \n let getGridSize = prompt(\"Please enter a new grid size (1-100)\");\n if (getGridSize >= 1 && getGridSize <=100){\n Array.from(gridItem_div).forEach(function (e){\n e.classList.remove(\"divChanged\");\n });\n gridSize = getGridSize; //modify global variable\n setGrid(gridSize);\n makeDivs() \n }\n}", "function changeValue(){\n\tvar newGridValue = prompt(\"Set the new size for the grid! WARNING: Values above 64 may cause lag: \");\n\tif(!isNaN(newGridValue) && newGridValue > 0 && (newGridValue % 1 === 0)){\n\t\tclearGrid();\n\t\tdrawGrid(newGridValue);\n\t\tpixelHover();\n\t} else {\n\t\talert(\"INVALID INPUT. Make sure you're writing a positive whole NUMBER!\");\n\t}\n}", "function userInput() {\n var h = 101;\n while (Number.isNaN(h) || h > 100) {\n h = prompt('How many squares do you want in the horizontal axis? (no more than 100): '); \n }\n var v = 101;\n while (Number.isNaN(v) || v > 100) {\n v = prompt('How many squares do you want in the vertical axis? (no more than 100): '); \n }\n createGrid(h, v);\n}", "function askForDimensions(){\n\n\t// Create new dialog window\n\tvar w = new Window (\"dialog\", \"Export PNG Scale\");\n\n\t// Group all inputs together\n\tvar scaleInputGroup = w.add(\"group\");\n\n\t// Put all inputs into a column\n\tscaleInputGroup.orientation = \"column\";\n\n\t// Group all width portions\n\tvar widthGroup = scaleInputGroup.add(\"group\");\n\n\t// Puts all width into a row\n\twidthGroup.orientation = \"row\"\n\n\t// Label for width\n\tvar widthLabel = widthGroup.add(\"statictext\", undefined, \"width in px\");\n\n\t// Editable text field for width\n\tvar widthField = widthGroup.add(\"edittext\", undefined, \"200\");\n\n\t// Sets number of characters allowed\n\twidthField.characters = 20;\n\n\t// Allows field to be editable\n\twidthField.active = true;\n\n\t// Group all height portions\n\tvar heightGroup = scaleInputGroup.add(\"group\");\n\n\t// Puts all height into a row\n\theightGroup.orientation = \"row\";\n\n\t// Label for height\n\tvar heightLabel = heightGroup.add(\"statictext\", undefined, \"height in px\");\n\n\t// Editable text field for width\n\tvar heightField = heightGroup.add(\"edittext\", undefined, \"200\");\n\n\t// Sets number of characters allowed\n\theightField.characters = 20;\n\n\t// Allows field to be editable\n\theightField.active = true;\n\t\n\n\t// Puts all buttons into a group\n\tvar buttonGroup = w.add(\"group\");\n\n\t// Sets all buttons into a row\n\tbuttonGroup.orientation = \"row\";\n\n\t// Aligns buttons to the left side\n\tbuttonGroup.alignment = \"left\";\n\n\t// Set confirm button\n\tvar confirmButton = buttonGroup.add(\"button\", undefined, \"OK\");\n\n\t// Create cancel button\n\tbuttonGroup.add(\"button\", undefined, \"Cancel\")\n\t\n\t// Callback to after the button has been clicked\n\tconfirmButton.onClick = function(){\n\n\t\t// Creates the scale for the height export\n\t\tvscale = parseInt(heightField.text)\n\n\t\t// Creates the scale for the width export\n\t\thscale = parseInt(widthField.text)\n\n\t\t// Closes the window\n\t\tw.close()\n\t}\n\t// Shows the window\n\tw.show ();\n}", "function addChangeSizeEvent(button) {\n button.addEventListener('click', () => {\n let newGridSize = getUserInput();\n resetBackGroundButton(button);\n removeGridChilds();\n generateGridElement(newGridSize);\n addSingleButtonEvents();\n })\n}", "function askC(){\n let ask = confirm(`Create new grid with ${out.value}x${out.value} squares with color mode?`);\n if (ask == true){\n reset();\n createGridColor(out.value);\n } else {\n alert('Canceled.');\n }\n}", "function populate() {\n\t\tvar temp = \"\";\n\t\tvar div = '<div class=\"squares\"></div>';\n\t\tvar input = parseInt(prompt(\"Choose a new grid size!\"), 10);\n\t\t$('.squares').remove();\n\t\tfor (var i = 1; i <= input * input; i++) {\n\t\t\ttemp += div;\n\t\t};\n\t\t$(\".wrapper\").append(temp);\n\t\tvar height = 640 / input;\n\t\t$('.squares').css('height', height);\n\t\t$('.squares').css('width', height);\n\t}", "function getNewSize() {\n //input defaults to the previously selected size for user convenience \n let newSize = parseInt(prompt(\"How large would you like your etch-a-sketch to be?\", size));\n //input validation\n\n while (!(typeof newSize === 'number' && newSize > 0 && newSize < 101)) {\n newSize = parseInt(prompt(\"Please enter a number between 1 and 100.\", size));\n }\n size = newSize\n numOfSquares = size * size;\n}", "function formSubmission() {\n event.preventDefault();\n var height = document.getElementById('inputHeight').value;\n var width = document.getElementById('inputWidth').value;\n makeGrid(height, width);\n}", "function reset() {\n const reset = document.getElementById(\"reset\");\n reset.addEventListener(\"click\", resetGrid);\n\n function resetGrid() {\n container.innerHTML = \"\";\n var cellNumber = prompt (\"Select grid size\", 16);\n if (cellNumber >=10 && cellNumber <= 100) {\n grid(cellNumber);\n console.log(\"cellNumber\");\n } else {\n alert(\"Select a number between 10 and 100\");\n }\n }\n}", "function resetGrid(){\n let divCount = prompt(\"How many boxes per side do you need?\");\n clearGrid();\n createGrid(divCount);\n}", "function autoSize() {\n gridManager.autoSize();\n}", "function sizeToFit() {\n gridManager.sizeToFit();\n}", "function testInput() { // function to validate user inputs\n\talert(\"working...\");\n\tvar columns = document.getElementById(\"x-axis\").value;\n\tvar rows = document.getElementById(\"y-axis\").value;\n\tvar mines = document.getElementById(\"mines\").value;\n\t\n\n\tif(columns<8 || rows<8 || columns>40 || rows>30) { // test that grids are within bounds\n\t\talert(\"Sorry, please enter a grid size between 8x8 and 40x30.\");\n\t}\n\telse if (mines>=(columns*rows)) { // test that the number of mines does not exceed the grid area\n\t\talert(\"Sorry, please enter a number of mines less than \" + (columns*rows));\n\t}\n\telse {\n\t\tvar popup_message = \"Your minesweeper grid will be: \" \n\t\t+ document.getElementById(\"x-axis\").value\n\t\t+ \" by \"\n\t\t+ document.getElementById(\"y-axis\").value;\n\t\talert(popup_message);\n\n\t\tcreateGrid(columns, rows, mines);\n\t}\n}", "function newSize(){\n\t\tvar input = prompt(\"Enter the number of rows (1-64)\");\n\t\tvar exit = false;\n\t\tdo {\n\t\t\tif((input < 1) || (input > 64)){\n\t\t\t\tinput = prompt(\"Please, enter a valid value or 'exit'\");\t\t\t\n\t\t\t}\n\t\t\telse if(input==\"exit\"){\n\t\t\t\treturn; //exit without change the old values\n\t\t\t}\t\n\t\t\telse{\n\t\t\t\texit = true;\n\t\t\t}\t\t\t\n\t\t}while (!exit)\n\t\tdefaultPixelsQuantity = parseInt(input);// just in case of no integer values\t\n\t\tfillYellowed(defaultPixelsQuantity); //draw new area\n}", "function askGrid(){\n $('.box').remove();\n var grid=+prompt(\"Click OK to reset the grid\", 16);\n myFunction(grid);\n makeSquare(grid);\n}", "function listener(event) {\n event.preventDefault();\n let inputHeight = document.getElementById(\"inputHeight\").value;\n let inputWidth = document.getElementById(\"inputWidth\").value;\n\n makeGrid(inputHeight, inputWidth);\n}", "function makeGrid() {\n // Avoid the creation of repeating elements (h3, h4 tags)\n setInitialStates();\n\n const tableHeight = $('#input_height').val();\n const tableWidth = $('#input_width').val();\n\n // clear the old canvas\n myTable.children().remove();\n\n //Set maximum limit for number inputs\n if(tableHeight>50||tableWidth>50){\n alert(\"Please Insert a Number Between 1 and 50 for GRID Height & Width\");\n // Function the removes the unnecessary info tags (at this point)\n setInitialStates();\n // Reset the input values\n $(\"form input[type=number]\").val(\"1\");\n return true;\n }else {\n // Create the table\n for (let n = 1; n<=tableHeight; n++){\n // Create rows\n myTable.append('<tr></tr>');\n for(let m = 1; m<=tableWidth; m++){\n $('tr').last().append('<td></td>');\n }\n }\n // Add the extra info\n addInfo();\n }\n}", "function resetGrid() {\n // remove the old grid\n const cells = Array.from(grid.childNodes);\n for(let i = 0; i < cells.length; i++)\n grid.removeChild(cells[i]);\n\n // get the new size\n let size = 0;\n while(size < 2 || size > 100 || isNaN(size)) {\n size = prompt(\"Enter a new grid size between 2 and 100:\");\n }\n // create a grid with the new size\n makeRows(size, size);\n}", "function setGridSize (newGrid) {\n\n\t\tnewGrid = newGrid || {};\n\n\t\tif (newGrid.rows) {\n\t\t\tgrid.rows = newGrid.rows;\t\n\t\t}\n\n\t\tif (newGrid.columns) {\n\t\t\tgrid.columns = newGrid.columns;\n\t\t}\n\t\t\n\n\t\tupdateGridText();\n\n\t\tupdateCanvas();\n\t}", "function userPrompt() {\n eraseGrid();\n let text = \"\";\n let userNumber = Number(prompt(\"Please enter a number between 1 and 100 to generate a new grid:\", \"16\"));\n if (userNumber == null || userNumber<1 || isNaN(userNumber) || userNumber>100|| !Number.isInteger(userNumber)) {\n text = \"Invalid entry, try again.\";\n }\n else {\n text = `An Etch-A-Sketch with a grid of <strong>${userNumber}x${userNumber}</strong> has been constructed for your \n for your pleasure.`;\n userChoice = userNumber; \n userGrid(userChoice); \n }\n document.getElementById(\"userText\").innerHTML = text;\n return userChoice;\n \n}", "function selectColor() {\nconst selectColor = document.getElementById(\"rdmColor\");\nselectColor.addEventListener(\"click\", resetRandom);\n\n function resetRandom() {\n container.innerHTML = \"\";\n var cellNumber = prompt (\"Select grid size\", 16);\n if (cellNumber >=10 && cellNumber <= 100) {\n randomGrid(cellNumber);\n console.log(\"random\");\n } else {\n alert(\"Select a number between 10 and 100\");\n }\n }\n}", "function newSize(){\n\n var size = prompt(\"Enter a new size! Size MUST be than 2 and less than 50.\");\n\n if((size < 50) && (size > 2)){\n current_size = size;\n clearSquare();\n } else {\n alert(\"Oops! You entered a size too big. Please try again!\");\n newSize();\n }\n}", "function makeGrid() {\n\n // get the table element\n const canvas = document.getElementById('pixelCanvas');\n // reset grid\n while(canvas.firstChild) {\n canvas.removeChild(canvas.firstChild);\n }\n\n\n var width = sizeForm.width.value;\n var height = sizeForm.height.value;\n console.debug(width);\n console.debug(height);\n \n // create grid with height and width inputs\n for(y = 0; y < height; y++) {\n row = canvas.appendChild(document.createElement('TR'));\n for(x = 0; x < width; x++) {\n cell = row.appendChild(document.createElement('TD'));\n }\n }\n\n canvas.addEventListener('click', changeColor);\n\n}", "function createGrid(width, height) {\n\n}", "function createGrid(size){\n gridContainer.style.display='grid';\n gridContainer.style.gridTemplateColumns=`repeat(${size},1fr)`;\n gridContainer.style.gridTemplateRows=`repeat(${size},1fr)`;\n createElement(size);\n}", "function makeGrid() {\n canvas.find('tablebody').remove();\n\n // \"submit\" the size form to update the grid size\n let gridRows = gridHeight.val();\n let gridCol = gridWeight.val();\n\n // set tablebody to the table\n canvas.append('<tablebody></tablebody>');\n\n let canvasBody = canvas.find('tablebody');\n\n // draw grid row\n for (let i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n // draw grid col\nfor (let i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n\n }", "function ask(e) {\n var sure = prompt('Are you sure you want to erase your drawing?');\n sure.toLowerCase;\n if (sure != 'yes') {\n return;\n }\n unpaint();\n deleteDivs();\n var h = prompt('How many squares do you want in the horizontal axis?: ');\n var v = prompt('Hoy many squares do you want in the vertical axis?: ');\n createGrid(h, v);\n}", "function makeGrid() {\n // prevent submit button from reloading page\n event.preventDefault();\n const grid = document.querySelector(\"table\");\n // clear any previously created table\n grid.innerHTML = \"\";\n // get the users size input\n const size = getSize();\n const width = size[0];\n const height = size[1];\n for (let y = 0; y < height; y++) {\n // table row is intitialized inside the for loop so as to create a different <tr> in each loop\n const tableRow = document.createElement(\"tr\");\n grid.appendChild(tableRow);\n for (let x = 0; x < width; x++) {\n const tableColumn = document.createElement(\"td\");\n tableRow.appendChild(tableColumn);\n }\n }\n grid.addEventListener(\"click\", setCellColor);\n}", "function gridSize(){\n var rows = countRows();\n var cols = countColumns();\n var sizeText = rows + \" x \" + cols;\n return sizeText;\n}", "setWidth(){\n var newWidth = prompt(\"Enter a new bitmap width: \", 8);\n if(newWidth != null){\n newWidth = parseInt(newWidth);\n if(newWidth != NaN){\n if(newWidth >= 1 && newWidth <= 72){\n this.COLUMN_COUNT = newWidth;\n this.updatePanelTitle();\n this.renderGrid();\n this.saveLocally();\n this.applyGridSize();\n return true;\n }else{\n alert(\"That width is too large or small (min: 1, max: 72)\");\n return false;\n }\n }\n }\n return false;\n }", "function settings()\r\n{\r\n if(ready)\r\n {\r\n var sizeInput = prompt(\"Indiquez les nouvelles dimensions du jeu:\", 4);\r\n\r\n if(sizeInput != null)\r\n {\r\n var newSize = parseInt(sizeInput);\r\n\r\n if(newSize > 1 && newSize < 100)\r\n {\r\n size = newSize; // Update de la nouvelle size\r\n }\r\n else \r\n {\r\n alert(\"Les dimensions du jeu doivent être entre 2 et 99 inclusivement!\");\r\n settings();\r\n }\r\n }\r\n else \r\n {\r\n ready = false;\r\n settingToRestart = false;\r\n }\r\n }\r\n else if(confirm(\"La partie en cours sera perdue. Êtes-vous certains?\"))\r\n {\r\n ready = true;\r\n settingToRestart=true;\r\n settings();\r\n\r\n if(settingToRestart)\r\n restart();\r\n }\r\n}", "function showDialog()\r\n{\r\n\t// Create a new dialog box with a single panel\r\n\tvar dialog = new Window(\"dialog\", \"Sprite Sheet Splitter\");\r\n\tvar sizePanel = dialog.add(\"panel\", [0,0,215,180], \"Sprite Sheet Size\");\r\n\r\n\t// Number of columns\r\n\tvar numColsLabel = sizePanel.add(\"statictext\", [25,25,150,35], \"Number of columns:\");\r\n\tvar numColsText = sizePanel.add(\"edittext\", [145,24,185,43], 4);\r\n\r\n\t// Number of rows\r\n\tvar numRowsLabel = sizePanel.add(\"statictext\", [25,55,150,65], \"Number of rows:\");\r\n\tvar numRowsText = sizePanel.add(\"edittext\", [145,54,185,73], 4);\r\n\tnumRowsLabel.enabled = false;\r\n\tnumRowsText.enabled = false;\r\n\r\n\t// Checkbox for making the number of cols/rows the same\r\n\tvar equalRowsLabel = sizePanel.add(\"statictext\", [25,85,150,95], \"Equal cols/rows:\");\r\n\tvar equalRowsBox = sizePanel.add(\"checkbox\", [145,85,175,105]);\r\n\tequalRowsBox.value = true;\r\n\r\n\t// When the checkbox is clicked, enable/disable the second input box\r\n\tequalRowsBox.onClick = function()\r\n\t{\r\n\t\tnumRowsLabel.enabled = !numRowsLabel.enabled; \r\n\t\tnumRowsText.enabled = !numRowsText.enabled; \r\n\t\t\r\n\t\tif(equalRowsBox.value == true)\r\n\t\t\tnumRowsText.text = numColsText.text;\r\n\t}\r\n\r\n\t// Make the number of rows match the number of columns if necessary\r\n\tnumColsText.onChanging = function()\r\n\t{\r\n\t\tif(equalRowsBox.value == true)\r\n\t\t\tnumRowsText.text = numColsText.text; \r\n\t}\r\n\r\n\t// Buttons for OK/Cancel\r\n\tvar okButton = sizePanel.add(\"button\", [25,125,100,150], \"OK\", {name:'ok'});\r\n\tvar cancelButton = sizePanel.add(\"button\", [110,125,185,150], \"Cancel\", {name:'cancel'});\r\n\r\n\t// Event handler for OK button\r\n\tokButton.onClick = function()\r\n\t{\r\n\t\tnumCols = parseInt(numColsText.text);\r\n\t\tnumRows = parseInt(numRowsText.text);\r\n\t\tdialog.close(0);\r\n\t}\r\n\r\n\t// Event handler for Cancel button\r\n\tcancelButton.onClick = function()\r\n\t{\r\n\t\tdialog.close();\r\n\t\tuserCancelled = true;\r\n\t}\r\n\r\n\tdialog.center();\r\n\tdialog.show();\r\n}", "function setGridSize(size) {\n gridContainer.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function setGridSize(size) {\n gridContainer.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function refreshGrid(){\n clearGrid();\n makeGrid(document.getElementById(\"input_height\").value, document.getElementById(\"input_width\").value);\n}", "function defaultGrid(){\n gridSize(24)\n createDivs(24)\n}", "function makeGrid() {\n // reset pixel canvas\n $(\"#pixelCanvas\").html(\"\");\n // Select size input\n height = $(\"#inputHeight\").val();\n width = $(\"#inputWeight\").val();\n //loop to add table cells and rows according to user input\n for (let x = 0; x < height; x++) {\n $('#pixelCanvas').append('<tr></tr>');\n }\n for (let y = 0; y < width; y++) {\n $('#pixelCanvas tr').each(function () {\n $(this).append('<td></td>');\n });\n }\n}", "function createGrid(size) {\n container.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${size}, 1fr)`;\n}", "function replaceGrid() {\n nCells = prompt('Enter a number between 1 and 50');\n if (nCells > 50 || nCells < 1) {\n if (typeof(nCells) != 'object') {\n alert(\"Not in range!\");\n }\n } else {\n while (container.hasChildNodes()) {\n container.removeChild(container.firstChild);\n }\n // Remove old grid\n makeGrid(nCells);\n draw();\n // Establish new grid\n }\n}", "function getUserChoice(userInput){\n if(userInput > 1 && userInput < 10){\n createGrid(userInput);\n }\n else {\n getUserChoice(prompt('Please enter a valid number'));\n }\n}", "function changeMaxTeamSize() {\n if (maxTeamSize < 8) {\n maxTeamSize = maxTeamSize + 1;\n } else {\n maxTeamSize = 2;\n }\n document.getElementById(\"teamsizebutton\").textContent = maxTeamSize + \" Max Team Size\";\n initializeTeamArrays();\n}", "function setMaximumGridSize() {\n var maxCols = Math.floor( ($(window).width() - 42) / 40);\n var maxRows = Math.floor( ($(window).height() - 42) / 40);\n $(\"#rows\").prop(\"min\", 1).prop(\"max\", maxRows);\n $(\"#cols\").prop(\"min\", 1).prop(\"max\", maxCols);\n // $(\"#message\").text(\"Maximum rows = \" + maxRows + \" and maximum columns = \" + maxCols);\n}", "function createGrid(size) {\n\tif (gridBlocks.length > 0) {\n\t\tfor (let block = 0; block < gridBlocks.length; block++) {\n\t\t\tcontainer.removeChild(gridBlocks[block]);\n\t\t}\n\n\t\tgridBlocks = [];\n\t}\n\n\tcontainer.style['grid-template-columns'] = `repeat(${size}, 1fr)`;\n\n\tfor (let i = 0; i < (size * size); i++) {\n\t\tconst gridBlock = document.createElement('div');\n\t\tgridBlock.style.width = `${480 / size}`;\n\t\tgridBlock.style.height = `${480 / size}`;\n\t\tgridBlock.style.border = '1px solid rgba(0, 0, 0, 0.3)';\n\t\tcontainer.appendChild(gridBlock);\n\n\t\tgridBlocks.push(gridBlock);\n\t}\n\n\tcheckForClick();\n\n}", "function checkPrompt(input) {\n if (input >= 1 && input <= 64) {\n changeSize(input);\n }\n else {\n input = prompt(\"Your size did not work! Please choose between 1 and 64!\");\n checkPrompt(input);\n }\n}", "function gridSize(){\n\t//eventaully this function will adjust has row and col numbers need to be more dynamic\n\tvar obj = {};\n \n\tobj.cols = 15;\n\tobj.rows = 30;\n\tobj.rowHeight = 21;\n\tobj.colWidth = 100;\n\t\n\treturn obj;\n}", "function createGrid(gridSize) {\n const outerContainer = document.querySelector(\"#outer-container\");\n const container = document.createElement('div');\n container.setAttribute(\"id\", \"container\");\n outerContainer.appendChild(container);\n container.style = \"grid-template-columns: repeat(\"+ gridSize +\", 1fr)\";\n const informationBox = document.querySelector(\"#information-box\");\n outerContainer.insertBefore(container,informationBox);\n for (let i = 0; i < (gridSize * gridSize); i++) {\n const container = document.querySelector('#container');\n\n const div = document.createElement('div');\n div.className = 'grid-block';\n container.appendChild(div);\n }\n}", "function askForNewInput(){\n // inform user about wrong input\n alert(\"Both the height and width should be less or equal to 50!\\nPlease enter new valid values.\");\n\n // initialize input values\n $('#input_height').val(1);\n $('#input_width').val(1);\n\n // delet previous canvas if there is any\n deleteCanvas();\n}", "function gridSize(size) {\n container.style.gridTemplateColumns = `repeat(${size}, 1fr)`;\n}", "function makeGrid() {\n\n\t// Your code goes here!\n\t\n\tlet submit = $('input[type=\"submit\"]');\n\tlet canvas = $('#pixelCanvas');\n\tlet colorPicker = $('#colorPicker');\n\n\tsubmit.on('click', function(e){\n\t\te.preventDefault();\n\t\tcanvas.empty();\n\t\tlet height = $('#inputHeight').val();\n\t\tlet width = $('#inputWeight').val();\n\t\tconsole.log(height);\n\t\tconsole.log(width);\n\t\taddRows(height, width);\n\t});\n\t\n\tfunction addRows(height,width){\n\t\tfor(var i=0; i < height; i++) {\n\t\t\tcanvas.append('<tr></tr>');\n\t\t}addColumns(width);\n\t}\n\t\n\tfunction addColumns(width){\n\t\tfor(var i=0; i <width; i++) {\n\t\t\tlet cell=$('<td></td>',{class:'cells'});\n\t\t\n\t\t\tcell.on('click',function(e){\n\t\t\t\te.preventDefault()\n\t\t\t\tlet color = colorPicker.val();\n\t\t\t\t$(this).css('background-color', color);\n\t\t\t});\n\n\t\t\t$('tr').append(cell);\n\t\t}\n\t}\n\n\t$('#clear').on('click', function(e){\n\t\te.preventDefault();\n\t\t$('.cells').css('background-color','');\n\t})\n}", "function makeGrid() {\n canvas.find('tbody').remove();\n\n //submit button size changes to fit grid size\n var gridRows = heightInput.val();\n var gridCol = weightInput.val();\n\n //tbody set to the table\n canvas.append('<tbody></tbody>');\n\n var canvasBody = canvas.find('tbody');\n\n //drawing grid rows\n for (var i = 0; i < gridRows; i++) {\n canvasBody.append('<tr></tr>');\n }\n\n //draw grid col\n for (var i = 0; i < gridCol; i++) {\n canvas.find('tr').append('<td class=\"transparent\"></td>');\n }\n }", "function createGrid(size = 4) {\n \n if ( size > 64 || isNaN(size)) return alert('the number has to be less than 64');\n \n for (let i = 0 ; i<size*size; i++){\n const createDivs = document.createElement('div');\n createDivs.style.width = `${(100/size)-0.4}%`;\n createDivs.classList.add('grid');\n main.appendChild(createDivs);\n}\n mouseOver();\n}", "function makeGrid() {\n\n\n}", "function mouseClicked(){\n //resizes gridSpacing based on mouse click with shift\n windowResized();\n rectGrid();\n if (keyIsDown(SHIFT)){\n gridSpacing += 1;\n }\n else if (gridSpacing !== 8){\n gridSpacing -= 1;\n }\n}", "function resizeGrid(gridSize){\n while(gridContainer.firstChild) {\n gridContainer.removeChild(gridContainer.firstChild);\n }\n gridContainer.style.gridTemplateColumns = `repeat(${gridSize}, ${600/gridSize}px)`;\n gridContainer.style.gridTemplateRows = `repeat(${gridSize}, ${600/gridSize}px)`;\n for(row = 1; row <= gridSize; row++) {\n for(col = 1; col <= gridSize; col++){\n div = document.createElement(\"div\");\n div.className = \"gridBox\";\n div.style.gridColumnStart = col;\n div.style.gridColumnEnd = (col + 1);\n div.style.gridRowStart = row;\n div.style.gridRowEnd = (row + 1);\n div.style.backgroundColor = 'rgb(255, 255, 255)';\n gridContainer.appendChild(div);\n }\n }\n }", "setHeight(){\n var newHeight = prompt(\"Enter a new bitmap height: \", 8);\n if(newHeight != null){\n newHeight = parseInt(newHeight);\n if(newHeight != NaN){\n if(newHeight >= 1 && newHeight <= 40){\n this.ROW_COUNT = newHeight;\n this.updatePanelTitle();\n this.renderGrid();\n this.saveLocally();\n this.applyGridSize();\n return true;\n }else{\n alert(\"That height is too large (min: 1, max: 40)\")\n return false;\n }\n }\n }\n return false;\n }", "function calcCellSize(grid_size) {\n var cell_size = 5;\n return cell_size\n}", "function changeGridSize(){\n gridContainer.innerHTML = ''; //clear grid Container before adding new divs\n let gridSize = parseInt(slider.value,10);\n for (let i=1; i<=Math.pow(gridSize,2); i++){\n addElement();\n\n };\n gridContainer.style[\"grid-template-columns\"] = \"repeat(\" + gridSize + \", 1fr)\";\n}", "function submitForm() {\n\t$( \"#sizePicker\" ).on( \"submit\", function( evt ) {\n\t\tevt.preventDefault();\n\t\tmakeGrid();\n\t});\n}", "function getNumBlocks() {\n\tvar tempSize, badSize = true;\n\t//test for proper grid size and deny if outside specified range\n\tdo {\n\t\ttempSize = +prompt(\"Please specifiy a grid size between 16-64\", 16);\n\t\tif (tempSize >= 16 && tempSize <= 64) {\n\t\t\tbadSize = false;\n\t\t} else {\n\t\t\talert(\"Your choice of \" + tempSize + \" is outside the specified range. Please try again.\");\n\t\t}\n\t} while (badSize)\n\treturn tempSize;\n}", "function checkAspectRatio(sw, sh, pw) {\n\n let nearestW = Math.ceil(sw / pw) * pw;\n let nearestH = Math.ceil(sh / pw) * pw;\n\n $('.menu_options__ssize input.w').val(nearestW);\n $('.menu_options__ssize input.w').val(nearestW);\n $('.menu_options__ssize input.h').val(nearestH);\n\n sw = $('.menu_options__ssize input.w').val();\n sh = $('.menu_options__ssize input.h').val();\n\n $('button.s').data('size',`${sw},${sh}`);\n $('button.m').data('size',`${sw * 1.5},${sh * 1.5}`);\n $('button.l').data('size',`${sw * 2},${sh * 2}`);\n $('button.xl').data('size',`${sw * 2.5},${sh * 2.5}`);\n\n drawGrid(sw, sh, pw);\n}", "function makeGrid(event) {\r\n \tevent.preventDefault();\r\n \t// height and width values declared to create the pixel canvas\r\n\tlet height = inputHeight.value;\r\n\tlet width = inputWidth.value;\r\n\t//creating a blank table in the HTML\r\n \ttable.innerHTML = \"\";\r\n \t//build table depending on values entered by the user. Reviewed the knowledge area to get the table to build.\r\n \tfor (let r = 0; r < height; r++) {\r\n \tlet row = document.createElement(\"tr\");\r\n \tfor (let c = 0; c < width; c++) {\r\n \t\tlet cell = document.createElement(\"td\");\r\n \t\trow.appendChild(cell); //append the column to the table\r\n \t\tcell.addEventListener(\"click\", function (cellColor) {\r\n \t\tcellColor.target.style.backgroundColor = color.value; //set background color to user selection.\r\n \t\t});\r\n \t}\r\n table.appendChild(row);\r\n //append the row to the table.\r\n //The placement of this action was identified on the knowledge area, as initially had this after declaring the row variable.\r\n \t}\r\n}", "function drawResizedGrid(newGridSize) {\n gridContainer.innerHTML = '';\n drawGrid(newGridSize)\n}", "function setGrid(gridSize){\n container.style.gridTemplateColumns = `repeat(${gridSize}, 1fr)`;\n container.style.gridTemplateRows = `repeat(${gridSize}, 1fr)`;\n}", "function setup() {\n\t//reset gridcontainer each time button is pressed\n\tdocument.getElementById('gameboard').innerHTML = '';\n\t\n\t// get user input\n\tvar rows = parseInt(document.getElementById('numrows').value, 10);\n\tvar cols = parseInt(document.getElementById('numcols').value, 10);\n\t\n\t// create and setup the game board\n\tgame = new BattleshipGame(rows, cols, 50, document.getElementById(\"gameboard\"));\n\tconsole.log('Set up new game with a ' + rows + ' by ' + cols + ' board.');\n\tconsole.log(game);\n}", "function editor_tools_handle_size()\n{\n editor_tools_store_range();\n\n // Create the size picker on first access.\n if (!editor_tools_size_picker_obj)\n {\n // Create a new popup.\n var popup = editor_tools_construct_popup('editor-tools-size-picker','l');\n editor_tools_size_picker_obj = popup[0];\n var content_obj = popup[1];\n\n // Populate the new popup.\n for (var i = 0; i < editor_tools_size_picker_sizes.length; i++)\n {\n var size = editor_tools_size_picker_sizes[i];\n var a_obj = document.createElement('a');\n a_obj.href = 'javascript:editor_tools_handle_size_select(\"' + size + '\")';\n a_obj.style.fontSize = size;\n a_obj.innerHTML = editor_tools_translate(size);\n content_obj.appendChild(a_obj);\n\n var br_obj = document.createElement('br');\n content_obj.appendChild(br_obj);\n }\n\n // Register the popup with the editor tools.\n editor_tools_register_popup_object(editor_tools_size_picker_obj);\n }\n\n // Display the popup.\n var button_obj = document.getElementById('editor-tools-img-size');\n editor_tools_toggle_popup(editor_tools_size_picker_obj, button_obj);\n}", "function getMatrixSize() {\r\n\tchosenSize = document.getElementById(\"matrixSize\").value;\r\n}", "function makeGrid(event1) {\n// 1. We get the reference where we should place the table\nvar tableplace = document.getElementById(\"pixelCanvas\")\n//1.1 We take the table place reference and clear the old grid\ntableplace.innerHTML = \" \";\n// 2. We get the sizes of our inputs\nvar Height = document.getElementById(\"inputHeight\").value;\nvar Widht = document.getElementById(\"inputWidth\").value;\n// 3. We do a loop to create a new <tr> (row) for each number on our height input\n for (var row = 0; row < Height; row++) {\n let newrow = tableplace.insertRow(row);\n// 4. We do a loop, inside the loop of step 4, to create a new column <td> for each number on the input width\n for (var columns = 0; columns < Widht; columns++) {\n let newcell = newrow.insertCell(columns);\n //With this function Im going to let the user colored and specific square\n newcell.addEventListener(\"click\", function () {\n newcell.style.backgroundColor = color.value\n })\n }\n }\nevent1.preventDefault();\n}", "function getGridSize() {\n\t return (window.innerWidth < 600) ? 2 :\n\t\t (window.innerWidth < 800) ? 3 :\n\t\t (window.innerWidth < 900) ? 4 : 5;\n\t }", "function reset(gridWidth, gridHeight){\n\t$( \"#dialog-confirm\" ).dialog({\n\t\tresizable: false,\n\t\theight: \"auto\",\n\t\twidth: 400,\n\t\tmodal: true,\n\t\tbuttons: {\n\t\t\t\"Reset Canvas\": function() {\n\t\t\t $( this ).dialog( \"close\" );\n\t\t\t makeGrid(gridWidth, gridHeight);\n\t\t\t},\n\t\t\tCancel: function() {\n\t\t\t $( this ).dialog( \"close\" );\n\t\t\t}\n\t\t}\n\t});\n}", "SetOverallGridSize(value){\n\t\tvar chk = new Checker(\"SetOverallGridSize\");\n\t\tchk.isValidType(value, \"value\", 'number');\n\t\tthis.overallGridSize = value;\n\t\t\n\t}", "function handleMazeSize() {\n \"use strict\";\n var r = document.getElementById(\"height\"),\n c = document.getElementById(\"width\");\n NUM_COLS = parseInt(c.value, 10) || NUM_COLS;\n if (NUM_COLS % 2 !== 1) {\n // Don't want an even number...\n NUM_COLS += 1;\n }\n // Update the width input box..\n c.value = NUM_COLS;\n NUM_ROWS = parseInt(r.value, 10) || NUM_ROWS;\n if (NUM_ROWS % 2 !== 1) {\n NUM_ROWS += 1;\n }\n // Update the height input box..\n r.value = NUM_ROWS;\n}", "function getGridSize() {\n return (window.innerWidth < 320) ? 1 :\n (window.innerWidth < 600) ? 2 :\n (window.innerWidth < 800) ? 3 :\n (window.innerWidth < 900) ? 4 : 5;\n }", "function makeGrid(event) {\n// Your code goes here!\n event.preventDefault();\n let height = heightInput.value;\n let width = widthInput.value;\n console.log(height + \",\" + width);\n while (pixelCanvas.firstChild) {\n pixelCanvas.removeChild(pixelCanvas.firstChild);\n }\n\n for (let i = 0; i < height; i++) {\n let newRow = document.createElement(\"tr\");\n for (let j = 0; j < width; j++) {\n let newTd = document.createElement(\"td\");\n newRow.appendChild(newTd);\n }\n pixelCanvas.append(newRow);\n }\n}", "function getGridSize() {\n return window.innerWidth < 600 ? 1 : window.innerWidth < 900 ? 2 : 3;\n }", "function setDefaultGrid() {\n setGridSize(16);\n fillGrid(16);\n}", "function createGrid([width = 5, height = 5]) {\n return `Generates a ${width} x ${height} grid`;\n}", "function makeGrid(e) {\n // Select color input\n // const colorPicked = document.getElementById('colorPicker').value;\n // Select size input\n //height (tr)\n let inputHeight = document.getElementById('inputHeight').value;\n // console.log(inputHeight);\n //width (td)\n let inputWidth = document.getElementById('inputWidth').value;\n // console.log(inputWidth);\n // canvas\n let pixelCnvs = document.getElementById('pixelCanvas');\n pixelCnvs.innerHTML = '';\n // adding tr and td to the table\n let tableBody = document.createElement('tbody');\n for(let i = 0; i < inputHeight; i++) {\n let tableRow = document.createElement('tr');\n for (let j = 0; j < inputWidth; j++) {\n let tableColumn = document.createElement('td');\n tableColumn.appendChild(document.createTextNode(''));\n tableRow.appendChild(tableColumn);\n }\n tableBody.appendChild(tableRow);\n }\n pixelCnvs.appendChild(tableBody);\n e.preventDefault();\n\n}" ]
[ "0.8320363", "0.79700446", "0.78062344", "0.7760569", "0.7658037", "0.7616819", "0.7501996", "0.7445124", "0.7361827", "0.7321994", "0.71696794", "0.7148174", "0.7117558", "0.70880324", "0.7057192", "0.7000555", "0.695037", "0.66914827", "0.6577477", "0.65454835", "0.6498492", "0.64372253", "0.6434368", "0.6406296", "0.63781697", "0.6370449", "0.6341867", "0.63372827", "0.63227427", "0.6283567", "0.61872745", "0.6174723", "0.6137924", "0.6129483", "0.6125713", "0.60903156", "0.60803205", "0.6072682", "0.60591316", "0.60477895", "0.6036692", "0.60156083", "0.6013403", "0.6003021", "0.59983057", "0.59755445", "0.5953326", "0.5910644", "0.59103566", "0.58835554", "0.5857515", "0.583453", "0.5821851", "0.5803833", "0.5795213", "0.5786076", "0.574576", "0.572764", "0.57276106", "0.57132244", "0.5708712", "0.57059324", "0.56933695", "0.56802934", "0.56757724", "0.5656591", "0.5653271", "0.5649368", "0.56376284", "0.56332165", "0.5610677", "0.5606299", "0.56047946", "0.5576758", "0.5574651", "0.556918", "0.5557433", "0.5550789", "0.5549796", "0.55405664", "0.55405045", "0.551757", "0.54988694", "0.5485305", "0.54833597", "0.5473948", "0.5454925", "0.54479903", "0.5439922", "0.54278153", "0.54104114", "0.5402095", "0.53982437", "0.53958434", "0.5393552", "0.5392343", "0.5390451", "0.53868335", "0.5383344", "0.53818744" ]
0.6791367
17
Prime Number Cruncher Bilangan prima adalah sebuah bilangan dimana hanya bisa habis dibagi oleh angka 1 dan angka itu sendiri. 7 adalah bilangan prima, karena hanya habis dibagi angka 1 dan 7. 22 BUKAN bilangan prima, karena habis dibagi 1, 2, 11, dan 22. PROBLEM: Disediakan sebuah function primeNumberCruncher yang menerima sebuah parameter berupa number, dan mengembalikan kumpulan angka prima yang lebih besar dari ratarata kumpulan angka prima dari inputan parameter tersebut. Contoh 1: input: 10 proses: kumpulan deret array prima sampai `input`: [ 2, 3, 5, 7 ] 2 + 3 + 5 + 7 = 17 AVERAGE: 17/4 = 4.25 output: [5, 7] Contoh 2: input: 44 proses: kumpulan deret array prima sampai `input`: [ 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43 ] 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 + 29 + 31 + 37 + 41 + 43 = 281 AVERAGE: 281/14 = 20.07 Output: [ 23, 29, 31, 37, 41, 43 ] Contoh 3: input: 23 proses: kumpulan deret array prima sampai `input`: [ 2, 3, 5, 7, 11, 13, 17, 19, 23 ] 2 + 3 + 5 + 7 + 11 + 13 + 17 + 19 + 23 = 100 AVERAGE: 100/9 = 11.11 output: [ 13, 17, 19, 23 ] RULES DILARANG MENGGUNAKAN BUILTIN FUNCTION JS APAPUN SELAIN .push
function numberPrimeCruncher(angka) { var arrPrime = []; var arrTemp = []; var total = 0; var newArrPrime = []; for (let i = 2; i <= angka; i++) { var counter = 0; for (let j = 0; j <= i; j++) { if (i % j == 0) { counter++; } } if (counter == 2) { arrPrime.push(i); } } for (let l = 0; l < arrPrime.length; l++) { total += arrPrime[l]; } var median = total / arrPrime.length; for (let m = 0; m < arrPrime.length; m++) { if (arrPrime[m] > median) { newArrPrime.push(arrPrime[m]); } } return newArrPrime; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function checkPrime(number){\n //var faktor = [];\n var jumlahFaktor = 0;\n for(let i=1; i<=number; i++){\n if(number%i === 0){\n //faktor.push(i);\n jumlahFaktor++;\n }\n }\n if(jumlahFaktor === 2){\n return true;\n } else {\n return false;\n }\n }", "function isPrime(n){\n console.log(\"Các số nguyên tố trong khoảng từ 1 đến \"+n)\n if(n <2){\n console.log(\"không có số nguyên tố nào cả\")\n \n }else{\n console.log(2)\n for(var i = 3; i <= n; i++ ){\n \n for(var j=2; j < Math.sqrt(i); j++){\n if(i % j === 0){\n return 0;\n \n }\n console.log(i) \n }\n \n }\n \n }\n \n \n}", "function sumPrimes(num) {\n let myNums = [];\n for(let i = 3; i <= num; i+=2){\n myNums.push(i);\n }\n myNums = myNums.filter(x => {\n if(x === 3 || x === 5 || x === 7 || x === 11){\n return true;\n }else if(x % 3 === 0 || x % 5 === 0 || x % 7 === 0 || x % 11 === 0){\n return false;\n }\n return true;\n });\n let j = 4;\n while(Math.pow(myNums[j],2) < num){\n myNums.splice(myNums.indexOf(Math.pow(myNums[j],2)),1);\n j++;\n }\n let u = 4;\n let h = u + 1;\n while(myNums[u] * myNums[h] <= num){\n while(myNums[u] * myNums[h] <= num){\n myNums.splice(myNums.indexOf(myNums[u] * myNums[h]),1);\n h++;\n }\n u++;\n h = u+1;\n }\n console.log(myNums);\n return 2 + myNums.reduce((x,y) => x+y);\n}", "function prime(){\nalert(\"A factor is a number that can divide another without leaving a remainder eg 3 is a factor of 6.\");\nalert(\"A number can have more than one factor eg 2,3,4,6 are all factors of 12.\");\nalert(\"A multiple is a number that can be divided by another without leaving a remainder eg 6 is a multiple of 3 \");\nalert(\"A number can have more than one multiple eg 6,9,12,15,18,21 etc are all multiples of 3.\");\nalert(\"Two or more numbers can have common factors eg factors of 12 are 2,3,4,6 and factors of 18 are 2,3,6,9.It can be seen that 2,3 and 6 are common factors of 12 and 18.The most useful common factor is the Highest common factor(HCF) in this case 6.\");\nalert(\"Two or more numbers can have common multiples eg multiples of 2 are 4,6,8,10,12,14,16,18,20,22,24 etc and multiples of 3 are 6,9,12,15,18,21,24 etc.It can be seen that 6,12,18,24 are common multiples of 2 and 3.The most useful common multiple is the Lowest common multiple(LCM) in this case 6.\");\n}", "function cekPrime (param1){\n for(var i=2;i< param1; i++){\n if(param1 % i==0){\n return false;\n }\n }\n return true;\n}", "function sumPrimes(num) {\n \nvar Sum=2;\nvar primeNum=[2]\n\n//Checks for every number lower or equals to num\n for (var i=3;i<=num;i++){\n var test=0;\n \n //Check if the number is prime (is if divisible by any other prime?)\n //If it is, adds one to test value. If test value stays to 0, the number is prime\n //and is added to the sum (value Sum) and to the array containing all prime.\n for (var j=0;j<primeNum.length;j++){\n if (i%primeNum[j]==0)\n {test+=1;}\n }\n\n if (test ==0)\n {Sum+=i;\n primeNum.push(i) \n }\n \n } \n \n return Sum;\n}", "function sumPrimes(num) {\n\n //array starts with the first prime numb since its the only non-odd prime.\n var arr = [2];\n\n\nfunction isOdd(n) {\n return Math.abs(n % 2) == 1;\n}\n \nfunction checkIfNOTPrime(max,counter) {\n return Math.abs(max % counter) == 0;\n}\n \n\n //add all odd numbers to array. if not prime , then arr.pop()\n for(var i = 2;i<=num;i++){\n if(isOdd(i)){\n arr[i] =i;\n \n //check all numbers up to i if they can be divided by i\n for(var j = 1;j<i;j++){\n if(checkIfNOTPrime(i,arr[j])){\n arr.pop();\n break;\n\n }\n } \n }\n }\n\n \n \n function add(a, b) {\n return a + b;\n }\n \n //adding all primes to get the sum\n var sum = arr.reduce(add, 0);\n\n\n\n return sum;\n}", "function primeMover(num) {\n\t var firstSort = [1,2,3];\n\t \n\t for(var i = 4; i < 10000; i++) {\n\t\t \n\t\t if(i % 2 !== 0 && i % 3 !== 0){\n\t\t\t\tprimeArray.push(i);\n\t\t\t\t}\n\t }\n\t\n\tfor(var j = 0; j < firstSort.length; j++){\n\t\tfor(var k = 0; k < firstSort.length; k++) {\n\t\t\t\n\t\t}\n\t}\n\t \n\tconsole.log(primeArray);\n\t\n\t return primeArray[num - 1];\n }", "function prime3(n) {\n const data = new Int8Array((n + 1) / 2);\n data[0] = 1;\n for(let i = 1; i < data.length; i+= 1) {\n if (data[i] === 0) {\n let k = 2 * i + 1;\n let u = i * (1 + k);\n if (u > data.length) { break; }\n for (let j = u; j < data.length; j += k) {\n data[j] = 1;\n }\n }\n }\n const result = [2];\n for(let i = 0; i < data.length; i += 1) {\n if (data[i] == 0) {\n result.push(2 * i + 1);\n }\n }\n return result;\n }", "function findPrime() {\n prime = [2];\n const value = document.getElementById(\"input\").value;\n\n for (let number = 3; number <= value; number++) {\n let numArr = [];\n for (let divider = 2; divider < number; divider++) {\n numArr.push(number % divider);\n }\n\n let isZero = numArr.includes(0);\n\n if (!isZero) {\n prime.push(number);\n }\n }\n console.log(prime);\n}", "function sumPrimes(num) {\n // CREATE ARRAY TO STORE PRIMES\n var result = [];\n // GO OVER THE NUMBERS +1 BECAUSE WE WANT TO TEST THE GIVEN NUMBER AS WELL\n for (var i = 1; i < num + 1; i++) {\n // 2 IS THE FIRST PRIME SO WE PUSH\n if (i === 2) {\n result.push(i);\n } else {\n var x = 1;\n // WHILE THE X IS SMALLER THEN THE I UNTIL THE LAST\n while (x < i) {\n x++;\n if (i % x === 0) {\n break;\n }\n // -1 BECAUSE WE LOOK IF X<I THIS IS THE LAST PRIME IN I\n if (x === i - 1) result.push(i);\n }\n }\n }\n // console.log(result)\n return result.reduce((a, b) => a + b);\n}", "function printPrime(value) {\n let primes = [];\n for(let i = 2; i < value; i++) {\n primes[i] = true;\n }\n let limit = Math.sqrt(value);\n for(let i = 2; i < limit; i++) {\n console.log(` i ${i} limit ${limit} `)\n if(primes[i] === true) {\n for(let j = i * i; j < value; j += i) {\n console.log(` j ${j} `)\n primes[j] = false;\n }\n }\n }\n for(let i = 2; i < value; i++) {\n // if(primes[i] === true) {\n console.log(i + \" \" + primes[i]);\n // }\n }\n}", "function PrimeChecker(num) {\n function Prime(num) {\n if (num === 2) {\n return true;\n }\n if (num === 1 || num % 2 === 0) {\n return false;\n }\n for (let i = 3; i <= Math.sqrt(num); i = i + 2) {\n if (num % i === 0) {\n return false;\n }\n }\n return true;\n }\n\n function permut(string) {\n if (string.length < 2) return [string];\n var permutations = [];\n for (var i = 0; i < string.length; i++) {\n var char = string[i];\n\n if (string.indexOf(char) != i) continue;\n\n var remainingString =\n string.slice(0, i) + string.slice(i + 1, string.length);\n\n var subLoop = permut(remainingString);\n\n for (var subPermutation of subLoop)\n permutations.push(char + subPermutation);\n }\n return permutations;\n }\n let res = 0;\n let digits = num.toString();\n let powerSet = permut(digits);\n console.log('PrimeChecker -> powerSet', powerSet);\n powerSet.forEach((combo) => {\n debugger;\n if (Prime(parseInt(combo))) {\n res = 1;\n }\n });\n\n return res;\n}", "function isPrime(input){\n var count = 0;\n for(var i = 1; i <= input; i++){\n if(input % i == 0){\n count++\n }\n }\n // console.log(count)\n if(input == 1 || input == 0){\n return (\"Neither Prime Nor Co-Prime\")\n }\n else if(count == 2){\n return(\"Prime\")\n }\n else{\n return(\"Not Prime\")\n }\n}", "isPrime(number)\n{\n if(number==0 || number == 1)\n {\n return false;\n }\n else\n {\n for (let index = 2; index < number; index++)\n {\n if (number % index == 0) \n {\n return false;\n }\n }\n return true;\n }\n}", "function problem7(){\n c=1;\n x=3;\n while( c < 10001 ){\n if(fasterPrime(x)){\n c++;\n }\n x+=2;\n }\n return x-2;\n}", "function prime(a){\n\n for(let i=2;i<a;i++){\n\n if(a%i == 0){\n return \"Nu este prim\"\n }\n }\n\n return \"Este prim\";\n\n}", "primeChecker(input) {\n let result = this.checkValidNum(input);\n if (input > 1) {\n result = this.checkPrime(input);\n };\n if (result) {\n return 'This is a prime number.';\n } else {\n return 'This is not a prime number.';\n }\n }", "function notPrimes(a,b) {\n let nonPrimeArr = [];\n for(let i = a; i <= b; i++) {\n if(!isPrime(i) && checkForPrimeDigits(i)) {\n nonPrimeArr.push(i)\n }\n }\n return nonPrimeArr;\n\n function checkForPrimeDigits(num) {\n let numStr = num.toString();\n for(let elem of numStr) {\n if(elem!=='2' && elem!=='3' && elem!=='5' && elem!=='7') {\n return false;\n }\n }\n return true;\n }\n function isPrime(num) {\n if(num < 2) return false;\n for(let i=2; i < num; i++){\n if(num%i===0) return false;\n }\n return true;\n }\n}", "function test_prime(n) {\n console.log(\"prime clicked\");\n console.log(n);\n\n if (n <= 1) {\n return false;\n } else if (n === 2 || n == 3) {\n return true;\n } else {\n for (var x = 2; x <= Math.floor(Math.sqrt(n)); x++) {\n if (n % x === 0) {\n console.log(x);\n return false;\n }\n }\n return true;\n }\n}", "function primeMover(num){\n\t\n\tfunction sOE(n){\n\t\tvar tempArray = [];\n\t\tvar outputArray = [];\n\t\tvar upperLimit = Math.sqrt(n);\n\t\t\n\t\tfor(var i = 0; i < n; i++){\n\t\t\ttempArray.push(true);\n\t\t}\n\t\t\n\t\tfor(var j = 2; j <= upperLimit; j++){\n\t\t\tif(tempArray[j]){\n\t\t\t\tfor(var k = j*j ; k < n; k += j){\n\t\t\t\t\ttempArray[k] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(var l = 2; l < n; l++){\n\t\t\tif(tempArray[l]){\n\t\t\t\toutputArray.push(l);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn outputArray;\n\t}\n\t\n\n\tvar primes = sOE(10000);\n\t\tconsole.log(primes);\n\t\n\treturn primes[num - 1];\n}", "function isPrime(x) {\n var i;\n \n console.log('Checking base');\n if (isNaN(x) || !isFinite(x) || x < 2) {\n return false;\n }\n\n console.log('Checking x % 2 ');\n if (x % 2 === 0) {\n return x === 2;\n }\n\n console.log('Checking x % 3');\n if (x % 3 === 0) {\n return x === 3;\n }\n\n console.log('Checking x % 5');\n if (x % 5 === 0) {\n return x === 5;\n\n }\n\n for (i = 7; i <= Math.sqrt(x); i += 30) {\n console.log('Checking x % ' + i);\n if (x % i === 0) {\n return false;\n }\n\n console.log('Checking x % ' + (i + 4));\n if (x % (i + 4) === 0) {\n return false;\n }\n\n console.log('Checking x % ' + (i + 6));\n if (x % (i + 6) === 0) {\n return false;\n }\n\n console.log('Checking x % ' + (i + 10));\n if (x % (i + 10) === 0) {\n return i + 10;\n }\n\n console.log('Checking x % ' + (i + 12));\n if (x % (i + 12) === 0) {\n return i + 12;\n }\n\n console.log('Checking x % ' + (i + 16));\n if (x % (i + 16) === 0) {\n return i + 16;\n }\n\n console.log('Checking x % ' + (i + 22));\n if (x % (i + 22) === 0) {\n return i + 22;\n }\n\n console.log('Checking x % ' + (i + 24));\n if (x % (i + 24) === 0) {\n return i + 24;\n }\n }\n\n return true;\n }", "function findPrime2(max) {\n var arr = []\n for (let i = 2; i <= max; i++) {\n arr.push(i)\n }\n // console.log(\"Prime Array: \" + arr)\n for (let i = 0; i < (Math.ceil(Math.sqrt(max))); i++) {\n for (let j = arr[i];arr[i]*j <= arr[arr.length -1]; j++) {\n // console.log(\"we are at number :\" + arr[i] )\n // var multval = arr[i]*j\n // console.log(\"multiple is:\" + multval)\n var multiple = arr.indexOf(arr[i]*j)\n // console.log(\"multiple index is :\" + multiple)\n if (multiple != -1) {\n arr.splice(multiple,1)\n // console.log(\"removed \" + multiple + \"new array :\" + arr)\n }\n }\n }\n return arr\n}", "function checkprime(){\r\n\r\n var firstelement = 0;\r\n firstelement = items[0];\r\n \r\n\r\n if(firstelement===\"\" || items.length == 0){\r\n alert(\"Enter valid Number\");\r\n \r\n }\r\n else if(firstelement===\"0\"){\r\n\r\n document.getElementById(\"ans01\").innerHTML=firstelement +' - is neither Prime nor Composite';\r\n\r\n }else if(firstelement===\"1\"){\r\n \r\n document.getElementById(\"ans01\").innerHTML=firstelement +' - is not a Prime Number';\r\n\r\n }else if(firstelement===\"2\"){\r\n \r\n document.getElementById(\"ans01\").innerHTML=firstelement +' - is a Prime Number';\r\n }else{\r\n for(var x=2;x<firstelement;x++)\r\n {\r\n if(firstelement%x===0)\r\n { \r\n \r\n document.getElementById(\"ans01\").innerHTML=firstelement +' - is not a Prime Number';\r\n return ;\r\n }\r\n }\r\n \r\n document.getElementById(\"ans01\").innerHTML=firstelement +' - is a Prime Number';\r\n }\r\n}", "isPrime(number) {\n\n }", "function primenum(){\n var num=+prompt('Enter a number');\n if(num<3){\n console.log('Not a prime number');\n } else {\n checkPrimenum();\n }\n\n function checkPrimenum() {\n for (var a=2;a<num;a++) {\n for (var b=2;b<a;b++) {\n if (a%b == 0) break;\n }\n if (b == a){\n console.log(a);\n }\n }\n } \n}", "function displayPrimeNumbers() {\r\n var isPrimeArr = [];\r\n var inputIsValid = validateInput();\r\n //inputIsValid ? console.log('Input is valid'):console.log('Input not valid'); //todo Will remove later\r\n\r\n var startNum = document.forms['cFlowForm'].txt_startValue.value;\r\n var endNum = document.forms['cFlowForm'].txt_endValue.value;\r\n\r\n if (inputIsValid) {\r\n for (var i = startNum; i <= endNum; i++) {\r\n if (isPrime(i) && i > 2) {\r\n isPrimeArr.push(i);\r\n }\r\n }\r\n createTable(isPrimeArr);\r\n }\r\n}// end of display Prime numbers function", "function displayPrimeNumbers() {\r\n var isPrimeArr = [];\r\n var inputIsValid = validateInput();\r\n //inputIsValid ? console.log('Input is valid'):console.log('Input not valid'); //todo Will remove later\r\n\r\n var startNum = document.forms['cFlowForm'].txt_startValue.value;\r\n var endNum = document.forms['cFlowForm'].txt_endValue.value;\r\n\r\n if (inputIsValid) {\r\n for (var i = startNum; i <= endNum; i++) {\r\n if (isPrime(i) && i > 2) {\r\n isPrimeArr.push(i);\r\n }\r\n }\r\n createTable(isPrimeArr);\r\n }\r\n}// end of display Prime numbers function", "function PrimeValues(value) {\n let primes = [], tempArr=[];\n\n //fills an array with 'true' from 2 to the given value.\n for(let i = 2; i < value; i++) {\n primes[i] = true;\n }\n\n //work way thru array tagging primes & non-primes\n let limit = Math.sqrt(value);\n for(let i = 2; i < limit; i++) {\n if(primes[i] === true) {\n for(let j = i * i; j < value; j += i) {\n primes[j] = false;\n }\n }\n }\n\n // remove nonprimes from array.\n for(let i = 2; i < value; i++) {\n if(primes[i] === true) {\n tempArr.push(i);\n }\n }\n return tempArr;\n }", "isPrime(number) {\n if (number == 0 || number == 1) {\n return false;\n }\n for (let index = 2; index < number; index++) {\n if (number % index == 0) {\n return false;\n }\n\n }\n return true;\n}", "function prime(index) {\n\n}", "function prime(){\r\n \r\n\r\nnumArray = numArray.filter((number) => {\r\n for (var i = 2; i <= Math.sqrt(number); i++) {\r\n if (number % i === 0) return false;\r\n }\r\n return true;\r\n\r\n\r\n});\r\n\r\nconsole.log(numArray);\r\n }", "function problem3(num){\n for(var x = 2; x<=num; x++){\n if(isPrime(x) !== true){\n }\n else if (num%x===0){\n num = num/x;\n }\n else if (isPrime(num) == true)\n return num;\n }\n}", "function findSmallerPrimes() {\n for (let i = 0; i < 1000; i++) {\n isPrime(i);\n }\n}", "function sumPrimes(num) {\n sum = 1;\n for (let i=2;i<=num;i++) {\n console.log(\"-----\");\n console.log(\"i=\"+i);\n for (let j=2;j<i;j++) {\n console.log(\"j=\"+j);\n if (i % j == 0) {\n break;\n }\n }\n sum = sum + i;\n console.log(\"sum=\"+sum);\n }\n return sum;\n}", "function isPrime(number) {\n var numArray = \"\";\n var this_number, divisor, not_prime;\n var this_number = 3;\n var lastNumber;\n while (this_number < number) {\n var divisor = parseInt(this_number / 2);\n var not_prime = 0;\n while (divisor > 1) {\n if (this_number % divisor == 0) {\n not_prime = 1;\n divisor = 0;\n } else {\n divisor = divisor - 1;\n }\n }\n if (not_prime == 0) {\n numArray += (this_number + \" \");\n lastNumber = this_number;\n }\n this_number = this_number + 1;\n }\n return lastNumber;\n}", "function prime(n){\n var p=Math.floor((Math.sqrt(n)));\n console.log(p)\n if(n==0||n==1||n==2||n==3){\n return \"Prime\"\n }\n for(i=2;i<=p;i++){\n if(n%i==0){\n return console.log(\"Number is not prime\")\n }\n }\n return console.log(\"Number is prime\")\n }", "function getPrime() {\n var i = 0;\n var j = 0;\n\n limit_numbers = document.getElementById('limit').value;\n\n //loop till i equals to limit_numbers of numbers\n for (i = 1; i <= limit_numbers; i++) {\n count = 0;\n\n for (j = 1; j <= i; j++) {\n // % modules will give the reminder value, so if the reminder is 0 then it is divisible\n if (i % j == 0) {\n //increment the value of count\n count++;\n }\n }\n\n\n //prime number should be exactly divisible by 2 times only (itself and 1)\n if (count == 2) {\n document.getElementById(\"result\").insertAdjacentHTML('beforeend', i + '<br>');\n }\n }\n}", "function getPrime(x,y){\n for(let i=x;i<y;i++){\n let flag = true;\n for(let a=2;a<i;a++){\n if(i%a==0 && i!==a){\n flag= false\n break\n }\n }\n if(flag==true){\n console.log(i)\n }\n }\n}", "function loopsExample2() {\n // until how much it will count\n const CEILING = 50;\n function primeTest(testValue) {\n // let the \"isPrime\" variable be true until it is prooven wrong\n let isPrime = true;\n // start at 2 and run the loop as many times as we tell in the function(variable) \n // not by one, because dividing threw one will never leave a remainder\n // the i from the loop wich runs till the CELING nr will be used as testValue\n // the tested value will be tested for its ramainder from the nr 2 to one smaller than its own number\n for ( let i = 2; i<testValue; i++ ) {\n // if the test value leaves no remainder even once its not a prime number!\n if ( testValue % i === 0 ) {\n // so set isPrime to false \n isPrime = false;\n }\n } //for loop\n // return bolean if it is a prime number\n return isPrime;\n } // primeTest\n\n // loop wich holds the function with the loop inside\n // will run until the end number we declared in the CEILING variable\n // startig with two because one never leaves a remainder (restnumber)\n for (let i = 2; i<=CEILING; i++) {\n // every number until the end number will be tested if it has a remainder from 2 to its own number\n let result = primeTest(i);\n // only console log the prime numbers, if it isnt one, start over (and skip the rest of the loopcode)\n if (result==false) {\n continue;\n }\n // is skipped in case continue is evaluated\n console.log(i + \" is a prime number.\"+result);\n } // for loop\n\n\n // example:\n // CEILING = 5;\n // for i = 5,i<100 -> i = 2, i<5 > 5%2 = 1 = true\n // for i = 5,i<100 -> i = 3, i<5 > 5%3 = 2 = true\n // for i = 5,i<100 -> i = 3, i<5 > 5%4 = 1 = true\n\n // for i = 4,i<100 -> i = 2, i<4 > 4%2 = 0 = false (false for the rest of the loop)\n // for i = 4,i<100 -> i = 2, i<4 > 4%3 = 1 = sill false\n}", "function demoFun(num,prime){\nvar x=0\nfor(var i=2;i<num;i++){\nif(num%i == 0){\nx=1\nbreak;\n}\n}\nif(x == 0){\nprime()\n}\n}", "function prime2(n) {\n const data = [];\n for (let i = 1; i < n; i += 2) {\n data.push(i);\n }\n data[0] = 0;\n for(let i = 1; i < data.length; i+= 1) {\n if (data[i] > 0) {\n let k = data[i];\n let u = i * (1 + k);\n if (u > data.length) { break; }\n for (let j = u; j < data.length; j += k) {\n data[j] = 0;\n }\n }\n }\n const result = [2];\n for (let i of data) {\n if (i > 0) {\n result.push(i);\n }\n }\n return result;\n }", "function pin(input) {\n let firstDigit = input[0];\n let secondDigit = input[1];\n let thirdDigit = input[2];\n let maxNum = Number(firstDigit + secondDigit + thirdDigit);\n\n for(let i = 222; i <= maxNum; i++) {\n let currentNum = i + \"\";\n let currentFirst = Number(currentNum.charAt(0));\n let currentSecond = Number(currentNum.charAt(1));\n let currentThird = Number(currentNum.charAt(2));\n let isPrime = true;\n \n if(currentSecond == 1) {\n isPrime = false;\n } else if(currentSecond == 2) {\n isPrime = true;\n } else {\n for(let j = 2; j < currentSecond; j++) {\n if(currentSecond % j == 0) {\n isPrime = false;\n break;\n }\n } \n }\n\n if(currentFirst % 2 == 0 && isPrime == true && currentThird % 2 == 0) {\n if(currentSecond <= secondDigit && currentSecond !== 0 && currentThird <= thirdDigit && currentThird !== 0) {\n console.log(`${currentFirst} ${currentSecond} ${currentThird}`);\n }\n }\n }\n}", "function primeList() {\n // For max=60M, computes 3.5 million primes in 15 seconds\n // For max=10M, computes 67k primes in 2 seconds.\n\n // Initialize variables\n let max = 10000000; // Maximum number to check if prime.\n let a = new Array(max);\n let out = []\n\n // Initialize sieve array\n for (var i=0; i<=max; i++) {\n a[i]=1;\n }\n\n // Mark all composite numbers\n for (var i=2; i<=max; i++) {\n for (var j=2; i*j<=max; j++) {\n a[i*j]=0;\n }\n }\n\n // Generate output list of prime numbers\n for (var i=2; i<=max; i++) {\n if (a[i]==1) {\n out.push(i)\n }\n }\n\n return out;\n}", "function sumPrimes(num) {\n\n var primeArr = [];\n\n // loop through all numbers between 2 (inclusive) to number (not inclusive)\n // start at 2 because we know that the number is divisible by 1\n // check for a 0 remainder\n // if there is no 0 remainder, return true\n\n // check if number is prime\n function isPrime(n){\n for (let a = 2; a < n; a++){\n if (n%a === 0){\n return false;\n }\n }\n return true;\n }\n\n // add prime numbers to array\n for (let i = num; i > 1; i--){\n if (isPrime(i)){\n primeArr.unshift(i);\n }\n }\n\n // sum of all prime numbers\n return primeArr.reduce((a, b) => a+b);\n}", "function getRemAndPrime(num) {\n if (num !== 1) { /*If Number Is One Thats A End Point Of Recursive*/\n let i = 1;\n while (++i) {\n if (isPrime(i)) {/*Check Prime*/\n let res = num / i;\n if (!isFloat(res)) {/*Result Should Be Whole number*/\n primeList.push(i);\n getRemAndPrime(res);\n break;\n }\n }\n }\n } else {\n console.log(JSON.stringify(primeList) + \"===\" + primeList.reduce((a, b) => { return a * b }, 1));\n }\n}", "function primePrint(element) {\n\tif (isNaN(element)) {\n\t\treturn false;\n\t}\n\tif (element <= 0 || element === 1) {\n\t\treturn false;\n\t}\n\tif (element % 2 === 0 && element != 2 || element % 3 === 0 && element != 3 || element % 5 === 0) {\n\t\treturn false;\n\t}\n\tif (element % Math.sqrt(element) === 0) {\n\t\treturn false;\n\t}\n\tconsole.log(element);\n}", "function sumAllPrimes() {}", "function solutionFive(){\n //Modulus is expensive so try to cut down on its use.\n //The last digit must be a 0\n //Sum of digits must be divisible by 9. Difficult to reverse engineer so will have to check each number.\n //Will just be easier to see if divisible my 9.\n //Second digit must be a 2 4 6 or 8\n //The last three digits must be divisible by 8\n //Difference of sums of alternating digits must equal 11\n //Start with 360 and always add 360 to always be in line with first 10 rules (except 7)\n let baseNum = (()=>{\n let b = 20;//Start at 20, covers 10, 5, 2\n while(b%18!=0 || b%16!=0 || b%15!=0 || b%14!=0){//18 will cover 9, 6, 4, 3, 16 will cover 8, 14 will cover 7\n b+=20;\n }\n return b;\n })();\n baseNum/=10;//Remove the zero from the end\n //(Rules for primes deal with subtracting the last digit from the rest of the number to see if the differnce is divisible by the prime)\n //(Since we know the last digit must be zero then the subtraction plays no role so we can check the primes against the truncated number)\n let num = baseNum;\n while(num%11!=0 || num%13!=0 || num%17!=0 || num%19!=0){//Then do the primes\n num+=baseNum;//Always add baseNum to stay lined up with all non-prime numbers (and 7)\n }\n num*=10;//Add the zero back to the end. This cuts our time in about half\n return num;\n\n}", "static sumPrimes(num) {\n const isPrime = num => {\n for(let i=2 ; i<= Math.sqrt(num) ; ++i) {\n if(num % i == 0) {\n return false;\n }\n }\n return true;\n }\n\n let sum = 0;\n for(let i=2 ; i<=num ; ++i) {\n console.log(sum);\n if(isPrime(i)) {\n sum += i;\n }\n }\n return sum;\n }", "function primeFactorize(v)\n{let factors=[];\n for(k=1;k<v;k++)\n {\n if(v%k===0&&isPrime(k))\n {\n if(!factors.includes(k))\n factors.push(k);\n }\n }\n for(j=0;j<factors.length;j++)\n {\n console.log(factors[j]+\" \");\n }\n}", "function notPrimes(a,b){\n let arr = [];\n for (let i = a; i < b; i++){\n if (!/[014689]/.test(i)) {\n for (let j = 2; j <= Math.sqrt(i); j++){\n if (i % j === 0) { arr.push(i); break;}\n }\n }\n }\n return arr;\n}", "function fillArray() {\n\n let inputValue = document.getElementById('ingreso');\n let arrayPrimeNumber = [];\n console.time(\"Iniciodefuerzabruta\");\n for (let i = 0; i < Number(inputValue.value); i++) {\n let numberPrime = isPrime();\n if (numberPrime === null) {\n i--;\n } else {\n arrayPrimeNumber[i] = numberPrime;\n }\n\n }\n console.timeEnd(\"Iniciodefuerzabruta\");\n\n console.log(arrayPrimeNumber);\n let maximo = 0;\n for (let x = 0; x < arrayPrimeNumber.length; x++) {\n if (maximo < arrayPrimeNumber[x]) {\n maximo = arrayPrimeNumber[x];\n }\n }\n console.log(maximo);\n\n\n\n}", "function primeNum(p) {\nvar isPrime = true;\nfor (var i = 2; i < 10; i++){\nif (p % i === 0 && p !== i) {\n isPrime = false;\n break;\n }\n }\n return isPrime;\n}", "function prime(num) {\n for (var i = numArr.length - 1;i >= 0; i--) {\n for (var j = 2; j < numArr[i]; j++) {\n var number = numArr[i];\n if (number % j === 0) {\n numArr.splice(i, 1);\n $('#result').append(numArr + '<br>');\n }\n }\n }\n}", "function allPrimesLessThanN(n) {\n for (let i = 0; i < n; i++) {\n if (isPrime2(i)) {\n \n }\n }\n}", "function isPrime(v)\n{ let count=0;\n for(i=1;i<=v/2;i++)\n {\n if(v%i==0)\n count++\n }\n if(count>1)\n return false;\n else \n return true;\n}", "function sumPrimes(num){\n var arr = [];\n var sum = 0;\n for (var i = num; i > 0; i--){\n if(isPrime3(i)){\n arr.push(i);\n }\n }\n console.log(arr);\n sum = sumArray(arr);\n return sum;\n}", "function problem10(){\n let c=2;\n let x=3;\n while( x < 2000000 ){\n if(fasterPrime(x) === true){\n c+=x;\n }\n x+=2;\n }\n return c;\n}", "function findPrime(nPrimes,startAt){\n var n = 100\n k=startAt+nPrimes\n \n while (startAt<=k){\n i=2\n flag = false\n while(i<startAt){\n if(startAt%i===0){\n flag = true\n }\n \n i++\n }\n \n console.log(flag? startAt+' is not a prime':startAt+' is prime')\n startAt++\n }\n}", "function smallestCommons(arr) {//locura\r\n //ordenamos el array\r\n let max\r\n let min\r\n//ordenamos\r\n if( arr[0]<arr[1]){\r\n min=arr[0]\r\n max=arr[1]\r\n }else {\r\n max=arr[0]\r\n min=arr[1]\r\n }\r\n //multiplos \r\n //obtenemos el array con el rango entre el min y el maximo\r\n function getRange(m, mx){\r\n let arrRange= []\r\n for(let i = min; i<=max; i++){\r\n arrRange.push(i)\r\n }\r\nreturn arrRange\r\n }\r\n let range= getRange(min, max)\r\n //console.log(range)\r\n let multiple= 1 //no podemos multiplicar por 0\r\n while(multiple<1000000){\r\n let mcm=(min*multiple)*max\r\n //miramos los que son divisibles en el rango\r\n\r\n let divTrue= 0\r\nfor(let i= 0;i <range.length;i++){\r\n //console.log(mcm, range)\r\n if(mcm % range[i]===0){\r\n divTrue+=1\r\n//console.log('divisible entre:',divTrue, 'rango',range.length)\r\n//divTrue nos dice cuando es divisible, en el caso de que sea divisible en todos los casos del rango, hemos encontrado la respuesta 6 es divisible entre 1, 2, 3, con resto 0. Por eso 6 es el minimoComunMultiplo del rango[1,2,3]\r\n if(divTrue===range.length){\r\n return mcm //retornamos el multiplo\r\n }\r\n }\r\n \r\n}\r\n multiple +=1\r\n }\r\nreturn ' Fuera de rango'\r\n}", "function br_isPrime(num) \n{\n // 1 is not prime\n if(PCmode == PC_PRIME_MODE) {\n for(var i = 0; i < br_primes.length; i++) {\n if(br_primes[i] == num) {\n return true;\n }\n }\n }else if(PCmode == PC_EVEN_MODE) {\n return (num%2 == 0);\n }else{\n return (num%PCmultiplier == 0);\n }\n return false;\n}", "function br_isPrime(num) \n{\n // 1 is not prime\n if(PCmode == PC_PRIME_MODE) {\n for(var i = 0; i < br_primes.length; i++) {\n if(br_primes[i] == num) {\n return true;\n }\n }\n }else if(PCmode == PC_EVEN_MODE) {\n return (num%2 == 0);\n }else{\n return (num%PCmultiplier == 0);\n }\n return false;\n}", "function primesArray(input) {\n //initialising array\n let primes = [];\n //avoid returning 1 as a prime value\n let i = 2;\n\n //setting condition - total number of values returned should be equal to n\n while (primes.length < input) {\n //if i passes prime test add it to the array\n if (isPrime(i)) {\n primes.push(i);\n }\n //increment in and add 1 to i\n i += 1;\n }\n return primes;\n}", "function isPrime(number) {\n var result = \"\";\n \n if(typeof number !== \"number\"){\n result = \"Input isn't number\"\n }\n else{\n\n result = \"Number is prime\";\n\n for(var i = 2; i < number; i++){\n if((number / i) % 1 !== 0){\n \n }\n else{\n result = \"Number is not prime\";\n }\n }\n }\n\n return result;\n}", "function isPrime(n)\r\n{\r\n var flag=0;\r\n for(let i=2 ; i < n/2 ; i++) {\r\n if(n%i === 0) {\r\n flag = 1;\r\n break;\r\n }\r\n }\r\n if(flag == 0) {\r\n return true;\r\n }\r\n}", "function isPrime(number) { \n if (number === 1) return false\n else if (number === 2) return true\n else if (number % 2 === 0) return false\n for (let j = 3; j <= Math.floor(Math.sqrt(number)); j+=2) {\n if (!(number % j)) return false\n }\n return true\n}", "function sumAllPrimes(num) {\r\n let sum = 0;\r\n\r\n checkForPrime = num =>{\r\n for (let j = 2; j < num; j++) {\r\n if(num % j === 0){\r\n return false;\r\n }\r\n }\r\n return true\r\n }\r\n for(let i = 2; i <= num; i++){\r\n if(checkForPrime(i)){\r\n sum += i;\r\n }\r\n }\r\n return sum\r\n}", "function primeSort(arr) {\r\n // -------------------- Your Code Here --------------------\r\n var pArray = primeArray(arr);\r\n var sortArr = bubleSort(pArray);\r\n\r\n\r\n return sortArr;\r\n\r\n\r\n // --------------------- End Code Area --------------------\r\n}", "function sumPrime(x) {\n let primeArr = [];\n let sum = 0;\n for (let i = 2; primeArr.length < x; i++) {\n if (prim(i)) {\n primeArr.push(i);\n }\n }\n for (let j = 0; j < primeArr.length; j++) {\n sum += primeArr[j];\n }\n return sum;\n}", "function isPrime(num) {\nwhile ( num < 0){\n return false\n }\nwhile(num <= 3){\n if(num !=1 && num % 1 == 0 && num % Number(num) ==0){\n return true;\n } else {\n return false;\n }\n }\n\nwhile( num >3){\n if(num != 1 && num % 1 == 0 && num % Number(num) ==0 && num % 2 != 0 && num % 3 != 0 ){\n return true;\n } else {\n return false\n }\n }\n}", "function validate(n) {\n n = String(n)\n let pisah = n.split('')\n let jumlah = 0\n console.log(pisah)\n if (pisah.length % 2 === 0) {\n for (let i = 0; i < pisah.length; i++) {\n if (i % 2 === 0) {\n pisah[i] = pisah[i] * 2\n }\n }\n } \n \n else if (pisah.length % 2 !== 0) {\n for (let i = 0; i < pisah.length; i++) {\n if (i % 2 !== 0) {\n pisah[i] = pisah[i] * 2\n }\n }\n }\n\n console.log(pisah)\n\n for (let i = 0; i < pisah.length; i++) {\n if (String(pisah[i]).length > 1) {\n pisah[i] = pisah[i]-9\n }\n }\n \n console.log(pisah)\n for (let i = 0; i < pisah.length; i++) {\n jumlah += Number(pisah[i])\n }\n\n console.log(jumlah)\n\n if (jumlah % 10 === 0) {\n return true\n } else {\n return false\n }\n}", "function getPrimes(int) {\r\n var primes = [];\r\n var curr = 2n;\r\n \r\n while (curr < int) {\r\n if ((int / curr) * curr === int) {\r\n int /= curr;\r\n primes.push(curr);\r\n console.log(curr);\r\n } else {\r\n curr += 1n;\r\n }\r\n }\r\n primes.push(int);\r\n \r\n return primes;\r\n}", "function sumPrimes(num) {\n if (typeof num !== 'number') {\n throw new Error('input should be a number.');\n }\n if (num % 1 !== 0) {\n throw new Error('input should be an integer.');\n }\n\n if (num === 1) {\n return 1;\n }\n var res = 0;\n\n for (var i = 2; i <= num; i++) {\n if (i % 2 === 0 && i !== 2) {\n continue;\n }\n\n if (i === 2 || i === 3 || i === 5 || i === 7) {\n res += i;\n continue;\n }\n\n\n\n var flag = true;\n for (var j = 3; j <= Math.sqrt(i); j++) {\n if (i % j === 0) {\n flag = false;\n }\n }\n if (flag) {\n res += i;\n }\n }\n\n return res;\n}", "function primeNumber(number,callback){ \n\n for(var i=2;i<=number;i++)\n { \n var not=1;\n for(var j=2;j<=i;j++)\n {\n if(i%j===0 && j!==i){\n not=0;\n result=\"not a prime\";\n }\n}\n if(not===1){\n result=\"prime\";\n }\n }\n callback();\n }", "function primeFactorization() { \n\n\tnumber = document.getElementById(\"userNumber3\").value;\t\n\tconsole.log(number);\n\n\tdivider = [];\n\tfor (i = 2; i < 100000; i++) {\n\t\tdivider.push(i);\n\t} \n\n\tvar check = []\n\tvar factors = []\n\tvar count = 0; \n\n\tvar findFactors = function(number) { \n\t\tcheck = []\n\t\t\n\t\tfor (i = 0; i < divider[i]; i++) {\n\t\t\t\n\t\t\tif (number % divider[i] === 0 && divider[i] != number) {\n\t\t\t\tif (number !== \"\" && number !== \"0\") {\n\t\t\t\tcheck.push(divider[i]);\n\t\t\t\tfactors.push(divider[i]);\n\t\t\t\tcount ++; \n\t\t\t\treturn number / divider[i];\n\t\t\t\t}\t\n\t\t\t} \n\t\t}\n\n\t\tif (check.length === 0 && count > 0) {\n\t\t\tfactors.push(number);\n\t\t\tnumber = \"end\";\n\t\t\treturn number;\n\t\t} else {\n\t\t\tfactors.push(\"Your number already is a prime number. Try a different one!\");\n\t\t\tnumber = \"end\";\n\t\t\treturn number;\n\t\t}\n\n\t}\t\n\n\tvar loop = function(number) {\n\t\tvar i = 0;\n\t\twhile (number !== \"end\" && i < 10000) {\n\t\t\ti++;\n\t\t\tvar number = findFactors(number);\n\t\t}\n\t}\t\n\n\tloop(number);\n\tvar answer = Math.max.apply(Math, factors);\n\tif (isNaN(answer) === true) {\n\t\tanswer = \"Not available\"\n\t} \n\n\tdocument.getElementById(\"multiplesAnswer3\").innerHTML = \"<h4> Prime factors of your\tnumber are: \" + factors.toString() + \" </h4>\" + \"<h4> The largest prime factor of your number is: \" + answer + \" </h4>\";\n return false;\n}", "function primeSieve(num){\n var primes = [];\n for(var i = 0; i <= num; i++){\n primes.push(1);\n }\n for(var j = 2; j <= Math.floor(Math.sqrt(primes.length)); j++){\n console.log('j', j);\n if(primes[j] === 1){\n for(var k = j * j; k <= num; k += j){\n primes[k] = 0; \n }\n }\n }\n return primes; \n}", "function isPrime(number) {\n if (number === 1) {\n return false;\n }\n for (let i = 2; i * i <= number; i++) {\n if (number % i === 0) {\n console.log(number + ' - the number is not prime');\n return false;\n }\n }\n console.log(number + ' - the number is prime');\n return true;\n }", "function isPrime (number) { // <== HELPER FUNCTION\n if (number < 2) {\n return false;\n }\n for (let i = 2; i < number; i++) {\n if (number % i === 0)\n return false;\n }\n return true;\n}", "function testPrimeNum(n){\n if(n===1){\n return false;\n }else if(n===2){\n return true;\n }else{\n for(var i=2; i<n;i++){\n if(n%i===0){\n return false;\n }\n }\n return true;\n }\n}", "function testPrimeNum(num){\n for(var i=2; i<num; i++){\n if(num%i===0){\n return false;\n }\n return num>1;\n }\n}", "function prime4(n) {\n const data = new Int8Array((n + 1) / 2);\n data[0] = 1;\n\n // clear 3's\n for (let j = 4; j < data.length; j += 3) {\n data[j] = 1;\n }\n\n let step = 2;\n let u = 1;\n const result = [2, 3];\n for(let i = 2; i < data.length; i += step) {\n if (data[i] === 0) {\n let k = 2 * i + 1;\n result.push(k);\n if (u < data.length) {\n u = i * (1 + k); // (i + 2 * i**2 + i\n for (let j = u; j < data.length; j += k) {\n data[j] = 1;\n }\n }\n }\n step = 3 - step;\n }\n\n return result;\n }", "function sumPrimes(num) {\n var sum = 0;\n if(isPrime(num)){\n sum = sum+num;\n }\n for(j=2; j<num; j++){\n if(isPrime(j)){\n console.log(j);\n sum = sum + j;\n }\n\n }\n return sum;\n}", "function sumAllPrimes(num) {\r\n\r\n let total = 0;\r\n\r\n function checkIsPrime(i){\r\n for (let j = 2; j < i; j++){\r\n if(i % j === 0)\r\n return false;\r\n }\r\n return true;\r\n }\r\n\r\n for (let i = 2; i <= num; i++){\r\n if(checkIsPrime(i)){\r\n total += i\r\n }\r\n }\r\n\r\n return total;\r\n}", "function seventhProblem(){\n\tconsole.log('\\nProblem 7\\nThis number is prime:');\n\tvar arr = [1, 2, 3, 4, 9, 37, 97, 51, -3, 0],\n\t\tii = 0,\n\t\tlen = arr.length;\n\tfor(ii; ii < len; ii++){\n\t\tvar prime = true;\n\t\tif(arr[ii] >= 2) {\n\t\t\tfor(var i = 2; i <= Math.floor(Math.sqrt(arr[ii])); i++){\n\t\t\t\tif((arr[ii] % i) === 0){\n\t\t\t\t\tprime = false;\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tprime = false;\n\t\t}\n\t\tconsole.log('\\t\"' + arr[ii] + '\" ' + prime);\n\t}\n}", "function isPrime(num) {\n if(num < 2) return false;\n \n for (let i = 2; i < num; i++){\n if( num % i === 0){\n return false;\n }\n }\n return true;\n }", "function nth_prime(n) {\n\n}", "function listPrimeNumbers(number){\n const aqui = document.querySelector('.primos');\n const para = document.createElement('p');\n aqui.appendChild(para);\n const dentro = document.querySelector('p');\n dentro.id = \"dentro\";\n for(let i= number; i>1 ; i--){\n \n //const dentro= document.querySelector('.pimos);\n if (isPrime(i)){\n console.log(i);\n \n dentro.textContent += \" \"+i;\n \n \n }\n } \n}", "function angkaPrima2(num){\n for(var i = 2; i < num; i++){\n if(num % i === 0) return false;\n }\n // Jika kondisi diatas sudha selesai di cek, dan menemukan bilangan prima, \n // Selanjutnya melakukan pengecekan, apakah bilangan tersebut bilangan negatif atau dibawah satu,\n // jika tidak, maka dia adalah bilangan prima\n return num > 1;\n}", "function primeNumber(number) {\n if (number == 1) {\n return false;\n }else if(number===2){\n return true\n }\n for(var i=2; i<number;i++){\n if(number%i===0){\n return false\n }\n }\n return true\n}", "function PrimeTime(number) {\n let trueValue = new Boolean(true);\n let falseValue = new Boolean(false);\n if (Number.isInteger(number)) {\n if (number === 1) {\n return falseValue.toString();\n } else if (number === 2) {\n return trueValue.toString();\n } else {\n for (var x = 2; x < number; x++) {\n if (number % x === 0) {\n return falseValue.toString();\n }\n }\n return trueValue.toString();\n }\n } else {\n window.alert('This is not valid number')\n }\n\n}", "function isPrime(number){\n //determine if number is 1\n if(number === 1){\n return false;\n }\n//0 gives you NaN and all the numbers are divisible by 1. Therefore, you\n//start at 2.\n for(var i = 2; i < number; i++){\n if(number % i === 0){ //if the statement is true, then return false\n return false;\n }\n }\n return true;\n}", "function printAllPrimesUpTo(max){\n for (let i = 2; i <= max; i++) {\n let possiblePrime = checkPrime(i);\n if (possiblePrime) {\n console.log(possiblePrime);\n }\n }\n}", "function isPrime(n){\n if (n<=1){\n return false //number isnt prime \n }\n for (let i= 2; i< n; i++){\n if ( (n % i) ==0){\n false /*number isnt prime // we \n cant do i<= n coz that would definately \n return 0 when the \n value of n== i ;and test would end \n without answering any questions */\n }\n }\nreturn true /*the number is indeed prime \ncoz(i) it is either less than or equal to 1\nand (ii) there was a number less than it that coul\nreturn a remainder of 0 on division */\n}", "function sumPrime(num) {\r\n function isPrime(num) {\r\n var primeNumbers = [];\r\n var sieve = [];\r\n for (var i = 2; i <= num; i++) {\r\n if (!sieve[i]) {\r\n primeNumbers.push(i);\r\n for (var j = i; j <= num; j += i) {\r\n sieve[j] = true;\r\n }\r\n }\r\n }\r\n return primeNumbers;\r\n }\r\n return isPrime(num).reduce((x, y) => x + y);\r\n}", "function isPrime(num) {\n num = Math.abs (num);\nif (num < 2) {return false;}\nfor (let i=2;i<num;i++) { \n if (num%i === 0){ \n return false;}\n}\nreturn true;\n}", "function prime(a,call)\n{\nif(call(a)==a)\n{\nreturn \"prime\"\n}\nelse\n{\nreturn \"not prime\"\n}\n}", "function isPrime3(n) {\n if (isNaN(n) || !isFinite(n) || n%1 || n<2) return false; \n if (n%2==0) return (n==2);\n if (n%3==0) return (n==3);\n var m=Math.sqrt(n);\n for (var i=5;i<=m;i+=6) {\n if (n%i==0) return false;\n if (n%(i+2)==0) return false;\n }\n return true;\n}", "function isPrime(number){\n if(typeof number === 'number'){\n let divisior = 2;\n while( number > divisior ){\n if(number % divisior === 0 ){\n return false\n }else{\n divisior++\n return true\n }\n }\n }else{\n return \"this is not a number\"\n }\n\n}", "function isPrime(num) {\n for(var i = 2; i < num; i++){\n if(num % i === 0){ \n return false;\n }\n }\n //return num !== 1;\n return true;\n }" ]
[ "0.67275953", "0.66603035", "0.646349", "0.64058435", "0.6398311", "0.63615626", "0.6356677", "0.6275163", "0.62634337", "0.62393194", "0.61949515", "0.61657083", "0.6152941", "0.6138274", "0.6123141", "0.6123005", "0.61131954", "0.6098964", "0.6090424", "0.60766906", "0.6053094", "0.6048626", "0.6036542", "0.60313743", "0.60229737", "0.6019512", "0.60131365", "0.60131365", "0.6001718", "0.598759", "0.5986811", "0.5969798", "0.596941", "0.5961191", "0.5953914", "0.5942759", "0.5936543", "0.5925409", "0.5923705", "0.59221435", "0.59221035", "0.5920595", "0.59194547", "0.59111226", "0.5905767", "0.59031534", "0.58978415", "0.5884878", "0.58847654", "0.58833504", "0.5878123", "0.58779335", "0.5873468", "0.58686817", "0.5856528", "0.58521724", "0.58519256", "0.58491343", "0.5848756", "0.5848629", "0.584696", "0.58382803", "0.58382803", "0.5838227", "0.5831169", "0.5829794", "0.5822392", "0.5818332", "0.5817653", "0.58157855", "0.58071095", "0.58037186", "0.58001345", "0.57847494", "0.5765736", "0.57617944", "0.57529944", "0.5749523", "0.57465166", "0.5745915", "0.57403785", "0.5735632", "0.573325", "0.5728135", "0.5726381", "0.57194203", "0.5716684", "0.5714625", "0.5714178", "0.5705754", "0.5705187", "0.5704531", "0.5701767", "0.569736", "0.56952935", "0.56935203", "0.5682361", "0.5679079", "0.5672443", "0.5672017" ]
0.66310185
2
BASIC UTILITY FUNCTIONS return string of date in mm/dd format
function formatDate1(someDate) { var month = someDate.getMonth() + 1; var day = someDate.getDate(); return month + "/" + day; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getDateString() {\n var now = new Date();\n var day = (\"0\" + now.getDate()).slice(-2);\n var month = (\"0\" + (now.getMonth() + 1)).slice(-2);\n return (month) + \"/\" + (day) + \"/\" + now.getFullYear();\n }", "getDateString() {\n return this.month.toString().padStart(2, \"0\") + \"/\" + this.year.toString().padStart(2, \"0\");\n }", "function getDateString() {\n // Initializing variables for date, month and year\n let day = date.getDate();\n let month = date.getMonth() + 1;\n let year = date.getFullYear() - 2000;\n \n let strDate = month.toString() + \"/\" + day.toString() + \"/\" + year.toString();\n return strDate\n }", "function dateFmtStr(today) {\n\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n return mm + '/' + dd + '/' + yyyy;\n}", "function _getFormattedDate(date) {\n var year = date.getFullYear();\n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n return month + '/' + day + '/' + year;\n }", "function getFormattedDate(date) {\n var year = date.getFullYear();\n\n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n\n return day + '/' + month + '/' + year;\n}", "dateToString(date) {\n let year = date.getFullYear();\n let month = (1 + date.getMonth()).toString().padStart(2, '0');\n let day = date.getDate().toString().padStart(2, '0');\n \n return month + '/' + day + '/' + year;\n }", "function formatDate() {\n var d = new Date(),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n \n if (month.length < 2) month = '0' + month;\n if (day.length < 2) day = '0' + day;\n \n return [day, month, year].join('/');\n }", "function dateFormat(d){\n\t\tvar string = d.getFullYear() +'/';\n\t\tstring += ( (d.getMonth() < 9) ? '0'+(d.getMonth()+1) : d.getMonth()+1) +'/';\n\t\tstring += d.getDate();\n\t\treturn string;\n\t}", "dateFormat(date) {\n if (date != '') {\n let newdate = new Date(date);\n let dd = newdate.getDate();\n let mm = newdate.getMonth() + 1;\n let yy = newdate.getFullYear();\n return mm + \"/\" + ('0' + dd).slice(-2) + \"/\" + yy;\n } else {\n return \"\";\n }\n }", "static formatDateDDMMYYYY(date) {\n if (Common.isNullOrUndifined(date)) return \"\";\n try {\n return moment(date).format(\"DD/MM/yyyy\");\n } catch (error) {\n console.log(\"formatDateDDMMYYYY\\n\" + error);\n }\n }", "function formatDate(date) {\n \n var dd = date.getDate();\n if (dd < 10) {\n dd = '0' + dd;\n }\n \n var mm = date.getMonth() + 1;\n if (mm < 10) {\n mm = '0' + mm;\n }\n \n var yy = date.getFullYear();\n if (yy < 10) {\n yy = '0' + yy;\n }\n \n return mm + '/' + dd + '/' + yy;\n }", "function getDateInFormat() {\n var today = new Date();\n var dd = today.getDate();\n\n var mm = today.getMonth() + 1;\n var yyyy = today.getFullYear();\n if (dd < 10) {\n dd = '0' + dd;\n }\n if (mm < 10) {\n mm = '0' + mm;\n }\n return today = mm + '/' + dd + '/' + yyyy;\n}", "function formatDate(date) {\n result = \"\";\n if (date) {\n result += date.getDate() + \"/\"; // Day\n result += (date.getMonth() + 1) + \"/\";\n result += (date.getYear() + 1900);\n }\n return result;\n}", "static getDateString(date)\r\n\t{\r\n\t\tlet month = date.getMonth() + 1; //months are counted from zero, we need to format it correctly.\r\n\t\tlet addZero = '';\r\n\t\tlet addZeroToDay = '';\r\n\t\tif(month < 10) //add a leading zero in case month is one digit, needed for correct formatting.\r\n\t\t\taddZero = '0';\r\n\t\tif(date.getDate() < 10)\r\n\t\t\taddZeroToDay = '0'\r\n\r\n\t\treturn date.getFullYear() + '-' + addZero + month + '-' + addZeroToDay + date.getDate();\r\n\t}", "function formatDate(date){\n var yyyy = date.getFullYear();\n var mm = date.getMonth() + 1;\n var dd = date.getDate();\n //console.log(\"This is dd\" + dd);\n if(dd<10){\n dd='0'+ dd;\n }\n if(mm<10){\n mm='0'+mm;\n } \n return ( mm + '/' + dd + '/' + yyyy);\n \n }", "function getDate(){\n const currentDate = new Date();\n const dd = String(currentDate.getDate()).padStart(2, '0');\n const mm = String(currentDate.getMonth() + 1).padStart(2, '0');\n const yyyy = currentDate.getFullYear();\n return dd + '/' + mm + '/' + yyyy;\n}", "function getDateString() {\n var d = new Date();\n return d.getDate() + \" \" + months[d.getMonth()] + \" \" + (d.getYear() + 1900);\n}", "function getDateAsString(dateVal) {\n if (dateVal) {\n var dateAsYYYYMMDD = dateVal.toString(),\n year = dateAsYYYYMMDD.substr(2, 2),\n month = dateAsYYYYMMDD.substr(4, 2),\n day = dateAsYYYYMMDD.substr(6, 2);\n\n return month + '/' + day + '/' + year;\n }\n}", "function formattedDate(d = new Date) {\n\treturn [d.getDate(), d.getMonth()+1, d.getFullYear()]\n\t\t.map(n => n < 10 ? `0${n}` : `${n}`).join('/');\n }", "function formatDate(date) {\n\t\tvar day = date.getDate();\n\t\t\n\t\t// Add '0' if needed\n\t\tif (parseInt(day / 10) == 0) {\n\t\t\tday = \"0\" + day;\n\t\t}\n\t\t\n\t\tvar month = date.getMonth() + 1; // months start at 0\n\t\t\n\t\t// Add '0' if needed\n\t\tif (parseInt(month / 10) == 0) {\n\t\t\tmonth = \"0\" + month;\n\t\t}\n\t\t\n\t\tvar year = date.getFullYear();\n\t\t\n\t\treturn day + \"/\" + month + \"/\" + year;\n\t}", "function dateGet() {\n const d = new Date();\n const curr_date = d.getDate();\n const curr_month = d.getMonth() + 1; //Months are zero based\n const curr_year = d.getFullYear();\n return curr_month + \"/\" + curr_date + \"/\" + curr_year;\n }", "function formatDate(val) {\n var d = new Date(val),\n day = d.getDate(),\n month = d.getMonth() + 1,\n year = d.getFullYear();\n\n if (day < 10) {\n day = \"0\" + day;\n }\n if (month < 10) {\n month = \"0\" + month;\n }\n return month + \"/\" + day + \"/\" + year;\n}", "dateFormate(d) {\n const date = new Date(d)\n const j = date.getDate()\n const m = (date.getUTCMonth() + 1)\n const a = date.getUTCFullYear()\n return (\"0\" + j).slice(-2) + '/' + (\"0\" + m).slice(-2) + '/' + a\n }", "function formatted_date()\n{\n var result=\"\";\n var d = new Date();\n var month = (d.getMonth()+1);\n var day = d.getDate();\n if (d.getMonth()+1 < 10){\n \t\tvar month = '0' + (d.getMonth()+1);\n }\n if (d.getDate()+1 < 10){\n \t\tvar day = '0' + d.getDate();\n }\n result += d.getFullYear() +''+ month +''+ day;\n console.log(result);\n return result;\n}", "function formattedDate(date) {\n\n // Récupération\n var month = String(date.getMonth() + 1);\n var day = String(date.getDate());\n var year = String(date.getFullYear());\n\n // Ajout du 0\n if (month.length < 2) \n month = '0' + month;\n\n // Ajout du 0\n if (day.length < 2) \n day = '0' + day;\n\n return day+'/'+month+'/'+year;\n }", "function DateFormat(date,month,year)\n{\n\treturn date+\"/\"+month+\"/\"+year;\n}", "function GetDate() {\r\n\tvar today = new Date();\r\n\tvar dd = today.getDate();\r\n\tvar mm = today.getMonth()+1;\r\n\tvar yyyy = today.getFullYear();\r\n\r\n\tif(dd<10) {\r\n\t\tdd='0'+dd\r\n\t} \r\n\r\n\tif(mm<10) {\r\n\t\tmm='0'+mm\r\n\t} \r\n\r\n\treturn mm+'/'+dd+'/'+yyyy;\r\n}", "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "function getDateString() {\n var today = new Date();\n var month = monthNames[today.getMonth()];\n var day = getOrdinal(today.getDate());\n var year = today.getFullYear();\n return month + ' ' + day + ', ' + year;\n}", "function es_date(d) {\n var month = d.getMonth()+1;\n var day = d.getDate();\n var o = (day<10 ? '0' : '') + day + '/' + (month<10 ? '0' : '') + month + '/' + d.getFullYear();\n return o;\n}", "function stringifiedDate(){\r\n var date=new Date();\r\n var d = date.getDate();\t\r\n var m = date.getMonth()+1;\t\r\n var y = date.getFullYear().toString().substr(-2);\t\r\n\r\n if(d<10)d=\"0\"+d;\r\n if(m<10)m=\"0\"+m;\r\n \r\n return fullDate=d+\"-\"+m+\"-\"+y;\r\n}", "function formateDate(date){\n \n function pad(number){\n if(number > 10){\n return \"0\" + number;\n }\n else{\n return number;\n }\n }\n return pad(date.getDate()) + \"/\" + pad(date.getMonth() + 1) + \"/\" + date.getFullYear();\n}", "function formatDate(d) {\n return (d.getMonth()+1) + '/' +\n d.getDate() + '/' +\n d.getFullYear();\n }", "function getFormattedDateString() {\n const now = new Date();\n const date_string = `${now.getFullYear().toString()}${(now.getMonth() < 10 ? (\"0\" + (now.getMonth() + 1).toString()) : (now.getMonth() + 1).toString())}${(now.getDate < 10 ? (\"0\" + now.getDate().toString()) : now.getDate().toString())}`;\n return date_string;\n }", "function getDate() {\n var today = new Date();\n var dd = today.getDate();\n var mm = today.getMonth()+1; //January is 0!\n\n var yyyy = today.getFullYear();\n if(dd<10){\n dd='0'+dd;\n } \n if(mm<10){\n mm='0'+mm;\n } \n return dd+'/'+mm+'/'+yyyy;\n}", "function formatDate(date) {\n var formattedDate = date.substr(5, 2) + '/';\n formattedDate += date.substr(8, 2) + '/';\n formattedDate += date.substr(0, 4);\n return formattedDate;\n} //end formatDate", "function dateToAussieString(d){\r\n return d.getDate() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getFullYear();\r\n}", "function getDateString(date)\n{\n\tlet year = date.getFullYear();\n\tlet month = date.getMonth() + 1;\n\tlet day = date.getDate();\n\tlet content = \"\";\n\n\tcontent += year;\n\tif(month < 9) content += \"-0\" + month;\n\telse content += \"-\" + month;\n\n\tif(day < 9) content += \"-0\" + day;\n\telse content += \"-\" + day;\n\treturn content;\n\t\n}", "function getDateAsString() {\n var currentDate = new Date(); //We use the JavaScript Date object/function and then configure it\n\n var currentMonth;\n var currentDay;\n\n if(currentDate.getMonth() < 10) {\n currentMonth = \"0\" + String(currentDate.getMonth()+1); //0 indexed month, january is 0\n } else {\n currentMonth = String(currentDate.getMonth()+1);\n }\n\n if(currentDate.getDate() < 10) {\n currentDay = \"0\" + String(currentDate.getDate());\n } else {\n currentDay = String(currentDate.getDate());\n }\n\n var date = currentDate.getFullYear() + \".\" + currentMonth + \".\" + currentDay;\n return date; //returns the date string\n}", "returnDateFormat(date){\n var day = new Date(date);\n return day.toDateString();\n }", "function formatDate(date) {\r\n date = new Date(date);\r\n let DD = date.getDate();\r\n if (DD < 10) {\r\n DD = \"0\" + DD;\r\n }\r\n let MM = date.getMonth() +1;\r\n if (MM < 10) {\r\n MM = \"0\" + MM;\r\n }\r\n const YYYY = date.getFullYear();\r\n return DD + \"/\" + MM + \"/\" + YYYY;\r\n}", "function formatDate(date) {\r\n var day = '',\r\n month = '',\r\n year = '',\r\n tmp = [],\r\n str = '';\r\n tmp = date.split('/');\r\n day = tmp[1];\r\n month = tmp[0];\r\n year = '20' + tmp[2];\r\n str = year + '-' + month + '-' + day;\r\n return str;\r\n}", "function formatDate(date) {\r\n date = new Date(date);\r\n let DD = date.getDate();\r\n if (DD < 10) {\r\n DD = \"0\" + DD;\r\n }\r\n let MM = date.getMonth() +1;\r\n if (MM < 10) {\r\n MM = \"0\" + MM;\r\n }\r\n const YYYY = date.getFullYear();\r\n return DD + \"/\" + MM + \"/\" + YYYY;\r\n }", "function getDate() {\n const date = new Date(); //Create a ne date object\n\n let year = date.getFullYear(); //Get 4 digit year\n let day = date.getDate(); //Get date\n let month = date.getMonth() + 1; //Get month and adds 1 since months are zero-indexed (January is 0 instead of 1)\n\n\n if (day < 10) {\n day = `0${day}`; //Adds 0 in front of date if date is before the 10th of the month\n }\n\n if (month < 10) {\n month = `0${month}`; //Adds 0 in front of the month if the month is before 10 (October)\n }\n\n return `${year}-${month}-${day}`;\n}", "function formatDate(date)\n{\n g_date=date.getDate();\n if(g_date <=9)\n {\n g_date=\"0\"+g_date;\n }\n g_month=date.getMonth();\n g_year=date.getFullYear();\n if (g_year < 2000) g_year += 1900;\n return todaysMonthName(date)+\" \"+g_date+\", \"+g_year;\n}", "getFormattedDate(date) {\n const year = date.getFullYear();\n const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');\n const day = (date.getUTCDate()).toString().padStart(2, '0');\n // Logger.log(`Day: ${day}, Month: ${month}, Year:${year}`)\n const dateFormatted = `${year}-${month}-${day}`;\n return dateFormatted;\n }", "function fomatDate(date) {\n var date = new Date(date);\n var day = date.getDate();\n var month = date.getMonth() + 1;\n var year = date.getFullYear();\n return day + '/' + month + '/' + year;\n}", "function formatDate(date) {\n var dd = date.getDate()\n if (dd < 10) dd = '0' + dd;\n var mm = date.getMonth() + 1\n if (mm < 10) mm = '0' + mm;\n var yy = date.getFullYear();\n if (yy < 10) yy = '0' + yy;\n return dd + '.' + mm + '.' + yy;\n}", "function convertDateToString(date)\n{\n\t// Add \"0\" ahead the month & day if needed\n\tvar month = date.getMonth()+1;\n\tvar day = date.getDate();\n\n\tif (month < 10) {\n\t\tmonth = \"0\"+month;\n\t}\n\tif (day < 10) {\n\t\tday = \"0\"+day;\n\t}\n\t// Date formating\n\tStringDateResult = month+\"/\"+day+\"/\"+(date.getFullYear());\n\n\treturn StringDateResult;\n}", "function formatDate(date) {\r\n\r\n let dd = date.getDate();\r\n if (dd < 10) dd = '0' + dd;\r\n\r\n let mm = date.getMonth() + 1;\r\n if (mm < 10) mm = '0' + mm;\r\n\r\n let yy = date.getFullYear() % 100;\r\n if (yy < 10) yy = '0' + yy;\r\n\r\n return dd + '.' + mm + '.' + yy;\r\n}", "function formattedDate(d = new Date()) {\n return [d.getDate(), d.getMonth() + 1, d.getFullYear()]\n .map((n) => (n < 10 ? `0${n}` : `${n}`))\n .join(\"/\")\n .concat(` at ${getTime(d)}`);\n }", "function formDate(date) { \n\tvar day = date.getDate();\n\tvar month = date.getMonth() + 1;\n\treturn day +'/'+ month;\n}", "function getDateString(date) {\n var m = date.getMonth() + 1;\n if (m < 10) m = '0' + m;\n\n var d = date.getDate();\n if (d < 10) d = '0' + d;\n \n return '' + date.getFullYear() + m + d;\n }", "function getFormatedDate(date) {\n return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;\n}", "function formatDate(userDate) {\n // format from M/D/YYYY to YYYYMMDD\n userDate = new Date(userDate);\n y = userDate.getFullYear().toString();\n m = (userDate.getMonth() + 1).toString();\n d = userDate.getDate().toString();\n if (m.length == 1) m = '0' + m;\n if (d.length == 1) d = '0' + d;\n return y + m + d;\n }", "formatDate (date){\n var d = new Date(date),\n month = (d.getMonth() + 1),\n day = d.getDate(),\n year = d.getFullYear();\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n return [year, month, day].join('-');\n }", "function formatDate(date) {\n var day = (\"0\" + date.getDate()).slice(-2);\n var month = (\"0\" + (date.getMonth() + 1)).slice(-2);\n var year = date.getFullYear().toString().slice(-2);\n return day + month + year;\n}", "function getDate()\n {\n var date = new Date();\n\n var month = date.getMonth()+1;\n var day = date.getDate();\n\n if (date.getMonth() < 10)\n {\n month = \"0\" + month;\n }\n\n if (date.getDate() < 10)\n {\n day = \"0\" + day;\n }\n\n var datestring = \"\" + date.getFullYear() + month + day;\n\n return datestring;\n }", "function get_date(){\n var d = new Date();\n var date_string = \"\" + d.getFullYear().toString() + \"-\";\n var month = (d.getMonth() + 1);\n date_string += (month < 10 ? \"0\" + month.toString() : month.toString());\n date_string += \"-\" + d.getDate().toString();\n return date_string;\n}", "function yyyymmdd(date) {\n var yyyy = date.getFullYear().toString();\n var mm = (date.getMonth() + 1).toString(); // getMonth() is zero-based\n var dd = date.getDate().toString();\n return yyyy + (mm[1] ? mm : \"0\" + mm[0]) + (dd[1] ? dd : \"0\" + dd[0]); // padding\n }", "function getDate () {\n let date = new Date()\n let month = date.getMonth() + 1 <10 ? '0' + (date.getMonth() + 1): date.getMonth() + 1\n let year = date.getFullYear()\n let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()\n date = month + '/' + day + '/' + year\n return date\n}", "function dateTodayStr() {\n\n var today = new Date();\n return dateFmtStr(today);\n}", "function formatDate(date) {\n var day = date.getDate();\n if (day < 10) {\n day = \"0\" + day;\n }\n\n var month = date.getMonth() + 1;\n if (month < 10) {\n month = \"0\" + month;\n }\n\n var year = date.getFullYear();\n\n return day + \".\" + month + \".\" + year;\n}", "function getDateString()\n{ \n var d = new Date();\n var year = d.getUTCFullYear();\n var month = d.getUTCMonth()+1;\n var day = d.getUTCDay()+1;\n var date=\"\";\n if(day<10)\n {\n date = \"\"+year+\"\"+month+\"0\"+day;\n }\n else\n {\n date = \"\"+year+\"\"+month+\"\"+day;\n }\n return date;\n}", "function _getDateString() {\n var myDate = new Date();\n // forward compatability with ES5 Shims\n if (typeof myDate.getFullYear !== \"function\") {\n myDate.getFullYear = function() {\n return (myDate.getYear + 1900); // offset from year 1900\n };\n }\n\n var myYear = myDate.getFullYear().toString();\n var myMonth = _zeroPad(myDate.getMonth() + 1, 2); // counts from 0\n var myDay = _zeroPad(myDate.getDate(), 2);\n var myHours = _zeroPad(myDate.getHours(), 2);\n var myMinutes = _zeroPad(myDate.getMinutes(), 2);\n var mySeconds = _zeroPad(myDate.getSeconds(), 2);\n\n return myYear + \n \"-\" + myMonth + \n \"-\" + myDay + \n \"T\" + myHours + \n ':' + myMinutes + \n ':' + mySeconds +\n '.' + (myDate.getMilliseconds() / 1000).toFixed(3).slice(2, 5);\n }", "function dateFormat(theDate) {\n\t// getMonth() method 0=Janurary, 1=Feb, etc\n\treturn theDate.getMonth()+1 + '/' + theDate.getDate() + '/' + theDate.getFullYear();\n}", "function formatDate(date){\n var yr = date.getFullYear();\n var mnth = date.getMonth()+1;\n if(mnth < 10){\n mnth = `0${mnth}`;\n }\n var day = date.getDate()\n if(day < 10){\n day = `0${day}`;\n }\n return yr+\"-\"+mnth+\"-\"+day;\n}", "function getFormattedDate(d){\n var startDay = d.getDate();\n if(startDay < 10) startDay = \"0\" + startDay;\n var startMonth = d.getMonth() + 1; // months are 0-indexed in javascript.. god knows why\n if(startMonth < 10) startMonth = \"0\" + startMonth;\n return(d.getFullYear() + \"-\" + startMonth + \"-\" + startDay);\n}", "function dateTimeString(date) {\n return `${date.getDate()} ${convertMonthInWord(\n date.getMonth()\n )} ${date.getFullYear()}`;\n}", "function dateControlString(dt) {\n\n var m = dt.getMonth() + 1;\n var d = dt.getDate();\n // if (m < 10) { s += '0'; }\n var s = '' + m + '/';\n // if (d < 10) { s += '0'; }\n s += d;\n s += '/' + dt.getFullYear() + '';\n return s;\n}", "function formatDate(date){\n var dd = date.getDate(),\n mm = date.getMonth()+1, //January is 0!\n yyyy = date.getFullYear();\n\n if(dd<10) dd='0'+dd;\n if(mm<10) mm='0'+mm;\n\n return yyyy+'-'+mm+'-'+dd;\n}", "get date_string() {\n return dayjs__WEBPACK_IMPORTED_MODULE_3__(this.date).format('DD MMM YYYY');\n }", "function formatDate(date) {\n let source = new Date(date);\n let day = source.getDate();\n let month = source.getMonth() + 1;\n let year = source.getFullYear();\n\n return `${day}/${month}/${year}`;\n }", "function formatDate(date) {\r\n var d = date ? new Date(date) : new Date()\r\n month = '' + (d.getMonth() + 1),\r\n day = '' + d.getDate(),\r\n year = d.getFullYear();\r\n if (month.length < 2)\r\n month = '0' + month;\r\n if (day.length < 2)\r\n day = '0' + day;\r\n\r\n return `${day}${month}${year}`;\r\n}", "function date_to_str(date)\n{\n return format(\"%02u/%02u/%02u\", date.getUTCMonth()+1, date.getUTCDate(), date.getUTCFullYear()%100);\n}", "formatDate(date) {\n\t\treturn date.toString()\n\t\t.replace(/(\\d{4})(\\d{2})(\\d{2})/, (string, year, month, day) => `${year}-${month}-${day}`);\n\t}", "function dateToString(date) {\n return date.year + '-' + date.month + '-' + date.day\n}", "dateFormate() {\n let today = new Date('dd/MM/yyyy');\n console.log(today);\n today.toLocaleDateString(\"en-US\");\n }", "function dateFormat(date) {\n var month = date.getMonth();\n var day = date.getDate();\n if (day < 10) {\n day = \"0\" + day;\n }\n var year = date.getUTCFullYear();\n month = vm.months[month];\n return day + \" de \" + month + \" del \" + year;\n }", "function dateFormat(d){\n return months[d.getMonth()]+\" \"+d.getDate();\n }", "getFormattedDate(date) {\n return dayjs(date).format(\"MMM MM, YYYY\");\n }", "formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n return [year, month, day].join('-');\n }", "function returnReadableDateString(dayValue, monthValue, yearValue)\n{\n\t// The relevant values are passed in from the date object, and simuarly to above,\n\t// I pass the month value into the monthValues array to get back the month\n\t// as a string\n\treturn dayValue + \" \" + monthValues[monthValue] + \" \" + yearValue;\n}", "function dateFormat(i){\n var date = data.list[i].dt_txt;\n var year = date.slice(0,4);\n var day = date.slice(5,7);\n var month = date.slice(8,10);\n\n var newDateFormat = day + \"/\" + month + \"/\" + year;\n console.log(newDateFormat);\n return newDateFormat;\n }", "function dateformat(date) {\n \n // Main array that will be used to sort out the date.\n let dateArray = date.split('-');\n // Sorts days\n let dayArray = dateArray[2].split('T');\n let day = dayArray[0];\n // Sets up month and year months\n let month = dateArray[1];\n let year = dateArray[0];\n // Using the global standard or writing DOB\n let formatedDOB = [day, month, year].join('-');\n // Retuns the data from the formatted DOB.\n return formatedDOB;\n }", "function getFormattDate(date) {\n let month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : \"0\" + month;\n\n let day = date.getDate().toString();\n day = day.length > 1 ? day : \"0\" + day;\n\n return (date.getFullYear() + \"-\" + month + \"-\" + day);\n}", "function getFormattDate(date) {\n let month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : \"0\" + month;\n\n let day = date.getDate().toString();\n day = day.length > 1 ? day : \"0\" + day;\n\n return (date.getFullYear() + \"-\" + month + \"-\" + day);\n}", "function dateToFullAussieString(d){\r\n return d.getDate() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getFullYear() + \" \" + d.getHours() + \":\" + d.getMinutes() + \":\" + d.getSeconds();\r\n}", "static formatDate(date) {\n return new Date(date).toLocaleDateString();\n }", "function xl_GetDateStr()\n{\n\tvar today = new Date()\n\tvar year = today.getYear()\n\tif(year<1000) year+=1900\n\t\tvar todayStr = GetMonth(today.getMonth()) + \" \" + today.getDate()\n\ttodayStr += \", \" + year\n\treturn todayStr\n}", "function toString(date) {\n return date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? \n '0' + (date.getMonth() + 1) : (date.getMonth() + 1)) + '-' + \n date.getDate()\n }", "function toString(date) {\n return date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? \n '0' + (date.getMonth() + 1) : (date.getMonth() + 1)) + '-' + \n date.getDate()\n }", "fullDateString(date) {\n return {\n day: this.getDayName(date.getDay()),\n month: this.getMonthName(date.getMonth()),\n year: date.getFullYear(),\n d: date.getDate()\n };\n }", "function dateToString(date) {\n let dd = date.getDate();\n let mm = date.getMonth() + 1;\n if (dd < 10) {\n dd = '0' + dd\n }\n if (mm < 10) {\n mm = '0' + mm\n }\n return date.getFullYear() + '-' + mm + '-' + dd;\n}", "function formatDOB(date){\n return `${date.split('-')[1]}/${date.split('-')[2][0]+date.split('-')[2][1]}/${date.split('-')[0]}`\n}", "function formatDate(date) {\n const month = date.getMonth() + 1;\n const day = date.getDate();\n const year = date.getFullYear();\n \n return `${month}/${day}/${year}`;\n }", "function waBuildDate(pv_date) {\n\tvar dateString;\n pv_date=new Date(pv_date);\n var fullYear=pv_date.getFullYear().toString();\n var month=pv_date.getMonth()+1; //add 1 to month (othewise, date is 1 month behind)\n month=month.toString();\n\t\tif(month.length<2) {month=\"0\"+month;}\n var dayOfMonth=pv_date.getDate().toString();\n\t\tif(dayOfMonth.length<2) {dayOfMonth=\"0\"+dayOfMonth;}\n dateString=fullYear+month+dayOfMonth;\n\tif(isNaN(dateString)) { dateString=\"\"; }\n\treturn(dateString); //concatenate as YYYYMMDD\n}", "getCurrentDateFormated() {\n let today = new Date();\n let day = today.getDate();\n let month = today.getMonth()+1;\n let year = today.getFullYear();\n\n if( day < 10) {\n day = \"0\" + day;\n }\n\n if(month < 10) {\n month = \"0\"+month\n }\n\n return `${year}-${month}-${day}`\n }", "function getFormattedDate(d) {\n var todayTime = d;\n todayTime = new Date(todayTime);\n var month = todayTime.getMonth() + 1;\n var day = todayTime.getDate();\n var year = todayTime.getFullYear();\n return month + \"-\" + day + \"-\" + year;\n}", "function format(d) {\n const month = d.getMonth() >= 9 ? d.getMonth() + 1 : `0${d.getMonth() + 1}`;\n const day = d.getDate() >= 10 ? d.getDate() : `0${d.getDate()}`;\n const year = d.getFullYear();\n return `${month}/${day}/${year}`;\n}" ]
[ "0.82993793", "0.77656925", "0.77281773", "0.7691523", "0.7672199", "0.7632734", "0.76053065", "0.7560484", "0.75602794", "0.75567645", "0.75267583", "0.751916", "0.75036496", "0.7499108", "0.7477243", "0.7433282", "0.74329376", "0.74120045", "0.7333313", "0.7299341", "0.7295651", "0.7290834", "0.7290487", "0.72852343", "0.72629654", "0.7258105", "0.7249434", "0.7248306", "0.7245541", "0.72201645", "0.72182125", "0.72160846", "0.720915", "0.7203903", "0.7200671", "0.71981823", "0.7162022", "0.7159422", "0.71593946", "0.71556205", "0.7151544", "0.7140322", "0.7133931", "0.71159655", "0.71120125", "0.70972973", "0.7095389", "0.7084591", "0.70843816", "0.7072102", "0.706986", "0.7066324", "0.70624703", "0.7060501", "0.7055769", "0.7053362", "0.70476335", "0.7047343", "0.7046736", "0.7043234", "0.7042269", "0.70335096", "0.7029699", "0.70277506", "0.7019954", "0.7016685", "0.70127285", "0.7003104", "0.7002921", "0.70018977", "0.70002836", "0.6998998", "0.69980407", "0.69886637", "0.69880545", "0.6987985", "0.69871116", "0.6986095", "0.6984617", "0.69766074", "0.6974282", "0.6972047", "0.6971147", "0.6960422", "0.6943252", "0.6940874", "0.69360924", "0.69360924", "0.69171304", "0.6915296", "0.6912146", "0.69032145", "0.69032145", "0.6883866", "0.68823457", "0.68774223", "0.6877009", "0.6873814", "0.68662745", "0.6860328", "0.68590254" ]
0.0
-1
return string of date in database format
function formatDate2(someDate) { var year = someDate.getYear() + 1900; var month = someDate.getMonth() + 1; var day = someDate.getDate(); return year + "-" + month + "-" + day; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createDateStrForDBRequest(date){\n var year = date.getFullYear().toString();\n var tmpMonth = date.getMonth() + 1; \n var month = tmpMonth>9 ? tmpMonth.toString() : ('0'+tmpMonth.toString());\n var tmpDay = date.getDate();\n var day = tmpDay>9 ? date.getDate().toString() : ('0'+tmpDay.toString());\n return year+'-'+month+'-'+day;\n}", "function createDateStrForDBRequest(date){\n var year = date.getFullYear().toString();\n var tmpMonth = date.getMonth() + 1; \n var month = tmpMonth>9 ? tmpMonth.toString() : ('0'+tmpMonth.toString());\n var tmpDay = date.getDate();\n var day = tmpDay>9 ? date.getDate().toString() : ('0'+tmpDay.toString());\n return year+'-'+month+'-'+day;\n}", "function getDateString() {\n var now = new Date();\n var day = (\"0\" + now.getDate()).slice(-2);\n var month = (\"0\" + (now.getMonth() + 1)).slice(-2);\n return (month) + \"/\" + (day) + \"/\" + now.getFullYear();\n }", "function getSQLDate() {\n\t\tconst date = new Date();\n\t\treturn date.toISOString().substr(0, 19).replace('T', ' ');\n\t}", "function getDateString() {\n // Initializing variables for date, month and year\n let day = date.getDate();\n let month = date.getMonth() + 1;\n let year = date.getFullYear() - 2000;\n \n let strDate = month.toString() + \"/\" + day.toString() + \"/\" + year.toString();\n return strDate\n }", "function _getDateString() {\n var myDate = new Date();\n // forward compatability with ES5 Shims\n if (typeof myDate.getFullYear !== \"function\") {\n myDate.getFullYear = function() {\n return (myDate.getYear + 1900); // offset from year 1900\n };\n }\n\n var myYear = myDate.getFullYear().toString();\n var myMonth = _zeroPad(myDate.getMonth() + 1, 2); // counts from 0\n var myDay = _zeroPad(myDate.getDate(), 2);\n var myHours = _zeroPad(myDate.getHours(), 2);\n var myMinutes = _zeroPad(myDate.getMinutes(), 2);\n var mySeconds = _zeroPad(myDate.getSeconds(), 2);\n\n return myYear + \n \"-\" + myMonth + \n \"-\" + myDay + \n \"T\" + myHours + \n ':' + myMinutes + \n ':' + mySeconds +\n '.' + (myDate.getMilliseconds() / 1000).toFixed(3).slice(2, 5);\n }", "function getDateString() {\n var d = new Date();\n return d.getDate() + \" \" + months[d.getMonth()] + \" \" + (d.getYear() + 1900);\n}", "function getDate()\n\t\t\t{\n\t\t\t\tvar date = new Date();\n\t\t\t\treturn date.toDateString();\n\t\t\t}", "function getCurrentDateInSqlFormat()\r\n{\r\n var date = new Date();\r\n var day = date.getDate();\r\n var monthIndex = date.getMonth();\r\n var year = date.getFullYear();\r\n var hours = date.getHours();\r\n var mins = date.getMinutes();\r\n var sec = date.getSeconds();\r\n \r\n \r\n return day + \"-\" + (monthIndex + 1) + \"-\" + year + \" \" + hours + \":\" + mins + \":\" + sec;\r\n\r\n}", "function getFormattedDateString() {\n const now = new Date();\n const date_string = `${now.getFullYear().toString()}${(now.getMonth() < 10 ? (\"0\" + (now.getMonth() + 1).toString()) : (now.getMonth() + 1).toString())}${(now.getDate < 10 ? (\"0\" + now.getDate().toString()) : now.getDate().toString())}`;\n return date_string;\n }", "function dateToSQLFormat(date) {\n const year = date.getFullYear();\n const month = pad( date.getMonth() + 1 ); \n const day = pad( date.getDate() );\n const hour = pad( date.getHours() );\n const minutes = pad( date.getMinutes() ); \n const seconds = pad( date.getSeconds() ); \n return `${year}-${month}-${day} ${hour}:${minutes}:${seconds}`;\n \n //pads single digit value with 0\n function pad(num) {\n return (num + \"\").length < 2 ? \"0\" + num : num;\n }\n}", "function dateToSQL(dateString) {\n if(dateString == \"\")\n return \"\";\n\n var month = dateString.slice(0, 2);\n var day = dateString.slice(3, 5);\n var year = dateString.slice(-4);\n\n return (year + \"/\" + month + \"/\" + day);\n }", "getDateString() {\n return this.month.toString().padStart(2, \"0\") + \"/\" + this.year.toString().padStart(2, \"0\");\n }", "function getDateString(date)\n{\n\tlet year = date.getFullYear();\n\tlet month = date.getMonth() + 1;\n\tlet day = date.getDate();\n\tlet content = \"\";\n\n\tcontent += year;\n\tif(month < 9) content += \"-0\" + month;\n\telse content += \"-\" + month;\n\n\tif(day < 9) content += \"-0\" + day;\n\telse content += \"-\" + day;\n\treturn content;\n\t\n}", "function dateToString(date) {\n return date.year + '-' + date.month + '-' + date.day\n}", "function dateString () {\n now = new Date();\n year = \"\" + now.getFullYear();\n month = \"\" + (now.getMonth() + 1); if (month.length == 1) { month = \"0\" + month; }\n day = \"\" + now.getDate(); if (day.length == 1) { day = \"0\" + day; }\n hour = \"\" + now.getHours(); if (hour.length == 1) { hour = \"0\" + hour; }\n minute = \"\" + now.getMinutes(); if (minute.length == 1) { minute = \"0\" + minute; }\n second = \"\" + now.getSeconds(); if (second.length == 1) { second = \"0\" + second; }\n return year + \"-\" + month + \"-\" + day + \" \" + hour + \"_\" + minute + \"_\" + second;\n}", "function getDateString() {\n var today = new Date();\n var month = monthNames[today.getMonth()];\n var day = getOrdinal(today.getDate());\n var year = today.getFullYear();\n return month + ' ' + day + ', ' + year;\n}", "function date2str(date) {\n return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;\n }", "function toString(date) {\n return date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? \n '0' + (date.getMonth() + 1) : (date.getMonth() + 1)) + '-' + \n date.getDate()\n }", "function toString(date) {\n return date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? \n '0' + (date.getMonth() + 1) : (date.getMonth() + 1)) + '-' + \n date.getDate()\n }", "function dateToFullAussieString(d){\r\n return d.getDate() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getFullYear() + \" \" + d.getHours() + \":\" + d.getMinutes() + \":\" + d.getSeconds();\r\n}", "returnDateFormat(date){\n var day = new Date(date);\n return day.toDateString();\n }", "function stringifiedDate(){\r\n var date=new Date();\r\n var d = date.getDate();\t\r\n var m = date.getMonth()+1;\t\r\n var y = date.getFullYear().toString().substr(-2);\t\r\n\r\n if(d<10)d=\"0\"+d;\r\n if(m<10)m=\"0\"+m;\r\n \r\n return fullDate=d+\"-\"+m+\"-\"+y;\r\n}", "dateToString(date) {\n let year = date.getFullYear();\n let month = (1 + date.getMonth()).toString().padStart(2, '0');\n let day = date.getDate().toString().padStart(2, '0');\n \n return month + '/' + day + '/' + year;\n }", "function datetoisostring() { // @return String:\r\n return uudate(this).ISO();\r\n}", "static getDateString(date)\r\n\t{\r\n\t\tlet month = date.getMonth() + 1; //months are counted from zero, we need to format it correctly.\r\n\t\tlet addZero = '';\r\n\t\tlet addZeroToDay = '';\r\n\t\tif(month < 10) //add a leading zero in case month is one digit, needed for correct formatting.\r\n\t\t\taddZero = '0';\r\n\t\tif(date.getDate() < 10)\r\n\t\t\taddZeroToDay = '0'\r\n\r\n\t\treturn date.getFullYear() + '-' + addZero + month + '-' + addZeroToDay + date.getDate();\r\n\t}", "function getDateString(date) {\n var m = date.getMonth() + 1;\n if (m < 10) m = '0' + m;\n\n var d = date.getDate();\n if (d < 10) d = '0' + d;\n \n return '' + date.getFullYear() + m + d;\n }", "static getDateTimeString() {\n return `[${moment().format(\"DD.MM.YYYY HH:mm\")}] `;\n }", "function dateTimeString(date) {\n return `${date.getDate()} ${convertMonthInWord(\n date.getMonth()\n )} ${date.getFullYear()}`;\n}", "function getDate()\n {\n var date = new Date();\n\n var month = date.getMonth()+1;\n var day = date.getDate();\n\n if (date.getMonth() < 10)\n {\n month = \"0\" + month;\n }\n\n if (date.getDate() < 10)\n {\n day = \"0\" + day;\n }\n\n var datestring = \"\" + date.getFullYear() + month + day;\n\n return datestring;\n }", "function _getDateString() {\n return Utilities.formatDate((new Date()), AdWordsApp.currentAccount().getTimeZone(), \"yyyy-MM-dd\");\n}", "toString()\n {\n /// UC13 -- Adding the date in short representation\n const options = { year: 'numeric', month: 'long', day: 'numeric'};\n const emplpyeeStartDate = this.startDate == undefined ? \"Undefined\" : this.startDate.toLocaleDateString(\"en-US\", options);\n return `\\n ID : ${this.id} , Name : ${this.name} , Salary : ${this.salary}, Gender = ${this.gender}, Start Date : ${emplpyeeStartDate}`;\n }", "function getDateAsString(dateVal) {\n if (dateVal) {\n var dateAsYYYYMMDD = dateVal.toString(),\n year = dateAsYYYYMMDD.substr(2, 2),\n month = dateAsYYYYMMDD.substr(4, 2),\n day = dateAsYYYYMMDD.substr(6, 2);\n\n return month + '/' + day + '/' + year;\n }\n}", "function dateTodayStr() {\n\n var today = new Date();\n return dateFmtStr(today);\n}", "function dateToString(date) {\n let yangi = new Date(date).toDateString().slice(4);\n return yangi;\n}", "function dateFromSQL(dateString) {\n if(dateString == \"\")\n return \"\";\n\n var month = dateString.slice(5, 7);\n var day = dateString.slice(-2);\n var year = dateString.slice(0, 4);\n\n return (day + \"/\" + month + \"/\" + year);\n }", "function getDateString()\n{ \n var d = new Date();\n var year = d.getUTCFullYear();\n var month = d.getUTCMonth()+1;\n var day = d.getUTCDay()+1;\n var date=\"\";\n if(day<10)\n {\n date = \"\"+year+\"\"+month+\"0\"+day;\n }\n else\n {\n date = \"\"+year+\"\"+month+\"\"+day;\n }\n return date;\n}", "function get_date(){\n var d = new Date();\n var date_string = \"\" + d.getFullYear().toString() + \"-\";\n var month = (d.getMonth() + 1);\n date_string += (month < 10 ? \"0\" + month.toString() : month.toString());\n date_string += \"-\" + d.getDate().toString();\n return date_string;\n}", "function dateToDB(date) {\n //usamos librería moment para dar formato sql\n const dateSQL = moment(date).format(\"YYYY-MM-DD\");\n //devolvemos la fecha\n return dateSQL;\n\n}", "function getCurrentDateString() {\n return dataUtils_1.formatDate.bind(new Date())('yyyy-MM-dd-hhmm');\n}", "function getFormattedDate() {\n return \"[\" + new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '') + \"] \";\n}", "function dateFormat(d){\n\t\tvar string = d.getFullYear() +'/';\n\t\tstring += ( (d.getMonth() < 9) ? '0'+(d.getMonth()+1) : d.getMonth()+1) +'/';\n\t\tstring += d.getDate();\n\t\treturn string;\n\t}", "function dateString() {\n recipe.forEach(date => {\n let dateStr = `${date.created_at.getFullYear()}-${date.created_at.getMonth()+1}-${date.created_at.getDate()}`\n date.display_date = dateStr\n });\n return recipe\n }", "function getDateAsString() {\n var currentDate = new Date(); //We use the JavaScript Date object/function and then configure it\n\n var currentMonth;\n var currentDay;\n\n if(currentDate.getMonth() < 10) {\n currentMonth = \"0\" + String(currentDate.getMonth()+1); //0 indexed month, january is 0\n } else {\n currentMonth = String(currentDate.getMonth()+1);\n }\n\n if(currentDate.getDate() < 10) {\n currentDay = \"0\" + String(currentDate.getDate());\n } else {\n currentDay = String(currentDate.getDate());\n }\n\n var date = currentDate.getFullYear() + \".\" + currentMonth + \".\" + currentDay;\n return date; //returns the date string\n}", "function dateToAussieString(d){\r\n return d.getDate() + \"/\" + (d.getMonth() + 1) + \"/\" + d.getFullYear();\r\n}", "function formatDateString (date) {\n var month = (date.getMonth() + 1); \n var day = date.getDate();\n if (month < 10) month = '0' + month;\n if (day < 10) day = '0' + day;\n var dateString = date.getFullYear() + '-' + month + '-' + day;\n return dateString;\n }", "_stringify(date){\n date = date.toLocaleDateString();\n return date;\n }", "fullDateString(date) {\n return {\n day: this.getDayName(date.getDay()),\n month: this.getMonthName(date.getMonth()),\n year: date.getFullYear(),\n d: date.getDate()\n };\n }", "function datestring () {\n var d = new Date(Date.now() - 5*60*60*1000); //est timezone\n return d.getUTCFullYear() + '-'\n + (d.getUTCMonth() + 1) + '-'\n + d.getDate();\n}", "function datestring () {\n var d = new Date(Date.now() - 5*60*60*1000); //est timezone\n return d.getUTCFullYear() + '-'\n + (d.getUTCMonth() + 1) + '-'\n + d.getDate();\n}", "function getDateString(d){\n\t\tvar days = ['SUN','MON','TUES','WED','THURS','FRI','SAT'];\n\t\tvar spaces = [' ',' '];\n\t\tvar t = days[d.getDay()] + spaces.join('') + d.getDate();\n\t\treturn t\n\t}", "function get_formatted_date(date) {\n function get_formatted_num(num, expected_length) {\n var str = \"\";\n var num_str = num.toString();\n var num_zeros = expected_length - num_str.length;\n for (var i = 0; i < num_zeros; ++i) {\n str += '0';\n }\n str += num_str;\n return str;\n }\n var msg = get_formatted_num(date.getFullYear(), 4) + \"-\";\n msg += get_formatted_num(date.getMonth() + 1, 2) + \"-\";\n msg += get_formatted_num(date.getDate(), 2) + \" \";\n msg += get_formatted_num(date.getHours(), 2) + \":\";\n msg += get_formatted_num(date.getMinutes(), 2) + \":\";\n msg += get_formatted_num(date.getSeconds(), 2);\n return msg;\n}", "get date_string() {\n return dayjs__WEBPACK_IMPORTED_MODULE_3__(this.date).format('DD MMM YYYY');\n }", "function getDateStrYYYYMMDD(dateObj)\n {\n var data_ano = ( \"000\" + new String(dateObj.getFullYear()) ).slice( -4 ) ;\n var data_mes = ( \"0\" + new String(dateObj.getMonth()+1) ).slice( -2 ) ;\n var data_dia = ( \"0\" + new String(dateObj.getDate()) ).slice( -2 ) ;\n var data_str = data_ano + '-' + data_mes + '-' + data_dia ;\n return data_str ;\n }", "function xl_GetDateStr()\n{\n\tvar today = new Date()\n\tvar year = today.getYear()\n\tif(year<1000) year+=1900\n\t\tvar todayStr = GetMonth(today.getMonth()) + \" \" + today.getDate()\n\ttodayStr += \", \" + year\n\treturn todayStr\n}", "function convertDateToString(date) {\n return date.getFullYear() + '-' + (date.getMonth() + 1) + '-' + date.getDate();\n }", "function dateFormat(record) {\n var date = record.CREATE_DATE;\n if (date) {\n record.CREATE_DATE = date.substring(8, 10) + '-' + date.substring(5, 7) + '-' + date.substring(0, 4);\n return record.CREATE_DATE;\n }\n }", "function dateFormatted(date) {\n let d = null;\n\n if (date.toString() == 'Invalid Date') return ''; // eg MySQL 0000-00-00\n\n try {\n switch (config.dateFormat) {\n case 'ISO': // YYYY-MM-DDTHH:MM:SS.mmmZ\n d = date.toISOString();\n break;\n case 'SQL': // YYYY-MM-DD HH:MM:SS\n d = date.toISOString().replace('T', ' ').split('.')[0];\n break;\n case 'JS': // JavaScript date format\n d = date.toString();\n break;\n default:\n throw new Error('Xmlify: Unknown date format '+config.dateFormat);\n }\n } catch (e) {\n throw new Error('Xmlify: Invalid date '+date);\n }\n return d;\n }", "formatDateDbToBr(date) {\n if (!date) return null\n\n const [year, month, day] = date.split('-')\n return `${day}/${month}/${year}`\n }", "function getDateString() {\n var time = new Date().getTime();\n // 32400000 is (GMT+9 Japan)\n // for your timezone just multiply +/-GMT by 36000000\n var datestr = new Date(time +32400000).toISOString().replace(/T/, ' ').replace(/Z/, '');\n return datestr;\n}", "function dateString() {\n posts.forEach(date => {\n let dateStr = `${date.created_at.getFullYear()}-${date.created_at.getMonth()+1}-${date.created_at.getDate()}`\n date.display_date = dateStr\n });\n return posts\n }", "function dateToString(date) {\n let dd = date.getDate();\n let mm = date.getMonth() + 1;\n if (dd < 10) {\n dd = '0' + dd\n }\n if (mm < 10) {\n mm = '0' + mm\n }\n return date.getFullYear() + '-' + mm + '-' + dd;\n}", "getDate() {\n // intialzie te Date object\n const d = new Date();\n\n // retturns the date converted to string\n return `${d.getDate()}/${d.getMonth()}/${d.getFullYear()}`;\n }", "function _getFormattedDate(date) {\n var year = date.getFullYear();\n var month = (1 + date.getMonth()).toString();\n month = month.length > 1 ? month : '0' + month;\n var day = date.getDate().toString();\n day = day.length > 1 ? day : '0' + day;\n return month + '/' + day + '/' + year;\n }", "function formattedDate(date) {\n\n // Récupération\n var month = String(date.getMonth() + 1);\n var day = String(date.getDate());\n var year = String(date.getFullYear());\n\n // Ajout du 0\n if (month.length < 2) \n month = '0' + month;\n\n // Ajout du 0\n if (day.length < 2) \n day = '0' + day;\n\n return day+'/'+month+'/'+year;\n }", "getStringValue() {\n const value = this.getValue();\n return value === null ? null : moment(value).format('YYYY-MM-DD');\n }", "function getDateString() {\n var time = new Date().getTime();\n // 32400000 is (GMT+9 Korea, GimHae)\n // for your timezone just multiply +/-GMT by 3600000\n var datestr = new Date(time +32400000).toISOString().replace(/T/, ' ').replace(/Z/, '');\n return datestr;\n}", "prettyBirthday() {//Can be put in method\n return dayjs(this.person.dob.date)\n .format('DD MMMM YYYY')//change in assignment to different format not default\n }", "function createDateString(data){\n var months = [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"];\n var date = new Date(data);\n var day = date.getDate();\n var month = months[date.getMonth()];\n var year = date.getFullYear();\n return day + ' ' + month + ' ' + year;\n}", "getFormattedDate(date) {\n const year = date.getFullYear();\n const month = (date.getUTCMonth() + 1).toString().padStart(2, '0');\n const day = (date.getUTCDate()).toString().padStart(2, '0');\n // Logger.log(`Day: ${day}, Month: ${month}, Year:${year}`)\n const dateFormatted = `${year}-${month}-${day}`;\n return dateFormatted;\n }", "function date_str() {\n return Date().substring(0,24);\n}", "function getDate() {\n let date = new Date();\n let dateString = (date.getMonth()+1) + \".\"+date.getDate()+\".\"+date.getFullYear();\n return dateString;\n}", "function getDateString(moment){\n return moment.toLocaleDateString('en-US',\n {year:'numeric'\n ,month:'long',\n day:'numeric'})\n}", "function buildStringFromDate(date){\r\n\tvar year = date.getFullYear();\r\n\tvar month = date.getMonth();\r\n\tvar day = date.getDate();\r\n\tvar hours = date.getHours();\r\n\tvar minutes = date.getMinutes();\r\n\tvar seconds = date.getSeconds();\r\n\t\r\n\tif(month < 10){\r\n\t\tmonth = \"0\" + month;\r\n\t}\r\n\t\r\n\tif(day < 10){\r\n\t\tday = \"0\" + day;\r\n\t}\r\n\t\r\n\tif(hours < 10){\r\n\t\thours = \"0\" + hours;\r\n\t}\r\n\t\r\n\tif(minutes < 10){\r\n\t\tminutes = \"0\" + minutes;\r\n\t}\r\n\t\r\n\tif(seconds < 10){\r\n\t\tseconds = \"0\" + seconds;\r\n\t}\r\n\t\t\r\n\tvar sDate = year + \"-\" + month + \"-\" + day + \" \" + hours + \":\" + minutes + \":\"+ seconds + \" AST\";\r\n\treturn sDate;\r\n}", "function getDateTimeString(date) {\n\tfunction pad10(n) {\n\t\treturn n < 10 ? '0' + n : n;\n\t}\t\n\treturn date.getFullYear() + \"-\" + pad10(date.getMonth()) + \"-\" + pad10(date.getDate()) + \" \" + pad10(date.getHours()) + \":\" + pad10(date.getMinutes()) + \":\" + pad10(date.getSeconds());\n}", "function dateToString(date) {\r\n var month = \"\" + (date.getMonth() + 1),\r\n day = \"\" + date.getDate(),\r\n year = date.getFullYear();\r\n\r\n if (month.length < 2) month = \"0\" + month;\r\n if (day.length < 2) day = \"0\" + day;\r\n\r\n return [day, month, year].join(\"-\");\r\n}", "formatDate(date) {\n return date.toISOString().replaceAll(\"-\", \"\").substring(0, 8);\n }", "function formatJS2MySQLDate(js_date) {\n\n var year = js_date.getFullYear();\n var month = js_date.getMonth() + 1;\n var day = js_date.getDate();\n\n var monthStr = month;\n if (month < 10) {\n monthStr = '0' + monthStr;\n }\n\n var dayStr = day;\n if (day < 10) {\n dayStr = '0' + dayStr;\n }\n\n return year + '-' + monthStr + '-' + dayStr;\n }", "function formatDate(date) {\n result = \"\";\n if (date) {\n result += date.getDate() + \"/\"; // Day\n result += (date.getMonth() + 1) + \"/\";\n result += (date.getYear() + 1900);\n }\n return result;\n}", "getBirthday(){\n let result = `${this.dateOfBirth.getDate()}.${this.dateOfBirth.getMonth() +1 }.${this.dateOfBirth.getFullYear()}.`;\n return result;\n }", "function date_to_str(date)\n{\n return format(\"%02u/%02u/%02u\", date.getUTCMonth()+1, date.getUTCDate(), date.getUTCFullYear()%100);\n}", "static formatDate(date) {\n return new Date(date).toLocaleDateString();\n }", "function invoiceDateString() {\n return this.invoiceDate.split('T')[0];\n }", "function nowAsString() {\n return new Date().toISOString().substring(0, 10);\n}", "function getFormatedDate(date) {\n return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;\n}", "formatDate(date) {\n\t\treturn date.toString()\n\t\t.replace(/(\\d{4})(\\d{2})(\\d{2})/, (string, year, month, day) => `${year}-${month}-${day}`);\n\t}", "formatDate (date){\n var d = new Date(date),\n month = (d.getMonth() + 1),\n day = d.getDate(),\n year = d.getFullYear();\n if (month.length < 2)\n month = '0' + month;\n if (day.length < 2)\n day = '0' + day;\n return [year, month, day].join('-');\n }", "function getDateString(now)\n{\n const options={year:'numeric',month:'long',day:'numeric'};\n return now.toLocaleDateString('en-Us',options);\n \n}", "display_date_formate(date) {\n if (!date)\n return null;\n const [year, month, day] = date.split('-');\n let new_date = `${day}-${month}-${year}`;\n return new_date;\n }", "function formatDOB(date){\n return `${date.split('-')[1]}/${date.split('-')[2][0]+date.split('-')[2][1]}/${date.split('-')[0]}`\n}", "function formatted_date()\n{\n var result=\"\";\n var d = new Date();\n var month = (d.getMonth()+1);\n var day = d.getDate();\n if (d.getMonth()+1 < 10){\n \t\tvar month = '0' + (d.getMonth()+1);\n }\n if (d.getDate()+1 < 10){\n \t\tvar day = '0' + d.getDate();\n }\n result += d.getFullYear() +''+ month +''+ day;\n console.log(result);\n return result;\n}", "function dateFmtStr(today) {\n\n var dd = today.getDate();\n var mm = today.getMonth() + 1; //January is 0!\n var yyyy = today.getFullYear();\n return mm + '/' + dd + '/' + yyyy;\n}", "function getMySQLDate(date) {\n\n if (!$.trim(date)) {\n return '';\n }\n\n var m = moment(date, 'DD/MM/YYYY HH:mm');\n return m.format('YYYY-MM-DD HH:mm');\n }", "function getDateString () {\n var time = new Date();\n // 14400000 is (GMT-4 Montreal)\n // for your timezone just multiply +/-GMT by 3600000\n var datestr = new Date(time - 14400000).toISOString().replace(/T/, ' ').replace(/Z/, '');\n return datestr;\n}", "function dateformat(date) {\n \n // Main array that will be used to sort out the date.\n let dateArray = date.split('-');\n // Sorts days\n let dayArray = dateArray[2].split('T');\n let day = dayArray[0];\n // Sets up month and year months\n let month = dateArray[1];\n let year = dateArray[0];\n // Using the global standard or writing DOB\n let formatedDOB = [day, month, year].join('-');\n // Retuns the data from the formatted DOB.\n return formatedDOB;\n }", "function showDate() {\n return `The date is: '01.01.1990'`;\n }", "function datestring() {\n var d = new Date(Date.now() - 5 * 60 * 60 * 1000); //est timezone\n return d.getUTCFullYear() + \"-\" +\n (d.getUTCMonth() + 1) + \"-\" +\n d.getDate();\n}", "function serializedStringForDate(date) {\n\tvar month = date.getMonth() + 1; // 0-based month, eg 0 == Jan, 11 == Dec so add 1\n\tvar day = date.getDate(); \t // 1-based day of month eg 1 thru 31\n\n\tmonth = (month < 10) ? \"0\" + month : \"\" + month;\t// pad single digits\n\tday = (day < 10) ? \"0\" + day : \"\" + day;\t\t// pad single digits\n\n\tvar year = date.getFullYear();\n\treturn year + \"-\" + month + \"-\" + day;\n}", "function dateToString(_date, symbol){\n if(symbol == undefined) symbol = \"/\";\n return _date.getFullYear() + symbol + \n (\"0\" + (_date.getMonth() + 1)).substr(-2) + symbol + \n (\"0\" + _date.getDate()).substr(-2);\n}", "function convertDateToString(date)\n{\n\t// Add \"0\" ahead the month & day if needed\n\tvar month = date.getMonth()+1;\n\tvar day = date.getDate();\n\n\tif (month < 10) {\n\t\tmonth = \"0\"+month;\n\t}\n\tif (day < 10) {\n\t\tday = \"0\"+day;\n\t}\n\t// Date formating\n\tStringDateResult = month+\"/\"+day+\"/\"+(date.getFullYear());\n\n\treturn StringDateResult;\n}", "getCurrentDateFormated() {\n let today = new Date();\n let day = today.getDate();\n let month = today.getMonth()+1;\n let year = today.getFullYear();\n\n if( day < 10) {\n day = \"0\" + day;\n }\n\n if(month < 10) {\n month = \"0\"+month\n }\n\n return `${year}-${month}-${day}`\n }" ]
[ "0.7463057", "0.7463057", "0.7377157", "0.73541224", "0.7159952", "0.7125878", "0.71021456", "0.6971029", "0.69398516", "0.692364", "0.69203913", "0.68943876", "0.68784356", "0.68719685", "0.68438876", "0.6840694", "0.6828152", "0.6817267", "0.67385846", "0.67385846", "0.66903806", "0.6687488", "0.6677369", "0.6672704", "0.66571903", "0.6632569", "0.6627928", "0.661533", "0.66066873", "0.66043115", "0.6599416", "0.6589847", "0.65708995", "0.65607613", "0.65607387", "0.6550181", "0.6543794", "0.6535188", "0.6532129", "0.6500447", "0.64959115", "0.649574", "0.6495322", "0.648078", "0.64749026", "0.6459993", "0.64588356", "0.64471376", "0.6442244", "0.6442244", "0.64368963", "0.6434093", "0.64171207", "0.6415098", "0.64129966", "0.64068526", "0.640532", "0.6390013", "0.6389925", "0.6385589", "0.6359089", "0.63490796", "0.6346195", "0.6335702", "0.6332443", "0.6319653", "0.6313339", "0.629963", "0.62889564", "0.6281811", "0.627266", "0.626806", "0.6266592", "0.6265061", "0.6262773", "0.62512475", "0.62412137", "0.62396944", "0.6234119", "0.6231065", "0.62275636", "0.6220839", "0.6212618", "0.62091374", "0.61996824", "0.6199058", "0.61986655", "0.6194868", "0.6190252", "0.6183507", "0.61715317", "0.61674494", "0.6163759", "0.615918", "0.61562514", "0.6154137", "0.6151557", "0.6144988", "0.61415404", "0.6137675", "0.6137206" ]
0.0
-1
database time format to userfriendly time format
function convertTime(dbTime) { var timeString; var timeSplit = dbTime.split(":"); var timeSplitInt = []; var i; for (i = 0; i < timeSplit.length; i++) timeSplitInt[i] = parseInt(timeSplit[i]); if (timeSplitInt[0] == 0) timeString = "12:" + timeSplit[1] + "a"; else if (timeSplitInt[0] > 12) timeString = (timeSplitInt[0] - 12) + ":" + timeSplit[1] + "p"; else timeString = timeSplitInt[0] + ":" + timeSplit[1] + "a"; return timeString; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "timeFormatter (time) {\n var timeArr = time.split('T');\n var finalTime = timeArr[1].slice(0,2) + ':' + timeArr[1].slice(2,4);\n return finalTime;\n }", "function timeFormat(time) {\n return time < 10 ? \"0\"+time : time;\n }", "function formatTime(time) {\n if (time < 10) {\n time = \"0\" + time;\n }\n return time;\n }", "function formatTime(time) {\n if (time > 9) {\n return time;\n } else {\n return \"0\" + time;\n }\n }", "function timeFormat() {\n return setTwoDigit(timer.min) + \":\" + setTwoDigit(timer.sec) + \":\" + setTwoDigit(timer.millisecond);\n}", "function timeFormatter (time) {\n\tvar timeArr = time.split('T');\n\tvar finalTime = timeArr[1].slice(0,2) + ':' + timeArr[1].slice(2,4);\n\treturn finalTime;\n}", "function getFormattedTime() {\n var today = new Date();\n //return moment(today).format(\"YYYYMMDDHHmmssSSS\");\n return moment(today).format(\"YYYYMMDDHHmmss\");\n }", "function convert_to_mysql(jsontime) {\n return jsontime ? jsontime.replace(/^.*T/, '') : jsontime;\n}", "function getFormattedTime() {\n var today = new Date();\n //return moment(today).format(\"YYYYMMDDHHmmssSSS\");\n return moment(today).format(\"DDHHmmssSSS\");\n }", "formatTime(time) {\n time = parseInt(time, 10);\n if (time < 10) return '0' + time;\n return time;\n }", "function _formatTime(time) {\n var timeFormatted = time.toISOString();\n if (timeFormatted.indexOf(\"T\") > 0)\n timeFormatted = timeFormatted.split('T')[1];\n if (timeFormatted.length > 8)\n timeFormatted = timeFormatted.substr(0, 8);\n return timeFormatted;\n}", "function formatTime(time) {\n var hour = time.substr(0, 2);\n var minute = time.substr(3, 2);\n var ret;\n\n if (hour == 0) {\n ret = \"12:\" + minute + \"am\";\n }\n else if (hour == 12) {\n ret = hour + \":\" + minute + \"pm\";\n }\n else if (hour > 12) {\n hour -= 12;\n ret = hour + \":\" + minute + \"pm\";\n } else {\n ret = hour * 1 + \":\" + minute + \"am\";\n }\n if (hour < 10) {\n ret = \"&nbsp;\" + ret;\n }\n return ret;\n }", "function editTime(time){\r\n if((time.toString()).length === 1){\r\n return '0' + time;\r\n } else {\r\n return time.toString();\r\n }\r\n}", "function convertToSQLTimeFormat(timeConversion) {\n var userHour = timeConversion;\n var convertedTime = 0;\n if(userHour < 10) {\n convertedTime = `0${userHour}:00:00.0000000`;\n } else {\n convertedTime = `${userHour}:00:00.0000000`;\n }\n \n console.log(convertedTime);\n return convertedTime;\n }", "function formatTime(time) {\r\n if ( time < 10 ) {\r\n return '0' + time;\r\n }\r\n return time;\r\n}", "function timeFormatString() {\n return is24HourTime() ? 'HH:mm' : 'hh:mm a';\n}", "function timeConvertMysql(timeVal){\n\tvar timeAry = timeVal.split(\":\");\n\tvar timeHrs = timeAry[0];\n\tvar timeStr = false;\n\t\n\tif(timeVal.match(/am/i)) timeStr = timeHrs + \":\" + timeAry[1].slice(0,timeAry[1].indexOf(\" \",0)) + \":00\";\n\telse if(timeVal.match(/pm/i)){\n\t\ttimeHrs = parseInt(timeHrs) + 12;\n\t\ttimeStr = timeHrs + \":\" + timeAry[1].slice(0,timeAry[1].indexOf(\" \",0)) + \":00\";\n\t}\n\treturn timeStr;\n}", "formatTime(time) {\n return (time < 10) ? `0${time}` : time;\n }", "tConvert(time, format) {\n if (format == 12) {\n let timeArr = time.split(\":\");\n let hours = timeArr[0];\n let _ext = \"AM\";\n if (hours >= 12) {\n hours = timeArr[0] % 12;\n _ext = \"PM\";\n }\n return hours + \":\" + timeArr[1] + \":\" + timeArr[2] + \" \" + _ext;\n } else {\n }\n }", "formatTime(time) {\r\n var timeString = \"\";\r\n if (time < 1200) {\r\n time = time / 100.00;\r\n if (time % 1 === 0) {\r\n timeString = time + \".00 AM\";\r\n } else {\r\n timeString = time + \"0 AM\";\r\n }\r\n } else if (time === 1200) {\r\n time = time / 100.00;\r\n if (time % 1 === 0) {\r\n timeString = time + \".00 PM\";\r\n } else {\r\n timeString = time + \"0 PM\";\r\n }\r\n } else {\r\n time = (time - 1200) / 100.00;\r\n if (time % 1 === 0) {\r\n timeString = time + \".00 PM\";\r\n } else {\r\n timeString = time + \"0 PM\";\r\n }\r\n }\r\n return timeString;\r\n }", "getTimeFormat(time) {\n if (time.getHours() >= 12) {\n return ((time.getHours() - 12) >= 10 ? \"\" : \"0\") + (time.getHours() - 12) + \":\" + (time.getMinutes() >= 10 ? \"\" : \"0\") + time.getMinutes() + \" PM\";\n } else {\n return (time.getHours() >= 10 ? \"\" : \"0\") + time.getHours() + \":\" + (time.getMinutes() >= 10 ? \"\" : \"0\") + time.getMinutes() + \" AM\";\n }\n }", "function formatTime(time) {\r\n return time < 10 ? `0${time}` : time;\r\n}", "function editTime(time) {\n var timeFormat = time.match(/[^:]+(\\:[^:]+)?/g)[0];\n\n return timeFormat;\n}", "function prettyDate2(time) {\n var date = new Date(parseInt(time));\n var localeSpecificTime = date.toLocaleTimeString();\n return localeSpecificTime.replace(/:\\d+ /, ' ');\n }", "function getFormattedTime() {\n var today = new Date();\n\n return moment(today).format(\"YYYYMMDDHHmmss\");\n }", "formatTime(time) {\n var sec_num = parseInt(time, 10);\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) { hours = \"0\" + hours; }\n if (seconds < 10) { seconds = \"0\" + seconds; }\n return (hours < 1 ? '' : hours + ':') + (minutes < 1 ? '0:' : minutes + ':') + seconds;\n }", "function timeSetFormat(time){\r\n let tempArr = time.split(\":\");\r\n for(var i=0; i<tempArr.length; i++){\r\n tempArr[i] = +tempArr[i];\r\n }\r\n tempArr = roundTime(tempArr);\r\n\r\n //reformat by adding starting 0's\r\n if(tempArr[1] == '0'){\r\n tempArr[1] = '00';\r\n }\r\n if(tempArr[0] < 10){\r\n tempArr[0] = '0' + tempArr[0];\r\n }\r\n\r\n tempArr = tempArr.join(':');\r\n return tempArr;\r\n}", "function format_time_output(time) {\n var h = 0; \n var m = 0;\n var s = 0;\n var ms = 0;\n var formated_time;\n\n h = Math.floor( time / (60 * 60 * 1000) );\n time = time % (60 * 60 * 1000);\n m = Math.floor( time / (60 * 1000) );\n time = time % (60 * 1000);\n s = Math.floor( time / 1000 );\n ms = time % 1000;\n\n newTime = pad(h, 2) + ':' + pad(m, 2) + ':' + pad(s, 2) + ':' + pad(ms,3);\n return newTime;\n}", "function timeformat(time) {\r\n\t//calculate the time in hours, minutes and seconds\r\n\tmin = time / 60000;\r\n\tsec = min % 1;\r\n\tmin -= sec;\r\n\tsec *= 60;\r\n\tremainder = sec % 1;\r\n\tsec -= remainder;\r\n\tif( min < 10 ) { min = \"0\" + min; }\r\n\tif( sec < 10 ) { sec = \"0\" + sec; }\r\n\tformattedtime = min + \":\" + sec;\r\n\treturn formattedtime;\r\n}", "function timeFormatFn() {\n let now = new Date();\n return now.toUTCString();\n}", "function formatTime(time){\n\t\tvar formatted = {\n\t\t\tminute:time.getMinutes(),\n\t\t\thour:time.getHours(),\n\t\t\tampm:'AM',\n\t\t\ttimeString:''\n\t\t};\n\t\tif (formatted.hour > 11){\n\t\t\tformatted.ampm = 'PM';\n\t\t}\n\t\tif (formatted.hour > 12){\n\t\t\tformatted.hour -= 12;\n\t\t}\n\t\tif (formatted.minute < 10){\n\t\t\tformatted.minute = '0'+formatted.minute;\n\t\t}\n\t\tformatted.timeString = formatted.hour + ':'+formatted.minute + ' ' + formatted.ampm;\n\t\treturn formatted;\n\t}", "function convertTime(time) {\n\n \t\tvar time = time.toString();\n\t\tstrArray = time.split(\"\");\n\t\tnewString = \"\";\n\t\tfor (var i = 0; i < strArray.length; i++) {\n\t\t\tif ( i === strArray.length - 2) {\n\t\t\t\tnewString += \":\";\n\t\t\t}\n\t\t\tnewString += strArray[i]\n\t\t};\n\n\t\treturn newString;\n\t}", "function timeToString(t) {\n var s = t.hours + \":\" + t.mins + \" \";\n s += t.isAM ? \"AM\" : \"PM\";\n return s;\n }", "formatTime(time) {\n return (time >= 10) ? time : `0${time}`;\n }", "function formatTime(val) {\n var a = new Number(val.substring(0,val.indexOf(\":\")));\n if (a > 12) {\n a -= 12;\n }\n var b = val.substring(val.indexOf(\":\"),val.length);\n return a + b;\n}", "function formatTime(time) {\n return time >= 10 ? time : `0${time}`;\n}", "function fancyTimeFormat(time)\n{ \n // Hours, minutes and seconds\n var hrs =Math.floor(time / 3600);\n var mins = Math.floor((time % 3600) / 60);\n var secs = time % 60;\n\n // Output like \"1:01\" or \"4:03:59\" or \"123:03:59\"\n var ret = \"\";\n\n if (hrs > 0) {\n ret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\n }\n\n ret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\n ret += \"\" + secs;\n return ret;\n}", "function fancyTimeFormat(time)\r\n\t\t{ \r\n \t\tvar hrs = ~~(time / 3600);\r\n \t\tvar mins = ~~((time % 3600) / 60);\r\n \t\tvar secs = time % 60;\r\n\t\t\tvar ret = \"\";\r\n \t\tif (hrs > 0) {\r\n \tret += \"\" + hrs + \":\" + (mins < 10 ? \"0\" : \"\");\r\n \t\t}\r\n \t\tret += \"\" + mins + \":\" + (secs < 10 ? \"0\" : \"\");\r\n \t\tret += \"\" + secs;\r\n \t\treturn ret;\r\n\t\t}", "function formatTime(thisTime)\n{\n toReturn = thisTime.slice(8,10) + \":\" + thisTime.slice(10,12) + \", \";\n toReturn += thisTime.slice(6,8) + \".\" + thisTime.slice(4,6) + \".\" + thisTime.slice(0,4);\n return toReturn;\n}", "function formatTime(d){\n\treturn d.toTimeString().split(' ')[0];\n}", "function convertTimeStringformat(format, str) {\n var time = $(\"#clock\").val();\n var hours = Number(time.match(/^(\\d+)/)[1]);\n var minutes = Number(time.match(/:(\\d+)/)[1]);\n var AMPM = time.match(/\\s(.*)$/)[1];\n if (AMPM == \"PM\" && hours < 12) hours = hours + 12;\n if (AMPM == \"AM\" && hours == 12) hours = hours - 12;\n var sHours = hours.toString();\n var sMinutes = minutes.toString();\n if (hours < 10) sHours = \"0\" + sHours;\n if (minutes < 10) sMinutes = \"0\" + sMinutes;\n return (sHours + \":\" + sMinutes);\n}", "function format_time(departure) {\n var dep_array = departure.split('T');\n var time = dep_array[1];\n return time.substr(0, 5);\n }", "function timestr(time, full) {\r\n time = parseInt (time);\r\n var m = [];\r\n var t = time;\r\n if (t < 61)\r\n return t + 'sn.';\r\n if (t > 86400){\r\n m.push (parseInt(t/86400));\r\n m.push ('Gün');\r\n t %= 86400;\r\n } \r\n if (t>3600 || time>3600){\r\n m.push (parseInt(t/3600));\r\n m.push ('Saat ');\r\n t %= 3600;\r\n } \r\n m.push (parseInt(t/60));\r\n m.push ('Dk.');\r\n if (full || time<=3600 ){\r\n m.push (' ');\r\n m.push (t%60);\r\n m.push ('sn.'); \r\n }\r\n return m.join ('');\r\n}", "function formatTime(t) {\n return padZeros(t.getHours(), 2) + ':' + padZeros(t.getMinutes(), 2) + ':' + padZeros(t.getSeconds(), 2);\n}", "function ConvertTimeformat(format) {\n\tvar time = format;\n\tvar hours = Number(time.match(/^(\\d+)/)[1]);\n\tvar minutes = Number(time.match(/:(\\d+)/)[1]);\n\tvar AMPM = time.match(/\\s(.*)$/)[1];\n\tif (AMPM == \"PM\" && hours < 12) hours = hours + 12;\n\tif (AMPM == \"AM\" && hours == 12) hours = hours - 12;\n\tvar sHours = hours.toString();\n\tvar sMinutes = minutes.toString();\n\tif (hours < 10) sHours = \"0\" + sHours;\n\tif (minutes < 10) sMinutes = \"0\" + sMinutes;\n\treturn (sHours + \":\" + sMinutes + \":00\");\n}", "function formatTime(time){\r\n //Incoming Time format hh:mm:ss\r\n splitTime = time.split(\":\");\r\n hour = splitTime[0];\r\n minute = splitTime[1];\r\n\r\n //Determine if the hour is AM or PM\r\n if (hour > 12){\r\n amPM = \"PM\";\r\n hour = hour - 12;\r\n }else{\r\n amPM = \"AM\";\r\n }\r\n\r\n //return time in hh:mm AM/PM\r\n return hour +\":\" + minute + \" \" + amPM;\r\n}", "function timeShort() {\n return doFormat(date, {\n hour: 'numeric',\n minute: '2-digit'\n });\n }", "function timeConverter(t) {\n var tmr = new Date(t);\n var year = tmr.getFullYear();\n var month = tmr.getMonth();\n var day = tmr.getDate();\n var time = year + '-' + month + '-' + day;\n return time; \n}", "formatTime(d){\n let time = new Date(d.replace('Z', ''));\n let date = new Date(time);\n let hours = date.getHours();\n let minutes = date.getMinutes();\n let ampm = hours >= 12 ? 'PM' : 'AM';\n hours = hours % 12;\n hours = hours ? hours: 12;\n minutes = minutes < 10 ? '0'+minutes : minutes;\n let formatedTime = `${hours}:${minutes} ${ampm}`\n\n return formatedTime;\n }", "function timeConverter(time)\n{\n\tif(time == 0 || time == 24)\n\t\treturn \"12:00a.m.\"\n\tif(time < 12)\t\n\t\treturn time + \":00a.m.\";\t\n\telse if(time == 12)\n\t\treturn time + \":00p.m.\";\n\telse if(time > 12 && time < 24)\n\t\treturn (time - 12) + \":00p.m.\";\n}", "changeTimeFormatByTime(time) {\n if(time > moment().subtract(1, 'minutes')) {\n return time.startOf('second').fromNow();\n } else if(time > moment().subtract(1, 'hours')) {\n return time.startOf('minute').fromNow();\n } else if(time > moment().subtract(1, 'days')) {\n return time.format('h:mm:ss a');\n } else if(time > moment().subtract(1, 'years')) {\n return time.format(\"MMM Do\");\n } else {\n return time.format(\"MMM Do YYYY\");\n }\n }", "function formatTime(timeinmil){\n\t\n\t /*\n\t * if we get \"?\" or \"...\" do not process anything else we get \"?\" at the\n\t * begining of the grid we get \"...\" when grid is loading more rows\n\t */\n\t if (isNaN(timeinmil) || timeinmil == \"?\" || timeinmil == \"...\" || timeinmil === \"\" || timeinmil === \"*\") {\n\t return timeinmil;\n\t }\n\t \n\t // node where we will replace time\n\t var oDiv;\n\t \n\t // increment current row\n\t currentRow++;\n\t \n\t // get time object from input\n//\t var dateTime = new Date(timeinmil);\n//\t console.debug(dateTime);\n\t // get UTC time in msec\n\t var utc = timeinmil + tzoffset;\n\t \n\t // create new Date object for different city\n\t // using supplied offset\n\t var dateTime = new Date(utc + offset);\n\t \n//\t console.debug(dateTime);\n\t \n\t // change it into time\n\t //var time = dateTime.toLocaleString();\n\t var time = dojo.date.locale.format(dateTime, {\n\t formatLength: \"short\",\n\t timePattern : \"HH:mm:ss.SSS\"\n\t });\n\t \t \n\t return time;\n\t}", "function getFormattedTime(fourDigitTime) {\n var hours24 = parseInt(fourDigitTime.substring(0, 2),10);\n var hours = ((hours24 + 11) % 12) + 1;\n var amPm = hours24 > 11 ? 'pm' : 'am';\n var minutes = fourDigitTime.substring(2);\n\n return hours + ':' + minutes + amPm;\n}", "function formatTime(time) {\n let hour, apm\n if (time.hour < 12) {\n hour = \"\" + time.hour\n apm = \"am\"\n } else if (time.hour < 24) {\n if (time.hour == 12) hour = \"\" + time.hour\n else hour = \"\" + (time.hour - 12)\n apm = \"pm\"\n } else {\n // if hour >= 24, display it as on the next day\n hour = \"\" + (time.hour - 24)\n apm = \"am\"\n time.day = (time.day + 1) % 7\n }\n\n let minute = \"\" + time.minute\n if (time.minute < 10) minute = \"0\" + minute\n\n // let day\n // if (time.day == 0) day = \"Sun\"\n // else if (time.day == 1) day = \"Mon\"\n // else if (time.day == 2) day = \"Tue\"\n // else if (time.day == 3) day = \"Wed\"\n // else if (time.day == 4) day = \"Thu\"\n // else if (time.day == 5) day = \"Fri\"\n // else if (time.day == 6) day = \"Sat\"\n\n return hour + \":\" + minute + \" \" + apm\n}", "function reFormatTime(time) {\n const ampm = time.substr(-2, 2);\n let formattedTime;\n let formattedHour;\n const colon = time.indexOf(':');\n\n if (ampm === 'PM') {\n formattedHour = time.substr(0, 2);\n\n if (formattedHour == '12') { formattedHour = 12; } else { formattedHour = 12 + parseInt(time.substr(0, 2)); }\n\n formattedTime = `${formattedHour + time.substr(colon, 3)}:00`;\n } else {\n formattedHour = parseInt(time.substr(0, 2));\n if (formattedHour < 10) {\n formattedHour = `0${formattedHour}`;\n }\n if (formattedHour == 12) {\n formattedHour = '00';\n }\n formattedTime = `${formattedHour + time.substr(colon, 3)}:00`;\n }\n return formattedTime;\n }", "function fx_Time(data)\n{\n\t//has format?\n\tif (String_IsNullOrWhiteSpace(data))\n\t{\n\t\t//use default\n\t\tdata = \"h:m\";\n\t}\n\t//get current date\n\tvar theDate = new Date();\n\t//Format it\n\treturn VarManager_FormatDate(data, theDate);\n}", "function toRepresentation(time) {\n // Convert the time from server to the representation display on frontend.\n return moment(time, [\"h:mm a\", \"HH:mm:ss\"]).format(\"h:mm a\");\n }", "function formatTime(time) {\n // TODO This will fail for times that have hour value of 0 - 9\n let hour = Number.parseInt(time.substring(0, 2));\n if (hour < 12) {\n if (hour == 0) {\n return \"12\" + time.substring(2) + \" AM\";\n }\n else {\n return hour + time.substring(2) + \" AM\";\n }\n }\n else {\n if (hour == 12) {\n return \"12\" + time.substring(2) + \" PM\";\n }\n else {\n return (hour % 12) + time.substring(2) + \" PM\";\n }\n }\n}", "function formatTime(time){\n\ttime = Math.round(time);\n\n\tvar minutes = Math.floor(time / 60),\n\t\tseconds = time - minutes * 60;\n\n\tseconds = seconds < 10 ? '0' + seconds : seconds;\n\n\treturn minutes + \":\" + seconds;\n}", "function formatTime(t) {\n\tif (t < 10) {t = '0' + t}; \n\treturn t;\n}", "function format_time(time){\n\tvar h,m,s;\n\th=(time/360)|0;time%=360;\n\tm=(time/60)|0;time%=60;\n\ts=time|0;\n\t\n\treturn (h?h+\":\": \"\")+(m>=10?m: \"0\"+m)+\":\"+(s>=10?s: \"0\"+s);\n}", "function format(time){\n return time < 10 ? \"0\"+time : time;\n}", "function formatTime(time){\n var currentTime = new Date(Date.parse(time));\n var hour = currentTime.getHours();\n var minute = currentTime.getMinutes();\n\n if(minute < 10) {\n minute = '0' + minute;\n }\n\n if(hour >= 13){\n hour = hour-12;\n currentTime = hour + ':' + minute + 'PM';\n }\n\n else if(hour === 12){\n currentTime = hour + ':' + minute +'PM';\n }\n else if(hour === 0){\n currentTime = 1 + ':' + minute + 'AM';\n }\n else{\n currentTime = hour + ':' + minute +'AM';\n }\n\n return currentTime;\n\n }", "function timestr(time, full) {\r\n time = parseInt (time);\r\n var m = [];\r\n var t = time;\r\n if (t < 61)\r\n return t + 's';\r\n if (t > 86400){\r\n m.push (parseInt(t/86400)); \r\n m.push ('d ');\r\n t %= 86400;\r\n } \r\n if (t>3600 || time>3600){\r\n m.push (parseInt(t/3600)); \r\n m.push ('h ');\r\n t %= 3600;\r\n } \r\n m.push (parseInt(t/60)); \r\n m.push ('m');\r\n if (full || time<=3600 ){\r\n m.push (' ');\r\n m.push (t%60);\r\n m.push ('s'); \r\n }\r\n return m.join ('');\r\n}", "function timestr(time, full) {\r\n time = parseInt (time);\r\n var m = [];\r\n var t = time;\r\n if (t < 61)\r\n return t + 's';\r\n if (t > 86400){\r\n m.push (parseInt(t/86400));\r\n m.push ('d ');\r\n t %= 86400;\r\n } \r\n if (t>3600 || time>3600){\r\n m.push (parseInt(t/3600));\r\n m.push ('h ');\r\n t %= 3600;\r\n } \r\n m.push (parseInt(t/60));\r\n m.push ('m');\r\n if (full || time<=3600 ){\r\n m.push (' ');\r\n m.push (t%60);\r\n m.push ('s'); \r\n }\r\n return m.join ('');\r\n}", "function formatTime(time) {\n // converts the time in hours\n var hours = Math.floor(time / (1000 * 60 * 60));\n // converts the time to minutes\n var minutes = Math.floor(time / (1000 * 60)) % 60;\n // converts the time to seconds\n var seconds = Math.floor(time / 1000) % 60;\n\n // formatting for seconds\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n seconds = \":\" + seconds\n\n // formatting for hours\n if (hours == 0) {\n hours = \"\";\n } else {\n hours += \":\";\n }\n\n // formatting for minutes\n if (minutes == 0) {\n minutes = \"\";\n }\n // returns the final result as a string\n return hours + minutes + seconds;\n}", "function toString(time, format) {\n format = format || Time.DEFAULT_TIME_FORMAT;\n var bits = formatRegex.exec(format);\n var fHour = bits[1];\n var fMiddlebit = bits[2];\n var fMinutes = bits[3];\n var fPeriodSpace = bits[4];\n var fPeriod = bits[5];\n var fFirstPeriod = bits[6];\n var fPeriodM = bits[7];\n\n // always show hour\n var hours = fHour.length == 2 ? padTime(time.hours()) : time.hours();\n\n // show if in the format or if non-zero and middlebit is provided\n var minutes = (fMinutes || (fMiddlebit && time.minutes() !== 0)) ?\n padTime(time.minutes()) : '';\n\n // show middlebit if we have minutes\n var middlebit = (minutes && fMiddlebit) ? fMiddlebit : '';\n\n // show period if available and requested\n var period = '';\n if (fPeriod && time.period()) {\n var firstPeriod = time.period().charAt(0);\n if (fPeriod.charAt(0) === fPeriod.charAt(0).toUpperCase()) {\n firstPeriod = firstPeriod.toUpperCase();\n }\n period = firstPeriod + fPeriod.slice(1);\n }\n\n // only show space if it was requested by format and there's a period\n var space = (period && fPeriodSpace) ? fPeriodSpace : '';\n\n return '' + hours + middlebit + minutes + space + period;\n }", "function fancyTimeFormat(time) {\n var hrs= ~~(time/3600);\n var min= ~~((time%3600)/60);\n var sec= time%60;\n var ret=\"\";\n if(hrs>0)\n {\n ret+=\"\"+hrs+\":\"+(min<10?\":\":\"\");\n }\n ret+=\"\"+min+\":\"+(sec<10?\"0\":\"\");\n ret+=\"\"+sec;\n return ret;\n}", "function formatTweetTime(time) {\r\n var arr = time.split(' ');\r\n return arr[1] + ' ' + arr[2];\r\n }", "function formatTime(time){\n\n var now = new Date();\n var date = new Date(time);\n\n var amPm = \"AM\";\n\n var hour = date.getHours();\n\n if(hour>12) {\n hour = (hour - 12);\n amPm = \"PM\";\n }\n else if(hour===12)\n amPm = \"PM\";\n\n var minute = date.getMinutes();\n if(minute < 10)\n minute = '0'+minute;\n\n var seconds = date.getSeconds();\n if(seconds < 10)\n seconds = '0'+seconds;\n\n if(now.getTime()-date.getTime()>1000*60*60*24){\n return (date.getMonth()+1) + \"/\" + date.getDate() + \"/\" + date.getFullYear() +\n \" \" + hour + \":\" + minute + \":\" + seconds + ' ' + amPm;\n }\n else\n return hour + \":\" + minute + \":\" + seconds + ' ' + amPm;\n}", "function formatTime(time) {\n if (time == -1) { return \"N/A\" }\n time = +time;\n let cs = time % 1000;\n let s = time % (1000 * 60) - cs;\n let m = time - s - cs;\n\n // Since the values returned above is suffixed\n // we have to divide afterwards\n cs = Math.floor(cs / 10);\n s = Math.floor(s / 1000);\n m = Math.floor(m / (1000 * 60));\n\n return (m > 0 ? m + \":\" : \"\") + (s < 10 && m > 0 ? \"0\" + s : s) + \".\" + (cs < 10 ? \"0\" + cs : cs);\n}", "function formatTime(){\n let time = new Date(),\n minutes = time.getMinutes().toString().length == 1 ? '0'+time.getMinutes() : time.getMinutes(),\n hours = time.getHours().toString().length == 1 ? '0'+time.getHours() : time.getHours(),\n ampm = time.getHours() >= 12 ? 'pm' : 'am',\n months = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],\n days = ['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];\n return days[time.getDay()]+' '+months[time.getMonth()]+' '+time.getDate()+' '+time.getFullYear()+' '+hours+':'+minutes+ampm;\n }", "function render_datetime(data){\n\t var datetime = data.split(' ');\n\t var date = datetime[0].split('-').reverse().join('/');\n\t var time = datetime[1].substring(0,5);\n\t return date+' às '+time;\n\t}", "function formatTimeStamp() {\n var sendTime = Date().slice(16,21)\n var sendHour = sendTime.slice(0, 2)\n var pm = sendHour > 11 && sendHour < 24 ? true : false\n\n if (sendHour > 12) {\n sendHour = sendHour % 12\n }\n return sendHour + sendTime.slice(2) + (pm ? \" PM\" : \" AM\");\n}", "function FormatTime(time)\n{\n \n if (time < 10)\n {\n time= '0'+time;\n }\n return time; \n}", "stringifyTime(t) {\n return (t < 10) ? '0' + t : t;\n }", "function militaryToStandardNoSpaces(militaryTime)\r\n{\r\n\tvar splitMilitaryTime = militaryTime.split(\":\");\r\n\tvar stringMilitaryHH = splitMilitaryTime[0];\r\n\tvar stringMilitaryMM = splitMilitaryTime[1];\r\n\tvar retString = \"\";\r\n\r\n\tswitch(stringMilitaryHH)\r\n\t{\r\n\t\tcase \"00\": {\r\n\t\t\tretString = \"12:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"01\": {\r\n\t\t\tretString = \"01:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"02\": {\r\n\t\t\tretString = \"02:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"03\": {\r\n\t\t\tretString = \"03:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"04\": {\r\n\t\t\tretString = \"04:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"05\": {\r\n\t\t\tretString = \"05:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"06\": {\r\n\t\t\tretString = \"06:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"07\": {\r\n\t\t\tretString = \"07:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"08\": {\r\n\t\t\tretString = \"08:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"09\": {\r\n\t\t\tretString = \"09:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"10\": {\r\n\t\t\tretString = \"10:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"11\": {\r\n\t\t\tretString = \"11:\" + stringMilitaryMM + \"AM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"12\": {\r\n\t\t\tretString = \"12:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"13\": {\r\n\t\t\tretString = \"01:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"14\": {\r\n\t\t\tretString = \"02:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"15\": {\r\n\t\t\tretString = \"03:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"16\": {\r\n\t\t\tretString = \"04:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"17\": {\r\n\t\t\tretString = \"05:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"18\": {\r\n\t\t\tretString = \"06:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"19\": {\r\n\t\t\tretString = \"07:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"20\": {\r\n\t\t\tretString = \"08:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"21\": {\r\n\t\t\tretString = \"09:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"22\": {\r\n\t\t\tretString = \"10:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tcase \"23\": {\r\n\t\t\tretString = \"11:\" + stringMilitaryMM + \"PM\";\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}\r\n\r\n\treturn retString;\r\n}", "toString() {\n return this.time.toLocaleTimeString('en-US', {hour12: false});\n }", "function converTime(t){\n t = Number(t); //cast to number\n if (t > 0 && t < 12){\n return t + ':00 am'\n } else if(t === 0) {\n return \"12:00 am\"\n } else if(t === 12) {\n return '12:00 pm'\n } else if(t > 12){\n return (t-12) + ':00 pm'\n }\n }", "function formatTime (t) {\n if (isNaN(t)) return ('');\n var m = Math.floor(t/60/1000),\n s = Math.floor(t/1000 - m * 60);\n\n return m + ':' + (s > 9 ? s : '0' + s);\n}", "function tformatter(rawtime){\n return rawtime.slice(rawtime.indexOf(\"T\")+1).split(\":\");\n }", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},o=\" \";if(e%100>=20||e>=100&&e%100===0){o=\" de \"}return e+o+r[n]}", "function timeUtil(){\n var timestr = new Date().toISOString().replace(/T/, ' ').replace(/\\..+/, '');\n return timestr;\n}", "function timeConverter(t) {\n\n var minutes = Math.floor(t / 60);\n var seconds = t - (minutes * 60);\n\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n\n if (minutes === 0) {\n minutes = \"00\";\n\n } else if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n\n return minutes + \":\" + seconds;\n }", "function convertTime(time) {\n var ampm = 'am'\n var hrs = parseInt(Number(time/4));\n \tvar min = Math.round((Number(time/4)-hrs) * 60);\n if (hrs > 12) {\n ampm = 'pm';\n hrs = hrs - 12;\n }\n if (min == 0) {\n min = '00';\n }\n \n return hrs + ':' + min + ampm;\n }", "function formatTime(time) {\n const minutes = Math.floor(time / 60);\n let seconds = time % 60;\n \n if (seconds < 10) {\n seconds = `0${seconds}`;\n }\n \n return `${minutes}:${seconds}`;\n}", "function _timeFormat(sec) {\n\t\t\tstr = \"00:00\";\n\t\t\tif (sec > 0) {\n\t\t\t\tstr = Math.floor(sec / 60) < 10 ? \"0\" + Math.floor(sec / 60) + \":\" : Math.floor(sec / 60) + \":\";\n\t\t\t\tstr += Math.floor(sec % 60) < 10 ? \"0\" + Math.floor(sec % 60) : Math.floor(sec % 60);\n\t\t\t}\n\t\t\treturn str;\n\t\t}", "function niceTime (d) {\n\t\treturn prepend0(d.getHours()) + \":\" + prepend0(d.getMinutes()) + \":\" + prepend0(d.getSeconds());\n\t}", "function convertFormat(time) {\n let format = 'AM';\n if (time >= 12) {\n format = 'PM';\n }\n return format;\n}", "formatTime(n) {\n if ((n + '').length > 2) {\n\treturn n;\n }\n const padding = new Array(2).join('0');\n return (padding + n).slice(-2);\n }", "function reformatTime(isoTime) {\n\t\tvar hours = parseInt(isoTime.substring(0, 2), 10),\n\t\t\tminutes = parseInt(isoTime.substring(3, 5), 10),\n\t\t\tampm = 'am';\n\n\t\tif (hours >= 12) {\n\t\t\tampm = 'pm';\n\t\t}\n\n\t\tif (hours > 12) {\n\t\t\thours -= 12;\n\t\t}\n\n\t\tif (minutes == 0)\n\t\t\tminutes = \"00\";\n\t\treturn hours + ':' + minutes + ' ' + ampm;\n\t}", "function CIU_Time(op, data, rowDef) {\n switch (op) {\n case \"format\":\n return \"12:59:59\";\n\n default:\n };\n}", "toStandardTime () {\n var returnFormat = \"h:mm A\";\n if (/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]:[0-9][0-9]$/.test(this)) {\n // Case \"13:00:00\"\n return moment(this, \"HH:mm:ss\").format(returnFormat); // eslint-disable-line no-undef\n } else if (/^([0-9]|0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/.test(this)) {\n // Case \"13:00\"\n return moment(this, \"HH:mm\").format(returnFormat); // eslint-disable-line no-undef\n } else if (/^([0-9]|0[0-9]|1[0-9]|2[0-3])[0-5][0-9]$/.test(this)) {\n // Case \"1300\"\n return moment(this, \"HHmm\").format(returnFormat); // eslint-disable-line no-undef\n }\n }", "function formatTime(time) {\n hour = time.getHours();\n minute = time.getMinutes();\n afternoon = false;\n if (hour > 11) {\n afternoon = true;\n }\n formattedHour = hour % 12;\n if (formattedHour == 0) {\n formattedHour = 12;\n }\n if (afternoon) {\n return addLeadingZeros(formattedHour) + \":\" + addLeadingZeros(minute) + \" p.m.\";\n }\n return addLeadingZeros(formattedHour) + \":\" + addLeadingZeros(minute) + \" a.m.\";\n}", "function getFromattedTime() {\n \tvar dt = new Date();\n \tvar hours = dt.getHours() === 0 ? \"12\" : dt.getHours() > 12 ? dt.getHours() - 12 : dt.getHours();\n \tvar minutes = (dt.getMinutes() < 10 ? \"0\" : \"\") + dt.getMinutes();\n \tvar seconds = dt.getSeconds();\n \tvar ampm = dt.getHours() < 12 ? \"AM\" : \"PM\";\n \tvar formattedTime = hours + \":\" + minutes + \":\" + seconds + \" \" + ampm;\n \treturn formattedTime;\n }", "function format_to_human_readable(rt) {\n var h = rt.getUTCHours() > 0 ? rt.getUTCHours() + STRING_HOURS : \"\"\n var m = rt.getUTCMinutes() < 10 && rt.getUTCHours() > 1 ? \"0\"+ rt.getUTCMinutes() : rt.getUTCMinutes();\n var s = rt.getUTCSeconds() < 10 ? \"0\"+ rt.getUTCSeconds() : rt.getUTCSeconds();\n var ts = h + m + STRING_MINUTES + s + STRING_SECONDS;\n return ts;\n }", "function handleDateTime(mode, time) {\n if (time) {\n switch(mode) {\n case \"realTime\":\n return `${extractIsotime(time)}`;\n case \"dateTime\":\n return `${moment(time[0]).format(\"DD-MMM-YYYY HH:mm:ss\")} - ${moment(time[1]).format(\"DD-MMM-YYYY HH:mm:ss\")}`;\n default:\n return \"\";\n }\n } else {\n return \"\";\n }\n}", "function t(e,t,n){var r={ss:\"secunde\",mm:\"minute\",hh:\"ore\",dd:\"zile\",MM:\"luni\",yy:\"ani\"},a=\" \";if(e%100>=20||e>=100&&e%100===0){a=\" de \"}return e+a+r[n]}", "function TIME_FORMAT(time) {\n var sec_num = parseInt(time, 10); // don't forget the second param\n var hours = Math.floor(sec_num / 3600);\n var minutes = Math.floor((sec_num - (hours * 3600)) / 60);\n var seconds = sec_num - (hours * 3600) - (minutes * 60);\n\n if (hours < 10) {hours = \"0\"+hours;}\n if (minutes < 10) {minutes = \"0\"+minutes;}\n if (seconds < 10) {seconds = \"0\"+seconds;}\n \n if(time==Infinity || isNaN(time)){\n return '--';\n } else {\n return minutes+':'+seconds;\n }\n}", "_getTimeFormat() {\n const timeFormat = this.get('timeFormat.selected.format') || this.get('timeFormat.options').findBy('key', config.timeFormatDefault).format;\n // remove the milliseconds since the date control doesn't support that level of precision, and it causes issue with AM / PM in the picker.\n return timeFormat.replace('.SSS', '');\n }" ]
[ "0.7111784", "0.7035722", "0.701806", "0.7015446", "0.6978149", "0.6962987", "0.69178194", "0.6897171", "0.6858877", "0.68575776", "0.6834045", "0.6794033", "0.6760297", "0.6755594", "0.6745924", "0.67353153", "0.6732504", "0.6726982", "0.67036015", "0.6696584", "0.669474", "0.66939807", "0.6688517", "0.6682573", "0.6667247", "0.66498274", "0.6628374", "0.6625115", "0.6615551", "0.66153616", "0.6607873", "0.66057205", "0.66040707", "0.6602902", "0.65943754", "0.6579943", "0.65700424", "0.6557702", "0.65560514", "0.6551557", "0.6546379", "0.65330374", "0.65300894", "0.65231335", "0.6515156", "0.6512312", "0.6485257", "0.6481749", "0.64813876", "0.64813536", "0.64780945", "0.6475357", "0.6472159", "0.6446487", "0.6446372", "0.6424264", "0.6418512", "0.6418173", "0.6413219", "0.6407244", "0.6401877", "0.640095", "0.6399589", "0.6392724", "0.63908345", "0.63866067", "0.6372289", "0.6370897", "0.63620454", "0.63619256", "0.6355729", "0.6355359", "0.63504934", "0.63490474", "0.63423425", "0.6332545", "0.6329663", "0.6325733", "0.63220334", "0.63209075", "0.6317294", "0.6307628", "0.6307473", "0.6306295", "0.630546", "0.63008535", "0.62919635", "0.62882745", "0.6284744", "0.6283631", "0.6281839", "0.6277945", "0.6275267", "0.62745786", "0.6274138", "0.6271183", "0.626716", "0.62616515", "0.62520134", "0.6247144" ]
0.7018312
2
DB OBJECT CONSTRUCTORS task object constructor
function task(id, name, building, tasktime, taskdate, notes) { console.log("idk"); this.id = id; this.name = name; this.building = building; this.tasktime = tasktime; this.taskdate = taskdate; this.notes = notes; /* var startSplit = startTime.split(":"); var endSplit = endTime.split(":"); var startSplitInt = [] var endSplitInt = []; var i; // general properties this.startTimeDB = startTime; this.endTimeDB = endTime; this.id = id; this.details = details; this.notes = notes; this.startDate = startDate; this.endDate = endDate; this.dayOfWeek = dayOfWeek; this.location = location; this.course = course; this.taskType = taskType; // frontend-specific properties this.startTime = convertTime(startTime); this.endTime = convertTime(endTime); this.startMinute = startSplit[0] * 60 + startSplit[1]; this.endMinute = endSplit[0] * 60 + endSplit[1]; */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Task(task) {\n\n // Populate taskmodel\n\n for (var prop in task) {\n if (task[prop] !== undefined) this[prop] = task[prop]\n }\n\n if (task !== undefined) this.createId()\n\n // Register model with Barricane\n\n process.db.registerInstance(this)\n}", "constructor() {\n super(new Task());\n }", "function TaskRepository () {\n\n }", "constructor() {\n super();\n /**\n * Array that stores each task\n * @type {Task[]}\n */\n this.taskList = [];\n /**\n * This is the total task count that is also a way\n * to give each task a unique id\n * @type {number}\n */\n this.idCounter = 0;\n }", "function TaskModelBuilder() {}", "function Task(boardID, nameID, pinID, headerTxt, descTxt, statusID, priorityID, columnID, taskID, categoryID, owner, timeStamp) {\n this.boardID = boardID;\n this.pin = pinID;\n this.nameID = nameID;\n this.header = headerTxt;\n this.desc = descTxt;\n this.columnID = columnID;\n this.taskID = taskID;\n this.priorityID = priorityID;\n this.status = statusID;\n this.categoryID = categoryID;\n this.owner = owner;\n this.timeStamp = timeStamp;\n}", "function Task(){\n this.taskName = \"task1\";\n\tthis.description = \"\";\n\tthis.duedate = \"\";\n\t\n\tthis.blocking = \"false\";\n\tthis.signalling = \"true\";\n\tthis.priority = \"normal\";\n\t\n\tthis.swimlane = \"\";\n\t\n\tthis.controller = new Controller();\n\tthis.assignment = new Assignment();\n\tthis.event = new TaskEvent();\n}", "constructor() {\n this.jobs = {};\n this.tasks = tasks;\n }", "function Task(description) {\n this.description = description;\n}", "function Task(task) {\n this.task = task;\n this.id = 'new';\n }", "function Task(taskname, taskfun)\n{\n this.taskname = taskname;\n this.taskfun = taskfun;\n}", "static createTask(task={}){\n \n return new Promise(async (resolve, reject) => {\n try {\n //const person = new Task(task)\n const databaseLayer = new DatabaseLayer(async () => SQLite.openDatabase('didits.db'), Task.tableName)\n const items = [task]\n databaseLayer.bulkInsertOrReplace(items).then(response => {\n console.log(\"Insert id \"+JSON.stringify(response))\n resolve(response[0].insertId)\n }).catch((err) =>{\n reject(-1)\n })\n //await person.save()\n \n }\n catch {\n reject([])\n }\n });\n\n }", "function Task(title, task) {\n this.title = title;\n this.task = task;\n this.priority = 'Normal';\n this.id = Date.now();\n this.status = 'not complete';\n}", "function task(name, status, completeDate) {\n this.name = name;\n this.status = status;\n this.completeDate = completeDate;\n}", "constructor() {\n /**\n * The tasks.\n *\n * @type {Array<Task>}\n */\n this.tasks = [];\n\n /**\n * The task errors.\n *\n * @type {Array<Error>}\n */\n this.errors = [];\n }", "function Tasks(task, notes) {\n this.task = task,\n this.notes = notes\n}", "function taskObject(title, description)\n{\n\tthis.title = title;\n\tthis.desc = description;\n\tthis.date = new Date(); // TODO sanitize\n\tthis.status = \"new\";\n}", "function Task(name, description, date, difficulty, assigned, notes){\n this.name = name;\n this.description = description;\n this.date = date;\n this.difficulty = difficulty;\n this.assigned = assigned;\n this.notes = notes;\n}", "function Task(title, description) {\n this.title = title;\n this.description = description;\n this.done = false;\n this.collapsed = description ? false : true;\n this.id = Date.now().toString(36) + Math.random().toString(36).substring(2,5);\n this.date = new moment().format(\"DD.MM.YYYY HH:MM\");\n}", "constructor(currentId = 0) {\n this.tasks = [];\n this.currentId = currentId;\n }", "constructor() {\r\n this.tasks = {};\r\n this.next = 0;\r\n }", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function RawTask() {\n\t this.task = null;\n\t}", "function Task(name)\n {\n this.Init(name);\n }", "function Tasks (chore) {\n this.chore = chore;\n}", "function Task(content,date,isChecked,id) {\n\tthis.content = content,\n\tthis.date = date,\n\tthis.isChecked = isChecked,\n\tthis.id = count++\n}", "function Task() {\n var arg, args, key, opts, value, _base, _base1, _i, _len;\n args = 1 <= arguments.length ? __slice.call(arguments, 0) : [];\n Task.__super__.constructor.apply(this, arguments);\n if (this.config == null) {\n this.config = {};\n }\n if ((_base = this.config).name == null) {\n _base.name = \"Task \" + (Math.random());\n }\n if ((_base1 = this.config).run == null) {\n _base1.run = false;\n }\n opts = {};\n for (_i = 0, _len = args.length; _i < _len; _i++) {\n arg = args[_i];\n switch (typeof arg) {\n case 'string':\n opts.name = arg;\n break;\n case 'function':\n opts.method = arg;\n break;\n case 'object':\n for (key in arg) {\n if (!__hasProp.call(arg, key)) continue;\n value = arg[key];\n opts[key] = value;\n }\n }\n }\n this.setConfig(opts);\n this;\n }", "function RawTask() {\n\t\t this.task = null;\n\t\t}", "constructor() {\n this.meta = {\n tasks: [],\n items: [],\n errors: [],\n results: [],\n stopped: false,\n concurrency: 10,\n shouldResultsCorrespond: false,\n processedItems: [],\n taskTimeout: 0\n };\n this.handler = () => { };\n this.errorHandler = undefined;\n this.onTaskStartedHandlers = [];\n this.onTaskFinishedHandlers = [];\n }", "function Task(toDoID, toDoTitle, toDoDescription = \"\", toDoPriority = 1, toDoDueDate = \"No set date\", toDoStatus = \"In Progress\")\n{\n\tthis.to_do_id = toDoID;\n\tthis.to_do_title = toDoTitle; \n\tthis.to_do_description = toDoDescription; \n\tthis.to_do_priority = toDoPriority;\n\tthis.to_do_due_date = toDoDueDate;\n\tthis.to_do_status = toDoStatus;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function RawTask() {\n this.task = null;\n}", "function Storage() {\n\tconsole.debug(\"Creating database...\")\n\tthis.db = Sql.LocalStorage.openDatabaseSync(\n\t\t\t\"ShintyokuRitsu\", \"0.1\", \"Task database\", 4*1024*1024)\n\tconsole.debug(\"Initializing database...\")\n\tthis.db.transaction(function(tx) {tx.executeSql(\n\t\t\t'CREATE TABLE IF NOT EXISTS Tasks(' +\n 'id INTEGER PRIMARY KEY AUTOINCREMENT, ' +\n\t\t\t'name TEXT, ' +\n 'isProject INTEGER, ' +\n 'importance INTEGER, ' +\n 'deadline INTEGER, ' +\n\t\t\t'detail TEXT, ' +\n\t\t\t'targetTime INTEGER, ' +\n 'timeLapse INTEGER, ' +\n\t\t\t'percent INTEGER, ' +\n 'folder TEXT, ' +\n\t\t\t'projectId INTEGER)')})\n\tconsole.debug(\"Database created\")\n}", "function newTask(title, description) { //taking into 2 parameters\n const task = { //creating a variable OBJ in a function\n title: title, // first obj.key is equivalent to the first parameter\n description: description, //second.obj key is equivalent to second parameter\n complete: false, //boolean value of third obj key\n\n //creating a function to pass when a task is not completed. Checks using the boolean\n logState: function() {\n console.log(`${task.title} has${task.complete ? \" \" : \" not \"}been completed`)\n },\n //Creating a function to change the boolean value of a completed task to true\n markCompleted: function () { // marks the provided task as completed\n this.complete = true\n }\n };\n return task;\n}", "function TaskList() { //Elenco degli esami\r\n\r\n this.list = [];\r\n\r\n /** 2.1) init: faccio push di ogni Task, uno per uno: indicati dentro metodo */\r\n /**add: dopo un controllo se l'id è univoco, carico esame uno dopo altro presi da tasks.js */\r\n this.init = () => { \r\n this.list.push( //push -> inserisco in vettore\r\n new Task(1, \"Complete Lab 3\", false, true, \"2021-03-29T14:30:00\" ),\r\n new Task(2, \"Buy some groceries\", false, false, \"2021-04-11T14:00:00\"),\r\n new Task(3, \"Read a good book!\", true, true),\r\n new Task(4, \"Watch Mr. Robot\", false, true, \"2021-04-12T21:30:00\"),\r\n new Task(5,\"Treno MI-TO\",true,false,dayjs('2021-04-16') ),\r\n new Task(6,\"La Boum\",false,true),\r\n new Task(7,\"Hotel Centrale\",true,true,dayjs(\"2017-03-13\")),\r\n\r\n );\r\n };\r\n\r\n this.add = (task) => {\r\n if (!this.list.some(t => t.id == task.id))\r\n this.list = [...this.list, task];\r\n else throw new Error('Duplicate id');\r\n };\r\n\r\n /** 2.2) restituisco TUTTI i TASK, nel vettore list*/\r\n this.getAll = () => {\r\n return this.list;\r\n };\r\n\r\n /** 2.3) ritorno solo quelli i Task che sono URGENTI */\r\n this.getImportant =() =>\r\n {\r\n return this.list.filter(task => task.urgent);\r\n }\r\n\r\n /** 2.4) ritorno solo i Task che sono PRIVATI */\r\n this.getPrivate =() =>\r\n {\r\n return this.list.filter(task => task.prite);\r\n }\r\n\r\n /** Ritorno solo i task che hanno una deadline (N.B. da specifiche, possono non avere data) */\r\n this.condata =() =>{ \r\n\r\n return this.list.filter(task => task.deadline);\r\n\r\n }\r\n\r\n /** 2.5) getToday: solo i Task con deadline oggi*/\r\n this.getToday = function () {\r\n\r\n const now = dayjs();\r\n\r\n return this.condata().filter(t => t.deadline.isSame(now,'day'));\r\n\r\n }\r\n\r\n /** 2.6) get7Days: solo i Task con una deadline tra oggi e i prossimi 7 giorni */\r\n this.getSeven = function () {\r\n\r\n const now = dayjs();\r\n\r\n return this.condata()\r\n .filter(t => t.deadline.isAfter(now.subtract(1,'day'),'day')) //tutti i task con deadline da oggi in poi\r\n .filter(t => t.deadline.isBefore(now.add(8,'day'),'day')); //tutti i task con deadline entro 7 giorni da oggi\r\n \r\n }\r\n\r\n}", "constructor(db) {\n this.db = db\n }", "function taskCreate(cb) {\n\n var task = new Task({\n //_projectId: projects[0],\n _phaseId: phases[0],\n name: 'Phase 1',\n number: 1,\n start_date:'2017-06-06',\n end_date:'2018-02-06',\n priority: 'High',\n status: 'Ongoing',\n percentageComplete: 91,\n description: 'Create Models ',\n deletedAt: null\n });\n\n task.save(function (err) {\n if (err) {\n cb('task', null);\n return\n }\n console.log('New Task ' + task);\n tasks.push(task);\n cb(null, task)\n } );\n}", "function Task(key, title, date, content) {\n this.key = key; // the key for save/load of a task object in localStorage\n this.title = title; // the title of the task\n this.date = date; // the date of the task\n this.content = content; // the content of the task\n this.finished = 0; // indicate if the task is finished yet\n}", "constructor(db) {\n this.db = db;\n }", "function Task(name, duration, priority) {\n (this.name = name), (this.duration = duration), (this.priority = priority);\n\n}", "constructor() {\n this.database = new Database();\n }", "function Tasks() {\n this.list = [];\n return this;\n}", "function createTask(v,t){\r\n \r\n }", "function initialiseTaskData()\n{\n const taskData = { active: { }, archive: { } };\n return taskData;\n}", "get tasks() {\r\n return new Tasks(this, \"planner/tasks\");\r\n }", "constructor() { \n \n ExternalTaskQueryDto.initialize(this);\n }", "constructor( name, taskslist) {\n this.name = name\n this.taskslist = taskslist\n }", "constructor(id, owner, task_type, subject, title, description, options, solutions){\n this.id = id; this.owner = owner; this.task_type = task_type; this.subject = subject; \n this.title = title; this.description = description; this.options = options; this.solutions = solutions;\n }", "function gererateTaskObject() {\n let title = document.getElementById(\"title\").value;\n let urgency = document.getElementById(\"urgency\").value;\n let importance = document.getElementById(\"importance\").value;\n let date = document.getElementById(\"date\").value;\n let discription = document.getElementById(\"description\").value;\n\n let task = {\n 'title': title,\n 'urgency': urgency,\n 'importance': importance,\n 'date': date,\n 'description': discription,\n 'created': new Date().getTime() //unix timestamp at the time of creating the task \n };\n return task;\n}", "function DB(){\n\n\tthis.pool = new pg.Pool({connectionString: pgUri, max: 1});\n\t// console.log(\"NEW POOOL\");\n\n}", "function createTask(task) {\n return TaskModel.create(task);\n }", "constructor(props) {\n\t\tsuper(props);\n\t\t\n\t\tthis.state = {\n\t\t\ttasks: [],\n\t\t\tcurTaskKey: 0,\n\t\t\tcurDesc: \"\",\t//current string in DescriptionEntry\n\t\t\ttotTime: 10\n\t\t};\n\t\t\n\t\tthis.acquireTasks = this.acquireTasks.bind(this);\n\t\tthis.addTask = this.addTask.bind(this);\n\t\tthis.updateDesc = this.updateDesc.bind(this);\n\t\tthis.updateTime = this.updateTime.bind(this);\n\t}", "function Task() {\n if (!(this instanceof Task)) {\n return new Task();\n }\n this.message = 'Learning JS';\n}", "function resource(title,id,description,tasks,start,end,complete) {\n\t\t\tthis.title = title;\n\t\t\tthis.id = id;\n\t\t\tthis.description = description;\n\t\t\tthis.tasks = tasks;\n\t\t\tthis.start = start;\n\t\t\tthis.end = end;\n\t\t\tthis.complete = complete;\n\t\t}", "function TaskQueue() {\n this.promise = new __WEBPACK_IMPORTED_MODULE_0_pouchdb_promise__[\"a\" /* default */](function (fulfill) {fulfill(); });\n}", "function TaskParser() {\n}", "createWithId(TaskItem) {\n let sqlRequest = \"INSERT into taskItem (id, taskId,stateName, dbName,fileName,fileSize,status,startTime,allcount,downloadCount,source,msg) \" +\n \"VALUES ($id,$taskId,$stateName, $dbName,$fileName,$fileSize,$status,$startTime,$allcount,$downloadCount,$source,$msg)\";\n let sqlParams = {\n $id:TaskItem.id,\n $taskId: TaskItem.taskId,\n $stateName: TaskItem.stateName,\n $dbName: TaskItem.dbName,\n $fileName: TaskItem.fileName,\n $fileSize: TaskItem.fileSize,\n $status: TaskItem.status,\n $startTime: TaskItem.startTime,\n $allcount: TaskItem.allcount,\n $downloadCount: TaskItem.downloadCount,\n $source: TaskItem.source,\n $msg: TaskItem.msg,\n };\n return this.common.create(sqlRequest, sqlParams);\n }", "async function execute() {\n /**\n * Create a new instance of the TaskAppExample (Made for this example help create and load\n * the table with Task/Employee/Office data).\n **/\n const loader = new Loader(taskr);\n \n /**\n * Uncomment the relevant lines to create a table, then load it, optionally delete, and finally query.\n * For more examples checkout the README.\n **/\n // Make table:\n // await loader.makeTable();\n\n // Load table:\n // await loader.loadTable({employees: 800, tasks: 800});\n\n // Drop table:\n // await loader.dropTable()\n\n // Query table:\n await query();\n}", "function Task(text, timeStamp) {\n this.text = text;\n this.timeStamp = timeStamp;\n}", "static async createTask(info,res) {\n return Utils.RunFunctionWithError(\n async () => {\n const initialState = {\n ...info,\n status: StatusEnum.pending\n }\n // let randomToken = Utils.RandomToken()\n let task = new Task(initialState)\n // TODO: what if the db creates the job but the queue failed to execue?\n\n let result = await task.save()\n WorkerMessanger.queueJob(initialState,socket)\n return res.status(201).json(result)\n }\n ,res)\n }", "async createTask(taskName,content,dueDate,TL_id,tags){\n let newTask = await Task({\"taskName\":taskName,\"content\":content,\"dueDate\":dueDate,\"taskListId\":TL_id,\"tags\":tags});\n try{\n await newTask.save();\n }catch(err){\n console.log(err);\n return false;\n }\n \n return newTask;\n }", "constructor (db) {\n super(db);\n }", "constructor (db) {\n super(db);\n }", "create(TaskItem) {\n let sqlRequest = \"INSERT into taskItem ( taskId,stateName, dbName,fileName,fileSize,status,startTime,allcount,downloadCount,source,msg) \" +\n \"VALUES ( $taskId,$stateName, $dbName,$fileName,$fileSize,$status,$startTime,$allcount,$downloadCount,$source,$msg)\";\n let sqlParams = {\n $taskId: TaskItem.taskId,\n $stateName: TaskItem.stateName,\n $dbName: TaskItem.dbName,\n $fileName: TaskItem.fileName,\n $fileSize: TaskItem.fileSize,\n $status: TaskItem.status,\n $startTime: new Date(),\n $allcount: TaskItem.allcount,\n $downloadCount: TaskItem.downloadCount,\n $source: TaskItem.source,\n $msg: TaskItem.msg,\n };\n return this.common.create(sqlRequest, sqlParams);\n }", "constructor(task/*:TaskType<Never,a>*/) {\n this.task = task\n }", "constructor() { this.leerDB(); }", "static async injectDB(conn){ //Create a connection handle\n if (task){\n return; //If the task is already defined, stop\n }\n try{\n //task = database connection\n //\n connected = true;\n } catch (e) {\n console.error(\n `Connection handle error ${e}`\n )\n }\n }", "function Todo(id, task, who, dueDate, location) {\n this.id = id;\n this.task = task; \n this.who = who;\n this.dueDate = dueDate;\n this.done = false;\n this.location = location;\n}", "function Database(){}", "function TaskService(http) {\n this.http = http;\n this.baseUrl = '/tasks/';\n }" ]
[ "0.77144617", "0.7128225", "0.70270175", "0.6940322", "0.6909471", "0.6855991", "0.67991585", "0.6749561", "0.6727759", "0.669997", "0.66901433", "0.6498637", "0.6453899", "0.64496416", "0.6424196", "0.6343823", "0.6320438", "0.63035214", "0.62650985", "0.6259209", "0.62467384", "0.6243098", "0.6243098", "0.6243098", "0.6243098", "0.6243098", "0.6243098", "0.6243098", "0.6243098", "0.6243098", "0.6227245", "0.62237847", "0.6223167", "0.621791", "0.619888", "0.618839", "0.6181335", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61759937", "0.61592454", "0.6135865", "0.6133168", "0.6128034", "0.6117966", "0.61147034", "0.61140436", "0.60738504", "0.6058717", "0.60464823", "0.60463893", "0.6045408", "0.6023428", "0.60158175", "0.60119796", "0.60094446", "0.6008423", "0.6002397", "0.597972", "0.59776175", "0.5975832", "0.5975622", "0.5972015", "0.5970122", "0.5958261", "0.59470314", "0.59457386", "0.59314245", "0.5913944", "0.59106404", "0.59106404", "0.5908747", "0.59076107", "0.5901071", "0.5894339", "0.5885554", "0.58843666", "0.58797216" ]
0.68739855
5
CLASSES TAB HTML CONTROL
function buildCourseHTML() { var courses = getCourses(); $('#courseCards').empty(); courses.forEach(function(course) { $('#courseCards').append(` <div class="card mt-3" id="course` + course.id + `"> <div class="card-header"> <div class="d-flex align-items-center"> <span class="font-weight-bold mr-auto" style="font-size:16px;">` + course.courseName + `</span> <button class="btn float-right" id="editCourse` + course.id + `" style="background-color:transparent;" data-toggle="modal" data-target="#classForm"> <i class="fa fa-pen"></i> </button> </div> </div> <div class="container mt-2 mb-2"> <div class="row"> <div class="col text-right">Pattern: </div> <div class="col-8" name="1">` + course.meetPattern + `</div> </div> <div class="row"> <div class="col text-right">Time: </div> <div class="col-8">` + course.startTime + ` - ` + course.endTime + `</div> </div> <div class="row"> <div class="col text-right">Location: </div> <div class="col-8">` + course.building + ' ' + course.room + `</div> </div> </div> </div> `); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function tab_code(elem) {\n console.log(\"===TODO===\", 'tab', elem);\n}", "function Tabs(ide) {\n var tbs = this;\n ide = getObj(ide);\n this.tabs = null;\n\n\tvar active = 0;\n var blocks = gtn(ide, 'blockquote');\n\n\tthis.setDefault = function(a) {\n\t\tactive = a;\n\t};\n\n this.init = function() {\n this.tabs = gtn(gtn(ide, 'ul')[0], 'li');\n\n var nt = this.tabs.length, t;\n\n for (t = 0; t < nt; t ++) {\n var tab = this.tabs[t];\n tab.value = t;\n listen(this.tabs[t], 'click', this.display);\n }\n this.display();\n };\n\n\tthis.display = function(evt) {\n var i = 0;\n\n if (typeof evt == 'object') {\n evt = setEvent(evt);\n i = evt.target.value;\n } else if (typeof evt == 'number') i = evt;\n\n tbs.tabs[active].removeAttribute('class');\n tbs.tabs[i].className = 'active';\n\n blocks[active].style.display = 'none';\n blocks[i].style.display = 'block';\n\n active = i;\n\t};\n}", "function opentab(evt, punNum) {\n // Declaring variables \n var i, tabContent, tablink;\n tabContent = document.getElementsByClassName(\"tabContent\");\n for (i = 0; i < tabContent.length; i++) {\n tabContent[i].style.display = \"none\";\n }\n tablink = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablink.length; i++) {\n tablink[i].className = tablink[i].className.replace(\"active\", \"\")\n }\n\n document.getElementById(punNum).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "static get tag() {\n return \"a11y-tab\";\n }", "function TabView (tab, content) {\r\n\r\n function addClass() {\r\n tab.setAttribute(\"class\", \"active\");\r\n content.setAttribute(\"class\", \"tab-content active\");\r\n }\r\n if(tab.addEventListener) {\r\n tab.addEventListener('click', function () {\r\n clearClasses();\r\n addClass();\r\n });\r\n } else if (tab.attachEvent) {\r\n tab.attachEvent('onclick', function () {\r\n clearClasses();\r\n addClass();\r\n });\r\n }\r\n return {\r\n clearClass : function () {\r\n var classes = content.getAttribute(\"class\").split(\" \");\r\n tab.setAttribute(\"class\", \" \");\r\n content.setAttribute(\"class\", classes[0]);\r\n }\r\n }\r\n }", "function tec_show(tab, cls) {\n\ti = 1;\n\n\twhile (document.getElementById(\"tab_\" + i)) {\n\t\tdocument.getElementById(\"tab_\" + i).style.display = 'none';\n\t\tdocument.getElementById(\"a\" + i).className = '';\n\t\ti++;\n\n\t}\n\tdocument.getElementById(tab).style.display = 'block';\n\tdocument.getElementById(cls).className = 'sel';\n}", "static get CLASS() {\n return {\n MAIN_TAB_ELEMENT: '.tab-element'\n };\n }", "function openTab(evt, TabName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(TabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function openTab(evt, tabCorI) {\n // Declare all variables\n var i, tabcontent, tablinks;\n\n // Get all elements with class=\"tabcontent\" and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class=\"tablinks\" and remove the class \"active\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n\n // Show the current tab, and add an \"active\" class to the button that opened the tab\n document.getElementById(tabCorI).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function CodeSymTab(){\n CodeSymTab.prototype.superClass();\n this._shortNameClassesIndex = {};\n}", "function insertTab(event, obj) {\r\n var tabKeyCode = 9;\r\n if (event.which) // mozilla\r\n var keycode = event.which;\r\n else // ie\r\n var keycode = event.keyCode;\r\n if (keycode == tabKeyCode) {\r\n if (event.type == \"keydown\") {\r\n if (obj.setSelectionRange) {\r\n // mozilla\r\n var s = obj.selectionStart;\r\n var e = obj.selectionEnd;\r\n obj.value = obj.value.substring(0, s) +\r\n \"\\t\" + obj.value.substr(e);\r\n obj.setSelectionRange(s + 1, s + 1);\r\n obj.focus();\r\n } else if (obj.createTextRange) {\r\n // ie\r\n document.selection.createRange().text = \"\\t\"\r\n obj.onblur = function () { this.focus(); this.onblur = null; };\r\n } else {\r\n // unsupported browsers\r\n }\r\n }\r\n if (event.returnValue) // ie ?\r\n event.returnValue = false;\r\n if (event.preventDefault) // dom\r\n event.preventDefault();\r\n return false; // should work in all browsers\r\n }\r\n return true;\r\n}", "static get tag() {\n return \"a11y-tabs\";\n }", "function tabs(evt, tabName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n document.getElementById(\"defaultOpen\").click();\n}", "function openTab(evt, pN){\r\n var i, tC, tL;\r\n tC = document.getElementsByClassName(\"tabcontent\");\r\n for (i = 0; i < tC.length; i++) {\r\n tC[i].style.display = \"none\";\r\n }\r\n tL = document.getElementsByClassName(\"tablinks\");\r\n for (i = 0; i < tL.length; i++) {\r\n tL[i].className = tL[i].className.replace(\" active\", \"\");\r\n }\r\n document.getElementById(pN).style.display = \"block\";\r\n evt.currentTarget.className += \" active\";\r\n}", "function setTab(elem) {\n\t\t for (var i = 0; i < selectors.length; i++) {\n\t\t selectors[i].className = selectors[i].className.replace('on',' ');\n\t\t }\n\t\t elem.className += ' on';\n\t\t}", "function openTab(evt, tabName) {\r\n\t\tvar i, tabcontenido, tablist, tabsActive;\r\n\t\ttabcontenido = document.getElementsByClassName(\"tabcontenido\");\r\n\t\tfor (i = 0; i < tabcontenido.length; i++) {\r\n\t\t\ttabcontenido[i].style.display = \"none\";\r\n\t\t}\r\n\r\n\t\ttablist = document.getElementsByClassName(\"tablist\");\r\n\t\tfor (i = 0; i < tablist.length; i++) {\r\n\t\t\ttablist[i].className = tablist[i].className.replace(\" active\", \"\");\r\n\t\t}\r\n\r\n\t\ttabsActive = document.getElementsByClassName(tabName);\r\n\t\tfor (i = 0; i < tabsActive.length; i++) {\r\n\t\t\ttabsActive[i].style.display='block';\r\n\t\t}\r\n\r\n\t\tevt.currentTarget.className += \" active\";\r\n\t}", "function OuterTab(display_text,url,image)\n{\n\n this.Tabs = [];\n this.DisplayText = display_text;\n this.Url = url;\n this.AddTab = add_tab;\n this.LastTabIndex = '';\n this.Image = image;\n this.line_number = 1;\n\n}", "function opentab(evt, usertype) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(usertype).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n }", "function cp_tab_control() {\n\tvar tabs = [];\n\tvar tabContainers = [];\n\tjQuery('ul.tabnavig a').each(function() {\n\t\tif ( window.location.pathname.match(this.pathname) ) {\n\t\t\ttabs.push(this);\n\t\t\ttabContainers.push( jQuery(this.hash).get(0) );\n\t\t}\n\t});\n\n\t//hide all contrainers except execpt for the one from the URL hash or the first container\n\tif ( window.location.hash !== \"\" && window.location.hash.search('block') >= 0 ) {\n\t\tjQuery(tabContainers).hide().filter(window.location.hash).show();\n\t\t//detecting <a> tab using its \"href\" which should always equal the hash\n\t\tjQuery(tabs).filter( function(index) {\n\t\t\treturn ( jQuery(this).attr('href') === window.location.hash );\n\t\t}).addClass('selected');\n\t\tjQuery('html').scrollTop( jQuery(window.location.hash).parent().position().top );\n\t} else {\n\t\tjQuery(tabContainers).hide().filter(':first').show();\n\t\tjQuery(tabs).filter(':first').addClass('selected');\n\t}\n\n\tjQuery(tabs).click(function() {\n\t\t// hide all tabs\n\t\tjQuery(tabContainers).hide().filter(this.hash).fadeIn(100);\n\t\tjQuery(tabs).removeClass('selected');\n\t\tjQuery(this).addClass('selected');\n\t\treturn false;\n\t});\n}", "function triigletabcontent() {\n $(\".tab-c\").each(function() {\n $(this).removeClass(\"active\");\n });\n }", "function openTab(evt, name) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(name).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function betterTab (cm) {\n if (cm.somethingSelected()) {\n cm.indentSelection('add');\n } else {\n cm.replaceSelection(cm.getOption('indentWithTabs') ? '\\t' :\n Array(cm.getOption('indentUnit') + 1).join(' '), 'end', '+input');\n }\n }", "function jscoverage_selectTab(tab) {\n\t$(tab).tab('show');\n}", "function openTab(evt, tabName) {\r\n let i, tabcontent, tablinks;\r\n tabcontent = document.getElementsByClassName(\"tabcontent\");\r\n for (i = 0; i < tabcontent.length; i++) {\r\n tabcontent[i].style.display = \"none\";\r\n }\r\n tablinks = document.getElementsByClassName(\"tablinks\");\r\n for (i = 0; i < tablinks.length; i++) {\r\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\r\n }\r\n document.getElementById(tabName).style.display = \"block\";\r\n evt.currentTarget.className += \" active\";\r\n}", "function do_tabpanel(group,idnode)\r\n{\r\n\r\n\t\tvar c = new class_compat();\r\n\t\tc.showgroupelement(group,idnode);\r\n\t\t\r\n\r\n}", "static get CLASS() {\n return {\n BUTTON_ACTIVE: 'tab-button--active',\n CONTENT_ACTIVE: 'tab-content--active'\n }\n }", "function ChangeTabs(evt, backSymbol) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(backSymbol).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function openTab(evt, tab) {\n var i, x, tablinks;\n\tx = document.getElementsByClassName(\"beamTabs\");\n\tfor (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablink\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" w3-indigo\", \"\");\n }\n evt.currentTarget.className += \" w3-indigo\";\n\tdocument.getElementById(tab).style.display = \"block\";\n\tupdateDiagramGeometry();\n}", "function openTab(evt, tabName) {\n let i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n \n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function betterTab(cm) {\n if (cm.somethingSelected()) {\n cm.indentSelection(\"add\");\n } else {\n cm.replaceSelection(cm.getOption(\"indentWithTabs\")? \"\\t\":\n Array(cm.getOption(\"indentUnit\") + 1).join(\" \"), \"end\", \"+input\");\n }\n}", "outputTab() {\n // advance the cursor to the next multiple of 8\n this.cursor.x += 8;\n this.cursor.x &= ~7;\n\n // go to a new line if this exceeds the terminal width\n if (this.cursor.x > this.termCols) {\n this.cursor.x = 0;\n this.outputLF();\n }\n }", "getTabString() {\n if (this.getUseSoftTabs()) {\n return lang.stringRepeat(\" \", this.getTabSize());\n } else {\n return \"\\t\";\n }\n }", "function openTab(evt, tabName) {\n console.log(evt.currentTarget)\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function openTab(colorAttribute) {\n var i;\n var x = document.getElementsByClassName(\"tabs\");\n for (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\"; \n }\n document.getElementById(colorAttribute).style.display = \"block\"; \n}", "function tabActivate( prmCanvasLoc, prmtabHdrLoc, prmtabCntLoc ) \n{\n var i, nChildCount;\n var strChildId;\n var oChild;\n\n //--- get the number of children in canvas\n nChildCount = prmCanvasLoc.children.length;\n \n //--- loop thru the child objects to manage CONTENT-TABS\n for( i = 0; i < nChildCount; i++ ) \n {\n //--- retrive child object and id\n oChild = prmCanvasLoc.children(i);\n strChildId = oChild.id;\n \n //--- process only if object is content tab\n if( strChildId.substr(0,6) == \"tabCnt\" ) \n { \n if( oChild.id==prmtabCntLoc.id )\n {\n oChild.style.visibility= 'inherit';\n oChild.style.zIndex= 2;\n }\n else \n oChild.style.visibility= 'hidden';\n }\n }\n \n //--- loop thru the child objects to manage HEADER-TABS\n for( i = 0; i < nChildCount; i++ ) \n {\n //--- retrive child object and id\n oChild = prmCanvasLoc.children(i); strChildId = oChild.id\n\n //--- process only if object is header tab\n if( strChildId.substr(0,6) == \"tabHdr\" ) \n { \n if(oChild.id==prmtabHdrLoc.id) \n {\n oChild.style.top=\"4px\"; oChild.style.width= \"108px\";\n oChild.style.borderBottomColor= \"buttonface\";\n oChild.style.borderBottomStyle= \"solid\";\n oChild.style.borderBottomWidth= \"1px\";\n oChild.style.cursor= 'default';\n oChild.style.zIndex= 4;\n }\n else \n {\n oChild.style.top=\"8px\"; oChild.style.width= \"100px\";\n oChild.style.cursor= 'hand';\n oChild.style.zIndex= -1;\n }\n }\n }\n}", "function openTab(evt, cityName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(cityName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n\n}", "function openTab(evt, cityName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(cityName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function options(evt, opName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(opName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function display_tabs( tabs ) {\n var tabs_code = $(tabs);\n\n set_active_tab( tabs_code );\n preapare_tabs_interface( tabs_code );\n\n $('#app-table>header').empty();\n $('#app-table>header').append( tabs_code );\n }", "function setTab(i) {\n\t\t\t//vm.activeTab = i;\n\t\t}", "setTabProperties() { }", "function openTab(evt, cityName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(cityName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function tabs () {\n\treturn 'foo'\n}", "function start(tab)\n{\n\t\n}", "function tab(cm) {\n var _a;\n var selections = cm.listSelections();\n var beforeCur = [];\n var afterCur = [];\n var selected = [];\n var addIndentTo = {}; // {lineNo: stringIndent}\n var tokenSeeker = new core_1.TokenSeeker(cm);\n /** indicate previous 4 variable changed or not */\n var flag0 = false, flag1 = false, flag2 = false, flag3 = true;\n function setBeforeCur(text) { beforeCur[i] = text; if (text)\n flag1 = true; }\n function setAfterCur(text) { afterCur[i] = text; if (text)\n flag2 = true; }\n function setSelected(text) { selected[i] = text; if (text)\n flag3 = true; }\n for (var i = 0; i < selections.length; i++) {\n beforeCur[i] = afterCur[i] = selected[i] = \"\";\n var range = selections[i];\n var left = range.head;\n var right = range.anchor;\n var rangeEmpty = range.empty();\n if (!rangeEmpty && codemirror_1.cmpPos(left, right) > 0)\n _a = [left, right], right = _a[0], left = _a[1];\n else if (right === left) {\n right = range.anchor = { ch: left.ch, line: left.line };\n }\n var eolState = cm.getStateAfter(left.line);\n var line = cm.getLine(left.line);\n if (eolState.hmdTable) {\n // yeah, we are inside a table\n flag0 = true; // cursor will move\n var isNormalTable = eolState.hmdTable === 2 /* NORMAL */;\n var columns = eolState.hmdTableColumns;\n tokenSeeker.setPos(left.line, left.ch);\n var nextCellLeft = tokenSeeker.findNext(isRealTableSep, tokenSeeker.i_token);\n if (!nextCellLeft) { // already last cell\n var lineSpan = eolState.hmdTableRow === 0 ? 2 : 1; // skip |---|---| line\n if ((left.line + lineSpan) > cm.lastLine() || cm.getStateAfter(left.line + lineSpan).hmdTable != eolState.hmdTable) {\n // insert a row after this line\n left.ch = right.ch = line.length;\n var newline_2 = core_1.repeatStr(\" | \", columns.length - 1);\n // There are always nut users!\n if (eolState.hmdTableRow === 0) {\n right.line = left.line += 1;\n right.ch = left.ch = cm.getLine(left.line).length;\n }\n if (isNormalTable) {\n setBeforeCur(\"\\n| \");\n setAfterCur(newline_2 + \" |\");\n }\n else {\n setBeforeCur(\"\\n\");\n setAfterCur(newline_2.trimRight());\n }\n setSelected(\"\");\n }\n else {\n // move cursor to next line, first cell\n right.line = left.line += lineSpan;\n tokenSeeker.setPos(left.line, 0);\n var line_1 = tokenSeeker.line.text;\n var dummySep = isNormalTable && tokenSeeker.findNext(/hmd-table-sep-dummy/, 0);\n var nextCellRight = tokenSeeker.findNext(/hmd-table-sep/, dummySep ? dummySep.i_token + 1 : 1);\n left.ch = dummySep ? dummySep.token.end : 0;\n right.ch = nextCellRight ? nextCellRight.token.start : line_1.length;\n if (right.ch > left.ch && line_1.charAt(left.ch) === \" \")\n left.ch++;\n if (right.ch > left.ch && line_1.charAt(right.ch - 1) === \" \")\n right.ch--;\n setSelected(right.ch > left.ch ? cm.getRange(left, right) : \"\");\n }\n }\n else {\n var nextCellRight = tokenSeeker.findNext(/hmd-table-sep/, nextCellLeft.i_token + 1);\n left.ch = nextCellLeft.token.end;\n right.ch = nextCellRight ? nextCellRight.token.start : line.length;\n if (right.ch > left.ch && line.charAt(left.ch) === \" \")\n left.ch++;\n if (right.ch > left.ch && line.charAt(right.ch - 1) === \" \")\n right.ch--;\n setSelected(right.ch > left.ch ? cm.getRange(left, right) : \"\");\n }\n // console.log(\"selected cell\", left.ch, right.ch, selected[i])\n }\n else if (eolState.listStack.length > 0) {\n // add indent to current line\n var lineNo = left.line;\n var tmp = void 0; // [\" * \", \" \", \"* \"]\n while (!(tmp = ListRE.exec(cm.getLine(lineNo)))) { // beginning line has no bullet? go up\n lineNo--;\n var isList = cm.getStateAfter(lineNo).listStack.length > 0;\n if (!isList) {\n lineNo++;\n break;\n }\n }\n var firstLine = cm.firstLine();\n var lastLine = cm.lastLine();\n for (; lineNo <= right.line && (tmp = ListRE.exec(cm.getLine(lineNo))); lineNo++) {\n var eolState_1 = cm.getStateAfter(lineNo);\n var listStack = eolState_1.listStack;\n var listStackOfPrevLine = cm.getStateAfter(lineNo - 1).listStack;\n var listLevel = listStack.length;\n var spaces = \"\";\n // avoid uncontinuous list levels\n if (lineNo > firstLine && listLevel <= listStackOfPrevLine.length) {\n if (listLevel == listStackOfPrevLine.length) {\n // tmp[1] is existed leading spaces\n // listStackOfPrevLine[listLevel-1] is desired indentation\n spaces = core_1.repeatStr(\" \", listStackOfPrevLine[listLevel - 1] - tmp[1].length);\n }\n else {\n // make bullets right-aligned\n // tmp[0].length is end pos of current bullet\n spaces = core_1.repeatStr(\" \", listStackOfPrevLine[listLevel] - tmp[0].length);\n }\n }\n addIndentTo[lineNo] = spaces;\n // if current list item is multi-line...\n while (++lineNo <= lastLine) {\n if ( /*corrupted */cm.getStateAfter(lineNo).listStack.length !== listLevel) {\n lineNo = Infinity;\n break;\n }\n if ( /*has bullet*/ListRE.test(cm.getLine(lineNo))) {\n lineNo--;\n break;\n }\n addIndentTo[lineNo] = spaces;\n }\n }\n if (!rangeEmpty) {\n flag3 = false;\n break; // f**k\n }\n }\n else {\n // emulate Tab\n if (rangeEmpty) {\n setBeforeCur(\" \");\n }\n else {\n setSelected(cm.getRange(left, right));\n for (var lineNo = left.line; lineNo <= right.line; lineNo++) {\n if (!(lineNo in addIndentTo))\n addIndentTo[lineNo] = \" \";\n }\n }\n }\n }\n // if (!(flag0 || flag1 || flag2 || flag3)) return cm.execCommand(\"defaultTab\")\n // console.log(flag0, flag1, flag2, flag3)\n for (var lineNo in addIndentTo) {\n if (addIndentTo[lineNo])\n cm.replaceRange(addIndentTo[lineNo], { line: ~~lineNo, ch: 0 });\n }\n if (flag0)\n cm.setSelections(selections);\n if (flag1)\n cm.replaceSelections(beforeCur);\n if (flag2)\n cm.replaceSelections(afterCur, \"start\");\n if (flag3)\n cm.replaceSelections(selected, \"around\");\n }", "_makeActive (tab) {\n tab.classList.add('active');\n let pfTab = this.tabMap.get(tab);\n let naturalDisplay = this.displayMap.get(pfTab);\n pfTab.style.display = naturalDisplay;\n pfTab.setAttribute('active','');\n }", "setTabIndexForTabControl() {\n let ele;\n let tabindexSet;\n const tabsControl = this.getElementsBySelector(this.selectorTabsControl);\n this.getArrayFromNodeList(tabsControl).map(tabControl => {\n ele = tabControl.querySelector(TAB_TITLE_CLASS);\n ele.setAttribute('tabindex', '-1');\n if (!tabindexSet && ele && this.isDefaultTabActive) {\n ele.setAttribute('tabindex', '0');\n tabindexSet = true;\n }\n if (!tabindexSet && ele && tabControl.classList.contains('tab-control-active')) {\n ele.setAttribute('tabindex', '0');\n tabindexSet = true;\n }\n });\n }", "function useTabChar() {\n\t\t\treturn (new Scintilla(context.handle)).Call(\"SCI_GETUSETABS\", 0, 0);\n\t\t}", "function openTab(tabName) {\n var i;\n var x = document.getElementsByClassName(\"tabPage\");\n for (i = 0; i < x.length; i++) {\n x[i].style.display = \"none\";\n }\n document.getElementById(tabName).style.display = \"block\";\n}", "function activeTab(index) {\n tabContent.forEach((section )=>{\n section.classList.remove('ativo');\n })\n tabContent[index].classList.add('ativo');\n }", "function htmlCode(tab_labels, msg) {\n var keys = Object.keys(tab_labels).sort();\n // Add tab buttons\n var tabs = '<ul class=\"tab-list\">';\n for (var idx in keys) {\n var d = keys[idx];\n var label = category === 'switches' ? 'SW_' + tab_labels[d] : tab_labels[d];\n tabs += '<li class=\"tab-control\" data-tab=\"tab-' + tab_labels[d] + '\">' + label + '</li>';\n }\n tabs += '</ul>';\n\n for (var idx in keys) {\n var s = keys[idx]\n tabs += '<div class=\"tab-panel\" id=\"tab-' + tab_labels[s] + '\"><h1>' + msg + '</h1></div>';\n }\n return tabs;\n }", "function activateTab(idTab) {\r\n\tvar tab = $(\"#\" + idTab)[0];\r\n\t// parcours les tags de meme nom dans le parent et leur enleve la classe active\r\n\t$(tab.parentNode).find(tab.tagName).removeClass(\"active\");\r\n\t// rajoute la classe active a notre onglet\r\n\t$(tab).addClass(\"active\");\r\n}", "function setTabAccessibility()\r\n{\r\n $(\"a, input, select, textarea\").each(function()\r\n {\r\n var element = $(this);\r\n if (element.hasClass(\"tabInaccessible\"))\r\n {\r\n element.attr(\"tabIndex\", \"2\");\r\n }\r\n else\r\n {\r\n element.attr(\"tabIndex\", \"1\");\r\n }\r\n });\r\n}", "function onClickTab(tab) {\n if (d3.select(\"#tab_\"+tab).classed(\"active\")) { return; }\n active_tab = tab;\n // hide all tab_content\n d3.selectAll(\".tab_content\").style(\"display\", \"none\");\n // show selected tab_content\n d3.select(\"#div_\"+tab).style(\"display\", \"unset\");\n // mark tab as selected\n d3.selectAll(\".tab\").classed(\"active\", false);\n d3.select(\"#tab_\"+tab).classed(\"active\", true);\n drawgraphs();\n}", "function ar(evt, cityName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent5\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks5\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(cityName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function draw_tabs() {\n // Get tab area\n var tabX = 0;\n var tabY = display.getHeight() - 4;\n var tabW = display.getWidth();\n var tabH = 4;\n\n // Draw the red area\n display.fill(tabX, tabY, tabW, tabH, \"white\", \"red\", ' ');\n\n // Draw instruction text\n display.text(tabX + Math.floor(tabW / 2) - 7, tabY + 1, \"Press <TAB> to\");\n display.text(tabX + Math.floor(tabW / 2) - 10, tabY + 2, \"switch between panes.\");\n\n // Width tab\n display.text(tabX + 2, tabY + 1, \" WIDTH \", 'red', 'white');\n if (tabSelected === 0) {\n display.fill(tabX + 2, tabY + 2, 11, 1, 'red', 'white', ' ');\n }\n display.text(tabX + 6, tabY + 2, etch.getWidth().toString());\n // Height tab\n display.text(tabX + 15, tabY + 1, \" HEIGHT \", 'red', 'white');\n if (tabSelected === 1) {\n display.fill(tabX + 15, tabY + 2, 11, 1, 'red', 'white', ' ');\n }\n display.text(tabX + 19, tabY + 2, etch.getHeight().toString());\n // Clear tab\n display.text(tabX + tabW - 26, tabY + 1, \" CLEAR \", 'red', 'white');\n if (tabSelected === 2) {\n display.text(tabX + tabW - 26, tabY + 2, \" [ENTER] \", 'red', 'white');\n }\n // Exit tab\n display.text(tabX + tabW - 13, tabY + 1, \" EXIT \", 'red', 'white');\n if (tabSelected === 3) {\n display.text(tabX + tabW - 13, tabY + 2, \" [ENTER] \", 'red', 'white');\n }\n}", "function changeTab (pressedTabIndex) {\n\n var tabsArea \n = document.getElementById(TABS_AREA);\n \n var tabs = tabsArea.getElementsByTagName(DIV_TAG);\n\n for (var tabIndex = 0; tabIndex < tabs.length; ++tabIndex) {\n tabs[tabIndex].className = TAB_CLASS;\n }\n\n tabs[pressedTabIndex].className = TAB_CLASS + ' ' + SELECTED_TAB_CLASS;\n}", "function onTabClick() {\n\n if(!loading && !new_patient) {\n\n var target = $(this).attr(\"data-target\");\n\n $(tabs).each(function() {\n\n $(this).removeClass(\"selected\");\n });\n\n $(sections).each(function() {\n\n ($(this).attr(\"data-type\") == target) ? $(this).removeClass(\"hide\") : $(this).addClass(\"hide\");\n })\n\n $(this).addClass(\"selected\");\n }\n }", "function triigletabcontent() {\n $(\".tab-c\").each(function() {\n $(this).removeClass(\"active\");\n });\n}", "function triigletabcontent() {\n $(\".tab-c\").each(function () {\n $(this).removeClass(\"active\");\n });\n}", "function triigletabcontent() {\n $(\".tab-c\").each(function () {\n $(this).removeClass(\"active\");\n });\n}", "function ShowTab1(obj){\n $(obj).addClass('active1');\n $(\"#tab1_info\").addClass('d-block');\n\n //color reset of tabs\n $(\"#t2\").removeClass(\"active2\");\n $(\"#t3\").removeClass(\"active3\");\n $(\"#t4\").removeClass(\"active4\");\n\n //hide show information\n $(\"#tab2_info\").removeClass('d-block');\n $(\"#tab3_info\").removeClass('d-block');\n $(\"#tab4_info\").removeClass('d-block');\n \n //hide information\n $(\"#tab2_info\").addClass('d-none');\n $(\"#tab3_info\").addClass('d-none');\n $(\"#tab4_info\").addClass('d-none');\n\n }", "function showTab(tabIndex){\n tabs.forEach(function(tab,i){\n console.log(i)\n console.log(tabIndex)\n if(i=== tabIndex){\n tab.classList.add('active')\n }\n else{\n tab.classList.remove('active')\n }\n })\n \n \n tabContents.forEach(function(content){\n content.style.display=\"none\"\n })\n tabContents[tabIndex].style.display=\"block\"\n}", "function displayMode(evt, mode) {\n var i, tabcontent, tablinks;\n document.getElementById(\"OUTPUT\").innerHTML = \"\";\n this.output_displayed = false;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(mode).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n\n}", "AccessTab(tab) {\n cy.xpath(infoElmts.tabName(tab)).click()\n }", "function semTab() {\r\n\tchecatab = false;\r\n}", "function contactTabs(evt, onglet) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(onglet).style.display = \"flex\";\n evt.currentTarget.className += \" active\";\n}", "_makeActive(tab) {\n tab.classList.add('active');\n const pfTab = this.tabMap.get(tab);\n const naturalDisplay = this.displayMap.get(pfTab);\n pfTab.style.display = naturalDisplay;\n pfTab.setAttribute('active', '');\n }", "function openTab(evt, tabName) {\n let i, x, tabLinks;\n\n x = document.querySelectorAll('.content-tab');\n for (i = 0; i < x.length; i++) x[i].style.display = \"none\";\n\n tabLinks = document.querySelectorAll('.tab');\n for (i = 0; i < x.length; i++) tabLinks[i].className = tabLinks[i].className.replace(' is-active', '');\n\n document.getElementById(tabName).style.display = \"block\";\n evt.currentTarget.className += ' is-active';\n}", "function hit()\n {\n //switches to tab\n switchTab(name, number);\n }", "function openTab(evt, tabContent) {\n // Declare all variables\n var i, tabcontent, tablinks;\n\n // Get all elements with class=\"tabcontent\" and hide them\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n // Get all elements with class=\"tablinks\" and remove the class \"active\"\n tablinks = document.getElementsByClassName(\"tablinks\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].classList.remove(\"activeTab\");\n }\n\n // Show the current tab, and add an \"active\" class to the link that opened the tab\n document.getElementById(tabContent).style.display = \"\";\n evt.currentTarget.classList.add(\"activeTab\");\n}", "function tabLevel(nbTabs) {\n\tvar result = \"\";\n\tfor (var i = 0; i < nbTabs; i++) {\n\t\tresult += \" \";\n\t}\n\treturn result;\n}", "function showTab(n) {\r\n // Esta funcion muestra el tab recibido por parametro...\r\n var x = document.getElementsByClassName(\"tab\");\r\n x[n].style.display = \"block\";\r\n // ... and fix the Previous/Next buttons:\r\n if (n == 0) {\r\n document.getElementById(\"prevBtn\").style.display = \"none\";\r\n } else {\r\n document.getElementById(\"prevBtn\").style.display = \"inline\";\r\n }\r\n if (n == (x.length - 1)) {\r\n document.getElementById(\"nextBtn\").innerHTML = \"Submit\";\r\n } else {\r\n document.getElementById(\"nextBtn\").innerHTML = \"Next\";\r\n }\r\n // ... and run a function that displays the correct step indicator:\r\n fixStepIndicator(n)\r\n}", "function changeTab(pageName, tabElement){\n var tabcontent;\n var tablinks;\n\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n tabcontent2 = document.getElementsByClassName(\"tabcontent\").value;\n\n for (var i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n\n }\n\n tablinks = document.getElementsByClassName(\"tablink\");\n\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].style.backgroundColor = \"\";\n\n }\n tabElement.style.backgroundColor = \"AntiqueWhite\";\n document.getElementById(pageName).style.display = \"block\";\n\n\n\n}", "function createTab(name, content) {\n \n // get tabs list and append a new line item for a new tab\n var tabsList = document.getElementById('afd-tabs-list');\n var numTabs = tabsList.children.length;\n var lineItem = document.createElement('li');\n var lineItemAnchor = document.createElement('a');\n\n /*\n * create attributes for line item\n */\n\n var role = document.createAttribute('role');\n role.value = 'tab';\n lineItem.setAttributeNode(role);\n\n var tabIndex = document.createAttribute('tabindex');\n tabIndex.value = '-1';\n lineItem.setAttributeNode(tabIndex);\n\n var cls = document.createAttribute('class');\n cls.value = 'ui-tabs-tab ui-corner-top ui-state-default ui-tab';\n lineItem.setAttributeNode(cls);\n\n var ariaControls = document.createAttribute('aria-controls');\n ariaControls.value = 'tabs-' + (numTabs+1);\n lineItem.setAttributeNode(ariaControls);\n\n var ariaLabelledBy = document.createAttribute('aria-labelledby');\n ariaLabelledBy.value = 'ui-id-' + (numTabs+1);\n lineItem.setAttributeNode(ariaLabelledBy);\n\n var ariaSelected = document.createAttribute('aria-selected');\n ariaSelected.value = 'false';\n lineItem.setAttributeNode(ariaSelected);\n\n var ariaExpanded = document.createAttribute('aria-expanded');\n ariaExpanded.value = 'false';\n lineItem.setAttributeNode(ariaExpanded);\n\n /*\n * create attributes for line item\n */\n\n lineItemAnchor.href = '#tabs-' + (numTabs+1);\n\n var anchorRole = document.createAttribute('role');\n anchorRole.value = 'presentation';\n lineItemAnchor.setAttributeNode(anchorRole);\n\n var anchorTabIndex = document.createAttribute('tabindex');\n anchorTabIndex.value = '-1';\n lineItemAnchor.setAttributeNode(anchorTabIndex);\n\n var anchorCls = document.createAttribute('class');\n anchorCls.value = 'ui-tabs-anchor';\n lineItemAnchor.setAttributeNode(anchorCls);\n\n var anchorId = document.createAttribute('id');\n anchorId.value = 'ui-id-' + (numTabs+1);\n lineItemAnchor.setAttributeNode(anchorId);\n\n // set the name of the tab\n lineItemAnchor.innerHTML = '<b>' + name + '</b>';\n\n // append elements\n lineItem.appendChild(lineItemAnchor);\n tabsList.appendChild(lineItem);\n \n /*\n * create new div to hold tab's content\n */\n\n var tabsList = document.getElementById('afd-tabs');\n var newTabDiv = document.createElement('div'); \n\n // set id and style attributes of div\n newTabDiv.id = 'tabs-' + (numTabs+1);\n newTabDiv.style.height = '100%';\n newTabDiv.style.width = '90%';\n newTabDiv.style.display = 'none';\n\n // set additional attributes of div\n var divAriaLabelledBy = document.createAttribute('aria-labelledby');\n divAriaLabelledBy.value = 'ui-id-' + (numTabs+1);\n newTabDiv.setAttributeNode(divAriaLabelledBy); \n\n divRole = document.createAttribute('role');\n divRole.value = 'tabpanel';\n newTabDiv.setAttributeNode(divRole); \n\n var divCls = document.createAttribute('class');\n divCls.value = 'ui-tabs-panel ui-corner-bottom ui-widget-content';\n newTabDiv.setAttributeNode(divCls); \n\n var divAriaHidden = document.createAttribute('aria-hidden');\n divAriaHidden.value = 'true';\n newTabDiv.setAttributeNode(divAriaHidden);\n\n // set div content\n var paragraph = document.createElement('p');\n paragraph.innerHTML = content;\n newTabDiv.appendChild(paragraph);\n tabsList.appendChild(newTabDiv);\n\n $(\"#afd-tabs\").tabs(\"refresh\");\n\n}", "function Tab(item) {\n _super.call(this);\n this.addClass(TAB_CLASS);\n this._item = item;\n var title = item.title;\n this.textNode.textContent = title.text;\n this.toggleClass(CLOSABLE_CLASS, title.closable);\n if (title.icon)\n exAddClass(this.iconNode, title.icon);\n if (title.className)\n exAddClass(this.node, title.className);\n title.changed.connect(this._onTitleChanged, this);\n }", "function g_tab(testoh1,elenco_task,color_class)\r\n{\r\n // a) modifico testo in <h1>\r\n const titoloh1= document.getElementById('titolo_tabella'); //id elemento h1\r\n titoloh1.innerText = testoh1; \r\n\r\n // b) Cancello contenuto Tabella\r\n initTable();\r\n\r\n // c) Inserisco nuove righe in tabella\r\n fillTaskTable(elenco_task);\r\n \r\n // d) Modifico stile elenco a sinistra (aside)\r\n //seleziono tutti gli elementi a, dentro al div, dentro all'elemento con id= left-sidebar -> per ognuno degli elementi a, gli rimuovo la classe active, che era quella che lo rendeva in evidenza\r\n //n.b. solo uno dei bottoni aveva la classe active, ma non posso sapere quale, così provo a toglierla a tutti\r\n document.querySelectorAll('#left-sidebar div a ').forEach( node => node.classList.remove('active'));\r\n document.getElementById(color_class).classList.add('active');\r\n //Aggiugno la classe active, solo al bottone che ho appena cliccato: corrisponde a quello sto vedendo in tabella\r\n\r\n}", "addTabOnTextArea(e) {\n if (e.keyCode === 9) {\n //If tab key is pressed\n let savePosition = e.target.selectionStart + 2;\n e.preventDefault();\n // Indent of two spaces\n e.target.value =\n e.target.value.substring(0, e.target.selectionStart) +\n ' ' +\n e.target.value.substring(\n e.target.selectionStart,\n e.target.value.length\n );\n e.target.selectionStart = savePosition;\n e.target.selectionEnd = savePosition;\n }\n }", "function Tabs(category) {\n var category = category;\n\n // Create the tab structure\n function htmlCode(tab_labels, msg) {\n var keys = Object.keys(tab_labels).sort();\n // Add tab buttons\n var tabs = '<ul class=\"tab-list\">';\n for (var idx in keys) {\n var d = keys[idx];\n var label = category === 'switches' ? 'SW_' + tab_labels[d] : tab_labels[d];\n tabs += '<li class=\"tab-control\" data-tab=\"tab-' + tab_labels[d] + '\">' + label + '</li>';\n }\n tabs += '</ul>';\n\n for (var idx in keys) {\n var s = keys[idx]\n tabs += '<div class=\"tab-panel\" id=\"tab-' + tab_labels[s] + '\"><h1>' + msg + '</h1></div>';\n }\n return tabs;\n }\n\n /**\n * Set listeners to user events.\n */\n function listenToEvents() {\n // only one tab list is allowed per page\n $('.tab-list').on('click', '.tab-control', function () {\n //var tab_id = $(this).attr('data-tab');\n var tab_id = $(this).data('tab');\n\n $('.tab-control').removeClass('active');\n $('.tab-panel').removeClass('active');\n\n $(this).addClass('active');\n $(\"#\" + tab_id).addClass('active');\n\n // Save active tab per category\n saveInSession('activetab', '', tab_id);\n })\n }\n\n // Append HTML\n function buildTabs(parent, tab_labels, msg) {\n var html_code = htmlCode(tab_labels, msg)\n $(parent).empty().append(html_code);\n listenToEvents();\n }\n\n // Fill tab panel\n function buildContent(id, envelope) {\n envelope.children('.tableframe').each(function (i, v) {\n $(v).data('order', i);\n })\n var order_list = getFromSession('order', 'tab-' + id);\n if (order_list) {\n var $cards = envelope.children('.tableframe');\n if ($cards.length != order_list.length) {\n // pass, a table added/removed so we cannot use the previous order\n saveInSession(\"order\", null);\n } else {\n //var $clone = envelope.clone().empty();\n for (var i in order_list) {\n var $card = $cards.eq(order_list[i]).detach();\n envelope.append($card);\n }\n //envelope = $clone;\n }\n }\n $('#tab-' + id).empty().append(envelope);\n }\n\n // Set active tab\n function setActive() {\n $('.tab-control').removeClass('active');\n $('.tab-panel').removeClass('active');\n\n var tab_id = getFromSession('activetab', '');\n if (tab_id) { // Active tab has been saved\n var $first = $('[data-tab=' + tab_id + ']')\n $first.addClass('active');\n $(\"#\" + tab_id).addClass('active');\n } else { // No active tab saved\n var $first = $('.tab-control').first();\n //var tab_id = $first.attr('data-tab');\n var tab_id = $first.data('tab');\n $first.addClass('active');\n $(\"#\" + tab_id).addClass('active');\n saveInSession('activetab', '', tab_id);\n }\n }\n\n return {\n buildTabs: buildTabs,\n buildContent: buildContent,\n setActive: setActive\n };\n}", "function goToSetChararcteristics(){\n tabsFrame.selectTab('page4');\n}", "function setTabActive(tab){tabVisited[tab]=true;$(\"#\" + tab).removeClass(\"inactive\")}", "function initTabControl() {\r\n var tabs = document.getElementById('tabs');\r\n var i;\r\n var child;\r\n var tabNum = 0;\r\n for (i = 0; i < tabs.childNodes.length; i++) {\r\n child = tabs.childNodes.item(i);\r\n if (child.nodeType === 1) {\r\n if (child.className !== 'disabled') {\r\n child.onclick = tab_click;\r\n }\r\n tabNum++;\r\n }\r\n }\r\n selectTab(0);\r\n}", "function bookTabToggle(evt)\n{\n evt=evt||event;\n var target=fdjtUI.T(evt);\n var tabid=fdjtDOM.findAttrib(target,'tabid');\n if (!(tabid)) return;\n var tbody=fdjtDOM.getParent(target,'tbody');\n var curtab=tbody.getAttribute('tab');\n if ((curtab)&&(curtab===tabid)) tbody.removeAttribute('tab');\n else tbody.setAttribute('tab',tabid);\n tbody.className=tbody.className;\n}", "static get CLASS() {\n return {\n TAB_BAR_ELEMENT: '.tab-button-bar',\n PARENT_HIDEN_CONTENT: '.tab-hidden-content',\n TAB_BUTTON: '.tab-button',\n HIDDEN_CONTENT: '.tab-content'\n };\n }", "function tabClick (event) {\n let clickedTab = event.target;\n let activePane = get(`#${clickedTab.getAttribute(\"data-tab\")}`);\n\n // remove all active tab classes\n for (let i = 0; i < tabs.length; i++) {\n tabs[i].classList.remove('active');\n }\n\n // remove all active pane classes\n for (var i = 0; i < panes.length; i++) {\n panes[i].classList.remove('active');\n }\n\n // apply active classes on desired tab and pane\n clickedTab.classList.add('active');\n activePane.classList.add('active');\n }", "function changeAtiveTab(event,activeClasses,normalClasses){\n event.preventDefault();\n // prepare classes for querySelectorAll and classList.remove/add\n normalClasses = normalClasses.split(\" \").filter(item => item !== \" \" && item !== \"\");\n activeClasses = activeClasses.split(\" \").filter(item => item !== \" \" && item !== \"\");\n let queryActiveClasses = activeClasses.map(item => \".\" + item);\n // get the anchor element with the data-toggle=\"tab\" that has been clicked\n let element = event.currentTarget;\n let elementID = event.currentTarget.getAttribute(\"href\");\n // get it's counterpart tab element\n let tabElement = document.querySelector(elementID);\n // get the unordered list parent (grand-parent actualy)\n let ulElement = element.parentNode.parentNode;\n // get the current active element\n let activeElement = ulElement.querySelector(\"li > a\" + queryActiveClasses);\n let activeElementID = activeElement.getAttribute(\"href\");\n // get the current active tab element\n let activeTabElement = document.querySelector(activeElementID);\n\n normalClasses.forEach((item) => {\n activeElement.classList.add(item);\n element.classList.remove(item);\n });\n activeClasses.forEach((item) => {\n activeElement.classList.remove(item);\n element.classList.add(item);\n });\n\n activeTabElement.classList.add(\"hidden\");\n activeTabElement.classList.remove(\"block\");\n tabElement.classList.remove(\"hidden\");\n tabElement.classList.add(\"block\");\n}", "function openInfo(evt, tabName) {\n\n\t// Get all elements with class=\"tabcontent\" and hide them\n\ttabcontent = document.getElementsByClassName(\"tabcontent\");\n\tfor (i = 0; i < tabcontent.length; i++) {\n\t\ttabcontent[i].style.display = \"none\";\n\t}\n\n\t// Get all elements with class=\"tablinks\" and remove the class \"active\"\n\ttablinks = document.getElementsByClassName(\"tablinks\");\n\tfor (i = 0; i < tablinks.length; i++) {\n\t\ttablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n\t}\n\n\t// Show the current tab, and add an \"active\" class to the button that opened the tab\n\tdocument.getElementById(tabName).style.display = \"block\";\n\tevt.currentTarget.className += \" active\";\n\n}", "function openInfo(evt, tabName) {\n\n\t// Get all elements with class=\"tabcontent\" and hide them\n\ttabcontent = document.getElementsByClassName(\"tabcontent\");\n\tfor (i = 0; i < tabcontent.length; i++) {\n\t\ttabcontent[i].style.display = \"none\";\n\t}\n\n\t// Get all elements with class=\"tablinks\" and remove the class \"active\"\n\ttablinks = document.getElementsByClassName(\"tablinks\");\n\tfor (i = 0; i < tablinks.length; i++) {\n\t\ttablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n\t}\n\n\t// Show the current tab, and add an \"active\" class to the button that opened the tab\n\tdocument.getElementById(tabName).style.display = \"block\";\n\tevt.currentTarget.className += \" active\";\n\n}", "function showTab(selectedTab, numTabs = NUM_TABS){\n console.log(`showTab for ${selectedTab}`);\n for(let i=1; i<=numTabs; i++){\n if(i == selectedTab){\n continue;\n }\n else{\n $(`#${i}a`).hide();\n $(`#tab${i}`).removeClass('active');\n $(`#${i}a`).removeClass('active');\n }\n }\n\n $(`#tab${selectedTab}`).show();\n $(`#${selectedTab}a`).show();\n $(`#tab${selectedTab}`).addClass('active');\n $(`#${selectedTab}a`).addClass('active');\n\n}", "function artificial(evt, cityName) {\n var i, tabcontent, tablinks;\n tabcontent = document.getElementsByClassName(\"tabcontent4\");\n for (i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n tablinks = document.getElementsByClassName(\"tablinks4\");\n for (i = 0; i < tablinks.length; i++) {\n tablinks[i].className = tablinks[i].className.replace(\" active\", \"\");\n }\n document.getElementById(cityName).style.display = \"block\";\n evt.currentTarget.className += \" active\";\n}", "function openTab(tab, success, table){\n tabcontent = document.getElementsByClassName(\"tabcontent\");\n successcontent = document.getElementsByClassName(\"successcontent\");\n tablecontent = document.getElementsByClassName(\"tablecontent\");\n\n for (var i = 0; i < tabcontent.length; i++) {\n tabcontent[i].style.display = \"none\";\n }\n\n for (var i = 0; i < successcontent.length; i++) {\n successcontent[i].style.display = \"none\";\n }\n\n for (var i = 0; i < tablecontent.length; i++) {\n tablecontent[i].style.display = \"none\";\n }\n \n tab.style.display = \"block\";\n success.style.display = \"flex\";\n table.style.display = \"table\";\n }", "function initTabs(activeClasses,normalClasses){\n let dataTabs = document.querySelectorAll(\"[data-toggle='tab']\");\n const toggleFunction = (event) => {\n event.preventDefault();\n activeClasses = activeClasses ? activeClasses:\"bg-blue-600 text-white\";\n normalClasses = normalClasses ? normalClasses:\"text-blue-600 bg-white\";\n changeAtiveTab(event,activeClasses,normalClasses)\n }\n for (var index = 0; index < dataTabs.length; index++) {\n dataTabs[index].addEventListener(\"click\",toggleFunction);\n }\n}", "function jumpAndTab(nb){\n return formatedRow + \"\\n\" + \" \".repeat(nb);\n }", "function openContent1(tab,value){\n\tvar tabcontent = document.getElementsByClassName(\"tab-content\");\n \tfor (i = 0; i < tabcontent.length; i++) {\n \ttabcontent[i].style.display = \"none\";\n \t}\n\n \tvar tablinks = document.getElementsByClassName(\"tabLinks\");\n \tfor (i = 0; i < tablinks.length; i++) {\n \ttablinks[i].className = tablinks[i].className.replace(\" active1\", \"\");\n \t}\n\n \t document.getElementById(value).style.display = \"block\";\n \t $(\"#\"+tab).addClass(\"active1\");\n\n}", "function EztableLstTab(tbl, ide, idf) {\n $(tbl).on(\"keypress\", ide, function (e) {\n \n var keyCode = e.keyCode || e.which;\n if (keyCode == 9) {\n e.preventDefault();\n $(this).closest('tr').next('tr').find(idf).focus();\n }\n });\n }", "function showTab(tabData) {\n $('.tab__title').html(objAjax[tabData - 1].name + '<br/>');\n $('.name-service>span').text(objAjax[tabData - 1].name.toUpperCase());\n $('.tab-body').empty();\n var tr;\n var employees = objAjax[tabData - 1].employees;\n\n for (var i = 0; i < employees.length; ++i) {\n tr = $('<tr/>');\n var employee = employees[i];\n tr.append('<td class=\"employee\">' + employee.employeeName + '</td>');\n tr.append('<td class=\"price\">' + employee.price + '</td>');\n tr.append('<td class=\"price\">' + employee.commonPrice + '</td>');\n $('.tab-body').append(tr);\n }\n\n descriptionTitle = '<h3>' + objAjax[tabData - 1].name + '</h3>';\n description = '<p>' + objAjax[tabData - 1].description + '</p>';\n descriptionPs = '<p>' + objAjax[tabData - 1].descriptionPs + '</p>';\n $('.description-tab').html(descriptionTitle + description + descriptionPs);\n }", "function changeTab(tab) {\n $('#tabGroup').find(\"a[class='active']\").removeClass('active');\n switch (tab) {\n case \"editAccount\":\n $('#editAccountTab').addClass(\"active\");\n break;\n case \"viewAccount\":\n $('#viewAccountTab').addClass(\"active\");\n break;\n case \"viewPurchaseHistory\":\n $('#viewPurchaseHistoryTab').addClass(\"active\");\n break;\n case \"viewCard\":\n $('#viewCardTab').addClass(\"active\");\n break;\n case \"registerCard\":\n $('#registerCardTab').addClass(\"active\");\n break;\n case \"viewAddress\":\n $('#viewAddressTab').addClass(\"active\");\n break;\n case \"registerAddress\":\n $('#registerAddressTab').addClass(\"active\");\n break;\n\n }\n}", "function CreateVerticalTabs( VerticalObj ) {\n var tabStr = \"\"; var j = 0;\n tabStr += '<div class=\"col-xs-3\">';\n tabStr += '<ul class=\"nav nav-tabs tabs-left\">';\n \n $.each(VerticalObj, function(i, TabVal){\n if(j == 0 ) tabStr += '<li class=\"active\"><a href=\"#'+i+'\" data-toggle=\"tab\" aria-expanded=\"false\">'+TabVal+'</a></li>';\n else tabStr += '<li class=\"\"><a href=\"#'+i+'\" data-toggle=\"tab\" aria-expanded=\"false\">'+TabVal+'</a></li>';\n j ++;\n });\n\n tabStr += '</ul>';\n tabStr += '</div>';\n return tabStr;\n }", "function makeActive(tab)\n{\n for (i = 0; i < TabView.listTabs.length; i++)\n {\n let tabElement = document.getElementById(TabView.listTabs[i].getIdTab());\n tabElement.className = tabElement.className.replace(ACTIVE_TAB_CLASS, '');\n\n let content = document.getElementById(TabView.listTabs[i].getIdContent());\n content.className = content.className.replace(ACTIVE_CONTENT_CLASS, '');\n }\n\n document.getElementById(tab.getIdTab()).className += ACTIVE_TAB_CLASS;\n document.getElementById(tab.getIdContent()).className += ACTIVE_CONTENT_CLASS;\n}", "function tabify(el, className) {\n\t\t if ($(el).length) {\n\t\t\t\tif(jQuery.browser.version <= 418.8 && $.browser.safari) {\n\t\t\t\t\t$(\"body\").addClass(\"safari\");\n\t\t\t\t}\n\t\t\t\tvar container = $(el);\n\t\t\t\tcontainer.attr(\"class\", className);\n\t\t\t\t$(el + \" div h2\").click(function() {\n\t\t\t\t\tvar id = $(this).parent().attr(\"id\");\n\t\t\t\t\tcontainer.attr(\"class\", id);\n\t\t\t\t});\n\t\t }\n\t\t}", "function nextMainTab(){\n $(\"#groupstab\").show();\n $(\"#maintab\").hide();\n $(\"#t1, #t3\").removeClass(\"active\");\n $(\"#t2\").addClass(\"active\");\n}" ]
[ "0.65874857", "0.64853036", "0.64562833", "0.63400596", "0.62931657", "0.6292885", "0.6218058", "0.6187638", "0.6186259", "0.6170682", "0.61666864", "0.61550856", "0.61520565", "0.61491317", "0.6142118", "0.61413676", "0.609032", "0.60798675", "0.60660666", "0.6054934", "0.60523456", "0.60360587", "0.60249996", "0.60144466", "0.5995867", "0.5981237", "0.5978431", "0.5972833", "0.59726375", "0.5967882", "0.5960453", "0.59476954", "0.59476954", "0.5904699", "0.5895602", "0.5889677", "0.5887734", "0.58858126", "0.5879523", "0.5877558", "0.5876314", "0.5865796", "0.58641547", "0.58614254", "0.5859805", "0.5838337", "0.5832665", "0.58312196", "0.5829759", "0.5817046", "0.5809238", "0.5808888", "0.57992387", "0.57982147", "0.57711303", "0.5766682", "0.57444054", "0.57431585", "0.5735937", "0.5732624", "0.5732624", "0.5732108", "0.57317936", "0.5724116", "0.5723664", "0.571738", "0.57063705", "0.5705408", "0.5703931", "0.57034564", "0.56981784", "0.5695414", "0.5689058", "0.5688915", "0.5687854", "0.56765753", "0.5675653", "0.56682914", "0.5667867", "0.56676376", "0.5667106", "0.56661123", "0.56599426", "0.5648815", "0.56386966", "0.5638456", "0.56360686", "0.56360686", "0.5620104", "0.5617779", "0.56168866", "0.5614141", "0.56123024", "0.560716", "0.560374", "0.5602671", "0.5602457", "0.55934495", "0.559314", "0.5592309", "0.5589035" ]
0.0
-1
TO DO TAB HTML CONTROL update carousel when moved
function carouselSlid(e) { if (e.direction == "right") { nextWeek.setDate(nextWeek.getDate() - 7); shownWeek.setDate(shownWeek.getDate() - 7); lastWeek.setDate(lastWeek.getDate() - 7); console.log(lastWeek); console.log(shownWeek); console.log(nextWeek); switch(carouselPosition) { case "#week1slide": carouselPosition = "#week3slide"; buildWeekHTML(lastWeek, "#week2slide"); break; case "#week2slide": carouselPosition = "#week1slide"; buildWeekHTML(lastWeek, "#week3slide"); break; case "#week3slide": carouselPosition = "#week2slide"; buildWeekHTML(lastWeek, "#week1slide"); break; } } else { nextWeek.setDate(nextWeek.getDate() + 7); shownWeek.setDate(shownWeek.getDate() + 7); lastWeek.setDate(lastWeek.getDate() + 7); console.log(lastWeek); console.log(shownWeek); console.log(nextWeek); switch(carouselPosition) { case "#week1slide": carouselPosition = "#week2slide"; buildWeekHTML(nextWeek, "#week3slide"); break; case "#week2slide": carouselPosition = "#week3slide"; buildWeekHTML(nextWeek, "#week1slide"); break; case "#week3slide": carouselPosition = "#week1slide"; buildWeekHTML(nextWeek, "#week2slide"); break; } } $("#shownWeekHeader").text("WEEK OF " + formatDate1(shownWeek)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function moveCarousel() {\n let transformValue = carouselItemsActiveIndex * carouselWrapWidth;\n carouselList.style.transform =\n \"translate3d(-\" + transformValue + \"px, 0px, 0px)\";\n addActiveToItem();\n addTransition();\n setActivePagination();\n setButtonAttr();\n}", "_changeActive(index){\n /*remove active class from carousel items*/\n $(this._items).removeClass(this._states.isCurrentItemClass);\n $(this._jumps).removeClass(this._states.isCurrentJumpClass);\n /*target new item*/\n let itemSelector = `${this._elementSelectors.item}[${this._itemIndexAttr}=${index}]`;\n let newItem = this._carousel.find(itemSelector);\n /*target new active jump control*/\n let jumpSelector = `${this._controlSelectors.jump}[${this._itemIndexAttr}=${index}]`;\n let newJump = this._carousel.find(jumpSelector);\n /*add active class to current carousel elements*/\n $(newItem).addClass(this._states.isCurrentItemClass);\n $(jumpSelector).addClass(this._states.isCurrentJumpClass);\n /*set new index*/\n this._currentItem = index;\n }", "function addCarouselMoving($carousel)\n {\n $carousel.find('.owl-item').on('click', function(){\n if($(this).prev().hasClass('center')) {\n $carousel.trigger('next.owl.carousel');\n } else if ($(this).next().hasClass('center')) {\n $carousel.trigger('prev.owl.carousel');\n }\n });\n }", "function updateCarousel(){\n for(let i = 0; i < carouselItems.length; i++){\n carouselItems[i].classList.remove('current');\n }\n carouselItems[currentItem].classList.add('current');\n \n for (let i = 0; i < carouselIndicators.length; i++) {\n carouselIndicators[i].classList.remove('current');\n }\n carouselIndicators[currentItem].classList.add('current');\n\n // Run autoChangeItem to reset the delay to 3 seconds again:\n autoChangeItem();\n }", "function changeCarousel() {\n $slider.find(\".show\").removeClass(\"show\").fadeOut();\n $slider\n .find(\"> div\")\n .eq(position)\n .fadeIn(set.fadeSpeed)\n .addClass(\"show\");\n // The Dots\n $slider.find(\"> ul\").find(\".showli\").removeClass(\"showli\");\n $slider.find(\"> ul > li\").eq(position).addClass(\"showli\");\n }", "function moveCarousel(btn) {\n const inner = $($(btn).parent()).find(\".CustomCarousel-inner\");\n let items = inner.find(\".item\");\n let visibleItems = inner.find(\".item.Visib\").length;\n let amount = visibleItems;\n if (items.length - visibleItems < visibleItems)\n amount = items.length - visibleItems;\n\n const condition = $(btn).hasClass(\"btn-prev\");\n items.hide();\n for (let i = 0; i < amount; i++) {\n items = inner.find(\".item\");\n if (condition) {\n items[0].before(items[items.length - 1]);\n } else {\n items[items.length - 1].after(items[0]);\n }\n }\n resizeCarousel(inner.parent());\n}", "function moveCarouselOnPagination() {\n pagination.forEach((item, index) => {\n item.addEventListener(\"click\", () => {\n carouselItemsActiveIndex = index;\n moveCarousel();\n });\n });\n}", "function loadCarousel() {\n var carousel = document.getElementById(\"carousel\");\n var prev = document.getElementById(\"prev\");\n var next = document.getElementById(\"next\");\n var items = carousel.querySelectorAll('.content li');\n var counter = 0;\n var amount = items.length;\n var current = items[0];\n for (var i = 0; i < amount; ++i) {\n if (items[i].classList.contains('current')) {\n current = items[i];\n counter = i;\n break;\n }\n }\n function navigate(direction) {\n current && current.classList.remove('current');\n counter += direction;\n if (counter <= 0) {\n counter = 0;\n prev.disabled = true;\n } else {\n prev.disabled = false;\n }\n if (counter >= amount - 1) {\n counter = amount - 1;\n next.disabled = true;\n } else {\n next.disabled = false;\n }\n current = items[counter];\n if (current) {\n current.classList.add('current');\n selectedHistory = current.textContent;\n }\n }\n next.addEventListener('click', function(ev) {\n navigate(1);\n });\n prev.addEventListener('click', function(ev) {\n navigate(-1);\n });\n if (current) {\n current.classList.add('current');\n selectedHistory = current.textContent;\n }\n navigate(0);\n}", "function nextCarouselSystem(change_ix, keep_style)\n {\n if (!change_ix)\n {\n change_ix = 1;\n }\n ThemeService.playSound('systemscroll');\n self.setCarouselSystemByIndex(self.system_index + change_ix, null, keep_style);\n }", "function carouselLeftArrow(){\n $(\".carousel\").carousel('prev');\n}", "function carouselTabs() {\n var $carouselTabs = $('.carusel-tabs-text').flickity({\n cellAlign: \"left\",\n contain: true,\n wrapAround: true,\n draggable: false,\n pageDots: false,\n prevNextButtons: false\n });\n $('.carousel-tabs').on( 'click', 'li', function() {\n var index = $(this).index();\n $carouselTabs.flickity( 'select', index );\n $(this).addClass('active').siblings().removeClass('active');\n return false;\n });\n}", "function throttleCarousel() {\n\t\t\t$('.ss-carousel .pag li a').fastTabFix();\n\t\t}", "function myMoveLeft() { //ad ogni click sulla freccia di sinistra\n scrollPosition = scrollPosition - scrollChange; //sottraggo alla posizione iniziale il valore di cambiamento settato \n carousel.scrollTo(scrollPosition, 0); //vado ad assegnare la posizione finale al contenitore sull'asse x\n}", "function onLoad() {\n carousel = new Carousel();\n carousel.centerSelected();\n}", "function shiftCarousel(carousel, direction) {\n const numberOfSlides = carousel.querySelectorAll('.iw-carousel__inner img').length;\n const currentSlideIndex = Number(carousel.querySelector('.iw-carousel__indicators .active').dataset.slideTo);\n let newSlideIndex = currentSlideIndex + direction;\n if (newSlideIndex >= numberOfSlides)\n newSlideIndex = 0;\n if (newSlideIndex < 0)\n newSlideIndex = numberOfSlides - 1;\n showCarouselSlide(carousel, newSlideIndex);\n}", "function move() {\n if (step == noOfSteps - 2) {\n clearInterval(id);\n step = 0;\n elem.style.width = (new_Carousel_Page / 3) * 100 + \"%\"\n } else {\n step++;\n pos -= percentProgress[step];\n elem.style.width = pos + \"%\";\n }\n }", "function constrolSlides(ele) {\n // select controls ul element\n const ul=controls.children;\n // select ul chidren li element\n const li=ul[0].children;\n var active;\n for(let i=0;i<li.length;i++){\n if(li[i].className==\"active\"){\n // find who is now active\n active=i;\n // remove active class from all li element\n li[i].className=\"\";\n }\n }\n // add active class ro current slide\n ele.className=\"active\";\n\n var numb=(ele.id-1)-active;\n jumpSlideWidth=jumpSlideWidth+(slicktrackWidth*numb);\n slicktrack.style.marginLeft=-jumpSlideWidth + \"px\";\n}", "constructor() {\n super();\n this.__aspects = {};\n this.__items = [];\n let target = this.shadowRoot.querySelector(\"#carouselitem\");\n if (this.selected.scroll && target) {\n this._scrollIntoView([this._getParentOffset(target)]);\n if (!this.selected.zoomed) target.focus();\n }\n }", "function moveSlide (carousel,currentSlide,targetSlide) {\n // first we need to find the position of the slide \n const position = targetSlide.style.left;\n //then we use translate X to shift the slide \n //need to move the slide to the left using translate X along the x-axis\n carousel.style.transform = `translateX(-${position})`;\n toggleActive (currentSlide,targetSlide);\n}", "nextSlide() {\n this.index = this.index + 1;\n if (this.index === this.tab.length) {\n this.index = 0;\n }\n this.img.src = this.tab[this.index];\n }", "function primaryContent_itemVisibleInCallbackBeforeAnimation(carousel, item, idx, state) {\r\n\tresetPanelHandler(idx);\r\n}", "slideTo(event) {\n main = this.findElement('.carousel__body__main');\n this.imageIndex = Number(event.target.alt);\n this.currentProduct = this.products[this.imageIndex];\n this.setDetails();\n this.setDotActive(event.target);\n main.style.backgroundImage = `url(${this.products[event.target.alt].image_url})`;\n }", "function autoIncrementCarouselSlide() {\n if (!isCarouselPaused()) {\n const current = quoteContainer.querySelector('.is-active');\n const index = quotes.indexOf(current);\n transitionQuote(index + 1);\n }\n }", "function create_carousel(current){\n var newId = current.name.split(\" \").join(\"-\").toLowerCase();\n var newCaro = $('#item-placeholder').clone();\n newCaro.removeAttr(\"id\");\n newCaro.removeAttr(\"data-target\");\n newCaro.attr(\"data-target\", \"#\"+newId);\n newCaro.find('h1.name').html(current.name);\n var numOfItems = $('#pic_display .item').length;\n var newIndicator = $('<li/>').attr(\"data-slide-to\", numOfItems).attr('data-target',\"#carousel\");\n $('.carousel-indicators').append(newIndicator);\n $('#pic_display').append(newCaro);\n}", "next () {\n\t\tconsole.log(this.currentItem)\n\t\tthis.gotoItem(this.currentItem + this.slidesToScroll) // Appel de la methode gotoItem et parametres : index de l'item + nombres de slide a defiler\n\t}", "function prev(){\n // If on first item go to end, otherwise go to previous item\n if ( currentItem - 1 < 0 ){\n currentItem = carouselItems.length - 1;\n } else {\n currentItem--;\n }\n updateCarousel();\n }", "function initCarouselType() {\n var group = $('.scenario_block_origin .generic_group').clone();\n group.insertBefore($('.message_bot_area .fixedsidebar-content .text_button_next'));\n // $('.message_bot_area .fixedsidebar-content').append(group);\n generic_element_select();\n createCarouselBox(group);\n addItemCarouselBox();\n initslide();\n slideCarousel();\n}", "function DetailSlide(){\n var slidelager = $(\"#slide-room-lg\");\n var slidethumnail = $(\"#slide-room-sm\");\n \n slidelager.owlCarousel({\n singleItem : true,\n autoPlay:false,\n slideSpeed : 1000,\n navigation: false,\n pagination:false,\n transitionStyle : \"fade\",\n afterAction : syncPosition\n });\n \n slidethumnail.owlCarousel({\n slideSpeed : 1000,\n mouseDrag:false,\n navigation:true,\n navigationText:[\"<span class='prev-next-room prev-room'></span>\",\"<span class='prev-next-room next-room'></span>\"],\n itemsCustom: [[320, 3],[480, 5], [768, 6], [992, 7], [1200, 8]],\n pagination:false,\n afterInit : function(el){\n el.find(\".owl-item\").eq(0).addClass(\"synced\");\n }\n });\n \n function syncPosition(el){\n var current = this.currentItem;\n slidethumnail\n .find(\".owl-item\")\n .removeClass(\"synced\")\n .eq(current)\n .addClass(\"synced\")\n if($(\"#slide-room-sm\").data(\"owlCarousel\") !== undefined){\n center(current)\n }\n }\n \n $(\"#slide-room-sm\").on(\"click\", \".owl-item\", function(e){\n e.preventDefault();\n if($(this).hasClass('synced')){\n return false;\n }else{\n var number = $(this).data(\"owlItem\");\n slidelager.trigger(\"owl.goTo\",number);\n }\n });\n \n function center(number){\n var slidethumnailvisible = slidethumnail.data(\"owlCarousel\").owl.visibleItems;\n var num = number;\n var found = false;\n for(var i in slidethumnailvisible){\n if(num == slidethumnailvisible[i]){\n var found = true;\n }\n }\n \n if(found==false){\n if(num>slidethumnailvisible[slidethumnailvisible.length-1]){\n slidethumnail.trigger(\"owl.goTo\", num - slidethumnailvisible.length+2)\n }else{\n if(num - 1 == -1){\n num = 0;\n }\n slidethumnail.trigger(\"owl.goTo\", num);\n }\n } else if(num == slidethumnailvisible[slidethumnailvisible.length-1]){\n slidethumnail.trigger(\"owl.goTo\", slidethumnailvisible[1])\n } else if(num == slidethumnailvisible[0]){\n slidethumnail.trigger(\"owl.goTo\", num-1)\n }\n \n }\n }", "function update(){\r\n if(currentIndex === 0){\r\n $nav.find(\".prev\").hide();\r\n }else{\r\n $nav.find(\".prev\").show();\r\n }\r\n\r\n\r\n\r\n if(currentIndex === $slides.length - 1 ){\r\n $nav.find(\".next\").hide();\r\n }else{\r\n $nav.find(\".next\").show();\r\n }\r\n }", "change() {\n let activeSlide = this.selector.querySelector('.active'),\n nextSlide = !activeSlide.nextElementSibling ? this.selectorInner.children[0] : activeSlide.nextElementSibling;\n activeSlide.classList.remove('active');\n nextSlide.classList.add('active');\n }", "function changeCarousal() {\n $(\"#carousel\").find(\".show\").removeClass(\"show\").fadeOut();\n $(\"#carousel > div\").eq(position).fadeIn(changeInterval).addClass(\"show\");\n $(\"#carousel > ul\").find(\".showli\").removeClass(\"showli\");\n $(\"#carousel > ul > li\").eq(position).addClass(\"showli\");\n }", "function setCurrentPage(newPage = -1) {\n const slideNames = ['together', 'performance', 'safe'];\n const paginator = document.getElementById('db-carousel__paginator');\n let currentPage = 0;\n // Change active paginator button\n const btns = paginator.getElementsByClassName('db-carousel__paginator-btn');\n for(let i =0; i < btns.length; i++) {\n if (btns[i].classList.contains('active')) {\n toggleClass(btns[i], 'active');\n currentPage = i;\n break;\n }\n }\n if (newPage < 0) {\n newPage = (currentPage + 1) % 3;\n }\n toggleClass(btns[newPage], 'active');\n // Change active screeen\n document.getElementById('db-carousel__screen').className =\n document.getElementById('db-carousel__screen').className.replace('--' + slideNames[currentPage], '--' + slideNames[newPage]);\n const screen = document.getElementById('db-carousel__screen');\n const images = screen.getElementsByClassName('db-carousel__screen-image');\n toggleClass(images[currentPage], 'active');\n setTimeout(() => {\n const film = screen.getElementsByClassName('db-carousel__screen-film')[0];\n film.setAttribute('style', 'transform: translateX(' + (-newPage * 100 / 3) + '%)');\n toggleClass(images[newPage], 'active');\n }, 600);\n // Change active description\n const textWrapper = document.getElementById('dp-carousel__text');\n const texts = textWrapper.getElementsByClassName('dp-carousel__text-item');\n toggleClass(texts[currentPage], 'active');\n setTimeout(() => {\n textWrapper.setAttribute('style', 'transform: translateX(' + (-newPage * 100 / 3) + '%)');\n toggleClass(texts[newPage], 'active');\n }, 450);\n}", "reposSlide() {\n this.current_button.classList.toggle('scroller__page_current', false);\n this.current_button = this.paginator_buttons[Math.min(Math.max(this.current_page, 0), this.count - 1)];\n this.current_button.classList.toggle('scroller__page_current', true);\n this.move(this.current_page);\n }", "function prevItem() {\r\n hideItems();\r\n currentIndex = currentIndex > 0 ? currentIndex - 1 : slidesLength - 1;\r\n updateIndexes();\r\n showItems();\r\n }", "function updateSlidePosition() {\n for (let slide of slides) {\n slide.classList.remove('carousel_item-visible'); \n slide.classList.add('carousel_item-visible-hidden');\n }\n \n slides[slidePosition].classList.add('carousel_item-visible');\n }", "function buidCarouselView(){\n $timeout(function() {\n showBorrowerCarousel();\n }, 100);\n \n }", "function change_qs(i){\n $('.carousel').carousel(i);\n mrev(0);\n return false;\n}", "_refreshScrollerPosition() {\n this.__carouselScrollerWidth = qx.bom.element.Dimension.getWidth(\n this.__carouselScroller.getContentElement()\n );\n\n this._scrollToPage(this.getCurrentIndex());\n }", "function carouselSwipe(pos) {\n let value = currentImage\n\tif(pos==='l'){\n value = value === 0 ? images.length -1 : value -1\n setCurrentImage(value)\n }else{\n value = value === images.length -1 ? 0 : value +1\n setCurrentImage(value)\n }\n \n\t// Disparition progressive de l'ancienne image\n // document.getElementById('carousel-'+currentImg).className = 'carousel-img carousel-img-hidden';\n\t\n // // Apparition progressive de la nouvelle image\n // var displayedCarousel = document.getElementById('carousel-'+newImg);\n\t// displayedCarousel.className = 'carousel-img carousel-img-hidden';\n\t// setTimeout(function() {\n\t// \tdisplayedCarousel.className = 'carousel-img carousel-img-displayed';\n\t// },20);\n \n // // Disparition totale de l'ancienne image\n\t// setTimeout(function() {\n\t// \tdocument.getElementById('carousel-'+currentImg).className = 'carousel-img carousel-img';\n\t// },520);\n \n}", "_setEvent_jump(){\n let jumps = this._carousel.find(this._controlSelectors.jump);\n $(jumps).click((e)=>{\n let indexStr = $(e.target).attr(this._itemIndexAttr);\n let indexInt = parseInt(indexStr);\n this.jump(indexInt);\n });\n }", "function carouselAutoplay() {\n this.slider.next();\n }", "function manageControls(position) {\n $('#selected').removeAttr('id');\n $('.navItem').get(position).id = \"selected\";\n // Hide left arrow if position is first slide\n if (position == 0) { $('#leftControl').hide() }\n else { $('#leftControl').show() }\n // Hide right arrow if position is last slide\n if (position == numberOfSlides - 1) { $('#rightControl').hide() }\n else { $('#rightControl').show() }\n }", "function animHandlerNav(carouselID, status, direction) {\n var region = $(carouselID).down(); // BUG FIX! named down isnt working...\n// var region = $(carouselID).down(\".carousel-clip-region\")\n if (status == \"before\") {\n Effect.Fade(region, {to: 0.3, queue: { position:'end', scope: \"carousel\" }, duration: 0.2})\n }\n if (status == \"after\") {\n Effect.Fade(region, {to: 1, queue: { position:'end', scope: \"carousel\" }, duration: 0.2})\n }\n}", "function mycarousel_initCallback(carousel) {\n\tvar carouselID\t= carousel.list.attr('id');\n\n $('#'+carouselID).parent().parent().parent().find('.btn_next').on('click', function() {\n carousel.next();\n return false;\n });\n\n $('#'+carouselID).parent().parent().parent().find('.btn_prev').on('click', function() {\n carousel.prev();\n return false;\n });\n}", "function generateLabCarousel() {\r\n\r\n\t\tvar defaultCss = {\r\n\t\t\twidth: 100,\r\n\t\t\theight: 100,\r\n\t\t\tmarginTop: 50,\r\n\t\t\tmarginRight: 0,\r\n\t\t\tmarginLeft: 0,\r\n\t\t\topacity: 0.2\r\n\t\t};\r\n\t\tvar selectedCss = {\r\n\t\t\twidth: 150,\r\n\t\t\theight: 150,\r\n\t\t\tmarginTop: 30,\r\n\t\t\tmarginRight: -25,\r\n\t\t\tmarginLeft: -25,\r\n\t\t\topacity: 1\r\n\t\t};\r\n\t\tvar aniOpts = {\r\n\t\t\tqueue: false,\r\n\t\t\tduration: 300,\r\n\t\t\t//easing: 'cubic'\r\n\t\t};\r\n\t\tvar $car = $('#lab-carousel');\r\n\t\t$car.find('img').css('zIndex', 1).css( defaultCss );\r\n\r\n\t\t$car.children('div').each(function(i){\r\n\t\t\t$(this).data('index',i);\r\n\t\t});\r\n\r\n\t\t$car.carouFredSel({\r\n\t\t\tcircular: true,\r\n\t\t\tinfinite: true,\r\n\t\t\twidth: '100%',\r\n\t\t\theight: 250,\r\n\t\t\titems: {\r\n\t\t\t\tvisible:3,\r\n\t\t\t\tstart:1\r\n\t\t\t},\r\n\t\t\tprev: '#prev',\r\n\t\t\tnext: '#next',\r\n\t\t\tauto: false,\r\n\t\t\tswipe : {\r\n\t\t\t\tonTouch :true,\r\n\t\t\t\tonMouse :true\r\n\t\t\t},\r\n\t\t\tscroll: {\r\n\t\t\t\titems: 1,\r\n\t\t\t\tduration: 300,\r\n\t\t\t\t//easing: 'cubic',\r\n\t\t\t\tonBefore: function( data ) {\r\n\t\t\t\t\tvar $comming = data.items.visible.eq(1),\r\n\t\t\t\t\t\t$going = data.items.old.eq(1),\r\n\t\t\t\t\t\t$commingdetail = $(\"div#lab-details div\").eq($comming.data('index')),\r\n\t\t\t\t\t\t$goingdetail = $(\"div#lab-details div\").eq($going.data('index'));\r\n\r\n\t\t\t\t\t\r\n\t\t\t\t\t$goingdetail.fadeOut(100,function(){\r\n\t\t\t\t\t\t$goingdetail.siblings().hide();\r\n\t\t\t\t\t\t$commingdetail.fadeIn(300);\r\n\t\t\t\t\t});\r\n\t\t\t\t\t\r\n\r\n\t\t\t\t\t$comming.find('img').css('zIndex', 2).animate( selectedCss, aniOpts );\r\n\t\t\t\t\tdata.items.old.eq(1).find('img').css('zIndex', 1).animate( defaultCss, aniOpts );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t});\r\n\t}", "function setCarousel(num2Scroll, dir2Scroll) {\n\t\tcarousel.carouFredSel({\n\t\t\talign\t\t\t\t\t\t: \"center\",\n\t\t\twidth\t\t\t\t\t\t: \"100%\",\n\t\t\tonWindowResize\t: 'throttle',\n\t\t\titems\t\t\t\t\t\t: Math.round(window.innerWidth/200),\n\t\t\tscroll\t\t\t\t\t: window.num2Scroll,\n\t\t\tdirection : window.dir2Scroll,\n\t\t\tswipe\t\t\t\t\t\t: {\n onTouch\t\t\t: true\n },\n\t\t\tprev\t\t\t\t\t\t: {\n button\t\t\t\t: c2\n\t\t\t},\n\t\t\tnext\t\t\t\t\t\t: {\n button\t\t\t\t: c5\n\t\t\t}\n\t\t}, {\n\t\t\t\t\tdebug : false // !!! production - set to false\n\t\t});\n\t}", "function switchCtrl( activeImgElem, activeSelectorElem, nextElemLen ) {\n // if actived element's next is empty, then go to the first element\n if ( nextElemLen === 0 ) {\n switchBoxContainer.find('.imgs-content li').eq(imgCount - 1).removeClass(config.method);\n switchBoxContainer.find('.imgs-content li').eq(0).addClass(config.method);\n switchBoxContainer.find('.selector-circle li').eq(imgCount - 1).removeClass('active');\n switchBoxContainer.find('.selector-circle li').eq(0).addClass('active');\n }\n else {\n activeImgElem.removeClass(config.method).next('li').addClass(config.method);\n activeSelectorElem.removeClass('active').next('li').addClass('active');\n }\n }", "function makeCarousel(content){\n\t\tvar length = content.images.length - 1;\n\t\tvar current = 0;\n\t\taddContent(content, current);\n\t\t$(\"#carousel-surf .fa-long-arrow-right\").on(\"click\", function() {\n\t\t\tcurrent = current + 1;\n\t\t\taddContent(content, current);\n\n\t\t\tif( current > length){\n\t\t\t\tcurrent = 0;\n\t\t\t\taddContent(content, current);\n\t\t\t} \n\t\t});\n\n\t\t//when click on an arrow - slide\n\t\t//making slideshow for the carousel\n\t\t$(\"#carousel-surf .fa-long-arrow-left\").on(\"click\", function() {\n\t\t\tif( current == 0 ){\n\t\t\t\tcurrent = length;\n\t\t\t\taddContent(content, current);\n\t\t\t} else {\n\t\t\t\tcurrent = current - 1;\n\t\t\t\taddContent(content, current);\n\t\t\t}\n\t\t});\n\n\t\t//tabs\n\t\tvar text = $(\".surf-tab-text p\");\n\t\t$(\".surf-tab a\").on('click', function() {\n\t\t\t$(\".surf-tab a\").removeClass('tab-active');\n\t\t\t$(\".surf-tab-text p\").addClass('d-none');\n\n\t\t\tfor(var i = 0; i < text.length; i++){\n\t\t\t\tif( $(this).attr('data-href') == ( \"#\" + $(text[i]).attr('id')) ) {\n\t\t\t\t\t$(this).addClass('tab-active');\n\t\t\t\t\t$(text[i]).removeClass(\"d-none\");\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "function openModal(e) {\n let imageURLSArray = e.target.parentNode.dataset.images.split(','),\n mainImages = document.getElementById('main-display'),\n thumbnailImages = document.getElementById('thumbnails'),\n carousel = document.getElementById('carousel'),\n imageCounter = 0,\n tabIndexCounter = 1;\n\n mainImages.innerHTML = \"\";\n thumbnailImages.innerHTML = \"\";\n\n imageURLSArray.forEach((imageURL) => {\n let carouselItem = document.createElement('div'),\n thumbnailItem = document.createElement('div'),\n carouselImage = document.createElement('img'),\n thumbImage = document.createElement('img'),\n leftArrow = document.createElement('span'),\n rightArrow = document.createElement('span');\n\n\n carouselItem.className = imageCounter === 0 ? 'item active' : 'item';\n thumbnailItem.className = 'thumb';\n thumbnailItem.setAttribute('data-target', '#carousel');\n thumbnailItem.setAttribute('data-slide-to', imageCounter);\n carouselImage.src = imageURL;\n thumbImage.src = imageURL;\n thumbImage.setAttribute('tabIndex', tabIndexCounter);\n thumbImage.onkeypress = thumbnailActivate;\n\n\n carouselItem.appendChild(carouselImage);\n thumbnailItem.appendChild(thumbImage);\n\n\n imageCounter++;\n tabIndexCounter++;\n mainImages.appendChild(carouselItem);\n thumbnailImages.appendChild(thumbnailItem);\n })\n\n modal.style.display = \"block\";\n $('.carousel').carousel('cycle');\n\n thumbnailImages.firstChild.firstChild.focus();\n thumbnailImages.lastChild.firstChild.onblur = tabTrap;\n\n close.addEventListener('click', closeModal);\n close.setAttribute('tabIndex', 0);\n close.onblur = tabBegin;\n }", "activePrevSlider(){\n if(this.index.prev !== undefined){\n this.changeSlide(this.index.prev)\n }\n }", "update() {\n\t\tthis.slideWidth = this.slides[0].offsetWidth;\n\t\tthis.slideWidth = parseInt(this.slideWidth, 10);\n\t\tthis.scrollRight = this.slider.scrollWidth - this.slider.offsetWidth;\n\t\tlet numberCards = this.slides.length;\n\t\tlet numberCardsDisplay = getCssVariable('--number-cards')\n\t\tlet sliderWidth = numberCardsDisplay * this.slideWidth;\n\t\t// calculate and set carousel width based on 80% +/- whats needed to fit\n\t\tlet width = document.body.clientWidth * 0.8\n\t\tlet ncards = width / this.slideWidth;\n\t\twidth = Math.round(ncards * this.slideWidth);\n\t\twidth = width.toString(10) - this.gap + 'px';\n\t\tthis.slider.scrollLeft = this.gap; // initial scroll left position\n\t\tsetCssVariable('--carousel-width', width);\n\t\t// save currently selected card number\n\t\tlet urlPath = window.location.pathname;\n\t\tthis.selected = urlPath.substring(urlPath.lastIndexOf('/') + 1)\n\t\t\n\t}", "function mainSlider(){\n\n\n\t//SLIDER 1\n\t$('#carousel-example-generic').carousel({\n\t\tinterval: 10000\n\t});\n\n\t\t$('.carousel-indicators li').click(function(){\n\t\t\t$('#carousel-example-generic').carousel('pause');\n\t\t});\n\n\n\t\t//URL HASH\n\t\tvar url = document.location.toString();\n\t\tif (url.match('#')) {\n\t\t // Clear active item\n\t\t $('#carousel-example-generic .carousel-inner .item.active').removeClass('active');\n\t\t $('#carousel-example-generic .carousel-indicators li.active').removeClass('active');\n\n\t\t // Activate item number #hash\n\t\t $('.carousel-inner div:nth-child(' + url.split('#')[1] + ')').addClass('active');\n\t\t $('.carousel-indicators li:nth-child(' + url.split('#')[1] + ')').addClass('active');\n\t\t}\n\n\t\t$('#carousel-example-generic').bind('slid', function (e) {\n\t\t // Update location based on slide (index is 0-based)\n\t\t window.location.hash = \"#\"+ parseInt($('#carousel-example-generic .carousel-inner .item.active').index()+1);\n\t\t});\n\n\n}", "function resizeCarousel(carousel) {\n const parentWidth = $(carousel).width();\n const Btns = $(carousel).find(\".btn-prev , .btn-next\");\n Btns.hide();\n let inner = $(carousel).find(\".CustomCarousel-inner\");\n const items = $(inner).find(\".item\");\n let pad = $(carousel).attr(\"data-padding\");\n if (pad == NaN) pad = 0;\n\n $(items).hide();\n let widthCount = 0;\n let visibleItems = 0;\n if ($(carousel).hasClass(\"spaced\")) {\n spaced(carousel, parentWidth, items, pad);\n }\n let last;\n let i = 0;\n let maxHeight = 200;\n $(items).each(function () {\n if ($(this).height() > maxHeight) maxHeight = $(this).height();\n if (i++ > 0) $(this).css(\"padding-left\", pad + \"px\");\n else $(this).css(\"padding-left\", 0);\n $(this).removeClass(\"Last\");\n widthCount += $(this).outerWidth();\n if (widthCount < parentWidth) {\n visibleItems++;\n $(this).show();\n $(this).addClass(\"Visib\");\n last = $(this);\n } else $(this).removeClass(\"Visib\");\n });\n $(carousel).height(maxHeight + \"px\");\n if (last) last.addClass(\"Last\");\n if (items.length > visibleItems) {\n Btns.height($(carousel).height());\n Btns.show();\n }\n}", "function prev_slide(ev)\n {\n ev.preventDefault();\n if (current == 0) return; // Already at first element\n activate(current - 1); // Move the \"active\" class\n //console.log(\"prev: current = \"+current+\" t -> \"+timecodes[current]);\n seek_video();\n }", "function cb_mover(tab) {\n\n\n var style = CB_TABS_CONF[\"id_\"+tab.parentNode.parentNode.cbcid].style;\n\n // get container containing cardbox\n var container = tab.parentNode.parentNode;\n\n // mouse over selected tag => return\n if (container.selected == tab.pos) {\n return;\n }\n\n // we distinguish three cases: first, last, else\n // change images in order as follows:\n // 1: separator to left neighbour / left corner\n // 2: tab itself\n // 3: separator to right neighbour / right corner\n switch(tab.pos) {\n case 0:\n\t tab.previousSibling.className = \"cb_\"+style+\"_tab_first_on\";\n\t tab.className = \"cb_\"+style+\"_tab_center_on\";\n\t if ((container.conf.length > 0) && (container.selected == 1)) {\n\t tab.nextSibling.className = \"cb_\"+style+\"_separator_on_on\";\n\t } else {\n\t tab.nextSibling.className = \"cb_\"+style+\"_separator_on_off\";\n\t }\n\t break;\n case container.conf.length-1:\n\t if ((container.conf.length > 1) && (container.selected == container.conf.length-2)) {\n\t tab.previousSibling.className = \"cb_\"+style+\"_separator_on_on\";\n\t } else {\n\t tab.previousSibling.className = \"cb_\"+style+\"_separator_off_on\";\n\t }\n\t tab.className = \"cb_\"+style+\"_tab_center_on\";\n\t tab.nextSibling.className = \"cb_\"+style+\"_tab_last_on\";\n\t break;\n default:\n\t if (container.selected == tab.pos-1) {\n\t tab.previousSibling.className = \"cb_\"+style+\"_separator_on_on\";\n\t } else {\n\t tab.previousSibling.className = \"cb_\"+style+\"_separator_off_on\";\n }\n\t tab.className = \"cb_\"+style+\"_tab_center_on\";\n\t if (container.selected == tab.pos+1) {\n\t tab.nextSibling.className = \"cb_\"+style+\"_separator_on_on\";\n\t } else {\n\t tab.nextSibling.className = \"cb_\"+style+\"_separator_on_off\";\n\t }\n\t break;\n }\n}", "function moveToNextSlide() {\n hideAllSlides();\n\n if (slidePosition === totalSlides - 1) {\n slidePosition = 0;\n } else {\n slidePosition++;\n }\n\n slides[slidePosition].classList.add(\"carousel-item-visible\");\n}", "function moveSlide(carouselTrack, currentSlide, newSlide) {\n carouselTrack.style.transform = \"translateX(-\" + newSlide.style.left + \")\";\n currentSlide.classList.remove(\"current-slide\");\n newSlide.classList.add(\"current-slide\");\n }", "activate_() {\n getCardSlider().selectCard(this.nextCardIndex_(), true);\n }", "setCurrentState(direction) {\n\n if (direction.className == 'gallery-controls-previous') {\n this.carouselArray.unshift(this.carouselArray.pop());\n this.titleArray.unshift(this.titleArray.pop());\n } else {\n this.carouselArray.push(this.carouselArray.shift());\n this.titleArray.push((this.titleArray.shift()));\n }\n \n this.updateGallery();\n }", "function initHomeCarouselSmall() {\n $tabbedCarousel.show().owlCarousel({\n autoPlay: 4000,\n slideSpeed: 300,\n paginationSpeed: 400,\n singleItem: true,\n pagination: true,\n stopOnHover: true,\n beforeMove: function(el) {\n //el.find('img.lazy').show().lazyload();\n }\n });\n }", "function clickMove(e) {\n const elem = e.target\n currentInd = parseInt(elem.dataset.ind)\n currentTranslate = currentInd * -window.innerWidth\n prevTranslate = currentTranslate\n setSliderPosition()\n\n changeActiveDot(currentInd)\n }", "function initCarousel3up() {\n var galleryPrev = '<a href=\"\" class=\"icon icon-arrow-left no-bg\"><span class=\"is-vishidden\">Previous</span><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 500 500\" enable-background=\"new 0 0 500 500\"><path d=\"M344.5 5.3l31.7 31.6L163.1 250l213.1 213.1-31.7 31.6L99.8 250z\"/></svg></a>';\n var galleryNext = '<a href=\"\" class=\"icon icon-arrow-right no-bg\"><span class=\"is-vishidden\">Next</span><svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 500 500\" enable-background=\"new 0 0 500 500\"><path d=\"M153.5 5.3l-31.7 31.6L334.9 250 121.8 463.1l31.7 31.6L398.2 250z\"/></svg></a>';\n\n $carousel3up.show().owlCarousel({\n autoPlay: 4000,\n slideSpeed: 300,\n lazyLoad: true,\n paginationSpeed: 400,\n pagination: false,\n navigation: true,\n stopOnHover: true,\n navigationText: [galleryPrev, galleryNext],\n itemsCustom: [[0,2], [730,3], [800,2], [930,3]]\n });\n }", "function makeTeamCarousel(obj) {\n\t\tvar current = 0;\n\t\tvar max = 4;\n\t\taddTeamContent(obj, current, max);\n\n\t\t//click right\n\t\t//making slideshow\n\t\t$(\".team .fa-arrow-right\").on(\"click\", function() {\n\t\t\tcurrent = 4;\n\t\t\tmax = 8;\n\t\t\taddTeamContent(obj, current, max);\n\t\t});\n\n\t\t//click left\n\t\t//making slideshow\n\t\t$(\".team .fa-arrow-left\").on(\"click\", function() {\n\t\t\tcurrent = 0;\n\t\t\tmax = 4;\n\t\t\taddTeamContent(obj, current, max);\n\t\t\t//console.log(\"Clicked left\");\n\t\t});\n\t}", "function onTabPaneClick(e) {\n e.preventDefault();\n var $target = $(this);\n var idx = $target.index();\n var $parent = $target.parent();\n var $tabs = $parent.find('.js-tab-pane');\n var $slider = $( $parent.data('slider') );\n $tabs.removeClass('js-active');\n $target.addClass('js-active');\n $slider.slick('slickGoTo', idx);\n }", "function switchView(idx) {\n $container.find('#' + carouselID).find('.frame').attr('aria-hidden', true);\n $container.find('#' + carouselID).find('.frame').eq(idx).attr('aria-hidden', false);\n }", "updateItems(e) {\n this.__tabs = this.querySelectorAll(\"a11y-tab\");\n this.__hasIcons = true;\n if (!this.id) this.id = this._generateUUID();\n if (this.__tabs && this.__tabs.length > 0)\n this.__tabs.forEach((tab, index) => {\n if (!tab.icon) this.__hasIcons = false;\n tab.order = index + 1;\n tab.total = this.__tabs.length;\n });\n this.selectTab(this.activeTab);\n }", "next() {\n let newIndex = this.activeIndex + 1;\n\n // Wrap around indices.\n if (newIndex >= this.$slides.length) newIndex = 0;\n else if (newIndex < 0) newIndex = this.$slides.length -1;\n\n this.set(newIndex);\n }", "function tst_carousel() {\n $('.tst-carousel').owlCarousel({\n margin: 0,\n items: 1,\n loop: true,\n autoplay: true,\n autoplayTimeout: 4000,\n nav:false,\n// navText: ['<i class=\"fa fa-angle-left\"></i>', '<i class=\"fa fa-angle-right\"></i>']\n });\n }", "function updateSlideButtons(e) {\n const buttonIndex = e.target.dataset.value\n const isButtonActive = +buttonIndex === state.currentlyActiveIndex;\n\n if (!isButtonActive) {\n state.translateX = buttonIndex * -state.currentSlideElement.offsetWidth;\n state.carouselCardsContainer.style.transform = `translateX(${state.translateX}px)`;\n state.currentSlideElement.classList.remove(\"active\");\n state.carouselCards[buttonIndex].classList.add(\"active\");\n state.activeSlideButton.classList.remove(\"button-active\");\n state.carouselButtons[buttonIndex].classList.add(\"button-active\");\n\n state.currentlyActiveIndex = +buttonIndex;\n }\n}", "function carousel_init(wrap_elem,elem_of_carousel,prev_btn_elem,next_btn_elem){\r\n\t\tconst main_box = document.querySelector(`.${wrap_elem}`),\r\n\t\t elements = document.querySelectorAll(`.${elem_of_carousel}`);\r\n\t\tlet flag = 0;\r\n\t\t\r\n\t\tmain_box.addEventListener('click', (e) => {\r\n\t\t\tif(e.target.className.includes(`${prev_btn_elem}`)){\r\n\t\t\t\telements[flag].classList.remove('carousel__active');\r\n\t\t\t\tflag -= 1;\r\n\t\t\t\tif(flag < 0){\r\n\t\t\t\t\tflag = elements.length - 1;\r\n\t\t\t\t}\r\n\t\t\t\telements[flag].classList.add('carousel__active');\r\n\t\t\t}else if(e.target.className.includes(`${next_btn_elem}`)){\r\n\t\t\t\telements[flag].classList.remove('carousel__active');\r\n\t\t\t\tflag += 1;\r\n\t\t\t\tif(flag >= elements.length){\r\n\t\t\t\t\tflag = 0;\r\n\t\t\t\t}\r\n\t\t\t\telements[flag].classList.add('carousel__active');\r\n\t\t\t}\r\n\t\t\tconsole.log(flag);\r\n\t\t});\r\n\t}", "function owl_carousel_animate() {\r\n\t\t\t\r\n\t\t\t$($fullscreenSelector + '.owl-carousel[data-enable-animation=\"true\"]').each(function () {\r\n\t\t\t\t\r\n\t\t\t\tvar $owlOffsetPos \t= ($('#nectar_fullscreen_rows').length > 0) ? '200%' : 'bottom-in-view';\r\n\t\t\t\tvar $animationDelay = 0; \r\n\t\t\t\t\r\n\t\t\t\tif($(this).is('[data-animation-delay]') && \r\n\t\t\t\t$(this).attr('data-animation-delay').length > 0 && \r\n\t\t\t\t$(this).attr('data-animation') != 'false') {\r\n\t\t\t\t\t$animationDelay = $(this).attr('data-animation-delay');\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tvar $that = $(this);\r\n\t\t\t\tvar waypoint = new Waypoint({\r\n\t\t\t\t\telement: $that,\r\n\t\t\t\t\thandler: function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('animated-in')) {\r\n\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t$that.find('.owl-stage > .owl-item').each(function (i) {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tvar $that = $(this);\r\n\t\t\t\t\t\t\t\t$that.delay(i * 200).transition({\r\n\t\t\t\t\t\t\t\t\t'opacity': '1',\r\n\t\t\t\t\t\t\t\t\t'y': '0'\r\n\t\t\t\t\t\t\t\t}, 600, 'easeOutQuart');\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t$that.addClass('animated-in');\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}, $animationDelay);\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t},\r\n\t\t\t\t\toffset: $owlOffsetPos\r\n\t\t\t\t\t\r\n\t\t\t\t});\r\n\t\t\t\t\r\n\t\t\t});\r\n\t\t\t\r\n\t\t}", "render(){\n return (\n <div>\n <Carousel moveArray={this.handleMoveArray} pictures={this.state.items} amount={this.state.amount}/>\n <button className=\"navigation previous\" onClick={() => this.handleMoveArray('left')}><ion-icon name=\"arrow-back\"></ion-icon></button>\n <button className=\"navigation next\" onClick={() => this.handleMoveArray('right')}><ion-icon name=\"arrow-forward\"></ion-icon></button>\n </div>\n );\n }", "function setControls(){\n \n $( \".pointer\" ).click(function() {\n var point = $(this).attr('data-sl');\n count = point;\n initSlider(slides);\n console.log(\"clicked point:\"+point);\n });\n\n }", "function moveSlide(n) { //moveSlide untuk button prev dan next\r\n index = index+n\r\n showSlides(index);\r\n}", "function next(){\n // If on last item go back to start, otherwise go to next item\n if ( currentItem + 1 >= carouselItems.length ){\n currentItem = 0;\n } else {\n currentItem++;\n }\n updateCarousel();\n }", "function setScreen(button) {\n var parent = button.parent().parent(),\n active = parent.find('.active'),\n index = active.index() + 2,\n count = parent.find('li').length,\n target;\n\n if(button.attr('class') === 'carousel-paddles-lt')\n index = index - 2;\n\n if(index > count)\n index = 1;\n else if(index < 1)\n index = count;\n\n target = parent.find('li:nth-child(' + index + ')');\n\n active\n .css({'opacity':0})\n .removeClass('active')\n .find('.popover')\n .hide();\n\n target\n .css({'opacity':1})\n .addClass('active');\n\n animatePin(target.find('.popover'));\n\n var menu = parent.parent().parent().find('.carousel-tabs');\n\n menu\n .find('.active').removeClass('active')\n .end()\n .find('ul li:nth-child(' + index + ') a')\n .addClass('active');\n}", "function callback() {\n const images = document.getElementsByClassName(\"carousel-image\");\n const prevBttn = document.getElementById(\"prev-bttn\");\n const nextBttn = document.getElementById(\"next-bttn\");\n const totalImgs = images.length;\n let slide = 0;\n let moving = false;\n\n function disableInteraction() {\n moving = true;\n setTimeout(() => {\n moving = false;\n }, 500);\n }\n\n function moveCarouselTo() {\n if (!moving) {\n disableInteraction();\n images[0].classList.remove(\"initial\");\n for (let i = 0; i < totalImgs; i += 1) {\n images[i].classList.remove(\"prev\");\n images[i].classList.remove(\"next\");\n images[i].classList.remove(\"active\");\n }\n\n const nextSlide = slide === totalImgs - 1 ? 0 : slide + 1;\n const prevSlide = slide === 0 ? totalImgs - 1 : slide - 1;\n images[slide].classList.add(\"active\");\n images[nextSlide].classList.add(\"next\");\n images[prevSlide].classList.add(\"prev\");\n }\n }\n\n function moveToNext() {\n if (!moving) {\n if (slide === totalImgs - 1) {\n slide = 0;\n } else {\n slide += 1;\n }\n }\n moveCarouselTo(slide);\n }\n\n function moveToPrev() {\n if (!moving) {\n if (slide === 0) {\n slide = totalImgs - 1;\n } else {\n slide -= 1;\n }\n }\n moveCarouselTo(slide);\n }\n\n if (images[0]) {\n nextBttn.addEventListener(\"click\", moveToPrev);\n prevBttn.addEventListener(\"click\", moveToNext);\n }\n }", "function slide(dir) {\n let active_index = $('.active-img').index();\n let new_index;\n if (dir == 'right') {\n new_index = active_index + 1;\n if (new_index == $('.carousel').children('li').length - 1) {\n new_index = 0;\n };\n } else if (dir == 'left') {\n new_index = active_index - 1;\n if (new_index == 0) {\n new_index = $('.carousel').children('li').length - 1;\n };\n };\n slideTo(new_index);\n}", "seekTo() {\n this.dragging = false;\n this.props.seekTo(this.slider.current.value * this.props.mediaLength);\n this.props.hideThumbnail();\n }", "activeNextSlider(){\n if(this.index.next !== undefined){\n this.changeSlide(this.index.next)\n }\n }", "function caroselFunction(){\r\n $('.multi-item-carousel').carousel({\r\n interval: false\r\n });\r\n $('.multi-item-carousel .item').each(function(){\r\n var next = $(this).next();\r\n if (!next.length) {\r\n next = $(this).siblings(':first');\r\n }\r\n next.children(':first-child').clone().appendTo($(this));\r\n if (next.next().length>0) {\r\n next.next().children(':first-child').clone().appendTo($(this));\r\n } else {\r\n $(this).siblings(':first').children(':first-child').clone().appendTo($(this));\r\n }\r\n });\r\n }", "function animHandler(carouselID, status, direction) {\n var region = $(carouselID).down(); // BUG FIX! named down isnt working...\n// var region = $(carouselID).down(\".carousel-clip-region\")\n if (status == \"before\") {\n Effect.Fade(region, {to: 0.3, queue: { position:'end', scope: \"carousel\" }, duration: 0.2})\n }\n if (status == \"after\") {\n Effect.Fade(region, {to: 1, queue: { position:'end', scope: \"carousel\" }, duration: 0.2})\n }\n}", "function myFunction(){\n //console.log(carousel.getActiveIndex());\n addClass();\n setTimeout(myFunction, 500);\n}", "function tabLogic3() {\n $(\".carousel-content\").hide();\n $(\".carousel-content:first\").show();\n $(\"ul.tabs3 li:first\").addClass(\"active\");\n\n /* if in tab mode */\n $(\"ul.tabs3 li\").click(function () {\n // console.log(\"clickity\");\n $(\".carousel-content\").hide();\n var activeTab = $(this).attr(\"data-rel\");\n //console.log(activeTab);\n $(\"#\" + activeTab).fadeIn();\n\n $(\"ul.tabs3 li\").removeClass(\"active\");\n $(this).addClass(\"active\");\n });\n\n}", "function startPosition ()\n\nfunction carouselData (array) {\n\n let startPosition = 0\n let displayArticles = []\n displayArticles.push(array[startPosition], array[startPosition+1], array[startPosition+2]);\n\n const showArticle = (item) => {\n if (item.classList.contains(\"hide\")) {\n item.classList.remove(\"hide\")\n item.classList.add(\"active\")\n }\n }\n\n displayArticles.forEach(showArticle)\n \n let updateArticles = (startPosition) => {\n displayArticles.pop()\n displayArticles.push(array[startPosition], array[startPosition+1], array[startPosition+2]);\n displayArticles.forEach(showArticle)\n }\n \n const handleLeft = () => {\n if (startPosition !== 0) {\n let leftMove = startPosition - 1\n console.log(leftMove)\n updateArticles(leftMove)\n startPosition = leftMove\n }\n }\n\n const moveLeft = document.querySelector(\"#leftCarousel\");\n moveLeft.addEventListener(\"click\",handleLeft);\n\n const handleRight = () => {\n if (startPosition !== array.length) {\n let rightMove = startPosition + 1\n console.log(rightMove) \n updateArticles(rightMove)\n startPosition = rightMove\n }\n }\n\n const moveRight = document.querySelector(\"#rightCarousel\");\n moveRight.addEventListener(\"click\", handleRight);\n console.log(startPosition)\n}", "function changeSlider(index) {\n sliderItems[currentSlider].classList.remove('active');\n sliderItems[index].classList.add('active');\n\n dots[currentSlider].classList.remove('active');\n dots[index].classList.add('active');\n currentSlider = index;// điều kiện này có thể thay thế cho currentSlider++;\n number.innerHTML = (index + 1).toString().padStart(2, '0');\n\n}", "function car_click(idn,ca_lr,cr_rpt,cardir) // ca_lr 0 = prev 1 = next\n{\n\n\nif(car_rpt[idn] === \"true\")\n\t{\n\t\t\n\t\tdocument.getElementById(\"car_left_\" + idn).style.visibility = \"visible\";\n\t\tdocument.getElementById(\"car_right_\" + idn).style.visibility = \"visible\";\n\t}\n\t\n\t\nif(car_rpt[idn] === \"false\")\n\t{\n\tswitch(cardir)\n\t\t{\n\t\t\tcase 1:\n\t\t\t\t\t\tif(document.getElementById(cur_slide_number[idn][0]).className === \"item active\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdocument.getElementById(\"car_left_\" + idn).style.visibility = \"visible\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\tif(document.getElementById(cur_slide_number[idn][car_slide_array[idn] - 2]).className === \"item active\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdocument.getElementById(\"car_right_\" + idn).style.visibility = \"hidden\";\n\t\t\t\t\t\t\t}\n\n\t\t\tbreak;\n\t\t\t\t\n\t\t\tcase 0:\n\t\t\t\t\t\tif(document.getElementById(cur_slide_number[idn][1]).className === \"item active\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdocument.getElementById(\"car_left_\" + idn).style.visibility = \"hidden\";\n\t\t\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\t\tif(document.getElementById(cur_slide_number[idn][car_slide_array[idn] - 1]).className === \"item active\")\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tdocument.getElementById(\"car_right_\" + idn).style.visibility = \"visible\";\n\t\t\t\t\t\t\t}\t\t\t\n\t\t\tbreak;\t\n\t\t}\n\t}\n/*\n\tif(document.getElementById(cur_slide_number[idn][0]).className !== \"item active\")\n\t\t{\n\t\t\t//alert(\"Left Arrow On\");\n\t\t}\t\n*/\n\t\n\t\nvar carouselStatement = {\n\n \"type\": \"carousel\",\n\n \"verb\": \"interacted\",\n\n \"activity\": \"http://adlnet.gov/expapi/activities/interaction\",\n\t\t\t\t\"module\": bCurrentMod + 1, //bCurrentMod\n\t\t\t\t\"lesson\": bCurrentLsn + 1, //bCurrentLsn\n\t\t\t\t\"page\": np_num,\n\n \"objectID\": carouselid,\n\n \"extensions\":{\n\n \"slideclicked\": cur_slide,\n \"slidestotal\": car_slide_total,\n\n }\n\n}\t\n\t\t\t\t\t\tif(isXAPI){\n\t\t\t\t\t\t\t\t\tLRSSend(carouselStatement);\n\t\t\t\t\t\t\t}\t\n\t\n\t\n}", "componentDidUpdate() {\n const currentHealthBehavior = this.state.currentHealthBehavior;\n const selectedLevel = this.getData(currentHealthBehavior).get('level');\n this._forceUpdateCarousel = true;\n this.refs.carousel.goToSlide(selectedLevel - 1);\n this._resetSelectStyle(selectedLevel - 1);\n }", "function carousel_gallery_int (mc){\t\n\n\t\tmc.find(\".carousel_thumbails\").css({\"visibility\":\"hidden\", \"opacity\":0});\t\t\t\t\t\t\t\n\t\tvar current = 0,\t\t\t\t\t\n\t\t$carouselEl = mc.find(\".carousel_thumbails\"),\n\t\t$preview = $( mc.attr(\"data-link\") ),\n\t\t$carouselItems = $carouselEl.children(),\n\t\tisFullScreen = mc.hasClass(\"fullScreen\"),\n\t\tisSmoothResize = $preview.hasClass(\"smooth_resize\"),\n\t\tsmothFirstLod = true,\n\t\tnextBtn = $preview.find('.proj_next'),\n\t\tprevBtn = $preview.find('.proj_prev'),\n\t\tfullNextBtn = mc.parent().find(\".gallery_navigations a.next_button\"),\n\t\tfullPrevBtn = mc.parent().find(\".gallery_navigations a.previous_button\"),\n\t\tfullClosBtn = mc.parent().find(\".gallery_navigations a.thumbClose_btn\"),\n\t\t\n\t\tcarousel = $carouselEl.elastislide( {\n\t\t\tcurrent : current,\n\t\t\tminItems : 1,\n\t\t\tonClick : function( el, pos, evt ) {\n\t\t\t\tchangeImage( el, pos, isFullScreen);\n\t\t\t\tevt.preventDefault();\n\t\t\t},\n\t\t\tonReady : function() {\n\t\t\t\tmc.find(\".carousel_thumbails\").css({\"visibility\":\"visible\"}).animate({\"opacity\":1}, 200, \"easeInOutQuart\");\t\t\t\t \n\t\t\t\ttry{\n\t\t\t\t\tvar thu = $( mc.data(\"thu\"));\n\t\t\t\t\tvar sc = thu.find('.thumbClose_btn .btn_icon');\n\t\t\t\t\tvar cc = thu;\n\t\t\t\t\tthu.css({\"visibility\":\"visible\"});\n\t\t\t\t\t/*if(!isTouch && !self.mobile){\n\t\t\t\t\t\tthu.removeClass(\"mobileView\");\n\t\t\t\t\t\tif(thu.width()<15){\n\t\t\t\t\t\t\tsc.text(\"OPEN\");\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tsc.text(\"CLOSE\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}else{*/\n\t\t\t\t\tif(self.alignPgHor && !isTouch){\n\t\t\t\t\t\tele.mCustomScrollbar(\"update\");\n\t\t\t\t\t\tele.mCustomScrollbar(\"scrollTo\",\"top\");\t\n\t\t\t\t\t}\n\t\t\t\t\t\tthu.addClass(\"mobileView\");\n\t\t\t\t\t\tsc.children(\":first-child\").text(\"Thumbnails\");\t\n\t\t\t\t\t\t\n\t\t\t\t//\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif(sc.data(\"firLod\") === undefined){\n\t\t\t\t\t\tsc.data(\"firLod\", true);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tprevBtn.css({\"opacity\":.5});\n\n\t\t\t\t\tnextBtn.click(function(){ goNextSlider(); });\t\t\t\t\t\n\t\t\t\t\tprevBtn.click(function(){ goPrevSlider(); });\n\t\t\t\t\tfullNextBtn.click(function(){ goNextSlider(); });\n\t\t\t\t\tfullPrevBtn.click(function(){ goPrevSlider(); });\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tfullNextBtn.hover(function(){\n\t\t\t\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"nx\");\n\t\t\t\t\t\tif(mc.data(\"thu\").hasClass(\"miniView\")){\n\t\t\t\t\t\t\tvar cur = $carouselEl.children().length-1 > $carouselEl.data(\"cur\") ? $carouselEl.data(\"cur\")+1 : 0;\n\t\t\t\t\t\t\tcarousel._slideToItem(cur);\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\t\n\t\t\t\t\tfullPrevBtn.hover(function(){\n\t\t\t\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"pr\");\n\t\t\t\t\t\tif(mc.data(\"thu\").hasClass(\"miniView\")){\n\t\t\t\t\t\t\tvar cur = $carouselEl.data(\"cur\") > 0 ? $carouselEl.data(\"cur\")-1 : $carouselEl.children().length-1;\n\t\t\t\t\t\t\tcarousel._slideToItem(cur);\n\t\t\t\t\t\t}\n\t\t\t\t\t},function(){\n\t\t\t\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"nx\");\t\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\tfullClosBtn.click(function(){\t\t\t\t\t\t\n\t\t\t\t\t\tif(!mc.data(\"thu\").hasClass(\"miniView\")){\n\t\t\t\t\t\t\tvar ccc = $carouselEl.data(\"cur\");\n\t\t\t\t\t\t\tif($carouselEl.data(\"cur\") < 3 || $carouselEl.data(\"cur\") > $carouselEl.children().length-5){\n\t\t\t\t\t\t\t\tccc = $carouselEl.data(\"cur\") < 3 ? 3 : $carouselEl.children().length-5;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tcarousel._slideTo(ccc);\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\n\t\t\t\t} catch(e){ }\n\t\t\t\t\t\n\t\t\t\t\tif($preview !== undefined){\n\t\t\t\t\t\ttry{\t\t \n\t\t\t\t\t\t$(function() {\t\n\t\t\t\t\t\t\t$preview.swipe( {\n\t\t\t\t\t\t\t\t//Generic swipe handler for all directions\n\t\t\t\t\t\t\t\tswipe:function(event, direction, distance, duration, fingerCount) {\n\t\t\t\t\t\t\t\t\tif(direction === \"left\"){\n\t\t\t\t\t\t\t\t\t\tgoNextSlider();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tif(direction === \"right\"){\n\t\t\t\t\t\t\t\t\t\tgoPrevSlider();\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\tallowPageScroll : \"vertical\",\n\t\t\t\t\t\t\t\t//Default is 75px, set to 0 for demo so any distance triggers swipe\n\t\t\t\t\t\t\t\tthreshold:swipeThreshold\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\t\n\t\t\t\t\t }catch(e){}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"nx\");\n\t\t\t\t\tchangeImage( $carouselItems.eq( current ), current, isFullScreen );\n\t\t\t\t} \n\t\t\t\t\t \n\t\t\t});\n\t\t\n\t\tvar interval;\n\t\t\n\t\tfunction goNextSlider(){\n\t\t\t\n\t\t\tif($carouselItems.length-1 > current){\t\t\t\t\t\t\t\n\t\t\t\t current = current+1;\t\n\t\t\t}else{\n\t\t\t\t current = 0;\n\t\t\t}\n\t\t\t\t\t\t\t\t\t\n\t\t\t$carouselItems.removeClass( 'current-img' );\n\t\t\t$carouselItems.eq( current ).addClass( 'current-img' );\n\t\t\tif(!$($carouselEl).parent().parent().parent().hasClass(\"withoutThumb\")){\n\t\t\t\tcarousel.setCurrent( current );\t\t\t\n\t\t\t\tcarousel._slideToItem(current);\t\t\t\t\t\n\t\t\t}\n\t\t\tchangeImage( $carouselItems.eq( current ), current, false );\t\t\t\n\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"nx\");\t\t\t \t\t\t\n\t\t}\n\t\t\n\t\tfunction goPrevSlider(){\n\t\t\tif(current > 0){\t\t\t\t\t\t\t\n\t\t\t\tcurrent = current - 1;\t\n\t\t\t}else{\n\t\t\t\tcurrent = $carouselItems.length-1;\n\t\t\t}\t\t\t\t\n\t\t\t$carouselItems.removeClass( 'current-img' );\n\t\t\t$carouselItems.eq( current ).addClass( 'current-img' );\n\t\t\tif(!$($carouselEl).parent().parent().parent().hasClass(\"withoutThumb\")){\n\t\t\t\tcarousel.setCurrent( current );\t\t\t\n\t\t\t\tcarousel._slideToItem(current);\n\t\t\t}\n\t\t\tchangeImage( $carouselItems.eq( current ), current, false );\t\t\t\n\t\t\tmc.data(\"thu\").data(\"cHovBtn\", \"px\");\n\t\t}\n\t\t\t\n\t\tfunction changeImage( el, pos, isFullScreen ) {\t\n\t\t\t\t\t\n\t\t\tif(isSmoothResize && !smothFirstLod){\n\t\t\t\t$preview.css({\"height\":$preview.height()+ parseInt($preview.css(\"padding-top\"))});\t\t\t\t\n\t\t\t}\t\n\t\t\t\n\t\t\t$(\"body\").mainFm('fullScreenGallery', $preview);\t\t\t\t\t\n\n\t\t\tvar nn = 0;\t\t\n\t\t\t\n\t\t\tvar inAnimat = $preview.attr(\"data-animated-in\") !== undefined ? $preview.attr(\"data-animated-in\") : aniInEff;\n\t\t\tvar outAnimat = $preview.attr(\"data-animated-in\") !== undefined ? $preview.attr(\"data-animated-out\") : aniOutEff;\t\t\t\n\t\t\t\t\t\n\t\t\t$preview.data(\"startLoaded\", false);\n\t\t\t\n\t\t\tfunction resetImg (mc, in_, out_){\n\t\t\t\t$preview.data(\"startLoaded\", true);\t\t\t\t\t\t\t\n\t\t\t\tmc.css({\"left\": -$preview.width()}).hide();\t\t\t\t\t\t \n\t\t\t\tmc.removeClass(in_ + out_);\t\n\t\t\t};\n\t\t\t\t\t\t \n\t\t\t$preview.find(\".carousel_item\").each(function(){\t\t\t\t\n\t\t\t\tif(\"#\"+$(this).attr(\"id\") != el.data( 'preview')){\n\t\t\t\t\tclearInterval(interval);\n\t\t\t\t\t\n\t\t\t\t\tif( $(this).css(\"display\") !== \"none\"){\n\t\t\t\t\t\tnn++;\n\t\t\t\t\t \n\t\t\t\t\t\t var kk = -5;\n\t\t\t\t\t\t var self = $(this);\n\t\t\t\t\t\t var aniInTyp = aniInEff;\n\t\t\t\t\t\t var aniOutTyp = aniOutEff;\n\t\t\t\t\t\t \n\t\t\t\t\t\t var mc_ = $(this);\n\t\t\t\t\t\t var jj = 0;\n\t\t\t\t\t\t \n\t\t\t\t\t\t$(this).find('[data-animated-out]').each(function(){\n\t\t\t\t\t\t var mc = mc_ = $(this);\n\t\t\t\t\t\t mc.stop();\n\t\t\t\t\t\t jj++;\n\t\t\t\t\t\t aniInTyp = mc.attr(\"data-animated-in\") !== undefined ? mc.attr(\"data-animated-in\") : aniInTyp;\n\t\t\t\t\t\t aniOutTyp = mc.attr(\"data-animated-out\") !== undefined ? mc.attr(\"data-animated-out\") : aniOutTyp;\n\t\t\t\t\t\t \n\t\t\t\t\t\t if(cssAnimate){\n\t\t\t\t\t\t \t\tmc.removeClass(aniInTyp).addClass(aniOutTyp).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\n\t\t\t\t\t\t\t \t\tresetImg($(this),aniInTyp, aniOutTyp );\t\t\t\t\t \n\t\t\t\t\t\t\t\t});\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t mc.animate({\"left\":-25, \"opacity\":0},500, \"easeInOutQuad\", function(){\n\t\t\t\t\t\t\t \tresetImg($(this),aniInTyp, aniOutTyp );\n\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 \n\t\t\t\t\t if(jj == 0){\t\t\n\t\t\t\t\t \n\t\t\t\t\t if(cssAnimate){\t\t\t \t\t\t\t \t\t\t\t\t \n\t\t\t\t\t\tmc_.removeClass(inAnimat).addClass(outAnimat).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\n\t\t\t\t\t\t\tresetImg($(this),inAnimat, outAnimat );\t\t\t\t \n\t\t\t\t\t\t});\t\t\t\t\t\t\n\t\t\t\t\t }else{\n\t\t\t\t\t\t mc_.animate({\"left\":-25, \"opacity\":0},500, \"easeInOutQuad\", function(){\n\t\t\t\t\t\t\t resetImg($(this),inAnimat, outAnimat );\n\t\t\t\t\t\t });\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t}\t\t\t\t \n\t\t\t});\n\t\t\t\n\t\t\tif(nn === 0){\n\t\t\t\t$preview.data(\"startLoaded\", true);\n\t\t\t}\n\t\t\t\n\t\t\tinterval =\tsetInterval(function(){\n\n\t\t\t\tif($preview.data(\"startLoaded\") == undefined){\n\t\t\t\t\tclearInterval(interval); \n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif($preview.data(\"startLoaded\")){\n\t\t\t\t\tclearInterval(interval); \n\t\t\t\t\t\n\t\t\t\t\t var itm = $preview.find(el.data('preview'));\t\n\t\t\t\t\t itm.css({\"left\": $preview.width()});\n\t\t\t\t\t \n\t\t\t\t\t itm.find(\"a.lazyload\").each(function(){\t\n\t\t\t\t\t\tvar dd = $(this);\t\t\n\t\t\t\t\t\t$(\"body\").mainFm('lazyLoadInt', $(this))\n\t\t\t\t\t });\n\t\t\t\t\t \n\t\t\t\t\t itm.find(\"a.lazyload_gallery\").each(function(){\n\t\t\t\t\t\t var dd2 = $(this);\t\t\n\t\t\t\t\t\t $(\"body\").mainFm('lazyLoadInt', $(this))\n\t\t\t\t\t });\n\t\t\t\t\t \n\t\t\t\t\t var pattern = $preview.find(\".overlayPattern\");\n\t\t\t\t\t if(!isTouch){\t\n\t\t\t\t\t\tpattern.show();\n\t\t\t\t\t\t $(this).find(\".addVideo\").each(function(){\n\t\t\t\t\t\t\t$(this).find(\".overlayPattern\").show();\n\t\t\t\t\t\t\tpattern.hide();\n\t\t\t\t\t\t});\n\t\t\t\t\t }else{\n\t\t\t\t\t\t pattern.hide();\n\t\t\t\t\t }\n\t\t\t\t\t \n\t\t\t\t\t var kk = -5;\n\t\t\t\t\t var mc_ = itm;\n\t\t\t\t\t var leng = 0;\n\t\t\t\t\t var aniTyp = inAnimat;\n\t\t\t\t\t \t\t\t\t \n\t\t\t\t\t itm.find('[data-animated-in]').each(function(){\n\t\t\t\t\t\t var mc = mc_ = $(this);\n\t\t\t\t\t\t leng = leng + 1;\n\t\t\t\t\t\t mc.stop();\t\t\t\t\t\t\t\n\t\t\t\t\t\t var aniTyp = mc.attr(\"data-animated-in\") !== undefined ? mc.attr(\"data-animated-in\") : inAnimat;\n\t\t\t\t\t\t mc.data(\"in\", aniTyp)\n\t\t\t\t\t\t kk = !isNaN(mc.attr(\"data-animated-time\")) && mc.attr(\"data-animated-time\") > kk ? Number(mc.attr(\"data-animated-time\")) : kk+5;\n\t\t\t\t\t\t var aniTim = !isNaN(mc.attr(\"data-animated-time\")) ? 100*mc.attr(\"data-animated-time\") : 100*(kk);\t\t\t\t\t\t\n\t\t\t\t\t\t mc.removeClass(aniTyp);\n\t\t\t\t\t\t mc.css({\"visibility\":\"hidden\"});\t\t\t\t\t\t \n\t\t\t\t\t\t setTimeout(function(){\n\t\t\t\t\t\t\t if(cssAnimate){\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t mc.css({\"visibility\":\"visible\"}).removeClass(aniTyp).addClass(aniTyp).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\n\t\t\t\t\t\t\t\t\t $(this).removeClass($(this).data(\"in\"));\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t });\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t }else{\n\t\t\t\t\t\t\t\t mc.css({\"opacity\":0, \"left\":-25, \"visibility\":\"visible\"}).show().animate({\"opacity\":1, \"left\":0},500, \"easeInOutQuad\", function(){\n\t\t\t\t\t\t\t\t\t $(this).removeClass($(this).data(\"in\"));\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\t\n\t\t\t\t\t\t }, aniTim );\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t });\n\t\t\t\t\t \n\t\t\t\t\t if(leng === 0){\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(cssAnimate){ \t\t\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t mc_.css({\"visibility\":\"visible\"}).removeClass(aniTyp).addClass(aniTyp).one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){\n\t\t\t\t\t\t\t\t$(this).removeClass(aniTyp);\n\t\t\t\t\t\t\t\tif(isSmoothResize){\n\t\t\t\t\t\t\t\t\t$preview.delay(100).animate({\"height\": $(this).height()+ parseInt($preview.css(\"padding-top\"))}, 500 , \"easeInOutQuart\", function(){\n\t\t\t\t\t\t\t\t\t\t$preview.css({\"height\": \"auto\"});\n\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\tsmothFirstLod = false;\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t });\t\n\t\t\t\t\t\t \n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tmc_.show().css({\"visibility\":\"visible\"}).removeClass(aniTyp);\n\t\t\t\t\t\t\tif(isSmoothResize){\n\t\t\t\t\t\t\t\t$preview.animate({\"height\": mc_.height()+ parseInt($preview.css(\"padding-top\"))}, 500 , \"easeInOutQuart\", function(){\n\t\t\t\t\t\t\t\t\t$preview.css({\"height\": \"auto\"});\n\t\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsmothFirstLod = false;\t\t\n\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 \n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\t \n\t\t\t\t\t if(isFullScreen){\t\t\n\t\t\t\t\t\t itm.show().css({\"left\": 0, \"opacity\":1}).find('.resize_align').each(function(){\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t $(\"body\").mainFm('resizeImg', $(this));\n\t\t\t\t\t\t\t $(\"body\").mainFm('scroll_update');\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t});\t\n\t\t\t\t\t\t\tif(cssAnimate){\n\t\t\t\t\t\t\t\t$preview.find(el.data('preview')).stop().css({\"left\": 0, \"opacity\":0}).show()[animateSyntax]({\"opacity\": 1}, 500, \"easeInOutQuart\");\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$preview.find(el.data('preview')).show().stop().css({\"left\": 25, \"opacity\":0}).animate({\"left\": 0, \"opacity\":1},500, \"easeInOutQuad\", function(){\n\t\t\t\t\t\t\t\t $(\"body\").mainFm('scroll_update');\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}else{\n\t\t\t\t\t\t\tif(cssAnimate){ \t\n\t\t\t\t\t\t\t\t$preview.find(el.data('preview')).show().stop().css({\"left\": 0});\n\t\t\t\t\t\t\t\t $(\"body\").mainFm('scroll_update');\t\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$preview.find(el.data('preview')).show().stop().css({\"left\": 25, \"opacity\":0}).animate({\"left\": 0, \"opacity\":1},500, \"easeInOutQuad\", function(){\n\t\t\t\t\t\t\t\t $(\"body\").mainFm('scroll_update');\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\t\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t}, 50);\t\t\t\t \n \n\t\t\t\t \n\t\t\t$carouselItems.removeClass( 'current-img' );\n\t\t\tel.addClass( 'current-img' );\n\t\t\tif(!$($carouselEl).parent().parent().parent().hasClass(\"withoutThumb\")){\n\t\t\t\tcarousel.setCurrent( pos );\t\n\t\t\t}\n\n\t\t\t$carouselEl.data(\"cur\",pos);\t\t\n\t\t\t\n\n\t\t\tprevBtn.css({\"opacity\":1});\n\t\t\tnextBtn.css({\"opacity\":1});\n\t\t\t\n\t\t\tif(pos > $carouselItems.length-2){\n\t\t\t\tnextBtn.css({\"opacity\":.5});\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif(pos < 1){\n\t\t\t\tprevBtn.css({\"opacity\":.5});\n\t\t\t}\t\n\t\t\t\n\t\t\tcurrent = pos;\n\t\t\t\t\t\n\t\t\tvar tim = $carouselEl.data(\"fLod\") === undefined ? 3500 : 1200;\n\t\t\t$carouselEl.data(\"fLod\" , true)\n\n\t\t\tsetTimeout(function(){\n\t\t\t\t\n\t\t\t\tif(mc.data(\"thu\").hasClass(\"miniView\")){\n\t\t\t\t\tif(mc.data(\"thu\").data(\"cHovBtn\") === \"nx\"){\n\t\t\t\t\t\tvar cur = $carouselItems.length-1 > pos ? pos+1 : 0;\t\t\t\t\t\t\n\t\t\t\t\t\tcarousel._slideToItem(cur);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tvar cur = pos > 0 ? pos-1 : $carouselItems.length-1;\n\t\t\t\t\t\tcarousel._slideToItem(cur);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},tim);\n\n\t\t}\n\t\t\n\t\t$carouselEl.data(\"fn\",changeImage);\n\t\t$carouselEl.data(\"pl\",carousel);\n\t\t\n\t\t\n}", "function scrollCarouselPrevious() {\n\t\tvar currentId = getCarouselIdFromUrl();\n\t\tvar previousId = currentId-1;\n\n\t\tloadCarouselPage(previousId);\n\t}", "carouselHandleNext(index, e) {\n\t\tthis.setState({carouselIndex : index});\n\t\t\n\t}", "function initCarousel() {\n \"use strict\";\n try {\n var slides,\n leftButton = '<button class=\"carouselLeft\" type=\"button\" aria-label=\"Previous slide\">&#x276c;</button>',\n rightButton = '<button class=\"carouselRight\" type=\"button\" aria-label=\"Next slide\">&#x276d;</button>',\n navDotContainer,\n navDots,\n i,\n j;\n\n for (i = 0; i < carousels.length; i += 1) {\n carousels[i].classList.add(\"active\");\n carousels[i].setAttribute(\"aria-live\", \"polite\");\n // Insert buttons and attach event handlers\n carousels[i].insertAdjacentHTML(\"afterbegin\", leftButton);\n carousels[i].insertAdjacentHTML(\"beforeend\", rightButton);\n carousels[i].querySelector(\".carouselLeft\").onclick = function() {\n jumpToSlide(this.parentElement, \"previous\");\n };\n carousels[i].querySelector(\".carouselRight\").onclick = function() {\n jumpToSlide(this.parentElement, \"next\");\n };\n // Set up slides with classes to control position\n slides = carousels[i].querySelectorAll(\".slide\");\n navDotContainer = '<p class=\"navDots\">';\n for (j = 0; j < slides.length; j += 1) {\n if (j === 0) {\n slides[j].className = \"slide selected\";\n slides[j].setAttribute(\"aria-hidden\", false);\n } else {\n slides[j].className = \"slide right\";\n slides[j].setAttribute(\"aria-hidden\", true);\n }\n slides[j].dataset.index = j;\n navDotContainer += '<button type=\"button\" value=\"' + j +'\" aria-label=\"Slide ' + (j+1) +'\"></button>';\n }\n navDotContainer += '</p>';\n carousels[i].insertAdjacentHTML(\"beforeend\", navDotContainer);\n carousels[i].querySelector(\".navDots button:first-child\").className = \"current\";\n navDots = carousels[i].querySelectorAll(\".navDots button\");\n for (j = 0; j < navDots.length; j += 1) {\n navDots[j].onclick = function() {\n jumpToSlide(this.parentElement.parentElement, this.value);\n };\n }\n }\n setCarouselHeight();\n window.addEventListener(\"resize\", setCarouselHeight);\n } catch (ex) {\n console.log(ex.name + \": \" + ex.message);\n }\n }", "function moveCarousel(){\r\n\tvar carousel1 = document.getElementById(\"carousel1\");\r\n\tvar carousel2 = document.getElementById(\"carousel2\");\r\n\tif (carousel1.style.display === \"none\"){\r\n\t\tcarousel1.style.display = \"block\";\r\n\t\tcarousel2.style.display = \"none\";\r\n\t}\r\n\telse {\r\n\t\tcarousel1.style.display = \"none\";\r\n\t\tcarousel2.style.display = \"block\";\r\n\r\n\t}\r\n}", "function nextItem() {\r\n hideItems();\r\n currentIndex = currentIndex < slidesLength - 1 ? currentIndex + 1 : 0;\r\n updateIndexes();\r\n showItems();\r\n }", "previousSlide() {\n this.index = this.index - 1;\n if (this.index < 0) {\n this.index = 2;\n }\n this.img.src = this.tab[this.index];\n }", "_generateJumpButtons(){\n /*jump control wrapper*/\n let jumpWrapper = this._carousel.find(this._elementSelectors.jumpWrapper);\n /*for each item:*/\n $(this._items).each((i, v) => {\n /*give item index attribute*/\n $(v).attr(this._itemIndexAttr, i);\n /*give create jump control for item*/\n let jumpControl = `<div class=\"${this._elementClasses.jump}\" ${this._itemIndexAttr}=\"${i}\"></div>`;\n $(jumpWrapper).append(jumpControl);\n });\n this._jumps = this._carousel.find(this._controlSelectors.jump);\n }", "function prevSlide() {\n position = $slider.find(\".show\").index() - 1;\n if (position < 0) position = size - 1;\n changeCarousel(position);\n }", "function activeTab(slideIndex) {\n let prev = $('#quickSwap .slider-tab.active');\n let currentSlideQS = $('#quickSwap .slider-tab[data-selector=\"' + slideIndex + '\"]');\n prev.removeClass('active');\n currentSlideQS.addClass('active');\n }", "function case_carousel() {\n var owl = $(\"#case-slider\");\n owl.owlCarousel({\n loop: true,\n margin: 10,\n smartSpeed: 2000,\n animateIn: 'fadeIn',\n animateOut: 'fadeOut',\n responsiveClass: true,\n navigation: true,\n navText: [\"<i class='fa fa-angle-left'></i>\", \"<i class='fa fa-angle-right'></i>\"],\n nav: true,\n items: 1,\n addClassActive: true,\n dots: false,\n autoplay: false,\n autoplayTimeout: 7000,\n responsive: {\n 0: {\n nav: false,\n },\n 760: {\n nav: true,\n\n }\n }\n });\n }", "function showCarouselSlide(carousel, slideIndex) {\n const slides = carousel.querySelectorAll('.iw-carousel__item');\n const indicators = carousel.querySelectorAll('.iw-carousel__indicators li');\n addClassAndRemoveInSiblings(slides[slideIndex], 'active');\n addClassAndRemoveInSiblings(indicators[slideIndex], 'active');\n}", "function automaticallySlide(){\n\t\tactiveSlideNum++;\n\t\tif(activeSlideNum>3) activeSlideNum=1;\n\t\tactiveDot = \"dot_\" + activeSlideNum;\n\t\tactiveSlide = \"slide_\" + activeSlideNum;\n\n\t\t$(\".find_carousel .slide\").removeClass(\"active\");\n\t\t$(\".find_carousel .\" + activeSlide).addClass(\"active\");\n\n\t\t$(\".find_carousel .dot\").removeClass(\"active\");\n\t\t$(\".find_carousel .\" + activeDot).addClass(\"active\");\n\t}" ]
[ "0.7001379", "0.6867026", "0.67441565", "0.6599086", "0.65585494", "0.6520129", "0.6443169", "0.6415866", "0.6347934", "0.62898755", "0.6287182", "0.6287031", "0.6278506", "0.620447", "0.6165814", "0.61608285", "0.6141605", "0.6119438", "0.6109617", "0.6105422", "0.60960144", "0.60706335", "0.60673195", "0.6031671", "0.60271555", "0.60161185", "0.600688", "0.5989982", "0.59858775", "0.59707624", "0.59671015", "0.59630436", "0.5954111", "0.5949595", "0.59245336", "0.5923562", "0.5921915", "0.5907883", "0.5906904", "0.590415", "0.58980876", "0.58870274", "0.58784723", "0.5876621", "0.5866387", "0.58630985", "0.5855817", "0.5854905", "0.585065", "0.5836385", "0.58306485", "0.5830349", "0.58285403", "0.5821497", "0.5809638", "0.5809322", "0.5805543", "0.5802345", "0.5788779", "0.5782952", "0.57633483", "0.57619005", "0.5758736", "0.5757003", "0.57555085", "0.5748687", "0.57473785", "0.57381934", "0.573332", "0.57323354", "0.5728804", "0.57266366", "0.5724964", "0.57196224", "0.57124984", "0.5705735", "0.5696339", "0.5695653", "0.56942713", "0.56937927", "0.568637", "0.56813735", "0.56774086", "0.56701165", "0.5666668", "0.5666473", "0.56622237", "0.565643", "0.56551605", "0.5649129", "0.56490356", "0.5647707", "0.56425387", "0.56423396", "0.5642007", "0.56406295", "0.563752", "0.5636035", "0.5635391", "0.5633176", "0.56324446" ]
0.0
-1
These functions determine age on each planet
earthAge(birthday) { let today = new Date(); let myAge = (today - birthday); return Math.floor(myAge / 3.154e+10); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "calculateGalacticAge(){\n const MercuryMax = 21.12;\n const VenusMax = 54.56;\n const MarsMax = 165.44;\n const JupiterMax = 1043.68;\n if(this.planet == \"Mercury\"){\n this.planetAge = this.getMercuryAge();\n this.remainPlanetYears = Math.ceil(MercuryMax - this.planetAge);\n return;\n }else if(this.planet == \"Venus\"){\n this.planetAge = this.getVenusAge();\n this.remainPlanetYears = Math.ceil( VenusMax - this.planetAge);\n return;\n }else if(this.planet == \"Mars\"){\n this.planetAge = this.getMarsAge();\n this.remainPlanetYears = Math.ceil( MarsMax - this.planetAge);\n return;\n }else if(this.planet == \"Jupiter\"){\n this.planetAge = this.getJupiterAge();\n this.remainPlanetYears = Math.ceil( JupiterMax - this.planetAge);\n return;\n }else{\n return;\n }\n\n }", "calcAge() {\n\t\tconsole.log(2021 - this.birthYear);\n\t}", "ageMercury() {\n let mercurianAge = parseInt(this.ageEarthYears()/0.24); //I am 125 years old\n return mercurianAge;\n }", "ageEarthYears() {\n const birthdate = new Date(this.dob);\n let today = new Date();\n let calcAge = today - birthdate; \n let ageInYears = Math.floor(calcAge/(365.25 * 24 * 60 * 60 * 1000 )); // year * day * minutes per hour * seconds per minute * 1000 millisecs per sec // I am 30 years old\n\n return ageInYears;\n }", "ageVenus() {\n let venusianAge = parseInt(this.ageEarthYears()/0.62); //I am 48 years old\n return venusianAge;\n }", "mercuryYears(age) {\n let mercuryAge = age * 0.24;\n return mercuryAge;\n }", "ageJupiter() {\n let jovianAge = parseInt(this.ageEarthYears()/11.86); // I am 2.5 years old\n return jovianAge;\n }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "function calculateAge(year) {\n console.log(2020 - year);\n}", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "ageMars() {\n let martianAge = parseInt(this.ageEarthYears()/1.88); //I am 15 years old\n return martianAge;\n }", "function calculateAge(p) {\n var currentDate = new Date().getTime();\n var birth = new Date(p.birthDate).getTime();\n var day = 1000 * 60 * 60 * 24;\n var diff = currentDate - birth;\n\n var days = Math.floor(diff / day);\n var months = Math.floor(days / 31);\n var years = Math.floor(months / 12);\n\n console.log(p.name + ' tiene ' + years + ' años');\n}", "function calcAge(year) {\n\tconsole.log(2016 - year);\n}", "function calcAge(year){\n console.log(2019 - year);\n}", "getAge() {\n\n let months = 0;\n\n if (this.date) {\n\n months = (new Date().getFullYear() - this.date.getFullYear()) * 12;\n months -= this.date.getMonth() + 1;\n months += new Date().getMonth() + 1;\n\n const childChange = this.matchGrowthRange(months);\n\n return { months, childChange };\n\n }\n\n return undefined;\n\n }", "calcAge() {\n console.log(2020 - this.birthYear);\n }", "calcAge() {\n console.log(2020 - this.birthYear);\n }", "getMercuryAge() {\n return this.age * .24;\n }", "calcMercury() {\n let mercuryAge = this.age / .24;\n // 1 mercury year = ----> 0.24 earth year\n // x mercury year <------ 1 earth year\n // X * .24 = 1 * 1\n return mercuryAge;\n}", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "function calculateAge(year) {\n console.log(2019 - year);\n}", "calcAge() {\n console.log(2021 - this.birthYear);\n }", "calcAge() {\n console.log(2021 - this.birthYear);\n }", "earthAgeInDays(){\n var years = new Date();\n const EarthAge = years.getFullYear() - this.year;\n return EarthAge * 365;\n }", "function calculateAge(el) {\r\n return 2016 - el;\r\n}", "calculatePlanetYears(planetFactor) {\n let planetYears = this.earthYears / planetFactor;\n planetYears = planetYears.toFixed(2);\n\n return planetYears;\n }", "calculateAge(){\n return new Date().getFullYear() - this.birthYear;\n }", "function calculateAge (bornAge){\n return 2020-bornAge;\n}", "function calculateAge(year){\nconsole.log(2018-year); \n}", "function getAge() {\n year = born.slice(0, born.indexOf(\"-\"));\n month = born.slice(5, 7);\n day = born.slice(8);\n var today = new Date();\n var age = today.getFullYear() - year;\n var m = today.getMonth() - month;\n if (m < 0 || (m === 0 && today.getDate() < day)) {\n age--;\n }\n return age;\n }", "function getAge(people) {\n let dayToday = new Date().getDate();\n let monthToday = new Date().getMonth();\n let yearToday = new Date().getFullYear();\n for (let i = 0; i < people.length; i++) {\n let birthDate = people[i].dob;\n let birthDateSplit = people[i].dob.split(\"/\");\n birthDateSplit[0] -= 1;\n let splitDiff = [];\n splitDiff[0] = monthToday - birthDateSplit[0];\n splitDiff[1] = dayToday - birthDateSplit[1];\n splitDiff[2] = yearToday - birthDateSplit[2];\n if (splitDiff[0] < 0 || (splitDiff[0] == 0 && splitDiff[1] < 0)) {\n splitDiff[2]--;\n }\n people[i].age = splitDiff[2];\n }\n}", "function calculateAge(yearBirth) {\n console.log(2017-yearBirth);\n}", "function calcAge1(birthYear) {\r\n // const age = 2021 - birthYear\r\n // return age\r\n return 2021 - birthYear;\r\n}", "age() {\n let date = new Date();\n return date.getFullYear() - this.year;\n }", "ageEarthSeconds(){\n let ageInSecs = parseInt(this.ageEarthYears() * 365 * 24 * 60 * 60); // year * day * minutes per hour * seconds per minute \n return ageInSecs; // I am many many seconds old\n }", "function getAge(dateString) {\r\n var now = new Date();\r\n\r\n var yearNow = now.getFullYear();\r\n var monthNow = now.getMonth()+1; //starts from 0\r\n var dateNow = now.getDate();\r\n\r\n var dob = {\r\n year: dateString.substring(0,4),\r\n month: dateString.substring(5,7),\r\n day: dateString.substring(8,10)\r\n };\r\n\r\n var yearDob = dob.year;\r\n var monthDob = dob.month;\r\n var dateDob = dob.day;\r\n var age = {};\r\n var ageString = \"\";\r\n var yearString = \"\";\r\n var monthString = \"\";\r\n var dayString = \"\";\r\n\r\n\r\n yearAge = yearNow - yearDob;\r\n\r\n if (monthNow >= monthDob)\r\n var monthAge = monthNow - monthDob;\r\n else {\r\n yearAge--;\r\n var monthAge = 12 + monthNow -monthDob;\r\n }\r\n\r\n if (dateNow >= dateDob)\r\n var dateAge = dateNow - dateDob;\r\n else {\r\n monthAge--;\r\n var dateAge = 31 + dateNow - dateDob;\r\n\r\n if (monthAge < 0) {\r\n monthAge = 11;\r\n yearAge--;\r\n }\r\n }\r\n\r\n age = {\r\n years: yearAge,\r\n months: monthAge,\r\n days: dateAge\r\n };\r\n\r\n if ( age.years > 1 ) yearString = \" years\";\r\n else yearString = \" year\";\r\n if ( age.months> 1 ) monthString = \" months\";\r\n else monthString = \" month\";\r\n if ( age.days > 1 ) dayString = \" days\";\r\n else dayString = \" day\";\r\n\r\n console.log(\"pet name \" + savePetDataObj.general.name);\r\n console.log(\"age.years \" + age.years);\r\n console.log(\"age.months \" +age.months);\r\n console.log(\"age.days \" +age.days);\r\n\r\n if ( (age.years > 0) && (age.months > 0) )\r\n ageString = age.years + yearString + \" and \" + age.months + monthString;\r\n else if ( (age.years == 0) && (age.months == 0))\r\n ageString = age.days + dayString;\r\n else if ( (age.years > 0) && (age.months == 0) && (age.days == 0) )\r\n ageString = age.years + yearString +`. Happy Birthday ${savePetDataObj.general.name}!`;\r\n else if ( (age.years > 0) && (age.months > 0) )\r\n ageString = age.years + yearString + \" and \" + age.months + monthString + \" old.\";\r\n else if ( (age.years == 0) && (age.months > 0) )\r\n ageString = age.months + monthString;\r\n else if ( (age.years > 0) && (age.months == 0) )\r\n ageString = age.years + yearString;\r\n else if ( (age.years == 0) && (age.months > 0) )\r\n ageString = age.months + monthString;\r\n else ageString = \"Oops! Could not calculate age!\";\r\n\r\n return ageString;\r\n }", "function calculateAge(birthYear){\n return 2019 - birthYear;\n}", "function yourAge(birthYear){\nvar now = new Date();\n var thisYear = now.getFullYear();\n return (thisYear - birthYear);\n}", "howOld(birthday){\n \n //calculate the month difference from the current month\n //calculate the day difference from the current date\n //calculate year difference from the current year\n //put calculation in date format\n //calculate the age person\n //return the age of the person\n\n return -1;\n }", "function computeAge(i) \n {\n var todaysDate = new Date();\n var birthD = $(\"#booking_tickets_\"+ i +\"_birthdate_day\").val();\n var birthM = $(\"#booking_tickets_\"+ i +\"_birthdate_month\").val();\n var birthY = $(\"#booking_tickets_\"+ i +\"_birthdate_year\").val();\n\n if((birthM < todaysDate.getMonth()) || ((birthM == todaysDate.getMonth()) && (birthD <= todaysDate.getDate())))\n {\n var age = todaysDate.getFullYear() - birthY;\n }\n else\n {\n var age = todaysDate.getFullYear() - birthY - 1;\n } \n\n return age;\n }", "calcAge()\n {\n var age = new Date().getFullYear() - this.yearOfBirth;\n console.log(age);\n }", "age(year){\n const y = new Date().getFullYear();\n if(year<y||year>2200){\n console.log(`Enter a valid year to return person's age`);\n }else{\n age = (year-y)+this._age;\n return age;\n }\n }", "getVenusAge() {\n return this.age * .62;\n }", "calculateAge(yearOfBirth) {\n\tvar now = new Date();\n\tvar currentYear = now.getFullYear();\n\tvar age = currentYear - this.yearOfBirth;\n\treturn `${age} years old` ;\n}", "function catAge(year) {\n switch (year) {\n case 1: return 15;\n case 2: return 24;\n default: return 24 + ((year - 2) * 4)\n }\n}", "calculateAge() {\n let date_1 = new Date(age);\n let diff = Date.now() - date_1.getTime();\n var age_date = new Date(diff);\n return Math.abs(age_date.getUTCFullYear() - 1970); \n }", "function calculateAge(){\n var DOB = document.getElementById('DOB').value; //DOB = date of birth\n var DOM = document.getElementById('DOM').value; //DOM = date of measurement\n\n //convert DOB - NZ to US formatting to allow for calculations\n var DOB_US = moment(DOB, \"DD/MM/YYYY\").format(\"MM/DD/YYYY\");\n var DOBasdate = moment(DOB_US, \"MM/DD/YYYY\");\n\n //convert DOM - NZ to US formatting to allow for calculations\n var DOM_US = moment(DOM, \"DD/MM/YYYY\").format(\"MM/DD/YYYY\");\n var DOMasdate = moment(DOM_US, \"MM/DD/YYYY\");\n\n //calculate difference in days between DOM and date of birth\n var ageInDays = DOMasdate.diff(DOBasdate, 'days');\n var humanAge = convertToYearsOld(DOBasdate, DOMasdate);\n\n return [ageInDays,humanAge];\n\n\n\n\n}", "function calculateAge(year) {\n console.log(2019 - year);\n //this verweist bei normalen Aufrufe einer Funktion\n //immer auf den globalen Execution Context bzw. das Window-object \n\n console.log(this);\n}", "function getAge() {\n return _age;\n }", "function getYears(age) {\n var currentTime = new Date();\n var currentYear = currentTime.getFullYear();\n return currentYear - age;\n}", "calcAge () {\n var age = new Date().getFullYear() - this.buildYear;\n return age;\n }", "function calculateAge(birth_year) {\n var today = new Date();\n var year = today.getFullYear();\n\n console.log (\"You are \" + (year - birth_year) + \" years old.\")\n}", "function totAge() {\n let sum = 0;\n for (i = 0; i < devs.length; i++) {\n sum = devs[i].age + sum;\n }\n return sum;\n }", "function calculateAge(yearOfBirth) {\n var currentYear = new Date().getFullYear();\n var age = currentYear - yearOfBirth;\n return age;\n}", "function getDogAge(age){\n return age * 7;\n}", "function calculateAge(birthYear) {\n return 2019 - birthYear; \n //# return in equation\n }", "function calculateAge (birthYear, currentYear){\n\tvar age = currentYear- birthYear;\n\n\tconsole.log(\"You are either \" + age + \" or \" + (age-1));\n\n}", "function ShowAge()\n{\n\tlet birthDate = $(\"#name-born-info > time\");\n\tlet deathDate = $(\"#name-death-info > time\");\n\tlet born = new Date();\n\tlet age;\n\n\t//If true change it\n\tif (birthDate && birthDate.attr('datetime'))\n\t{\n\t\tdate = birthDate.attr('datetime').split('-');\n\t\tborn.setFullYear(date[0]);\n\t\tborn.setMonth(date[1] - 1);\n\t\tborn.setDate(date[2]);\n\n\t\tage = new Date() - born.getTime();\n\t\tage = age / (1000 * 60 * 60 * 24 * 365.242199);\n\n\t\tlet years = Math.floor(age);\n\t\tlet months = Math.floor((age - years) * 12);\n\t\tif (deathDate.length === 0)\n\t\t{\n\t\t\tlet container = \" <span>(Age: \" + years + \" year\" + (years === 1 ? '' : 's') + \", \" + months + \" month\" + (months === 1 ? '' : 's') + \")</span>\";\n\n\t\t\t$(container).insertAfter(birthDate);\n\t\t}\n\t}\n\n}", "function get_traveller_age(dob)\r\n\t\t{\r\n\t\t\tvar age = 0;\r\n\t\t\tif(typeof(dob)!='undefined' && dob !='') {\r\n\t\t\t\tdob=dob.split('-');\r\n\t\t\t\tvar year=parseInt(dob[0]);\r\n\t\t\t\tvar month=parseInt(dob[1])-1;\r\n\t\t\t\tvar day=parseInt(dob[2]);\r\n\t\t\t\tvar today=new Date();\r\n\t\t\t\tage=today.getFullYear()-year;\r\n\t\t\t\tif(today.getMonth()<month || (today.getMonth()==month && today.getDate()<day))\r\n\t\t\t\t{\r\n\t\t\t\t\tage--;\r\n\t\t\t\t}\r\n\t\t\t\tif(age == 0) {\r\n\t\t\t\t\tage=1;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn age;\r\n\t\t}", "getAge(){\n var today = new Date();\n var birthdate = new Date(this._birthdate);\n var age = today.getFullYear() - birthdate.getFullYear();\n var month = today.getMonth() - birthdate.getMonth();\n if (month < 0 || (month === 0 && today.getDate() < birthdate.getDate())) {\n age--;\n }\n return age;\n }", "function calculateAge (birthYear, currentYear){\n var actualAge = currentYear - birthYear;\n var anotherAge = actualAge - 1;\n console.log(\"You are either \"+ actualAge + ' or '+ anotherAge);\n}", "function age_calculator()\n{\n\tcurrent_year = 2013;\n\tbirth_year = 1988;\n\tage_1 = 2013 - 1988;\n\tage_2 = age_1 - 1;\n \n\talert(\"They are either \" + age_1 + \" or \" + age_2);\n}", "function calculateAge(birthYear, currentYear) {\n\tage1 = currentYear - birthYear;\n\tage2 = currentYear - (birthYear + 1);\n\tconsole.log(\"You are either \" + age1 + \" or \" + age2);\n}", "function calcAge(birthYear) {\n let age = 2019 - birthYear;\n console.log(`Age is ${age}`);\n}", "function calculateAge(birthYear,currentYear){\n if(birthYear == currentYear) { // to handle infants\n return \" you are below 1 year\";\n }\n // In one year our differs depending if it is befor or after the birthday month\n return \"You are either \"+ (currentYear - birthYear) +\" or \" + (currentYear - birthYear - 1 );\n\n }", "parkAge(){\n return new Date().getFullYear()-this.buildYear;\n }", "function calculateAge(element) {\n return 2016 - element;\n}", "function calculateAge(element) {\n return 2016 - element;\n}", "age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "age() {\n let age = this._ageValue();\n\n const residentTime = (this.now() - this._responseTime) / 1000;\n return age + residentTime;\n }", "function calculateAge(birthyear, currentyear) {\n\tvar lowage = currentyear - birthyear - 1;\n\tvar highage = currentyear - birthyear;\n\talert(\"You are either \" + lowage + \" or \" + highage)\n}", "function calculateAge(name, birthYears) {\n let date = new Date();\n let currentYear = date.getFullYear();\n let age = currentYear - birthYears;\n let display = name + \" is \" + age + \" years old \";\n return display;\n}", "function getAge(birth) {\r\n const today = new Date();\r\n\r\n const nowyear = today.getFullYear();\r\n const nowmonth = today.getMonth();\r\n const nowday = today.getDay();\r\n\r\n const birthyear = birth.getFullYear();\r\n const birthmonth = birth.getMonth();\r\n const birthday = birth.getDay();\r\n\r\n let age = 0;\r\n if( nowyear > birthyear ){\r\n age = nowyear - birthyear;\r\n if( nowmonth < birthmonth ){\r\n age -= 1;\r\n }\r\n else if( nowmonth === birthmonth ){\r\n if( nowday < birthday ){\r\n age -= 1;\r\n }\r\n }\r\n }\r\n\r\n return age;\r\n}", "getPlanetYearsArray() {\n let planetYearsArray = [];\n const earthFactor = 1;\n const mercuryFactor = 0.24;\n const venusFactor = 0.62;\n const marsFactor = 1.88;\n const jupiterFactor = 11.86;\n this.calculateEarthYears();\n\n planetYearsArray.push(this.calculatePlanetYears(mercuryFactor));\n planetYearsArray.push(this.calculatePlanetYears(venusFactor));\n planetYearsArray.push(this.calculatePlanetYears(marsFactor));\n planetYearsArray.push(this.calculatePlanetYears(jupiterFactor));\n\n return planetYearsArray;\n }", "function tellAge(month,day,year) {\n var myDay = new Date();\n\tvar yearNow = myDay.getFullYear();\n\tvar calYears = yearNow - year;\n\t\t\t\t var endDay = new Date(year,month,day);\n var millisecondsPerDay = 1000 * 60 * 60 * 24;\n\n var millisBetween = myDay.getTime() - endDay.getTime();\n var days = millisBetween / millisecondsPerDay;\n\n // Round down.\n var rounding = Math.floor(days);\n \n \n\nif(calYears > 1) {\n\n\treturn `You are ${calYears} years old`;\n\n}else if (calYears < 1){\n\n \n\t\treturn `You are ${rounding} days old`;\n}\n}", "function calculateAge(){\n var dob = $(\"#dob\").attr('value');\n var dayOfBirth = dob.substring(0,2);\n var monthOfBirth = dob.substring(3,5);\n var yearOfBirth = dob.substring(6,10);\n\n //Variables containg values of current date\n var today = new Date();\n var dayOfToday = parseInt(today.getDate());\n var monthOfToday = today.getMonth() + 1;\n var yearOfToday = today.getFullYear();\n\n //Variables required to calculate age.\n var yearDiff;\n if (monthOfToday > monthOfBirth){\n yearDiff = yearOfToday - yearOfBirth;\n }\n else if (monthOfToday == monthOfBirth) {\n if((dayOfToday == dayOfBirth) || (dayOfToday > dayOfBirth)) {\n yearDiff = yearOfToday - yearOfBirth;\n }\n else\n yearDiff = yearOfToday - yearOfBirth - 1;\n }\n else {\n yearDiff = yearOfToday - yearOfBirth - 1;\n }\n return yearDiff;\n}", "function calcAge1(birthYear) {\n return 2037 - birthYear;\n}", "function getAge(birth){\n birth = new Date(birth);\n let today = new Date();\n return Math.floor((today - birth) / (365.25 * 24 * 60 * 60 * 1000)).toString();\n }", "function getAge() {\n return this.age;\n}", "howOld(birthday){\n \n // convert birthday into a numeric value\n\n // convert current date into a numeric value\n\n // subtract birthday numeric value from current date value to get the numeric value of time elapsed\n\n // convert the time elapsed value into years\n\n // round down the converted years value\n\n // return the rounded years value\n\n let date = new Date().getFullYear();\n let age = date-birthyear\n \n return age;\n return -1;\n }", "function calcAge1(birthYear1) {\n return 2037 - birthYear1;\n}", "function ageDifference(person){\n var mother = byName[person.mother];\n return person.born-mother.born;\n}", "getMarsAge() {\n return this.age * 1.88;\n }", "function calculateAge(yearOfBirth) {\n var age = parseFloat(2018 - yearOfBirth);\n return age\n}", "function ageCalculator(birthYear){\n let currentYear = 2021;\n console.log(`your age is ${currentYear-birthYear}`);\n\n}", "function outputAges(age, homeplanet) {\n\n if(setUnits=='Seconds'){\n var earthYears = age / 31557600;\n } else if(setUnits=='Days'){\n var earthYears = age / 365.25;\n } else {\n var earthYears = planets[homeplanet] * age;\n }\n\n var tableData = '';\n\n Object.keys(planets).forEach(function (key) {\n\n\n tableData += '<p class=\"' + key.toLowerCase() + '\"><span>' + (earthYears / planets[key]).toPrecision(5) + '</span><span class=\"planet\"> ' + key + '</span> years' + '</a>';\n\n\n\n });\n\n console.log(tableData);\n document.getElementById('results').innerHTML = tableData;\n\n }", "function avgAge(...parks) {\n let totalAge = 0;\n parks.forEach(park => totalAge += new Date().getFullYear() - park.builtYear);\n console.log(`Our ${parks.length} parks have an average age of ${(totalAge / parks.length).toFixed(2)} years.`)\n}", "function getAge(birthday) {\n var ageDifMs = Date.now() - birthday;\n var ageDate = new Date(ageDifMs); // miliseconds from epoch\n //console.log(Date.now().getDay());\n var today = new Date();\n var mesPrueba = today.getMonth() - ageDate.getMonth();\n var edadTentativa = ageDate.getUTCFullYear() - 1970;\n /*Se obtiene la edad exacta, considerando si no ha llegado el mes de cumpleaños o\n si ya ha llegado el mes pero no el dia, entonces se restara 1 año a la edadTentiva obteniendo \n la edad real*/\n if (mesPrueba<0 || (mesPrueba===0 &&(today.getDate()-ageDate.getDate())<0)) {\n edadTentativa = edadTentativa - 1;\n }\n return Math.abs(edadTentativa);\n}", "getJupiterAge() {\n return this.age * 11.86;\n }", "function calculateArmandoAge() {\n // Calculate age, Armando was born on May 13, 2000.\n const diffMs = new Date() - new Date(2000, 5, 13);\n const ageDt = new Date(diffMs);\n\n // Add it to the page.\n const ageContainer = document.getElementById('armando-age-container');\n ageContainer.innerText = Math.abs(ageDt.getUTCFullYear() - 1970);\n\n}", "function addAges(born) {\n //find all the films, this in includes things like producer and writer\n var links = document.evaluate(\n \"//div[contains(@class,'filmo')]/ol/li\",\n document,\n null,\n XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,\n null);\n\n //loop round each film\n for (var i = 0; i < links.snapshotLength; i++) {\n\t\t\tvar link = links.snapshotItem(i);\n\t\t\t//extract the year of the film\n\t\t\tyearindex = link.innerHTML.search(\"\\\\([0-9]{4}\\\\)\")\n\t\t\tif(yearindex>0) {\n\t\t\t\tvar filmborn = link.innerHTML.substring(yearindex + 1,\n\t\t\t\t\tyearindex + 5);\n\t\t\t\t//calculate ages\n\t\t\t\tvar filmage = new Date().getFullYear() - filmborn;\n\t\t\t\tvar age = filmborn - born;\n\t\t\t\tage = new String(age +\n\t\t\t\t\t\" year\" + (age == 1 ? '' : 's') + \" old\");\n\n\t\t\t\t//get them in a nice format\n\t\t\t\tif (filmage < 0) {\n\t\t\t\t\tvar agetxt = new String(\n\t\t\t\t\t\t\"in \" +\n\t\t\t\t\t\tMath.abs(filmage) + \" year\" +\n\t\t\t\t\t\t(Math.abs(filmage) == 1 ? '' : 's') +\n\t\t\t\t\t\t\" will be \" + age);\n\t\t\t\t}\n\t\t\t\tif (filmage == 0) {\n\t\t\t\t\t\tvar agetxt = new String(\n\t\t\t\t\t\t\t\t\"this year while \" + age);\n\t\t\t\t}\n\t\t\t\tif (filmage > 0) {\n\t\t\t\t\tvar agetxt = new String(\n\t\t\t\t\t\tMath.abs(filmage) + \" year\" +\n\t\t\t\t\t\t(Math.abs(filmage) == 1 ? '' : 's') +\n\t\t\t\t\t\t\" ago while \" + age);\n\t\t\t\t}\n\n\t\t\t\tlink.innerHTML =\n\t\t\t\t\tlink.innerHTML.substring(0, yearindex + 5)\n\t\t\t\t\t+ \", \" + agetxt\n\t\t\t\t\t+ link.innerHTML.substring(yearindex + 5);\n\t\t\t}\n }\n}", "function Person1(name, dob) {\n this.name = name;\n this.dob = new Date(dob);\n this.calculateAge = function () {\n var diff_ms = Date.now() - this.dob.getTime();\n var age_dt = new Date(diff_ms);\n\n return Math.abs(age_dt.getUTCFullYear() - 1970);\n };\n console.log(this.calculateAge());\n}", "function calcAge1(birthYeah) {\n return 2037 - birthYeah;\n}", "function calcAge4(birthYear4, firstName4) {\n const age4 = 2020 - birthYear4;\n console.log(`${firstName4} is ${age4} years old.`);\n return age4;\n}", "function calculateAge(birthMonth, birthDay, birthYear) {\n\n // Get Todays Date\n var todayDate = new Date(),\n todayYear = todayDate.getFullYear(),\n todayMonth = todayDate.getMonth(),\n todayDay = todayDate.getDate();\n\n // Calculate Age\n var age = todayYear - birthYear;\n\n // Check month discrepancies\n if (todayMonth < (birthMonth - 1)) {\n age--;\n }\n\n // Check day discrepancies\n if (((birthMonth - 1) == todayMonth) && (todayDay < birthDay)) {\n age--;\n }\n\n // @return {Number} age\n return age;\n }", "function calculateDogAge(age) {\n var dogYears = 7 * age;\n console.log(\"Your doggie is \" + dogYears + \" years old in dog years!\");\n}" ]
[ "0.78215367", "0.7088235", "0.69984317", "0.69855535", "0.69116414", "0.6895201", "0.68357295", "0.67922795", "0.6781478", "0.6771395", "0.6771395", "0.6740703", "0.6733545", "0.6719946", "0.671888", "0.67046946", "0.67045563", "0.67045563", "0.670068", "0.6685058", "0.66843224", "0.66843224", "0.66843224", "0.66843224", "0.66691697", "0.66671896", "0.66671896", "0.66569775", "0.6652963", "0.66004366", "0.65965927", "0.6586392", "0.6584002", "0.6544529", "0.6512664", "0.6507849", "0.6480784", "0.6467966", "0.6453111", "0.6437159", "0.64313203", "0.64309585", "0.6429492", "0.6390179", "0.638548", "0.63664657", "0.63334507", "0.6319936", "0.6293014", "0.628462", "0.6274614", "0.62721753", "0.62549776", "0.6233029", "0.6214251", "0.6194852", "0.6191796", "0.6188325", "0.61826384", "0.61742616", "0.6146932", "0.6145218", "0.6139372", "0.61381584", "0.61378694", "0.6132521", "0.61184275", "0.61117965", "0.6105312", "0.60723656", "0.60668397", "0.60668397", "0.60663813", "0.60663813", "0.6064087", "0.6059204", "0.6051409", "0.60446036", "0.60386664", "0.60220224", "0.60111165", "0.6003238", "0.60002905", "0.5990799", "0.5988756", "0.5982301", "0.598085", "0.5979043", "0.59787536", "0.59627676", "0.5959042", "0.5949575", "0.5910407", "0.5910215", "0.5907406", "0.5897744", "0.58957446", "0.5893765", "0.588558", "0.5883145" ]
0.6462526
38
These functions calculate how much time left the user would have if they lived on other planets
mercuryTimeLeft() { let timeLeftMercury = this.timeLeft / 0.24; return timeLeftMercury; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function get_time_left() {\n return (escrow_amount / price_per_second) - time_spent;\n}", "function culcTimeLeftStore1() {\n let totalTime = 120;\n\n let distanceToStore1 = 10;\n\n let myHome = 0;\n\n let distanceFromMeToStore1 = myHome + distanceToStore1 * 2 + 5;\n\n let result = totalTime - distanceFromMeToStore1;\n\n return result;\n}", "_getRemainingTime()\r\n {\r\n // Get time remaining in seconds.\r\n let timeRemaining = this._getRemainingDistance() / this._getAverageSpeed();\r\n if (timeRemaining === Infinity){\r\n timeRemaining = NaN\r\n }\r\n return timeRemaining\r\n }", "_countLostPolyglots(time) {\n\t\tconst unableToActTime = this.unableToAct.getDowntimes().filter(downtime => Math.max(0, downtime.end - downtime.start) >= ASTRAL_UMBRAL_DURATION).reduce((duration, downtime) => duration + Math.max(0, downtime.end - downtime.start), 0)\n\t\treturn Math.floor((time - unableToActTime)/ENOCHIAN_DURATION_REQUIRED)\n\t}", "function reduceTime() {\n timeLeft = timeLeft - 10;\n}", "timeLeft() {\n if (!this.currentTimeout) {\n return 0\n }\n\n const now = new Date().getTime()\n return (this.currentTimeout.getTime() - now) / 1000\n }", "estimatedTime(peak) {\n // The estimated time depends on the distance in blocks\n // and whether the trip is occurring during peak hours or off peak hours.\n\n if (peak === true) {\n // while during peak hours\n // - two blocks in a minute.\n console.log(this.blocksTravelled()/2)\n let blocksOnPeak = this.blocksTravelled()/ 2;\n return Math.ceil(blocksOnPeak)\n } else {\n // During off peak hours,\n // - three blocks in a minute,\n console.log(this.blocksTravelled()/3)\n let blocksOnPeak = this.blocksTravelled()/ 3;\n return Math.ceil(blocksOnPeak)\n }\n }", "get efficiency() {\n\t\treturn this.passengers.length / this.travelTime;\n\t}", "function totalRace() {\n return player1Time + player2Time;\n }", "function getCurrentTournamentTimeLeft() {\n\tconst currentDate = new Date();\n\tconst endDate = new Date();\n\tendDate.setUTCDate(currentDate.getUTCDate() + 1);\n\tendDate.setUTCHours(0);\n\tendDate.setUTCMinutes(0);\n\tendDate.setUTCSeconds(0);\n\tendDate.setUTCMilliseconds(0);\n\treturn getTimeDifference(endDate, currentDate);\n}", "passTime () {\n let time = this.player.castTimeRemaining\n if (time == 0 || (this.player.gcdRemaining > 0 && this.player.gcdRemaining < time)) time = this.player.gcdRemaining\n\n // Look for the shortest time until an action needs to be done\n if (this.player.pet) {\n\n // Pet's attacks/abilities and such\n if (this.player.pet.mode == PetMode.AGGRESSIVE) {\n if (this.player.pet.spells.melee && this.player.pet.spells.melee.cooldownRemaining < time) time = this.player.pet.spells.melee.cooldownRemaining\n else if (this.player.pet.type == PetType.RANGED && this.player.pet.castTimeRemaining > 0 && this.player.pet.castTimeRemaining < time) time = this.player.pet.castTimeRemaining\n\n if (this.player.pet.pet == PetName.SUCCUBUS) {\n if (this.player.pet.spells.lashOfPain.cooldownRemaining > 0 && this.player.pet.spells.lashOfPain.cooldownRemaining < time) time = this.player.pet.spells.lashOfPain.cooldownRemaining\n } else if (this.player.pet.pet == PetName.FELGUARD) {\n if (this.player.pet.spells.cleave.cooldownRemaining > 0 && this.player.pet.spells.cleave.cooldownRemaining < time) time = this.player.pet.spells.cleave.cooldownRemaining\n }\n }\n }\n\n if (this.player.auras.corruption && this.player.auras.corruption.active && this.player.auras.corruption.tickTimerRemaining < time) time = this.player.auras.corruption.tickTimerRemaining\n if (this.player.auras.siphonLife && this.player.auras.siphonLife.active && this.player.auras.siphonLife.tickTimerRemaining < time) time = this.player.auras.siphonLife.tickTimerRemaining\n if (this.player.auras.flameshock && this.player.auras.flameshock.active && this.player.auras.flameshock.tickTimerRemaining < time) time = this.player.auras.flameshock.tickTimerRemaining\n if (this.player.auras.curseOfAgony && this.player.auras.curseOfAgony.active && this.player.auras.curseOfAgony.tickTimerRemaining < time) time = this.player.auras.curseOfAgony.tickTimerRemaining\n if (this.player.auras.curseOfTheElements && this.player.auras.curseOfTheElements.active && this.player.auras.curseOfTheElements.durationRemaining < time) time = this.player.auras.curseOfTheElements.durationRemaining\n if (this.player.auras.curseOfRecklessness && this.player.auras.curseOfRecklessness.active && this.player.auras.curseOfRecklessness.durationRemaining < time) time = this.player.auras.curseOfRecklessness.durationRemaining\n if (this.player.auras.destructionPotion) {\n if (this.player.spells.destructionPotion.cooldownRemaining > 0 && this.player.spells.destructionPotion.cooldownRemaining < time) time = this.player.spells.destructionPotion.cooldownRemaining\n if (this.player.auras.destructionPotion.active && this.player.auras.destructionPotion.durationRemaining < time) time = this.player.auras.destructionPotion.durationRemaining\n }\n if (this.player.spells.flameCap) {\n if (this.player.spells.flameCap.cooldownRemaining > 0 && this.player.spells.flameCap.cooldownRemaining < time) time = this.player.spells.flameCap.cooldownRemaining\n if (this.player.auras.flameCap.active && this.player.auras.flameCap.durationRemaining < time) time = this.player.auras.flameCap.durationRemaining\n }\n if (this.player.spells.bloodFury) {\n if (this.player.spells.bloodFury.cooldownRemaining > 0 && this.player.spells.bloodFury.cooldownRemaining < time) time = this.player.spells.bloodFury.cooldownRemaining\n if (this.player.auras.bloodFury.active && this.player.auras.bloodFury.durationRemaining < time) time = this.player.auras.bloodFury.durationRemaining\n }\n if (this.player.spells.demonicRune && this.player.spells.demonicRune.cooldownRemaining > 0 && this.player.spells.demonicRune.cooldownRemaining < time) time = this.player.spells.demonicRune.cooldownRemaining\n if (this.player.spells.superManaPotion && this.player.spells.superManaPotion.cooldownRemaining > 0 && this.player.spells.superManaPotion.cooldownRemaining < time) time = this.player.spells.superManaPotion.cooldownRemaining\n if (this.player.spells.powerInfusion) {\n for (let i = 0; i < this.player.spells.powerInfusion.length; i++) {\n if (this.player.spells.powerInfusion[i].cooldownRemaining > 0 && this.player.spells.powerInfusion[i].cooldownRemaining < time) time = this.player.spells.powerInfusion[i].cooldownRemaining\n }\n }\n if (this.player.spells.bloodlust) {\n for (let i = 0; i < this.player.spells.bloodlust.length; i++) {\n if (this.player.spells.bloodlust[i].cooldownRemaining > 0 && this.player.spells.bloodlust[i].cooldownRemaining < time) time = this.player.spells.bloodlust[i].cooldownRemaining\n }\n if (this.player.auras.bloodlust.active && this.player.auras.bloodlust.durationRemaining < time) time = this.player.auras.bloodlust.durationRemaining\n }\n if (this.player.spells.innervate) {\n for (let i = 0; i < this.player.spells.innervate.length; i++) {\n if (this.player.spells.innervate[i].cooldownRemaining > 0 && this.player.spells.innervate[i].cooldownRemaining < time) time = this.player.spells.innervate[i].cooldownRemaining\n }\n if (this.player.auras.innervate.active && this.player.auras.innervate.durationRemaining < time) time = this.player.auras.innervate.durationRemaining\n }\n if (this.player.spells.mysticalSkyfireDiamond) {\n if (this.player.spells.mysticalSkyfireDiamond.cooldownRemaining > 0 && this.player.spells.mysticalSkyfireDiamond.cooldownRemaining < time) time = this.player.spells.mysticalSkyfireDiamond.cooldownRemaining\n if (this.player.auras.mysticalSkyfireDiamond.active && this.player.spells.mysticalSkyfireDiamond.durationRemaining < time) time = this.player.auras.mysticalSkyfireDiamond.durationRemaining\n }\n if (this.player.spells.insightfulEarthstormDiamond && this.player.spells.insightfulEarthstormDiamond.cooldownRemaining > 0 && this.player.spells.insightfulEarthstormDiamond.cooldownRemaining < time) time = this.player.spells.insightfulEarthstormDiamond.cooldownRemaining\n if (this.player.spells.timbalsFocusingCrystal && this.player.spells.timbalsFocusingCrystal.cooldownRemaining > 0 && this.player.spells.timbalsFocusingCrystal.cooldownRemaining < time) time = this.player.spells.timbalsFocusingCrystal.cooldownRemaining\n if (this.player.spells.markOfDefiance && this.player.spells.markOfDefiance.cooldownRemaining > 0 && this.player.spells.markOfDefiance.cooldownRemaining < time) time = this.player.spells.markOfDefiance.cooldownRemaining\n if (this.player.spells.lightningOverload && this.player.spells.lightningOverload.cooldownRemaining > 0 && this.player.spells.lightningOverload.cooldownRemaining < time) time = this.player.spells.lightningOverload.cooldownRemaining\n if (this.player.spells.drumsOfBattle && this.player.spells.drumsOfBattle.cooldownRemaining > 0 && this.player.spells.drumsOfBattle.cooldownRemaining < time) time = this.player.spells.drumsOfBattle.cooldownRemaining\n if (this.player.spells.drumsOfWar && this.player.spells.drumsOfWar.cooldownRemaining > 0 && this.player.spells.drumsOfWar.cooldownRemaining < time) time = this.player.spells.drumsOfWar.cooldownRemaining\n if (this.player.spells.drumsOfRestoration && this.player.spells.drumsOfRestoration.cooldownRemaining > 0 && this.player.spells.drumsOfRestoration.cooldownRemaining < time) time = this.player.spells.drumsOfRestoration.cooldownRemaining\n if (this.player.auras.drumsOfBattle && this.player.auras.drumsOfBattle.active && this.player.auras.drumsOfBattle.durationRemaining < time) time = this.player.auras.drumsOfBattle.durationRemaining\n if (this.player.auras.drumsOfWar && this.player.auras.drumsOfWar.active && this.player.auras.drumsOfWar.durationRemaining < time) time = this.player.auras.drumsOfWar.durationRemaining\n if (this.player.auras.drumsOfRestoration && this.player.auras.drumsOfRestoration.active && this.player.auras.drumsOfRestoration.tickTimerRemaining < time) time = this.player.auras.drumsOfRestoration.tickTimerRemaining\n if (this.player.auras.wrathOfCenarius && this.player.auras.wrathOfCenarius.active && this.player.auras.wrathOfCenarius.durationRemaining < time) time = this.player.auras.wrathOfCenarius.durationRemaining\n if (this.player.auras.spellstrikeProc && this.player.auras.spellstrikeProc.active && this.player.auras.spellstrikeProc.durationRemaining < time) time = this.player.auras.spellstrikeProc.durationRemaining\n if (this.player.auras.powerInfusion && this.player.auras.powerInfusion.active && this.player.auras.powerInfusion.durationRemaining < time) time = this.player.auras.powerInfusion.durationRemaining\n if (this.player.auras.eyeOfMagtheridon && this.player.auras.eyeOfMagtheridon.active && this.player.auras.eyeOfMagtheridon.durationRemaining < time) time = this.player.auras.eyeOfMagtheridon.durationRemaining\n if (this.player.auras.sextantOfUnstableCurrents) {\n if (this.player.auras.sextantOfUnstableCurrents.active && this.player.auras.sextantOfUnstableCurrents.durationRemaining < time) time = this.player.auras.sextantOfUnstableCurrents.durationRemaining\n if (this.player.spells.sextantOfUnstableCurrents.cooldownRemaining > 0 && this.player.spells.sextantOfUnstableCurrents.cooldownRemaining < time) time = this.player.spells.sextantOfUnstableCurrents.cooldownRemaining\n }\n if (this.player.auras.quagmirransEye) {\n if (this.player.auras.quagmirransEye.active && this.player.auras.quagmirransEye.durationRemaining < time) time = this.player.auras.quagmirransEye.durationRemaining\n if (this.player.spells.quagmirransEye.cooldownRemaining > 0 && this.player.spells.quagmirransEye.cooldownRemaining < time) time = this.player.spells.quagmirransEye.cooldownRemaining\n }\n if (this.player.auras.shiffarsNexusHorn) {\n if (this.player.auras.shiffarsNexusHorn.active && this.player.auras.shiffarsNexusHorn.durationRemaining < time) time = this.player.auras.shiffarsNexusHorn.durationRemaining\n if (this.player.spells.shiffarsNexusHorn.cooldownRemaining > 0 && this.player.spells.shiffarsNexusHorn.cooldownRemaining < time) time = this.player.spells.shiffarsNexusHorn.cooldownRemaining\n }\n if (this.player.spells.bladeOfWizardry) {\n if (this.player.spells.bladeOfWizardry.cooldownRemaining > 0 && this.player.spells.bladeOfWizardry.cooldownRemaining < time) time = this.player.spells.bladeOfWizardry.cooldownRemaining\n if (this.player.auras.bladeOfWizardry.active && this.player.auras.bladeOfWizardry.durationRemaining < time) time = this.player.auras.bladeOfWizardry.durationRemaining\n }\n if (this.player.spells.robeOfTheElderScribes) {\n if (this.player.spells.robeOfTheElderScribes.cooldownRemaining > 0 && this.player.spells.robeOfTheElderScribes.cooldownRemaining < time) time = this.player.spells.robeOfTheElderScribes.cooldownRemaining\n if (this.player.auras.robeOfTheElderScribes.active && this.player.auras.robeOfTheElderScribes.durationRemaining < time) time = this.player.auras.robeOfTheElderScribes.durationRemaining\n }\n if (this.player.auras.ashtongueTalismanOfShadows && this.player.auras.ashtongueTalismanOfShadows.active && this.player.auras.ashtongueTalismanOfShadows.durationRemaining < time) time = this.player.auras.ashtongueTalismanOfShadows.durationRemaining\n if (this.player.auras.darkmoonCardCrusade && this.player.auras.darkmoonCardCrusade.active && this.player.auras.darkmoonCardCrusade.durationRemaining < time) time = this.player.auras.darkmoonCardCrusade.durationRemaining\n if (this.player.auras.manaEtched4Set && this.player.auras.manaEtched4Set.active && this.player.auras.manaEtched4Set.durationRemaining < time) time = this.player.auras.manaEtched4Set.durationRemaining\n if (this.player.spells.theLightningCapacitor && this.player.spells.theLightningCapacitor.cooldownRemaining > 0 && this.player.spells.theLightningCapacitor.cooldownRemaining < time) time = this.player.spells.theLightningCapacitor.cooldownRemaining\n if (this.player.spells.elementalMastery && this.player.spells.elementalMastery.cooldownRemaining > 0 && this.player.spells.elementalMastery.cooldownRemaining < time) time = this.player.spells.elementalMastery.cooldownRemaining\n if (this.player.auras.bandOfTheEternalSage) {\n if (this.player.auras.bandOfTheEternalSage.active && this.player.auras.bandOfTheEternalSage.durationRemaining < time) time = this.player.auras.bandOfTheEternalSage.durationRemaining\n if (this.player.spells.bandOfTheEternalSage.cooldownRemaining > 0 && this.player.spells.bandOfTheEternalSage.cooldownRemaining < time) time = this.player.spells.bandOfTheEternalSage.cooldownRemaining\n }\n if (this.player.spells.shatteredSunPendantOfAcumen) {\n if (this.player.spells.shatteredSunPendantOfAcumen.cooldownRemaining > 0 && this.player.spells.shatteredSunPendantOfAcumen.cooldownRemaining < time) time = this.player.spells.shatteredSunPendantOfAcumen.cooldownRemaining\n if (this.player.auras.shatteredSunPendantOfAcumen && this.player.auras.shatteredSunPendantOfAcumen.active && this.player.auras.shatteredSunPendantOfAcumen.durationRemaining < time) time = this.player.auras.shatteredSunPendantOfAcumen.durationRemaining\n }\n if (this.player.mp5Timer < time) time = this.player.mp5Timer\n for (let i = 0; i < 2; i++) {\n if (this.player.trinkets[i]) {\n if (this.player.trinkets[i].active && this.player.trinkets[i].durationRemaining < time) time = this.player.trinkets[i].durationRemaining\n if (this.player.trinkets[i].cooldownRemaining > 0 && this.player.trinkets[i].cooldownRemaining < time) time = this.player.trinkets[i].cooldownRemaining\n }\n }\n if (this.player.pet) {\n if (this.player.pet.auras.blackBook && this.player.pet.auras.blackBook.active && this.player.pet.auras.blackBook.durationRemaining < time) time = this.player.pet.auras.blackBook.durationRemaining\n }\n\n // Pass time\n // This needs to be the first modified value since the time in combat needs to be updated before spells start dealing damage/auras expiring etc. for the combat logging.\n this.player.fightTime += time\n this.player.castTimeRemaining = Math.max(0, this.player.castTimeRemaining - time)\n\n // Pet\n if (this.player.pet) this.player.pet.tick(time)\n\n // Auras need to tick before Spells because otherwise you'll, for example, finish casting Corruption and then immediately afterwards, in the same millisecond, immediately tick down the aura\n // This was also causing buffs like the t4 4pc buffs to expire sooner than they should.\n\n // Auras\n if (this.player.auras.powerInfusion && this.player.auras.powerInfusion.active) this.player.auras.powerInfusion.tick(time)\n if (this.player.auras.corruption && this.player.auras.corruption.active) this.player.auras.corruption.tick(time)\n if (this.player.auras.siphonLife && this.player.auras.siphonLife.active) this.player.auras.siphonLife.tick(time)\n if (this.player.auras.flameshock && this.player.auras.flameshock.active) this.player.auras.flameshock.tick(time)\n if (this.player.auras.curseOfAgony && this.player.auras.curseOfAgony.active) this.player.auras.curseOfAgony.tick(time)\n if (this.player.auras.curseOfTheElements && this.player.auras.curseOfTheElements.active) this.player.auras.curseOfTheElements.tick(time)\n if (this.player.auras.curseOfRecklessness && this.player.auras.curseOfRecklessness.active) this.player.auras.curseOfRecklessness.tick(time)\n if (this.player.auras.destructionPotion && this.player.auras.destructionPotion.active) this.player.auras.destructionPotion.tick(time)\n if (this.player.auras.elementalMastery && this.player.auras.elementalMastery.active) this.player.auras.elementalMastery.tick(time)\n if (this.player.auras.flameCap && this.player.auras.flameCap.active) this.player.auras.flameCap.tick(time)\n if (this.player.auras.spellstrikeProc && this.player.auras.spellstrikeProc.active) this.player.auras.spellstrikeProc.tick(time)\n if (this.player.auras.eyeOfMagtheridon && this.player.auras.eyeOfMagtheridon.active) this.player.auras.eyeOfMagtheridon.tick(time)\n if (this.player.auras.sextantOfUnstableCurrents && (this.player.auras.sextantOfUnstableCurrents.active || this.player.auras.sextantOfUnstableCurrents.hiddenCooldownRemaining > 0)) this.player.auras.sextantOfUnstableCurrents.tick(time)\n if (this.player.auras.quagmirransEye && (this.player.auras.quagmirransEye.active || this.player.auras.quagmirransEye.hiddenCooldownRemaining > 0)) this.player.auras.quagmirransEye.tick(time)\n if (this.player.auras.shiffarsNexusHorn && this.player.auras.shiffarsNexusHorn.active) this.player.auras.shiffarsNexusHorn.tick(time)\n if (this.player.auras.manaEtched4Set && this.player.auras.manaEtched4Set.active) this.player.auras.manaEtched4Set.tick(time)\n if (this.player.auras.bloodFury && this.player.auras.bloodFury.active) this.player.auras.bloodFury.tick(time)\n if (this.player.auras.bloodlust && this.player.auras.bloodlust.active) this.player.auras.bloodlust.tick(time)\n if (this.player.auras.drumsOfBattle && this.player.auras.drumsOfBattle.active) this.player.auras.drumsOfBattle.tick(time)\n if (this.player.auras.drumsOfWar && this.player.auras.drumsOfWar.active) this.player.auras.drumsOfWar.tick(time)\n if (this.player.auras.drumsOfRestoration && this.player.auras.drumsOfRestoration.active) this.player.auras.drumsOfRestoration.tick(time)\n if (this.player.auras.ashtongueTalismanOfShadows && this.player.auras.ashtongueTalismanOfShadows.active) this.player.auras.ashtongueTalismanOfShadows.tick(time)\n if (this.player.auras.darkmoonCardCrusade && this.player.auras.darkmoonCardCrusade.active) this.player.auras.darkmoonCardCrusade.tick(time)\n if (this.player.auras.bladeOfWizardry && this.player.auras.bladeOfWizardry.active) this.player.auras.bladeOfWizardry.tick(time)\n if (this.player.auras.shatteredSunPendantOfAcumen && this.player.auras.shatteredSunPendantOfAcumen.active) this.player.auras.shatteredSunPendantOfAcumen.tick(time)\n if (this.player.auras.robeOfTheElderScribes && this.player.auras.robeOfTheElderScribes.active) this.player.auras.robeOfTheElderScribes.tick(time)\n if (this.player.auras.bandOfTheEternalSage && this.player.auras.bandOfTheEternalSage.active) this.player.auras.bandOfTheEternalSage.tick(time)\n if (this.player.auras.mysticalSkyfireDiamond && this.player.auras.mysticalSkyfireDiamond.active) this.player.auras.mysticalSkyfireDiamond.tick(time)\n if (this.player.auras.wrathOfCenarius && this.player.auras.wrathOfCenarius.active) this.player.auras.wrathOfCenarius.tick(time)\n if (this.player.auras.innervate && this.player.auras.innervate.active) this.player.auras.innervate.tick(time)\n\n // Spells\n if (this.player.spells.lightningBolt && this.player.spells.lightningBolt.casting) this.player.spells.lightningBolt.tick(time)\n if (this.player.spells.flameshock && this.player.spells.flameshock.casting) this.player.spells.flameshock.tick(time)\n if (this.player.spells.corruption && this.player.spells.corruption.casting) this.player.spells.corruption.tick(time)\n if (this.player.spells.destructionPotion && this.player.spells.destructionPotion.cooldownRemaining > 0) this.player.spells.destructionPotion.tick(time)\n if (this.player.spells.elementalMastery && this.player.spells.elementalMastery.cooldownRemaining > 0) this.player.spells.elementalMastery.tick(time)\n if (this.player.spells.superManaPotion && this.player.spells.superManaPotion.cooldownRemaining > 0) this.player.spells.superManaPotion.tick(time)\n if (this.player.spells.demonicRune && this.player.spells.demonicRune.cooldownRemaining > 0) this.player.spells.demonicRune.tick(time)\n if (this.player.spells.flameCap && this.player.spells.flameCap.cooldownRemaining > 0) this.player.spells.flameCap.tick(time)\n if (this.player.spells.bloodFury && this.player.spells.bloodFury.cooldownRemaining > 0) this.player.spells.bloodFury.tick(time)\n if (this.player.spells.mysticalSkyfireDiamond && this.player.spells.mysticalSkyfireDiamond.cooldownRemaining > 0) this.player.spells.mysticalSkyfireDiamond.tick(time)\n if (this.player.spells.drumsOfBattle && this.player.spells.drumsOfBattle.cooldownRemaining > 0) this.player.spells.drumsOfBattle.tick(time)\n if (this.player.spells.drumsOfWar && this.player.spells.drumsOfWar.cooldownRemaining > 0) this.player.spells.drumsOfWar.tick(time)\n if (this.player.spells.drumsOfRestoration && this.player.spells.drumsOfRestoration.cooldownRemaining > 0) this.player.spells.drumsOfRestoration.tick(time)\n if (this.player.spells.timbalsFocusingCrystal && this.player.spells.timbalsFocusingCrystal.cooldownRemaining > 0) this.player.spells.timbalsFocusingCrystal.tick(time)\n if (this.player.spells.markOfDefiance && this.player.spells.markOfDefiance.cooldownRemaining > 0) this.player.spells.markOfDefiance.tick(time)\n if (this.player.spells.lightningOverload && this.player.spells.lightningOverload.cooldownRemaining > 0) this.player.spells.lightningOverload.tick(time)\n if (this.player.spells.theLightningCapacitor && this.player.spells.theLightningCapacitor.cooldownRemaining > 0) this.player.spells.theLightningCapacitor.tick(time)\n if (this.player.spells.bladeOfWizardry && this.player.spells.bladeOfWizardry.cooldownRemaining > 0) this.player.spells.bladeOfWizardry.tick(time)\n if (this.player.spells.shatteredSunPendantOfAcumen && this.player.spells.shatteredSunPendantOfAcumen.cooldownRemaining > 0) this.player.spells.shatteredSunPendantOfAcumen.tick(time)\n if (this.player.spells.robeOfTheElderScribes && this.player.spells.robeOfTheElderScribes.cooldownRemaining > 0) this.player.spells.robeOfTheElderScribes.tick(time)\n if (this.player.spells.quagmirransEye && this.player.spells.quagmirransEye.cooldownRemaining > 0) this.player.spells.quagmirransEye.tick(time)\n if (this.player.spells.shiffarsNexusHorn && this.player.spells.shiffarsNexusHorn.cooldownRemaining > 0) this.player.spells.shiffarsNexusHorn.tick(time)\n if (this.player.spells.sextantOfUnstableCurrents && this.player.spells.sextantOfUnstableCurrents.cooldownRemaining > 0) this.player.spells.sextantOfUnstableCurrents.tick(time)\n if (this.player.spells.bandOfTheEternalSage && this.player.spells.bandOfTheEternalSage.cooldownRemaining > 0) this.player.spells.bandOfTheEternalSage.tick(time)\n if (this.player.spells.insightfulEarthstormDiamond && this.player.spells.insightfulEarthstormDiamond.cooldownRemaining > 0) this.player.spells.insightfulEarthstormDiamond.tick(time)\n if (this.player.spells.powerInfusion) {\n for (let i = 0; i < this.player.spells.powerInfusion.length; i++) {\n if (this.player.spells.powerInfusion[i].cooldownRemaining > 0) this.player.spells.powerInfusion[i].tick(time)\n }\n }\n if (this.player.spells.bloodlust) {\n for (let i = 0; i < this.player.spells.bloodlust.length; i++) {\n if (this.player.spells.bloodlust[i].cooldownRemaining > 0) this.player.spells.bloodlust[i].tick(time)\n }\n }\n if (this.player.spells.innervate) {\n for (let i = 0; i < this.player.spells.innervate.length; i++) {\n if (this.player.spells.innervate[i].cooldownRemaining > 0) this.player.spells.innervate[i].tick(time)\n }\n }\n\n // Trinkets\n if (this.player.trinkets[0]) this.player.trinkets[0].tick(time)\n if (this.player.trinkets[1]) this.player.trinkets[1].tick(time)\n\n this.player.gcdRemaining = Math.max(0, this.player.gcdRemaining - time)\n this.player.mp5Timer = Math.max(0, this.player.mp5Timer - time)\n this.player.fiveSecondRuleTimer = Math.max(0, this.player.fiveSecondRuleTimer - time)\n if (this.player.mp5Timer == 0) {\n this.player.mp5Timer = 5\n if (this.player.stats.mp5 > 0 || this.player.fiveSecondRuleTimer <= 0 || (this.player.auras.innervate && this.player.auras.innervate.active)) {\n const currentPlayerMana = this.player.mana\n // MP5\n if (this.player.stats.mp5 > 0) {\n this.player.mana = Math.min(this.player.stats.maxMana, this.player.mana + this.player.stats.mp5)\n }\n // Spirit mana regen\n if (this.player.fiveSecondRuleTimer <= 0 || (this.player.auras.innervate && this.player.auras.innervate.active)) {\n // Formula from https://wowwiki-archive.fandom.com/wiki/Spirit?oldid=1572910\n let mp5FromSpirit = 5 * (0.001 + Math.sqrt(this.player.stats.intellect * this.player.stats.intellectModifier) * (this.player.stats.spirit * this.player.stats.spiritModifier) * 0.009327)\n if (this.player.auras.innervate && this.player.auras.innervate.active) {\n mp5FromSpirit *= 4\n }\n this.player.mana = Math.min(this.player.stats.maxMana, this.player.mana + mp5FromSpirit)\n }\n const manaGained = this.player.mana - currentPlayerMana\n this.player.totalManaRegenerated += manaGained\n this.player.manaGainBreakdown.mp5.casts = this.player.manaGainBreakdown.mp5.casts + 1 || 1\n this.player.manaGainBreakdown.mp5.manaGain = this.player.manaGainBreakdown.mp5.manaGain + manaGained || manaGained\n this.player.combatLog('Player gains ' + Math.round(manaGained) + ' mana from MP5 (' + Math.round(currentPlayerMana) + ' -> ' + Math.round(this.player.mana) + ')')\n }\n }\n\n return time\n }", "estimatedTime(peak){\n if(peak){\n return (this.blocksTravelled() / 2);\n }\n else{\n return (this.blocksTravelled() / 3);\n }\n }", "function getRemainingTime() {\n return new Date().getTime() - startTimeMS;\n}", "timeTaken(){\n var resultTime = this._endTime - this._startTime; \n var diff = Math.ceil(resultTime / 1000); \n this._timeTaken = diff;\n return diff ;\n }", "timeRemaining(reqTimeStamp) {\n let endTime= reqTimeStamp + this.validationWindow;\n let now = parseInt(new Date().getTime()/1000);\n return (endTime - now)\n }", "function timeExpired(){\n\t \t\tif(isGameOver){\n\t\t\t\talert(\"Time expired!\");\n\t\t\t\tfor (var i = 0; i < spaces.length; i++) {\n\t\t\t\t\tif(spaces[i].holdsMine){\n\t\t\t\t\t\t\tvar mineCircle = drawCircle(i,circleSize,'red');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse{\n\t\t\t\t\t\t\tvar myCircle = drawCircle(i,circleSize,'orange');\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tplayerStats.averageMoveDuration = (playerStats.timeTaken/playerStats.movesMade);\n\t\t\t\tsendUserMetrics();\n\n\t\t\t}\n\t \t}", "get remainingTime() {\r\n return Math.ceil((this.maxTime - this.timeTicker) / 60);\r\n }", "function calculateLongestPlayerAliveTime() {\n var playerAliveTimeArray = metrics.get(\"PlayerCreated\");\n var playerDeadTimeArray = metrics.get(\"PlayerDestroyed\");\n var timeAlive = 0;\n var maxTimeAlive = 0;\n\n for (i = 0; i < playerAliveTimeArray.length; i++) {\n timeAlive = playerDeadTimeArray[i] - playerAliveTimeArray[i];\n if (timeAlive > maxTimeAlive) {\n maxTimeAlive = timeAlive;\n }\n }\n\n metrics.set(\"maxTimeAlive\", maxTimeAlive);\n return maxTimeAlive/1000; //return answer whilst converting ms to s. This is done because the statistics presented at the the end of the block, are reported in seconds. \n}", "function calculateDuration() {\n return endTime - startTime;\n }", "function computeTime() {\n\n\tdb.freeTime.find({},{time:1, vote:1,_id:0}, (err, particular) => {\n\t\tparticular.sort((a,b) => a.time.localeCompare(b.time, undefined, {numeric:true}));\n\t\treturn getSum(particular)\n\t})\n}", "function prototypeTimeLeft() {\n let weddingDate = new Date('2020/10/17');\n let today = new Date();\n let diff = weddingDate - today;\n let days = diff / 86400000;\n let hours = (days % 1) * 24;\n let minutes = (hours % 1) * 60;\n let seconds = (minutes % 1) * 60;\n\n changeDays(Math.floor(days));\n changeHours(Math.floor(hours));\n changeMinutes(Math.floor(minutes));\n changeSeconds(Math.floor(seconds));\n}", "function calculateDuration() {\n return endTime - startTime;\n }", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function calculateDuration() {\n\t\t\treturn endTime - startTime;\n\t\t}", "function getRemainingTime() {\n return v.viewState.remainingTime;\n }", "function getRemaining() {\n\tvar millLeft = timeDone - (new Date).getTime();\n\n\tif (millLeft < 0) {\n\t\tmillLeft = 0;\n\t}\n\n\treturn {\n\t\t\"hours\": Math.floor(millLeft / 1000.0 / 60 / 60),\n\t\t\"minutes\": Math.floor(millLeft / 1000.0 / 60 % 60),\n\t\t\"seconds\": Math.floor(millLeft / 1000.0 % 60),\n\t\t\"milli\": Math.floor(millLeft % 1000.0)\n\t};\n}", "function calculateSleepDebt() {\n const actualSleepHours = getActualSleepHours();\n const idealSleepHours = getIdealSleepHours();\n //perfect sleeping time\n if (actualSleepHours === idealSleepHours) {\n return 'perfect amount of sleep';\n // Sleeping more than you need\n } else if (actualSleepHours > idealSleepHours) {\n return (\n 'You get ' +\n (actualSleepHours - idealSleepHours) +\n ' h more sleep than you need'\n );\n }\n //sleeping less than you need\n else {\n return (\n 'You should try to sleep for ' +\n (idealSleepHours - actualSleepHours) +\n ' h more'\n );\n }\n}", "infectionByRequestedTime() {\n const factor = this.powerFactor();\n return this.currentlyInfected() * 2 ** factor;\n }", "function getServerLocalDiffTime(){\n var startRequest = new Date().getTime();\n var config = getHdcontrolObject();\n var endRequest = new Date().getTime();\n var requestTime = parseInt((endRequest -startRequest)/1000);\n\n var diffTime = parseInt(parseInt(buyingTime/1000) - config.stime - requestTime);\n return diffTime;\n }", "function howLongDidItTake() {\n var later = new Date();\n return Math.round( (later.getTime() - startMilliseconds) / 1000.0);\n}", "function calculateHealthPlan() {\n var actualCalories = getTotalCalories();\n var idealCalories = getIdealCalories();\n if (actualCalories < idealCalories) {\n return 'Time for seconds!';\n }\n if (actualCalories > idealCalories) {\n return 'You\\'re fat. Get to the gym.';\n }\n else {\n return 'You know your body. Calories right on the money';\n }\n}", "function timeTaken() {\n let t = -1;\n for (let i = 0; i < result.length; i++) {\n if (result[i].time > t) {\n t = result[i].time;\n }\n }\n\n return t;\n }", "function howLongDidItTake() {\n\tvar end, start;\n\t\n\tstart = new Date();\n\t\n\t for(var i = 0; i < 10000; i++) {\n\t console.log(Math.sqrt(i));\n\t }\n\t\n\tend = new Date();\n \n var totalTime = end.getTime() - start.getTime();\n return 'This function took ' + totalTime + ' mseconds';\n\t\n\t// use date object's .getTime() method to get difference in milliseconds\n}", "function estimatedWait(){\n\n // Get a list of the mentors who are online\n var mentors = mentorsOnline();\n\n // Get the currently active tickets\n var tickets = activeTickets();\n\n // Get the currently claimed tickets\n var openTickets = tickets.filter(function(t){return t.status === \"OPEN\"});\n var claimedTickets = tickets.filter(function(t){return t.status === \"CLAIMED\"});\n\n var claimMentors = claimedMentors(claimedTickets);\n\n var unclaimedOnline = mentors.filter(function(m){\n return !claimMentors[m._id];\n });\n\n // Median completion time\n // We use median completion time here because\n // it is more accurate than the mean in practice.\n var completeTickets = completedTickets();\n var estCompletion = stats.median(completeTickets.map(function(t){return t.completeTime - t.claimTime}));\n var estResponse = stats.median(completeTickets.map(function(t){return t.claimTime - t.timestamp}));\n\n if (mentors.length > 0 && openTickets.length >=0){\n if (openTickets.length < unclaimedOnline.length){\n return estResponse;\n } else {\n // There are more open tickets than there are mentors\n // Mentors have to either complete the current tickets\n // or finish up on the tickets they've claimed\n var now = Date.now();\n\n // Find the latest ticket that hasn't been claimed yet.\n var latestOpen = stats.max(openTickets.map(function(t){return t.timestamp})) || now;\n\n if (claimedTickets.length > 0){\n // Find the earliest ticket that was claimed (soonest to completion)\n var earliestClaimed = stats.min(claimedTickets.map(function(t){return t.claimTime})) || now;\n\n // Take the min of the two options (a ticket is claimed and completed vs completed)\n // We use the latest open ticket as an earlier ticket has a higher probability of being\n // chosen soon.\n return Math.min(now - latestOpen + estResponse + estCompletion, now - earliestClaimed + estCompletion + estResponse);\n } else {\n return now - latestOpen + estResponse;\n }\n\n }\n\n }\n\n}", "getDifficulty(){\n \n let temp_difficulty = 3\n for(let i = 1;i < this.blockchain.length;i++){\n const diff = Math.abs(this.blockchain[i].timestamp - this.blockchain[i-1].timestamp)\n if(diff > 5000){\n temp_difficulty -= (diff-5000)/5000\n temp_difficulty = Math.max(temp_difficulty,1)\n }\n if(diff < 4000){\n temp_difficulty += (4000-diff)/4000\n temp_difficulty = Math.min(temp_difficulty,10)\n }\n }\n return 5\n }", "function calcCreditsLeft(user) {\n var count = 0;\n var finishedNames = user.classesFinished.map(getName).concat(user.classesInProgress.map(getName));\n for (var i = 0; i < exports.all_classes.length; i++) {\n if (finishedNames.indexOf(exports.all_classes[i]._name) === -1) {\n count += exports.all_classes[i]._creditHours;\n console.log(exports.all_classes[i]);\n }\n }\n return count;\n}", "get remainTime(){ \n let remainTime =''\n if (this.scheduler) {\n if (this.isPaused) {\n remainTime = 'pause';\n } else {\n let breakType = this.nextBreakType()\n if (breakType) {\n console.log(this.scheduler.timeLeft);\n remainTime = `${Utils.formatTillBreak(this.scheduler.timeLeft)}`\n }\n }\n }\n return remainTime\n }", "function walkingTime(pointA, pointB) {\n let dx = avenueDistance(pointA, pointB);\n let dy = streetDistance(pointA, pointB);\n return (dx + dy) / walkingSpeed * 60.0;\n}", "updateRemainingTime() {\n\n this.callsCounter++;\n //cada 25 llamadas, quito un segundo\n if (this.callsCounter % 25 == 0) {\n if (this.time.seconds == 0) {\n this.time.minutes -= 1;\n this.time.seconds = 60;\n }\n this.time.seconds -= 1;\n }\n //Se activa el hurryUp\n if (this.callsCounter == this.hurryUpStartTime) {\n this.hurryUpTime = true;\n }\n //Se llama al metodo cada 5 llamadas \n if (this.callsCounter >= this.hurryUpStartTime\n && this.callsCounter % 5 == 0) {\n this.hurryUp();\n }\n\n }", "function timeToWait() {\n let timesList = list.filter(times => times.status == \"done\");\n let times = [];\n for (let i = 0; i < timesList.length; i++) {\n times.push(timesList[i].timeServiced);\n }\n if (times.length > 0) {\n let sum = times.reduce((previous, current) => current += previous);\n avg = sum / times.length;\n return avg;\n }\n}", "function ReduceTime() {\n totalSeconds = totalSeconds - 30;\n return totalSeconds;\n }", "function penaltyTime () {\n secondsLeft += penaltyWrongAnswer;\n}", "function countSum() {\n\tvar sum = 0;\n\tvar timeWasted = JSON.parse(localStorage[\"timeWasted\"]);\n\t\tif (timeWasted !== undefined) {\n\t\t\tsum = timeWasted + UPDATE_SECONDS;\n\t\t\tlocalStorage[\"timeWasted\"] = JSON.stringify(sum);\n\t\t\tconsole.log('Total time wasted is ' + sum + ' seconds');\n\n\t\t\tvar target = JSON.parse(localStorage[\"target\"]);\n\t\t\tvar key = localStorage[\"keyVal\"];\n\t\t\tif (target !== 0 && !waiting && key !== \"Vaan\" && key !== \"Squall\") {\n\t\t\t\tcheckWasteTarget(sum, target);\n\t\t\t}\t\n\t\t\telse console.log(\"no target set\");\n\t\t\tif (waiting) console.log(\"waiting patiently\");\n\t\t}\n\t\telse console.log(\"PANIC: timeWasted undefined!!\");\n}", "function deductTime() {\n secondsLeft = secondsLeft - 5;\n return secondsLeft;\n}", "function Overtime(time) \n {\n\n var overtime=12*1.5*time;\n return overtime;\n }", "overTime(){\n\t\t//\n\t}", "function game(){\n if(timeleft <= 0 && catAttackStore.length<2){\n clearInterval(downloadTimer);\n document.getElementById(\"countdown\").innerHTML = \"Time<br>Up!\";\n catAttack();\n lifePoint();\n const timeOut = setTimeout(timeCount,1000);\n }\n else if(timeleft <= 0 && catAttackStore.length>=2){\n clearInterval(downloadTimer);\n catAttack();\n lifePoint();\n const youLoose = setTimeout(failed,1000);\n \n } \n \n else {\n document.getElementById(\"countdown\").innerHTML = timeleft ;\n }\n timeleft --;\n}", "function time_passed(date) {\n\t\t\tvar date_now = new Date();\n\t\t\treturn date_now.getTime() - date.getTime();\n\t\t}", "function _getTimeLeft(timeout) {\n return Math.ceil(timeout._idleStart + timeout._idleTimeout - Date.now());\n }", "function check_time(time){ // Input the unix difference\n // Condition if it is >= to 0(+)\n if(time >= 0){\n // Deployed\n return true\n // Condition if it is < 0(-)\n }else if(time < 0){\n // Mission Complete\n return false\n // When bad things happen\n }else{\n // Yelling\n console.log(\"Play it again, Sam.\")\n }\n }", "approaches() {\n this._time_until_arrival--;\n }", "function timePenalty() {\n timeRem =- 5;\n}", "compareArrivalTimes(a, b){\n const stationA = a.timeTableRows.find(station => station.stationShortCode === this.state.station.stationShortCode\n && station.type === this.state.stopType);\n const stationB = b.timeTableRows.find(station => station.stationShortCode === this.state.station.stationShortCode\n && station.type === this.state.stopType);\n\n const timeA = new Date(stationA.liveEstimateTime || stationA.scheduledTime);\n const timeB = new Date(stationB.liveEstimateTime || stationB.scheduledTime);\n\n return timeA - timeB;\n }", "function calcualteStayDuration(){\n // Variable that minuses the stored inputed time stamps from each other to find their difference\n var dateResult = (bookingDates.checkOutDate - bookingDates.checkInDate);\n // Variable that converts the timestamp outputed by dateResult into days\n var resultConverted = Math.floor(dateResult / (1000 * 60 * 60 * 24));\n bookingData.stayDuration = resultConverted;\n } // Invoked at line 390", "function findContainerTotalTime(ingredients) {\n var time = 0;\n var i;\n for (i = 0; i < ingredients.length; ++i) {\n var item = ingredients[i];\n var total = item.prepTime + item.cookTime + item.coolTime;\n if (total > time) {\n time = total;\n }\n }\n return time;\n }", "updateTime() {\r\n if (this.state == STATES.play) {\r\n if (this.remain === 0) {\r\n return this.winner();\r\n }\r\n this.time += 0.1; \r\n this.htmlScore.innerHTML = (this.mines-this.flags) +\r\n \" / \" + this.mines + \" \" + this.time.toFixed(1);\r\n }\r\n }", "function timerDone() {\n\t\tif((station3.done && station3.crew+1 < station2.crew || station2.done && station3.crew < station2.crew) && !threeHidden && !station3.running && crewArray[station3.crew] != undefined && !station3.pause) {\n\t\t\tstation3.nextCrew();\n\t\t\tstation3.startCountdown();\n\t\t}\n\t\tif((station2.done && station2.crew+1 < station1.crew || station1.done && station2.crew < station1.crew) && !station2.running && crewArray[station2.crew] != undefined && !station2.pause) {\t\t\t\n\t\t\tstation2.nextCrew();\n\t\t\tstation2.startCountdown();\t\t\t\n\t\t}\n\t\tif(station1.done && crewArray[station1.crew] != undefined && (station1.crew+1 < onDeck.crew || onDeck.done)) {\t\t\t\n\t\t\tstation1.nextCrew();\n\t\t\tstation1.startCountdown();\t\t\t\n\t\t}\n\t\tif(onDeck.done && crewArray[onDeck.crew] != undefined) {\t\t\n\t\t\tonDeck.nextCrew();\t\t\t\t\t\t\n\t\t\tonDeck.startCountdown();\t\t\t\n\t\t}\t\t\t\t\t\n\t}", "get timeLeft(){\n return this.getSeconds(this.currentTimeInput.value);\n \n }", "static getRefreshCost() {\n let notComplete = player.completedQuestList.filter((elem) => { return !elem(); }).length;\n return Math.floor(250000 * Math.LOG10E * Math.log(Math.pow(notComplete, 4) + 1));\n }", "function calculateTimeFraction() {\n const rawTimeFraction = timeLeft / TIME_LIMIT;\n return rawTimeFraction - (1 / TIME_LIMIT) * (1 - rawTimeFraction);\n }", "getTournamentOverdueCnt() {\n var cnt = 0, i; \n var d = Date.now();\n if (this.tournament.paymentdeadline != \"0\") {\n for (i = 0; i < this.players.length; i++) {\n if (this.players[i].paymentstatus == \"open\" && d > (parseInt(this.players[i].datetime) + (24*60*60*1000 * parseInt(this.tournament.paymentdeadline)))) cnt++;\n }\n }\n return cnt; \n }", "function stand() {\n getComputerTotal();\n compare(PLAYERTOTAL, COMPUTERTOTAL);\n}", "function VPosition_TimeCalculation(InitialPosition, FinalPosition, Velocity)\n{\n //t = (xf - xi)/v || t = (xf - xi) / v\n var Time = ( ( FinalPosition - InitialPosition) / Velocity );\n document.getElementById(\"result\").value = Time;\n //return Time;\n}", "function isWrong(){\n timeLeft -= 10;\n}", "function updateForFrame()\r\n{\r\n if (gameStart)\r\n {\r\n let time = clock.getElapsedTime(); // time, in seconds, since clock was created\r\n //let timeFloor = Math.floor(time); //for testing timer going up\r\n let timeCeiling = Math.ceil(time); //for the count down\r\n timeLeft = totalTime - timeCeiling\r\n }\r\n\r\n /**\r\n * For this section this is where we are going transfer\r\n * time left in the game/progression to the player\r\n * so that they can see a count down\r\n **/\r\n\r\n if(timeLeft >= 0) {\r\n document.getElementById(\"timeLeft\").innerHTML = \"\" + timeLeft;\r\n document.getElementById(\"collected\").innerHTML = \"\" + collision;\r\n }\r\n else{\r\n document.getElementById(\"timeLeft\").innerHTML = \"Lights Out!\"; \r\n gameover = true;\r\n }\r\n}", "function canYouMakeIt(dist, time) {\n time = Math.round((time - Date.now()) / 1000); //time to duration\n let distanceCanTravel = time * getKmPerSecond(1); //how far users can go\n let fixedTimeMargin = 300 * getKmPerSecond(1); //extra margin of 5 mins if users run\n let distanceCanTravelIfYouRun = distanceCanTravel * 2; //how far users can go if they run\n distanceCanTravelIfYouRun += fixedTimeMargin; //final calculation if users can run with some extra time\n let distanceCanTravelIfSlow = distanceCanTravel * 0.8; //how far users can go if they walk slowly\n\n if (dist < distanceCanTravelIfSlow) {\n //if users walk slowly within the distance and time\n return 0;\n } else {\n if (dist > distanceCanTravel) {\n //checks if too far\n if (dist < distanceCanTravelIfYouRun) {\n //check if too far when running\n return 2; //run\n }\n return 3; //you are too far away\n } else {\n return 1; //walk\n }\n }\n}", "function getRemainingStomach() {\n return (0, _kolmafia.fullnessLimit)() - (0, _kolmafia.myFullness)();\n}", "function getUsageIntervals( start_time )\n{\n var datetime = new Date();\n var ctime = parseInt( datetime.getTime()) / 1000 ;\n var diff = ctime - parseInt(start_time);\n return parseInt(diff).timeLeft();\n}", "function timePassed(response)\n{\n $(\"span#date\").text(response.date);\n $(\"span#partyHealth\").text(response.partyHealth);\n livingMembers = response.livingMembers;\n $(\"span#livingMembers\").text(livingMembers);\n\n if (livingMembers <= 0)\n {\n isGameloopDisallowed = true;\n stopGameLoop();\n $(\"div#nextLandmark\").hide();\n $(\"div#partyDied\").show();\n $(\"#rest_div\").hide();\n $(\"#supply_div\").hide();\n }\n}", "function compareTimes(dest, grace)\n{\n var t1, t2, hr, min;\n var t1diff, t2diff, total, limit;\n\n t1 = document.getElementById('maincarpickuptime' + dest).value;\n t2 = document.getElementById('maincardropofftime' + dest).value;\n\n t1diff = new Number();\n t2diff = new Number();\n\n total = new Number();\n limit = new Number();\n\n\t//the limit is how much time, in minutes, the dropoff time can be from the pickup time without charging an extra day.\n\t//1440 = 24 hours * 60.\n\t//The second number comes from the default value CarGracePeriod - any extra time a company allows after 24 hours.\n limit = 1440 + grace;\n\n //Get the total number of minutes from t1 until midnight\n hr = new Number(t1.split(\":\")[0]);\n min = new Number(t1.split(\":\")[1]);\n t1diff = 1440 - ((hr * 60) + min)\n\n //Get the total number of minutes from midnight until t2\n hr = new Number(t2.split(\":\")[0]);\n min = new Number(t2.split(\":\")[1]);\n t2diff = (hr * 60) + min\n\n //Get the total number of minutes between the pickup and dropoff times\n total = t1diff + t2diff\n\n //Is the total greater than the allowed amount of time? If yes, then display a warning\n if (total > limit)\n {\n\t\tdocument.getElementById('maincarwarning' + dest).style.display = 'block';\n\t\tdocument.getElementById('carover24hrs' + dest).value = 'Y';\n }\n else\n {\n \tdocument.getElementById('maincarwarning' + dest).style.display = 'none';\n \tdocument.getElementById('carover24hrs' + dest).value = 'N';\n }\n}", "getCountdownTimeRemaining() {\n var timeleft = CookieManager.get(this.options.popupID + '-timer');\n if (!timeleft) {\n timeleft = this.options.popupDelaySeconds;\n }\n timeleft = Number(timeleft);\n if (timeleft < 0)\n timeleft = 0;\n return timeleft;\n }", "calculateTime() {\n // Number of ingredients\n const numberOfIngredients = this.ingredients.length;\n // Number of periods (1 period = 3 ingredients)\n const periods = Math.ceil(numberOfIngredients / 3);\n\n // Time needed to cook (1 period takes 15 minutes)\n this.time = periods * 15;\n }", "function checkGameOver() {\n\tif (clickers === 0) {\n\t\t//Post DeClicking Time\n\t\tconst taken = Math.round((Date.now() - startTime) / 1000);\n\t\talert(`De-rick-ed in ${taken} seconds!`);\n\t}\n}", "function enough(cap, on, wait){\nif(on+wait>cap){\nreturn (on+wait)-cap\n}else{\nreturn 0\n}\n\n}", "function calcAwaitingTime(arrMin, depMin, arrHours, depHours) {\n\n\n var awaiting;\n if (depHours > arrHours) {\n if (arrMin > depMin) {\n awaiting = 60 - (arrMin - depMin);\n }\n else {\n awaiting = 60 + (depMin - arrMin);\n\n }\n\n }\n else {\n\n awaiting = depMin - arrMin;\n\n }\n return awaiting;\n\n\n}", "_getRemainingDistance()\r\n {\r\n let distanceList = this._navPath.distances;\r\n let distRemaining = 0;\r\n\r\n // Add distance to next waypoint.\r\n distRemaining += this._distanceToNext();\r\n\r\n for (let distIdx = this._waypointIdx + 1; distIdx < distanceList.length; distIdx++)\r\n {\r\n // Add distances between all successive waypoints.\r\n distRemaining += distanceList[distIdx]\r\n }\r\n\r\n // Return distance in metres.\r\n return distRemaining;\r\n }", "function deductTime() {\n secondsLeft = (secondsLeft - 10);\n }", "totalTime() {\n let time = 0\n this.measures.forEach(m => time += m.totalTime())\n return time\n }", "function calculateGameTime() {\n var d = new Date();\n endTime = d.getTime();\n\n var elapsedTime = endTime - startTime;\n\n metrics.set(\"elapsedTime\", elapsedTime);\n}", "function pointsGoUp() {\n if(startTime >= questions[currentQuestion].questionTime - (questions[currentQuestion].questionTime / 3)) {\n numPoints += 20;\n} else if (startTime >= questions[currentQuestion].questionTime - ((questions[currentQuestion].questionTime / 3)*2) && startTime < questions[currentQuestion].questionTime - (questions[currentQuestion].questionTime / 3)) {\n numPoints += 10;\n } else {\n numPoints += 5;\n }\n $(\"#pointCounter\").html(numPoints + \" points\");\n}", "function timeUpdate() {\n timeEngaged += delta();\n}", "estimateWhenToWater(){\n let msg = null;\n if(this.state.hardwareID !== \"-\" && this.state.hardwareHumidity > 0){\n if(parseInt((this.state.humidity) - parseInt(this.state.hardwareHumidity)) > 0){\n msg = \"Your plant needs water!\"\n }else{\n msg = \"Your plant has plenty of water\"\n }\n }else{\n msg = \"Connect your hardware to your account\";\n }\n this.setWateringMessage(msg);\n }", "function calculatePercentLeft() {\n for (let i = 0; i < props.rewards.length; i++) {\n // If the current index req points is great than, then use that as the next goal/threshold\n if (props.rewards[i].req_points > props.points.points)\n return Math.floor((props.points.points / props.rewards[i].req_points) * 100);\n }\n }", "calcTime() {\n const numIng = this.ingredients.length;\n const periods = Math.ceil(numIng / 3);\n this.time = periods * 15;\n }", "function tiempoJugadores() {\n\n var ms = tiempo * 60000;\n //Primero guarda cuanto aguanta el j1\n if (partidas == 1)\n tj1 = (ms - game.time.events.duration) / 1000;\n\n //Luego cuanto tarda el j2\n else\n tj2 = (ms - game.time.events.duration) / 1000;\n\n}", "function checkRemainingTime(){\r\r\n\tif(kalender_user_role != 'restzeitnutzer') return false;\r\r\n\r\r\n\tjQuery.getJSON(kalender_ajax_object.getAnzahl,{\r\r\n\t\t// get parameter\r\r\n\t\t'jahr': kalender_data.jahr,\r\r\n\t\t'monat': kalender_data.monat + 1,\r\r\n\t\t'username': kalender_user\r\r\n\t}).success(function(result){\r\r\n\t\t// abbruch wenn result objekt ein feld \"error\" enthaelt\r\r\n\t\tif(result.hasOwnProperty('error')){\r\r\n\t\t\tconsole.error(\"ERROR: \", result);\r\r\n\t\t\treturn;\r\r\n\t\t}\r\r\n\t\t\r\r\n\t\t// neues uhrzeit objekt mit der restdauer fuellen\r\r\n\t\tkalender_restzeit = new Uhrzeit(0,0,0, false);\r\r\n\t\tkalender_restzeit.addMin(result.max - result.dauer);\r\r\n//\t\tconsole.debug(result, kalender_restzeit);\r\r\n\t}).fail(function(result){\r\r\n\t\tconsole.error(\"ERROR: \", result);\r\r\n\t});\r\r\n}", "function calculateTime() {\n displayTime(Date.now() - startTime);\n}", "function TotalBulletTime(verticalVelocity, gravity) {\n var result;\n var verticalVelocityChange = 0;\n \n verticalVelocityChange = (verticalVelocity + verticalVelocity);\n result = verticalVelocityChange / gravity;\n return result;\n}", "function minutesLeft(room) {\n var time = getRelativeTime(room, -4);\n if (time['nh'] == time['h']) {\n return time['m'] - time['nm'];\n } else if (time['nh'] == time['h'] - 1) {\n return 60 - time['nm'] + time['m'];\n } else {\n return 60;\n }\n}", "function Velocity_TimeCalculation(InitialVelocity, FinalVelocity, Acceleration)\n{\n //t = (vf - vi)/a || t = ( vf - vi ) / a\n var Time = (FinalVelocity - InitialVelocity) / Acceleration;\n document.getElementById(\"result\").value = Time;\n}", "function countDown() {\n if (_timeRemaining > 0) {\n\n // This function will be called as frequently as the _refreshRate variable\n // dictates so we reduce the number of milliseconds remaining by the\n // _refreshRate value for accurate timing\n _timeRemaining -= _refreshRate;\n\n // Publish the fact that the remaining time has changed, passing along the\n // new time remaining as a percentage - which will help when we come to display\n // the remaining time on the game board itself\n Frogger.observer.publish(\"time-remaining-change\", _timeRemaining / _timeTotal);\n } else {\n\n // If the remaining time reaches zero, we take one of the player's remaining\n // lives\n loseLife();\n }\n }", "function timeRemaining() {\n return MAX_RUNTIME_SECONDS - timeRun();\n}", "function getLapTime() {\r\n\r\n if (initTime !== 0 && timerControl) {\r\n // get lap time\r\n clickTime = getCurrTime();\r\n let passedTime = calcPassedTime(initTime, clickTime)\r\n let lapTime = passedTime - lapInitialTimer;\r\n\r\n lapInitialTimer = passedTime;\r\n // update and store lap times array, unless laptime == 0\r\n if (lapTime !== 0) {\r\n lapTimesArray.unshift(lapTime);\r\n lapHistory(lapTimesArray);\r\n localStorage[\"laps\"] = JSON.stringify(lapTimesArray);\r\n }\r\n }\r\n}", "function getTimeLapse(session){\n\tconsole.log(\"getTimeLapse() executing\");\n\tvar botTime = new Date(session.userData.lastMessageSent);\n\tvar userTime = new Date(session.message.localTimestamp);\n\tvar userTimeManual = new Date(session.userData.lastMessageReceived);\n\tconsole.log(\"Time Lapse Info:\");\n\tvar timeLapseMs = userTimeManual - botTime;\n\tconsole.log(\"Time lapse in ms is: \" + timeLapseMs);\n\tvar timeLapseHMS = convertMsToHMS(timeLapseMs);\n\tconsole.log(\"Time lapse in HH:MM:SS: \" + timeLapseHMS);\n\treturn timeLapseHMS;\n}", "function subwayTime(stationA, stationB) {\n let dx = avenueDistance(stationA, stationB);\n let dy = streetDistance(stationA, stationB);\n return Math.sqrt(dx * dx + dy * dy) / subwaySpeed * 60.0;\n}", "function experienceGained(seconds) {\n if (seconds < 0)\n seconds = 0;\n\n return Math.floor(Math.sqrt(seconds), 0);\n}", "get remainingTime()\r\n { \r\n if (!this._endOfPath)\r\n {\r\n // Return remaining time in minutes.\r\n let minutesValue = (this._getRemainingTime() / 60).toFixed(2);\r\n if (isNaN(minutesValue))\r\n {\r\n return \"NaN\"\r\n }\r\n return minutesValue.toString() + \" mins\"\r\n }\r\n else\r\n {\r\n return \"None\"\r\n }\r\n }", "function getScore() {\n\n if (timeLeft < 0) {\n timeLeft = 0;\n }\n console.log(timeLeft);\n return score = timeLeft;\n \n}", "fastAutobuyersTimerLength() {\n return player.autobuyersTimerLength;\n }" ]
[ "0.70369065", "0.6747363", "0.6678641", "0.6579432", "0.6384992", "0.6375195", "0.6345107", "0.60752106", "0.6072048", "0.60105014", "0.6001674", "0.59913903", "0.5972084", "0.59233034", "0.5914371", "0.59119654", "0.5882657", "0.5853839", "0.58407074", "0.5823879", "0.58223313", "0.58095396", "0.5779777", "0.5779777", "0.5779777", "0.5745076", "0.5704158", "0.57015544", "0.57010764", "0.5697092", "0.56815827", "0.56765366", "0.5603102", "0.5597761", "0.5596456", "0.5592567", "0.5581592", "0.55803025", "0.55675906", "0.5561869", "0.5555196", "0.5546881", "0.55456537", "0.55443895", "0.55387104", "0.5518563", "0.5514977", "0.5476621", "0.54763114", "0.5475809", "0.5450016", "0.54499584", "0.54497826", "0.5449124", "0.54461366", "0.542716", "0.5426909", "0.54218423", "0.5407782", "0.5398552", "0.539202", "0.5389016", "0.5382661", "0.53785217", "0.5377754", "0.5373119", "0.5372148", "0.5366504", "0.53641945", "0.5364071", "0.5364024", "0.53609735", "0.53591037", "0.5353771", "0.5351547", "0.53498536", "0.53446925", "0.5342905", "0.53397304", "0.53347975", "0.5331427", "0.53278965", "0.532562", "0.53225976", "0.5317029", "0.5314493", "0.531194", "0.53114766", "0.5309386", "0.5304013", "0.5301481", "0.5300384", "0.5296407", "0.5295118", "0.529434", "0.5290398", "0.52832127", "0.52807266", "0.52694213", "0.5267572" ]
0.64239883
4
These functions determine how much life a person has left on Earth based on their current age, gender and what continet they live on. If 'male' is true use avg age on left If 'male' is false, use age on right
earthLifeExpectancy() { switch(this.continent) { case "North America": return this.gender === "male" ? 77 : 81; case "South America": return this.gender === "male" ? 73 : 79; case "Europe": return this.gender === "male" ? 75 : 82; case "Asia": return this.gender === "male" ? 71 : 74; case "Africa": return this.gender === "male" ? 61 : 64; case "Oceania": return this.gender === "male" ? 76 : 80; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "yearsLeft(smoker, age) {\n let that = this;\n let result;\n\n if (that.lifeExpectancy(smoker) - age > 0) {\n result = that.lifeExpectancy(smoker) - age;\n } else {\n result = \"You are living over your life expectancy. Are you sure you are not dead?\";\n }\n return result;\n }", "function classify_age(birth_date) {\n // ages ranges\n // 2 : child\n // 3 : teen\n // 4 : adult\n var today = date_to_ymd(new Date());\n var age = calc_age(today, birth_date);\n log(\"patron age: \" + age);\n if (isNaN(age)) {\n log(\"error: couldn't parse age\");\n return 0;\n } else if (age < 0) {\n log(\"patron age negative? treat as parsing error\");\n alert(\"Date entered is in the future. Are you a time traveler?\");\n return 0;\n } else if (age < 8) {\n log(\"classified as a younger child patron\");\n return 1;\n } else if (age < 13) {\n log(\"classified as a child patron\");\n return 2;\n } else if (age < 18) {\n log(\"classified as a teen patron\");\n return 3;\n } else if (age > 200) {\n log(\"patron age over 200? treat as parsing error\");\n return 0;\n } else {\n log(\"classified as an adult patron\");\n return 4;\n }\n}", "function calculateAge(birthYear,currentYear){\n if(birthYear == currentYear) { // to handle infants\n return \" you are below 1 year\";\n }\n // In one year our differs depending if it is befor or after the birthday month\n return \"You are either \"+ (currentYear - birthYear) +\" or \" + (currentYear - birthYear - 1 );\n\n }", "function calculateAge(birthyear, currentyear) {\n\tvar lowage = currentyear - birthyear - 1;\n\tvar highage = currentyear - birthyear;\n\talert(\"You are either \" + lowage + \" or \" + highage)\n}", "function averageAgeOfFemales(input) {\n var result = input.filter(function (item) {\n return item.gender;\n });\n\n var average = result.reduce(function (sum, item) {\n return sum += item.age;\n }, 0) / result.length;\n\n return average;\n}", "howOld(birthday){\n \n //calculate the month difference from the current month\n //calculate the day difference from the current date\n //calculate year difference from the current year\n //put calculation in date format\n //calculate the age person\n //return the age of the person\n\n return -1;\n }", "function retirement(birthYear, year, gender){\n var manRetirement = 65;\n var womanRetirement = 60;\n var workYear = 0;\n var status = \"\";\n\n workYear = year - birthYear;\n\n if (gender === \"m\" && workYear < manRetirement){\n status = manRetirement - workYear;\n }\n else if (gender === \"m\" && workYear > manRetirement){\n status = \"Man is in retirement\";\n }\n else if (gender === \"w\" && workYear < womanRetirement){\n status = womanRetirement - workYear;\n }\n else if (gender === \"w\" && workYear > womanRetirement){\n status = \"Woman is in retirement\";\n }\n\n return status;\n\n}", "function famAgeAvg(person) {\n const famAvgAge = famTotalAge(person) / person.length;\n return famAvgAge;\n}", "function averageAge(people) { \n var sumAvg =0;\n for (i=0 ; i<people.length ; i++){\n if (person.age > 18 && person.age <50 ){\n \tsumAvg = sumAvg + person.age / people.length \n }\n }\n return sumAge;\n }", "function calculateAge (birthYear, currentYear){\n\tvar age = currentYear- birthYear;\n\n\tconsole.log(\"You are either \" + age + \" or \" + (age-1));\n\n}", "function calculateAge (birthYear, currentYear){\n var actualAge = currentYear - birthYear;\n var anotherAge = actualAge - 1;\n console.log(\"You are either \"+ actualAge + ' or '+ anotherAge);\n}", "function isOldEnoughWithName() {\n for (var i = 0; i < peopleWhoWantToSeeMadMaxFuryRoad.length; i++) {\n if (peopleWhoWantToSeeMadMaxFuryRoad[i].gender == \"male\"){\n pronoun = \"He's\";\n }\n else if (peopleWhoWantToSeeMadMaxFuryRoad[i].gender == \"female\"){\n pronoun = \"She's\";\n };\n if (peopleWhoWantToSeeMadMaxFuryRoad[i].age >= 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is old enough to see Mad Max.\" + \" \" + pronoun + \" allowed into the movies.\")\n }\n else if(peopleWhoWantToSeeMadMaxFuryRoad[i].age < 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is to young to see Mad Max.\" + \" \" + pronoun + \" NOT allowed into the movies.\")\n };\n }\n}", "function avgFilteredData( dat, val, maleloc, femaleloc, ages )\n{\n\tvar total = 0;\n\tfor( var age = ages[0]; age <= ages[1]; age++ )\n\t\ttotal += genderFilteredData( dat[age], gender, maleloc, femaleloc )\n\t\t\n\ttotal /= ( ages[1] + 1 - ages[0] );\n\ttotal *= 100;\n\t\n\treturn total;\n}", "mercuryExpect() {\n if (this.sex === \"male\") {\n this.mercExpect = Math.round(this.male / this.mercNum);\n }\n if(this.sex === \"female\"){\n this.mercExpect = Math.round(this.female / this.mercNum);\n }\n }", "function pension(birth,currentY,gender) {\n var ret;\n if (gender === 'man') {\n ret = 65 - (currentY - birth);\n }\n else if (gender === 'woman') {\n ret = 60 - (currentY - birth);\n }\n else {\n return 'Please check input.';\n }\n if (ret > 0) {\n return ret + ' years to retirement';\n }\n else {\n return 'Already retired'\n }\n\n}", "function retirement(years, sex) {\n var ret = 2021 - years;\n if (sex === \"male\") {\n if (ret >= 65) {\n return \"Your are retirement\";\n } else if (ret < 65) {\n return \"Almost done. \" + (65 - ret);\n } else {\n return \"Wrong\";\n }\n }\n if (sex === \"female\") {\n if (ret >= 60) {\n return \"Your are retirement\";\n } else if (ret < 60) {\n return \"Almost done\" + (60 - ret);\n } else {\n return \"Wrong\";\n }\n }\n}", "function lifeExpectancy(values){\n\tvar centuries = groupBy(values,function(person){\n\t\treturn (Math.ceil(person.died/100));\n\t});\n\n\tfor(key in centuries){\n\t\tvar cent = ages(centuries[key]);\n\t\tconsole.log(key + \" century average age: \" + average(cent));\n\t}\n}", "function calculateAge(birth, current) {\n today = new Date()\n current = Number.isInteger(current) ? current : today.getFullYear();\n yearsElapsed = current - birth;\n console.log(\"you are either \" + (yearsElapsed - 1) + \" or \" + yearsElapsed + \" years old.\");\n}", "function avgAge(person){\n let totalAge = 0;\n person.forEach(element => {\n totalAge = totalAge + element.age;\n });\n return totalAge/person.length;\n }", "marsExpectancy() {\n if (this.sex === \"male\") {\n this.marsExpect = Math.round(this.male / this.marsNum);\n }\n if(this.sex === \"female\"){\n this.marsExpect = Math.round(this.female / this.marsNum);\n }\n }", "function ageChecker(age) {\n if (13 <= (age) && (age) <= 19) {\n return 'You are a teenager!'}\n else if ((age) <= 12) {\n return 'You are a kid'\n}\n else if ((age) >= 20) {\n return 'You are a grownup'\n }\n}", "function calculateAge(birth, current) {\n console.log(`You are ${current - birth} years old.`);\n}", "function findAgeLevel() {\n let weight = document.getElementById(\"weight\").value;\n weightInt = parseFloat(weight);\n let heightFeet = document.getElementById(\"heightFeet\").value;\n let heightInches = document.getElementById(\"heightInches\").value;\n\n var heightFeetInt = parseInt(heightFeet);\n var heightInchesInt = parseInt(heightInches);\n\n var TotalHeight = heightFeetInt * 12 + heightInchesInt;\n var ageLevel;\n\n if (weightInt < 120 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt < 120 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt < 120 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Junior\";\n } else if (weightInt < 120 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 120 && weightInt < 160 && TotalHeight >= 63) {\n ageLevel = \"Senior\";\n } else if (weightInt < 120 && TotalHeight >= 63) {\n ageLevel = \"Senior\";\n } else if (weightInt >= 160 && TotalHeight < 45) {\n ageLevel = \"Youth\";\n } else if (weightInt >= 160 && TotalHeight >= 45 && TotalHeight < 54) {\n ageLevel = \"Junior\";\n } else if (weightInt >= 160 && TotalHeight >= 54 && TotalHeight < 57) {\n ageLevel = \"Intermediate\";\n } else if (weightInt >= 160 && TotalHeight >= 57 && TotalHeight < 63) {\n ageLevel = \"Senior\";\n } else {\n ageLevel = \"Senior\";\n }\n\n return ageLevel;\n}", "calculateGalacticAge(){\n const MercuryMax = 21.12;\n const VenusMax = 54.56;\n const MarsMax = 165.44;\n const JupiterMax = 1043.68;\n if(this.planet == \"Mercury\"){\n this.planetAge = this.getMercuryAge();\n this.remainPlanetYears = Math.ceil(MercuryMax - this.planetAge);\n return;\n }else if(this.planet == \"Venus\"){\n this.planetAge = this.getVenusAge();\n this.remainPlanetYears = Math.ceil( VenusMax - this.planetAge);\n return;\n }else if(this.planet == \"Mars\"){\n this.planetAge = this.getMarsAge();\n this.remainPlanetYears = Math.ceil( MarsMax - this.planetAge);\n return;\n }else if(this.planet == \"Jupiter\"){\n this.planetAge = this.getJupiterAge();\n this.remainPlanetYears = Math.ceil( JupiterMax - this.planetAge);\n return;\n }else{\n return;\n }\n\n }", "function genderFilteredAgeData( dat, gender, maleloc, femaleloc, ages )\n{\n\tvar total = 0;\n\tfor( var age = ages[0]; age <= ages[1]; age++ )\n\t\ttotal += genderFilteredData( dat[age], gender, maleloc, femaleloc )\n\t\n\treturn total;\n}", "function age_calculator()\n{\n\tcurrent_year = 2013;\n\tbirth_year = 1988;\n\tage_1 = 2013 - 1988;\n\tage_2 = age_1 - 1;\n \n\talert(\"They are either \" + age_1 + \" or \" + age_2);\n}", "function averageMomChildAgeDiff() {\n // Your code here\n let diffs = [];\n for (let p in byName) {\n let person = byName[p];\n let mom = byName[person.mother];\n if (mom == undefined) continue;\n diffs.push(person.born - mom.born);\n }\n return average(diffs);\n}", "function calculateAge(birthYear, currentYear) {\n\tage1 = currentYear - birthYear;\n\tage2 = currentYear - (birthYear + 1);\n\tconsole.log(\"You are either \" + age1 + \" or \" + age2);\n}", "function timeLeft(currentAge){\n\tvar daysLeft = (90-currentAge)*365;\n\tvar weeksLeft = (90-currentAge)*52;\n\tvar monthsLeft = (90-currentAge)*12;\n\tvar temp = daysLeft*weeksLeft*monthsLeft;\n\tif (isNaN(temp)){\n\t\talert(\"You should type only numbers\")\n\t\t}\n\t\telse{\n\t\t\t return (\"You have \" + daysLeft + \" days, \" + weeksLeft + \" weeks and \" + monthsLeft + \" months left.\");\n\t\t}\n\t}", "function averageMomChildAgeDiff() \n{\n\tlet momExist = ancestry.filter(person => byName[person.mother] != null)\n\tlet momAge = momExist.map(person => (person.born - byName[person.mother].born))\n\treturn average(momAge)\n}", "function retirement(years, sex) {\n    var year = 2021;\n    var res = year - years;\n    var result = \"\";\n    if (sex === \"female\") {\n        if (res >= 60) {\n            result = \"You are retirement\";\n        }\n        else if (res < 60) {\n            result = \"Some more \" + (60 - res);\n        }\n        else {\n            result = \"Put a diferent years\";\n        }\n    }\n    else if (sex === \"male\") {\n        if (res >= 65) {\n            result = \"You are retirement\";\n        }\n        else if (res < 65) {\n            result = \"Some more \" + (65 - res);\n        }\n        else {\n            result = \"Put a diferent years\";\n        }\n    }\n    else {\n        return \"Something is wrong \";\n    }\n    return result;\n}", "ageMars() {\n let martianAge = parseInt(this.ageEarthYears()/1.88); //I am 15 years old\n return martianAge;\n }", "function averageMomChildAgeDiff() {\n var difference = ancestry.filter(function(person) {\n return byName[person.mother] != null;\n }).map(function(person) {\n return person.born - byName[person.mother].born;\n });\n\n return average(difference);\n}", "function describeAge(age) {\n return \"You're a(n) \" + (age < 13 ? \"kid\" : age < 18 ? \"teenager\" : age < 65 ? \"adult\" : \"elderly\")\n}", "function calculateValuesIntellectual(intellectual,childAge){\n var realValuePrioritiesApplied;\n \n var mathematical = intellectual.mathematical;\n var language = intellectual.language;\n var attention = intellectual.attention;\n var recognition = intellectual.recognition;\n\n if(0<=childAge<2){\n realValuePrioritiesApplied= (recognition * 4) + (language * 3) + (attention *2) + (mathematical *1);\n if(recognition ==10 || language ==10){\n notifyParent = true;\n } \n }else if(2<=childAge<=3){\n realValuePrioritiesApplied= (language * 4) + (recognition * 3) + (attention *2) + (mathematical *1);\n if(language ==10 || recognition ==10){\n notifyParent = true;\n } \n }else if(3<childAge<=4){\n realValuePrioritiesApplied= (language * 4) + (attention * 3) + (mathematical *2) + (recognition *1);\n if(language ==10 || attention ==10){\n notifyParent = true;\n } \n }else if(5<=childAge){\n realValuePrioritiesApplied= (attention * 4) + (language * 3) + (mathematical *2) + (recognition *1);\n if(attention ==10 || language ==10){\n notifyParent = true;\n } \n }\n \n return realValuePrioritiesApplied;\n}", "function tellAge(month,day,year) {\n var myDay = new Date();\n\tvar yearNow = myDay.getFullYear();\n\tvar calYears = yearNow - year;\n\t\t\t\t var endDay = new Date(year,month,day);\n var millisecondsPerDay = 1000 * 60 * 60 * 24;\n\n var millisBetween = myDay.getTime() - endDay.getTime();\n var days = millisBetween / millisecondsPerDay;\n\n // Round down.\n var rounding = Math.floor(days);\n \n \n\nif(calYears > 1) {\n\n\treturn `You are ${calYears} years old`;\n\n}else if (calYears < 1){\n\n \n\t\treturn `You are ${rounding} days old`;\n}\n}", "earthAge(birthday) {\n let today = new Date();\n let myAge = (today - birthday);\n return Math.floor(myAge / 3.154e+10);\n }", "function getAverageAge(data) {\n let age = 0;\n for(let i = 0; i < data.length; i++) {\n let total = data[i]['age']\n age += total\n }\n return Math.trunc(age / getProfileCount(data))\n}", "isAdult () { return this.age >= 18; }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "howOld(birthday){\n \n // convert birthday into a numeric value\n\n // convert current date into a numeric value\n\n // subtract birthday numeric value from current date value to get the numeric value of time elapsed\n\n // convert the time elapsed value into years\n\n // round down the converted years value\n\n // return the rounded years value\n\n let date = new Date().getFullYear();\n let age = date-birthyear\n \n return age;\n return -1;\n }", "function countRetirement (age, gender) {\n // First, we determine the age of retirement based\n // on gender\n let limit;\n if (gender === \"male\") {\n limit = 65;\n } else {\n limit = 60;\n }\n // We display the following years in the console \n for (let i = age; i <= limit; i++) {\n console.log(i);\n }\n\n // We display information about the remaining years of work in a conditional window\n if (age < limit) {\n alert(\"You have \" + (limit - age) + \" work years left!\");\n }\n}", "jupiterExpect() {\n if (this.sex === \"male\") {\n this.jupExpect = Math.round(this.male / this.jupNum);\n }\n if(this.sex === \"female\"){\n this.jupExpect = Math.round(this.female / this.jupNum);\n }\n }", "function getAge(dateString) {\r\n var now = new Date();\r\n\r\n var yearNow = now.getFullYear();\r\n var monthNow = now.getMonth()+1; //starts from 0\r\n var dateNow = now.getDate();\r\n\r\n var dob = {\r\n year: dateString.substring(0,4),\r\n month: dateString.substring(5,7),\r\n day: dateString.substring(8,10)\r\n };\r\n\r\n var yearDob = dob.year;\r\n var monthDob = dob.month;\r\n var dateDob = dob.day;\r\n var age = {};\r\n var ageString = \"\";\r\n var yearString = \"\";\r\n var monthString = \"\";\r\n var dayString = \"\";\r\n\r\n\r\n yearAge = yearNow - yearDob;\r\n\r\n if (monthNow >= monthDob)\r\n var monthAge = monthNow - monthDob;\r\n else {\r\n yearAge--;\r\n var monthAge = 12 + monthNow -monthDob;\r\n }\r\n\r\n if (dateNow >= dateDob)\r\n var dateAge = dateNow - dateDob;\r\n else {\r\n monthAge--;\r\n var dateAge = 31 + dateNow - dateDob;\r\n\r\n if (monthAge < 0) {\r\n monthAge = 11;\r\n yearAge--;\r\n }\r\n }\r\n\r\n age = {\r\n years: yearAge,\r\n months: monthAge,\r\n days: dateAge\r\n };\r\n\r\n if ( age.years > 1 ) yearString = \" years\";\r\n else yearString = \" year\";\r\n if ( age.months> 1 ) monthString = \" months\";\r\n else monthString = \" month\";\r\n if ( age.days > 1 ) dayString = \" days\";\r\n else dayString = \" day\";\r\n\r\n console.log(\"pet name \" + savePetDataObj.general.name);\r\n console.log(\"age.years \" + age.years);\r\n console.log(\"age.months \" +age.months);\r\n console.log(\"age.days \" +age.days);\r\n\r\n if ( (age.years > 0) && (age.months > 0) )\r\n ageString = age.years + yearString + \" and \" + age.months + monthString;\r\n else if ( (age.years == 0) && (age.months == 0))\r\n ageString = age.days + dayString;\r\n else if ( (age.years > 0) && (age.months == 0) && (age.days == 0) )\r\n ageString = age.years + yearString +`. Happy Birthday ${savePetDataObj.general.name}!`;\r\n else if ( (age.years > 0) && (age.months > 0) )\r\n ageString = age.years + yearString + \" and \" + age.months + monthString + \" old.\";\r\n else if ( (age.years == 0) && (age.months > 0) )\r\n ageString = age.months + monthString;\r\n else if ( (age.years > 0) && (age.months == 0) )\r\n ageString = age.years + yearString;\r\n else if ( (age.years == 0) && (age.months > 0) )\r\n ageString = age.months + monthString;\r\n else ageString = \"Oops! Could not calculate age!\";\r\n\r\n return ageString;\r\n }", "ageEarthYears() {\n const birthdate = new Date(this.dob);\n let today = new Date();\n let calcAge = today - birthdate; \n let ageInYears = Math.floor(calcAge/(365.25 * 24 * 60 * 60 * 1000 )); // year * day * minutes per hour * seconds per minute * 1000 millisecs per sec // I am 30 years old\n\n return ageInYears;\n }", "function checkDriveAges(ages){\n if(ages === 18){\n\t return \"Congratulation in your first year of driving. Enjoy de Ride\";\n } else if(ages > 18){\n\t return \"Powering On. Enjoy your Ride\";\n }else{\n\t return \"Sorry!. You are too young to drive this car. Powering off\";\n }\n}", "function calculateCalories(user) {\n\n // Formula\n // See Mifflin - St Jeor Formula at http://www.freedieting.com/calorie_needs.html\n // Female: ((10 x weight (kg)) + (6.25 x height (cm)) - (5 x age (y)) - 161) X activityFactor;\n // Male: ((10 x weight (kg)) + (6.25 x height (cm)) - (5 x age (y)) + 5) X activityFactor;\n\n if (!user || !user.gender) return 2000; // return default cals if no gender info\n\n // set defaults\n let weight = 70.760352; // 156 pounds in kg\n let height = 167.64; // 5 6' in centimeters\n let age = 37;\n let activityFactor = 1.55; // Moderate activity\n\n //set params\n weight = user.weight;\n height = user.height;\n age = user.age;\n activityFactor = user.activityLevel;\n\n // set specific to the user\n // if (user.weight) weight = parseInt(user.weight) * 0.453592; // converts lbs to kgs for formula\n // if (user.height) height = parseInt(user.height) * 2.54; // converts inches to cm for formula\n if (user.age) age = user.age;\n\n if (user.activityLevel) {\n // sedentary, light, moderate, very, extreme\n switch (user.activityLevel) {\n case \"sedentary\":\n activityFactor = 1.2;\n break;\n case \"light\":\n activityFactor = 1.375;\n break;\n case \"moderate\":\n activityFactor = 1.55;\n break;\n case \"very\":\n activityFactor = 1.725;\n break;\n case \"extreme\":\n activityFactor = 1.9;\n break;\n default:\n activityFactor = 1.55;\n }\n }\n\n if (user.gender == 'female') return parseInt(((10 * weight) + (6.25 * height) - (5 * age) - 161) * activityFactor);\n else if (user.gender == 'male') return parseInt(((10 * weight) + (6.25 * height) - (5 * age) + 5) * activityFactor);\n\n // else, return default\n else return 2000;\n }", "function howOld(age, year) {\n const currentDate = new Date();\n const currentYear = currentDate.getFullYear();\n\n if (year > currentYear) {\n var NewAge = year - currentYear + age;\n return `You will be ${NewAge} in the year ${year}`;\n } else if (year < currentYear - age) {\n var diference = currentYear - age - year;\n return `The year ${year} was ${diference} years before you were born`;\n } else if (year < currentYear && year > currentYear - age) {\n var NewAge = age - (currentYear - year);\n return `You were ${NewAge} in the year ${year}`;\n }\n}", "function calculateAge(p) {\n var currentDate = new Date().getTime();\n var birth = new Date(p.birthDate).getTime();\n var day = 1000 * 60 * 60 * 24;\n var diff = currentDate - birth;\n\n var days = Math.floor(diff / day);\n var months = Math.floor(days / 31);\n var years = Math.floor(months / 12);\n\n console.log(p.name + ' tiene ' + years + ' años');\n}", "function interpretBMI(age, z_bmi){\n\n if (age > 1857) { //above 5 years old\n return z_bmi > 2 ? \"Obese\" : z_bmi > 1 ? \"Overweight\" : z_bmi < -3 ? \"Severe Thinness\" : z_bmi < -2 ? \"Thinness\" : \"Normal\";\n } else if (age > 730 && age < 1858){ //ages 2 - 5\n return z_bmi > 3 ? \"Obese\" : z_bmi > 1.35 ? \"Overweight\" : z_bmi < -3 ? \"Severe Thinness\" : z_bmi < -2 ? \"Thinness\" : \"Normal\";\n } else if (age < 731){\n return \"Not for age < 2\"\n }\n \n }", "venusExpect(){\n if (this.sex === \"male\") {\n this.venExpect = Math.round(this.male / this.venNum);\n }\n if(this.sex === \"female\"){\n this.venExpect = Math.round(this.female / this.venNum);\n }\n }", "function teenager(age) {\n if (13 <= (age) && (age) <= 19) {\n return 'You are a teenager!'}\n else {\n return 'You are not a teenager'\n}\n}", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "calcAge() {\n console.log(2037 - this.birthYear);\n }", "function getAge(people) {\n let dayToday = new Date().getDate();\n let monthToday = new Date().getMonth();\n let yearToday = new Date().getFullYear();\n for (let i = 0; i < people.length; i++) {\n let birthDate = people[i].dob;\n let birthDateSplit = people[i].dob.split(\"/\");\n birthDateSplit[0] -= 1;\n let splitDiff = [];\n splitDiff[0] = monthToday - birthDateSplit[0];\n splitDiff[1] = dayToday - birthDateSplit[1];\n splitDiff[2] = yearToday - birthDateSplit[2];\n if (splitDiff[0] < 0 || (splitDiff[0] == 0 && splitDiff[1] < 0)) {\n splitDiff[2]--;\n }\n people[i].age = splitDiff[2];\n }\n}", "function oldEnoughTo(age) {\n if (age >= 16) {\n return \"Drive a car\";\n } else if (age >= 17) {\n return \"Vote\";\n } else if (age >= 21) {\n return \"Drink\";\n } else {\n return \"Do all the things!\";\n }\n}", "calcAge() {\n\t\tconsole.log(2021 - this.birthYear);\n\t}", "mercuryYears(age) {\n let mercuryAge = age * 0.24;\n return mercuryAge;\n }", "function calculateAge(birthday) {\r\n \r\n var dateOfBirth = new Date(birthday); \r\n var date2 = new Date();\r\n\r\n var convertIntoDays = (1000 * 60 * 60 * 24);\r\n var convertYears = 365;\r\n var daysPerMonth = 30;\r\n\r\n var dayDiff = (date2 - dateOfBirth) / convertIntoDays;\r\n var yearDiff = dayDiff / convertYears;\r\n var monthDiff = (dayDiff % 365) / daysPerMonth;\r\n var daysLeft = ((monthDiff - Math.floor(monthDiff)) * 30);\r\n\r\n\r\n\r\n console.log(\"You're \" + Math.floor(yearDiff) + \" Years, \" + Math.floor(monthDiff) + \" Months & \" + Math.floor(daysLeft) + \" Days Old.\");\r\n\r\n\r\n}", "function averageAgeByCentury() {\n //assign each person to a century\n var avgAgeExpectancy = {};\n var century;\n\n ancestry.forEach(function(person) {\n century = Math.ceil(person.died / 100).toString();\n if(!avgAgeExpectancy.hasOwnProperty(century)) { avgAgeExpectancy[century] = []; }\n avgAgeExpectancy[century].push(person.died - person.born);\n });\n\n for (var cent in avgAgeExpectancy) {\n avgAgeExpectancy[cent] = average(avgAgeExpectancy[cent]);\n }\n\n return avgAgeExpectancy;\n}", "function ternaryTeenager(age) {\n if (13 <= (age) && (age) <= 19) {\n return 'You are a teenager'}\n else {\n return 'You are not a teenager'\n }\n}", "function calculateAge(birthYear){\n return 2019 - birthYear;\n}", "function thisPersonsAge(user) {\n return user.age ? \"I know\" : \"I don't know\";\n}", "function ageDifference(person){\n var mother = byName[person.mother];\n return person.born-mother.born;\n}", "function getCurrentPDFMale(){\n if (currentY == \"age\") {\n return pdfAgeM;\n } else {\n return pdfOriginM;\n }\n}", "function calculateAge(birthYear) {\n return 2019 - birthYear; \n //# return in equation\n }", "function calculateAge(){\n var DOB = document.getElementById('DOB').value; //DOB = date of birth\n var DOM = document.getElementById('DOM').value; //DOM = date of measurement\n\n //convert DOB - NZ to US formatting to allow for calculations\n var DOB_US = moment(DOB, \"DD/MM/YYYY\").format(\"MM/DD/YYYY\");\n var DOBasdate = moment(DOB_US, \"MM/DD/YYYY\");\n\n //convert DOM - NZ to US formatting to allow for calculations\n var DOM_US = moment(DOM, \"DD/MM/YYYY\").format(\"MM/DD/YYYY\");\n var DOMasdate = moment(DOM_US, \"MM/DD/YYYY\");\n\n //calculate difference in days between DOM and date of birth\n var ageInDays = DOMasdate.diff(DOBasdate, 'days');\n var humanAge = convertToYearsOld(DOBasdate, DOMasdate);\n\n return [ageInDays,humanAge];\n\n\n\n\n}", "function averageAgeByCentury() {\n var centuries = {};\n var century;\n ancestry.forEach(function(person){\n century = Math.ceil(person.died/100);\n if(!(century in centuries)){\n centuries[century] = [];\n }\n centuries[century].push(person.died - person.born);\n });\n\n for(var key in centuries){\n centuries[key] = average(centuries[key]);\n }\n \n return centuries;\t\n}", "function dogToHumanYears(years)\n{\n let humanYears = 0;\n\n //ages 1-3 - 10 human years to dog years\n if (years <= 3)\n {\n humanYears = years * 10;\n }\n //other ages - 7 human years to dog years\n else\n {\n humanYears = 30; //first three dog years\n years -= 3;\n humanYears += (years * 7);\n }\n return humanYears;\n}", "function famTotalAge(person){\n const familyAge = person.map(function(ageCalc){\n return ageCalc.age;\n });\n const totalAge = familyAge.reduce(function(prev, curr){\n return prev + curr;\n });\n return totalAge;\n}", "function calculateAge (bornAge){\n return 2020-bornAge;\n}", "function calculateAge(){\n var dob = $(\"#dob\").attr('value');\n var dayOfBirth = dob.substring(0,2);\n var monthOfBirth = dob.substring(3,5);\n var yearOfBirth = dob.substring(6,10);\n\n //Variables containg values of current date\n var today = new Date();\n var dayOfToday = parseInt(today.getDate());\n var monthOfToday = today.getMonth() + 1;\n var yearOfToday = today.getFullYear();\n\n //Variables required to calculate age.\n var yearDiff;\n if (monthOfToday > monthOfBirth){\n yearDiff = yearOfToday - yearOfBirth;\n }\n else if (monthOfToday == monthOfBirth) {\n if((dayOfToday == dayOfBirth) || (dayOfToday > dayOfBirth)) {\n yearDiff = yearOfToday - yearOfBirth;\n }\n else\n yearDiff = yearOfToday - yearOfBirth - 1;\n }\n else {\n yearDiff = yearOfToday - yearOfBirth - 1;\n }\n return yearDiff;\n}", "function peopleStats(){\n\n\t//Categories: alone, core, acquaintances, strangers, colleagues [for starters, let's group singular and plural instances - eg: colleague and colleagues to see what that data looks like]\n\n\t//Most frequently w/: \n\n\t//Greatest happiness on avg. for time range with, if available, must be 3 times to ensure that it isn't an outlier, when user is with...\n\n\t//Lowest aliveness w/\n\n}", "function oldEnoughName(){\n for (var i = 0; i < peopleWhoWantToSeeMadMaxFuryRoad.length; i++){\n if (peopleWhoWantToSeeMadMaxFuryRoad[i].age >= 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is of age to see Mad Max.\")\n }\n else if(peopleWhoWantToSeeMadMaxFuryRoad[i].age < 18){\n console.log(peopleWhoWantToSeeMadMaxFuryRoad[i].name + \" is NOT of age to see Mad Max\")\n }\n }\n}", "function calculateAge(name, birthYears) {\n let date = new Date();\n let currentYear = date.getFullYear();\n let age = currentYear - birthYears;\n let display = name + \" is \" + age + \" years old \";\n return display;\n}", "checkAge() {\n if(this.calculateAge < 18) {\n return \"Sorry, you are to young\";\n }\n }", "calculateAge() {\n let date_1 = new Date(age);\n let diff = Date.now() - date_1.getTime();\n var age_date = new Date(diff);\n return Math.abs(age_date.getUTCFullYear() - 1970); \n }", "function getAge(faceAttributes) {\n return faceAttributes.age;\n}", "amIOld() {\n // Do some computations in here and print out the correct statement to the console\n if (this.initialAge < 0) {\n console.log(\"Age is not valid, setting age to 0.\");\n this.initialAge = 0;\n console.log(\"You are young.\");\n }\n\n else if (this.initialAge < 13) {\n console.log(\"You are young.\")\n } else if (this.initialAge >= 13 && this.initialAge < 18) {\n console.log(\"You are a teenager.\")\n } else if (this.initialAge >= 18) {\n console.log(\"You are old.\")\n }\n }", "function avgAge (arr)\n{\n// debugger\nvar total = arr.reduce( (total, x) => \n{ var y =x.age;\n return total+ y;\n}, 0 )\nvar avg = total/(arr.length);\n\nreturn avg;\n}", "function Person(initialAge) {\n // Add some more code to run some checks on initialAge\n const AGE_YOUNG = 'You are young.';\n const AGE_TEENAGER = 'You are a teenager.';\n const AGE_OLD = 'You are old.';\n const AGE_NOT_VALID = 'Age is not valid, setting age to 0.';\n\n const isValidAge = (age) => age >= 0;\n\n if (!isValidAge(initialAge)) {\n console.log(AGE_NOT_VALID);\n this.a = initialAge;\n } else {\n this.a = initialAge;\n }\n\n this.amIOld = () => {\n const isYoungAge = this.a < 13;\n const isTeenAge = this.a >= 13 && this.a < 18;\n // Do some computations in here and print out the correct statement to the console\n if (isYoungAge) {\n console.log(AGE_YOUNG);\n } else if (isTeenAge) {\n console.log(AGE_TEENAGER);\n } else {\n console.log(AGE_OLD);\n }\n };\n\n this.yearPasses = () => {\n // Increment the age of the person in here\n this.a += 1;\n };\n}", "function getAge(birth) {\r\n const today = new Date();\r\n\r\n const nowyear = today.getFullYear();\r\n const nowmonth = today.getMonth();\r\n const nowday = today.getDay();\r\n\r\n const birthyear = birth.getFullYear();\r\n const birthmonth = birth.getMonth();\r\n const birthday = birth.getDay();\r\n\r\n let age = 0;\r\n if( nowyear > birthyear ){\r\n age = nowyear - birthyear;\r\n if( nowmonth < birthmonth ){\r\n age -= 1;\r\n }\r\n else if( nowmonth === birthmonth ){\r\n if( nowday < birthday ){\r\n age -= 1;\r\n }\r\n }\r\n }\r\n\r\n return age;\r\n}", "function calculateAge(birth_year) {\n var today = new Date();\n var year = today.getFullYear();\n\n console.log (\"You are \" + (year - birth_year) + \" years old.\")\n}", "ageMercury() {\n let mercurianAge = parseInt(this.ageEarthYears()/0.24); //I am 125 years old\n return mercurianAge;\n }", "function gradeOf(gender, pace) {\n var i, arr = GRADE[gender + '_tv']; // tv: time value in seconds\n if (!arr) {\n return -1;\n }\n for (i = 0; i < arr.length; i++) {\n if (pace < arr[i][1]) {\n return i;\n }\n }\n return i - 1;\n}", "ageVenus() {\n let venusianAge = parseInt(this.ageEarthYears()/0.62); //I am 48 years old\n return venusianAge;\n }", "isAdult(){\n return this.age >= 18;\n }", "function averageAgeByCentury() {\n let data = {};\n for (let name in byName) {\n let person = byName[name];\n let century = (parseInt(person.died.toString().substr(0, 2)) + 1).toString();\n data[century] = data[century] || [];\n data[century].push(person.died - person.born);\n }\n Object.keys(data).forEach( x => data[x] = average(data[x]));\n return data;\n}", "function switchAge(age) {\n if (13 <= (age) && (age) <= 19) {\n return 'You are a teenager'}\n else {\n return 'You have an age'\n }\n}", "function moreAge(age){\n\n if (age >= 3){\n let sumAge = 24 + ((age-2) * 4);\n\n return sumAge;\n }\n}", "function getAge(birth){\n birth = new Date(birth);\n let today = new Date();\n return Math.floor((today - birth) / (365.25 * 24 * 60 * 60 * 1000)).toString();\n }", "function calcAge1(birthYear) {\r\n // const age = 2021 - birthYear\r\n // return age\r\n return 2021 - birthYear;\r\n}", "function calculateAge(birthDate) {\n\tif (birthDate !== null && birthDate != \"0000-00-00\") {\n\t\tbirthDateSplit = birthDate.split('-');\n\t\tbirthYear = birthDateSplit[0];\n\t\tbirthMonth = birthDateSplit[1];\n\t\tbirthDay = birthDateSplit[2];\n\n\t\ttodayDate = new Date();\n\t\ttodayYear = todayDate.getFullYear();\n\t\ttodayMonth = todayDate.getMonth();\n\t\ttodayDay = todayDate.getDate();\n\t\t\n\t\tage = todayYear - birthYear; \n\n\t\tif (todayMonth < birthMonth - 1) age--;\n\t\tif (todayMonth == birthMonth - 1 && todayDay < birthDay) age--;\n\n\t\treturn age;\t\n\t} else {\n\t\treturn \"\";\n\t}\n}", "function getAverageAge(users) {\n return users.map(user => user.age).reduce( (sum, userAge) => sum + userAge) / users.length;\n}", "function calculateDogAge(rate, age){\n\n var years = rate * age\n return \"Your doggie is \" + years + \" years old in dog years\"\n\n}", "function calculateAge(yearOfBirth) {\n var age = parseFloat(2018 - yearOfBirth);\n return age\n}" ]
[ "0.65848184", "0.65011257", "0.61647964", "0.6149521", "0.6143316", "0.61390984", "0.6117361", "0.60235834", "0.6019571", "0.6010498", "0.6003112", "0.60013705", "0.5992602", "0.59862417", "0.5975699", "0.59644043", "0.59555", "0.5947848", "0.5943127", "0.5942912", "0.5937562", "0.5909557", "0.59027183", "0.59010774", "0.58770084", "0.58633816", "0.5851377", "0.58439606", "0.5841171", "0.58220506", "0.5820106", "0.57600355", "0.57575494", "0.5754515", "0.57496333", "0.5748234", "0.5742857", "0.5721985", "0.5716015", "0.5712326", "0.5712326", "0.5712091", "0.56927085", "0.5683262", "0.56766033", "0.5674209", "0.56691694", "0.566615", "0.56655806", "0.56476414", "0.5638932", "0.56342775", "0.56292975", "0.5628057", "0.5620421", "0.5620421", "0.5620421", "0.5620421", "0.56154525", "0.56075126", "0.559305", "0.55779237", "0.5577326", "0.55629563", "0.55508095", "0.5545295", "0.55441374", "0.5520981", "0.55149984", "0.5510895", "0.55094916", "0.5505967", "0.54952466", "0.5485796", "0.5479923", "0.5463769", "0.546245", "0.5452714", "0.5451184", "0.54508823", "0.5445145", "0.5440549", "0.543681", "0.54296005", "0.54286295", "0.54154974", "0.54154885", "0.54063416", "0.54046", "0.54031575", "0.5394355", "0.53942186", "0.53926027", "0.53892237", "0.5386809", "0.53856164", "0.53840244", "0.5364039", "0.5357646", "0.53564847" ]
0.6541262
1
Return url to query opencop database for table name. If the need strikes you, you can throw a CQL_FILTER on the end.
function jsonUrl(tableName) { var url = "/geoserver/wfs" url += "?request=GetFeature" url += "&version=1.1.0" url += "&outputFormat=JSON" url += "&typeName=opencop:" url += tableName return url }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUrlTable() {\r\n return _urlTable;\r\n}", "function getUrlTable() {\r\n return _urlTable;\r\n}", "function getUrlTable() {\n return _urlTable;\n}", "tablename(context) {\n switch (context) {\n case \"select\":\n case \"selectOne\":\n return \"(select * from tablename1 join tablename2 on tablename1.id = tablename2.id)\";\n case \"insert\":\n case \"update\":\n case \"delete\":\n return \"tablename1\";\n }\n }", "static get tableName() {\n return '' + PREFIX + 'apps_countries';\n }", "static get tableName() {\n return 'fedland';\n }", "getTableName() {}", "function getTableStorageUrl(auth, fields, filter) {\n\n // ToDo: Add code to format a table storage URL with shared access signature\n var baseUrl = tableStorageBaseUrl\n + auth.tableName\n + '?tn=' + auth.tableName\n + '&sv=2014-02-14&si=GabLab'\n + '&sig=' + auth.signature;\n\n var filterUrl = '';\n var fieldsUrl = '';\n\n if (filter && typeof (filter.partitionKey) != 'undefined') {\n filterUrl = \"&$filter=PartitionKey eq '\" + filter.partitionKey + \"'\";\n }\n\n if (fields && fields.length) {\n fieldsUrl = \"&$select=\" + fields.join(',');\n }\n\n return baseUrl + fieldsUrl + filterUrl;\n\n\n }", "static get tableName() {\n return '' + PREFIX + 'loss_of_consciousness';\n }", "function _tableName() {\n\tif ( this.tableName ) {\n\t\treturn _.result( this, 'tableName' );\n\t}\n\n\tvar urlAttributeName = this instanceof Backbone.DynamoDB.Model ? 'urlRoot' : 'url',\n\t\ttable = _.result( this, urlAttributeName ).replace( /^\\//, '' );\n\n\treturn table.charAt( 0 ).toUpperCase() + table.substr( 1 );\n}", "function queryWIRATable(tableName) {\r\n //alert(\"Querying table: \" + tableName);\r\n var sql = 'SELECT * FROM ' + tableName + '';\r\n db.transaction(function (tx) {\r\n tx.executeSql(sql, [], queryWIRASuccess, queryWIRAError);\r\n });\r\n }", "static get tableName() {\n return \"doctors\";\n }", "function showTables() {\n var connStr =\n 'jdbc:google:rdbms://' +\n 'elwarbito:chapter6/contacts',\n conn,\n stmt,\n rs,\n sql;\n sql = 'SHOW TABLES';\n conn = Jdbc.getCloudSqlConnection(connStr);\n stmt = conn.createStatement();\n rs = stmt.executeQuery(sql);\n while (rs.next()) {\n Logger.log(rs.getString(1));\n }\n rs.close();\n stmt.close();\n conn.close();\n}", "static get tableName() {\n return '' + PREFIX + 'employees';\n }", "static get TABLE_NAME() {\r\n return 'device'\r\n }", "_buildSelectUrl(query){\n // by default, base url is the model table.\n var baseUrl = query._model._table;\n // append query string.\n var queryString = this._buildQueryString(query);\n if(queryString !== ''){\n baseUrl += (baseUrl.indexOf('?') > -1 ? '&' : '?') + queryString;\n }\n return baseUrl;\n }", "static get tableName() {\n return '' + PREFIX + 'config_confined_paths';\n }", "static get tableName() {\n return 'networks';\n }", "function gen_cloudant_lookup_url(owner, db, term){\n\treturn 'https://' + cloudant_username + ':' + cloudant_password + '@cloudant.com/db/' + owner +'/'+ db + '/_search?q=' + $('#as_in').val() + '&limit=1&include_docs=true';\n}", "function check_table_name ( table_name ) {\n\t'use strict';\n\tvar __FUNCTION__ = \"check_table_name\";\n\tvar tp = find_table ( table_name, model );\n\tvar rv = {};\n\tif ( tp === -1 ) {\n\t\t// crud_info = gen_crud_info ( crud_info, 'predef', table_name, req.params, __FUNCTION__, __FILE__, 17 );\n\t\trv.error = new restify.InvalidArgumentError(\"Error (1801): File: gen_crud_lib.m4.js Line: \"+ 18 +\", The specified table is not configured for access in this software. table_name=(\"+table_name+\")\");\n\t}\n\treturn rv;\n}", "function encodeSQLReference(tableName, connectionName) {\n\tvar retVal = tableName;\n\t\n\tvar beginningEscapeChar = \"[\";\n\tvar endingEscapeChar = \"]\";\n\t\n\tif (connectionName) {\n\t\tvar dom = dw.getDocumentDOM();\n\t\tvar driver = MMDB.getDriverName(connectionName);\n\t\tif ((dom && dom.serverModel && dom.serverModel.getServerName() == \"PHP\") ||\n\t\t\t\t(driver && driver.match && driver.match(/mysql/gi))) {\n\t\t\tbeginningEscapeChar = \"`\";\n\t\t\tendingEscapeChar = \"`\";\n\t\t}\n\t}\n\n\t// we need to remove any table prefix which might exist,\n\t// and then add it back on after encoding\n\tvar prefix = \"\";\n\tvar preIndex = tableName.lastIndexOf(\".\");\n\tif (preIndex != -1) {\n\t\tprefix = tableName.substring(0, preIndex+1);\n\t\ttableName = tableName.substring(preIndex+1);\n\t\tretVal = tableName;\n\t}\n\t\n\tif (tableName.charAt(0) == \"_\") {\n\t\tretVal = beginningEscapeChar + retVal + endingEscapeChar;\n\t} else if (dwscripts.isNumber(tableName.charAt(0))) {\n\t\tretVal = beginningEscapeChar + retVal + endingEscapeChar;\n\t} else if (tableName.match(/\\W/)) {\n\t\tretVal = beginningEscapeChar + retVal + endingEscapeChar;\n\t} else if (dwscripts.isSQLReservedWord(tableName)) {\n\t\tretVal = beginningEscapeChar + retVal + endingEscapeChar;\n\t}\n\n\tif (prefix) {\n\t\tretVal = prefix + retVal;\n\t}\n \n\treturn retVal;\n}", "function getURL(filters){\n\t\t\tvar url = URL + \"/codes/\" + filters.dataCenter;\n\n\t\t\tif( filters.prefix ){\n\t\t\t\turl = url + \"/\" + encodeURIComponent(filters.prefix);\n\t\t\t}\n\n\t\t\tif( filters.filterBy && filters.filter ){\n\t\t\t\turl = url + \"/\" + filters.filterBy + \"/\" + filters.filter;\n\t\t\t}\n\n\t\t\treturn url;\n\t\t}", "static get tableName() {\n return '' + PREFIX + 'ptw_ppmp_material_doc';\n }", "function getDatabaseCompoundURL(source, id) {\n const _source = source && source.toLowerCase();\n if (databaseBaseURLs[_source]) {\n return databaseBaseURLs[_source].replace(\"{{id}}\", id);\n } else {\n return \"\";\n }\n}", "async function viewTable(sqlQuery, tableName) {\n db.query(sqlQuery, (err, rows) => {\n const table = cTable.getTable(rows);\n console.log(\"\\n\", \"\\n\", `All ${tableName}`, \"\\n\", table, \"\\n\", \"\\n\");\n });\n await prompt();\n}", "static get tableName() {\n\t\treturn 'brand';\n\t}", "static get table() {\n return \"dioceses\";\n }", "selectQuery() {\n return `select * from ${this.tablename('select')}`;\n }", "function dwscripts_encodeSQLTableRef(tableName, encodeSQLReservedWords)\n{\n var retVal = tableName;\n\n // Use the Server Model version if it exists\n var serverObj = dwscripts.getServerImplObject();\n if (serverObj != null && serverObj.encodeSQLTableRef != null)\n {\n retVal = serverObj.encodeSQLTableRef(tableName);\n }\n else\n {\n // we need to remove any table prefix which might exist,\n // and then add it back on after encoding\n var prefix = \"\";\n var preIndex = tableName.lastIndexOf(\".\");\n if (preIndex != -1)\n {\n prefix = tableName.substring(0, preIndex+1);\n tableName = tableName.substring(preIndex+1);\n retVal = tableName;\n }\n \n if (tableName.charAt(0) == \"_\")\n {\n\t\tretVal = \"\\\"\" + retVal + \"\\\"\";\n\t}\n else if (dwscripts.isNumber(tableName.charAt(0)))\n {\n\t\tretVal = \"\\\"\" + retVal + \"\\\"\";\n }\n else if (tableName.match && tableName.match(/\\W/gi))\n {\n\t\tretVal = \"\\\"\" + retVal + \"\\\"\";\n }\n/* [lcho 06.23.05] removing reserved-word check, as it appears to be generating invalid code\n*/ \n else if (encodeSQLReservedWords && dwscripts.isSQLReservedWord(tableName))\n {\n\t\tretVal = \"\\\"\" + retVal + \"\\\"\";\n }\n if (prefix)\n {\n retVal = prefix + retVal;\n }\n }\n \n return retVal;\n}", "function getTableID()\n{\n _href = document.location.href ? document.location.href : document.location;\n\n var suffix = _href.split('?');\n var args = suffix[suffix.length-1].split('&');\n var tID = args[0].split('=');\n\n return tID[1];\n}", "function gettable()\n{\n return table;\n}", "static get TABLE_NAME() {\n return \"login_history\";\n }", "getTableNames(){\n return this.query(\"SELECT name FROM sys.tables;\")\n }", "function dbGetCustTable(table, dataSet, renderFuncs){\n\tif(selectTableObj[table] === undefined){\n\t\tthrow \"GzFox websql : \"+table+\" undefined\";\n\t}\n\tif(dataSet === undefined){\n\t\tthrow \"GzFox websql : \"+dataSet+\" undefined\";\n\t}\n\tif(renderFuncs === undefined){\n\t\tthrow \"GzFox websql : \"+renderFuncs+\" undefined\";\n\t}\n\thtml5.webdb.queries(selectTableObj[table], dataSet, renderFuncs);\n}", "function get_table_info() {\n ;\n}", "getTable() {\n return \"st_application\";\n }", "static get TABLE_NAME() {\r\n return 'firmware'\r\n }", "get tableName() {\n if (this.table !== undefined) {\n return this.table.name\n }\n }", "function list() {\n return db(tableName).select(\"*\").orderBy(\"table_name\");\n}", "static get tableName() {\n return 'shops';\n }", "function Percorrer_Tabela(table) {\n console.log(table);\n}", "function list(){\n return knex(\"tables\")\n .select(\"*\")\n .orderBy(\"table_name\")\n}", "function list_tables()\n{\n var tables = FusionTables.Table.list();\n var result_HTML = \"\";\n var table = \"\";\n if (tables.items)\n {\n for (var i = 0; i < tables.items.length; i++)\n {\n table = tables.items[i];\n result_HTML += \" <strong>Table ID:</strong>&nbsp;&nbsp;&nbsp;\" + table.tableId\n + \" &nbsp;&nbsp;&nbsp;<strong>Table name:</strong>&nbsp;&nbsp;&nbsp;\" + table.name + \"<br>\";\n }\n }\n else\n {\n Logger.log('No tables found.');\n }\n return result_HTML;\n}", "static get tableName() {\n return '' + PREFIX + 'asset_equipment_type';\n }", "static get tableName() {\n return 'empresa';\n }", "function tableCB(table) {\n table.alias = table.name.replace(/_[a-z]/g, (c) => c.substr(1).toUpperCase());\n}", "static get tableName() {\n return 'spell'\n }", "findByUrl(payload, err, success) {\n tables[table].find({\n where: {\n originalURL: payload.originalURL,\n },\n include: [{\n all: true,\n nested: true,\n }],\n }).then(success).catch(err);\n\n log(null, __filename,\n 'Model CRUD',\n 'Search by URL');\n }", "static get tableName() {\n return \"Game\";\n }", "selectOneQuery() {\n return `select * from ${this.tablename('selectOne')} where id = $1`;\n }", "function createTableQueryExp( tableName ) {\n var opRep = mkOpRep( \"table\", [ tableName ], [] );\n var ret = mkQueryExp( opRep );\n return ret;\n }", "function urlMaker() {\n url_string = \"\"\n\n // adding the first character\n url_string = url_string.concat(\"?\")\n\n // concatinating the filternames\n configSet.filters.forEach(element => {\n url_string = url_string.concat('filter_name_list=', element, '&')\n })\n\n // concatinating the thresholds\n configSet.confidence_thresholds.forEach(element => {\n url_string = url_string.concat('confidence_threshold_list=', element, '&')\n })\n\n // concatinating the column name\n url_string = url_string.concat('column_name=', configSet.col_name, '&')\n\n // concatinating the CSV URL/Path\n url_string = url_string.concat('csv_url=', encodeURIComponent(configSet.csv_url))\n\n // remove the extra & sign in the loop\n // url_string = url_string.slice(0, -1)\n return url_string\n}", "function getTables() {\n\n var tables = {\n\n 'Clients' : {\n query: 'SELECT ClientID, Title.Description as Title, Forename, Middlename, Surname, '\n + 'AddressLine1, AddressLine2, Town, Postcode, '\n + 'HomePhone, MobilePhone, EMail, isWheelchair, isActive, DateOfBirth '\n + 'FROM (Client LEFT OUTER JOIN Title ON Client.TitleID = Title.ID)',\n DateOnlyFields: {DateOfBirth: true},\n ChoiceOnlyFields: {Gender: ['M', 'F', 'X']}\n },\n 'Destinations' : {\n query: 'SELECT * FROM Destination'\n },\n 'DestinationType' : {},\n 'Drivers' : {\n query: 'SELECT * FROM Driver',\n DateOnlyFields: {DateOfBirth: true}\n },\n 'Jobs' : {}\n };\n \n for (var sTablename in tables) {\n\n if (tables[sTablename].query == undefined) {\n\n tables[sTablename].query = 'SELECT * from ' + sTablename;\n }\n }\n\n getTables = function() {\n return tables;\n };\n\n return tables;\n}", "static get tableName(){\n return \"state\";\n }", "static get tableName() {\n return 'orders';\n }", "getTable() {\n const endpoint = \"http://localhost:7777\";\n const rpc = new Rpc.JsonRpc(endpoint);\n rpc.get_table_rows({\n \"json\": true,\n \"code\": \"trackeos\", // contract who owns the table\n \"scope\": \"trackeos\", // scope of the table\n \"table\": \"procedures\", // name of the table as specified by the contract abi\n \"limit\": 100,\n }).then(result => console.log(result));\n }", "function viewSomething(obj) {\n console.log(\"Viewing requested table!\");\n connection.query(`SELECT * FROM ${obj.table}`, function(err, res) {\n if (err) throw err;\n const newTable = table.getTable(res);\n console.log(newTable);\n });\n console.clear();\n initiation();\n}", "get nameWithoutPrefix() {\n if (this.isClosureJunction && this._name)\n return this.entityMetadata.namingStrategy.closureJunctionTableName(this._name);\n // otherwise generate table name from target's name\n const name = this.target instanceof Function ? this.target.name : this.target;\n return this.entityMetadata.namingStrategy.tableName(name, this._name);\n }", "hasTable(tableName) {\n let sql = 'select * from information_schema.tables where table_name = ?';\n const bindings = [tableName];\n\n if (this.schema) {\n sql += ' and table_schema = ?';\n bindings.push(this.schema);\n } else {\n sql += ' and table_schema = database()';\n }\n\n this.pushQuery({\n sql,\n bindings,\n output: function output(resp) {\n return resp.length > 0;\n }\n });\n }", "static get tableName() {\n return '' + PREFIX + 'all_roles';\n }", "getAllTables() {\n return this.execute('SHOW TABLES;').map(item => item[Object.keys(item)[0]]);\n }", "function getTable () {\n const dataset = bigquery.dataset(\"iot_home\");\n\n return dataset.get()\n .then(([dataset]) => dataset.table(\"sensor_data\").get());\n}", "getUrl(name) { return \"\"; }", "function odbc(options, callback){\n var cn = options.cn;\n var table = options.table;\n db.open(cn, function (err) {\n if (err) {\n return console.log(err);\n }\n\n db.query(\"select * from \"+table, function(err, rows, moreResults){\n var data = rows;\n callback(data);\n })\n });\n\n}", "function getCurrentTable() {\n if (currentTableID != 0) {\n for (var i=0; i < DB.orders.length; i++) {\n if (DB.orders[i].table == currentTableID) {\n return DB.orders[i];\n }\n }\n }\n return \"error\";\n}", "function makeurl()\r\n\t{\r\n\t\tvar url = class_baseUrl + \"?func=ll&objAction=page&objID=\" + virtual_containerId + \"&page=\" + currentPageNum + \"&sort=\" + class_sortColumn;\r\n\r\n\t\t// add on the optional pieces\r\n\t\tif ( containerSubType !== \"\" ) \r\n\t\t{\r\n\t\t\turl += \"&objType=\" + containerSubType;\r\n\t\t}\r\n\t\tif ( filterValue !== \"\" )\r\n\t\t{\r\n\t\t\turl += \"&filterValue=\" + encodeURIComponent( filterValue );\r\n\t\t}\r\n\r\n\t\tif ( objFilter !== \"\" )\r\n\t\t{\r\n\t\t\turl += \"&objFilter=\" + objFilter;\r\n\t\t}\r\n\t\t\r\n\t\tif ( currentTab !== \"\" )\r\n\t\t\t\t{\r\n\t\t\t\t\turl += \"&tab=\" + encodeURIComponent( currentTab );\r\n\t\t}\r\n\t\t\r\n\t\tfor ( var key in contentFilter ) \r\n\t\t{\r\n\t\t\tfor ( var i = 0; i < contentFilter[ key ].length; i ++ ) \r\n\t\t\t{\r\n\t\t\t\turl += \"&\" + key + \"=\" + encodeURIComponent( contentFilter[ key ][ i ] );\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn url;\r\n\t}", "function dbTableSwitch(table) {\n switch (table) {\n case 'categories':\n return categories;\n case 'challenges_categories':\n return challenges_categories;\n case 'challenges':\n return challenges;\n case 'user_submissions':\n return user_submissions;\n case 'users':\n return users;\n }\n}", "function siteColumnUrl(columnWebId){\n\treturn 'http://' + siteUrl + '/' + columnWebId + '/';\n}", "static get DATABASE_URL() {\n const protocol = location.protocol;\n const host = location.host;\n return `${protocol}//${host}/data/restaurants.json`;\n }", "static get DATABASE_URL() {\n const url = \"http://localhost\";\n const port = 1337;\n const param = \"restaurants\";\n\n return url + \":\" + port + \"/\" + param;\n }", "hasTable(tableName) {\n let sql = 'select * from information_schema.tables where table_name = ?';\n const bindings = [tableName];\n\n if (this.schema) {\n sql += ' and table_schema = ?';\n bindings.push(this.schema);\n } else {\n sql += ' and table_schema = current_schema()';\n }\n\n this.pushQuery({\n sql,\n bindings,\n output(resp) {\n return resp.rows.length > 0;\n },\n });\n }", "static get tableName() { return 'pages' }", "static get tableName() { return 'pages' }", "function tableFormat(str) {\n // Regular Expression for URIs in table specifically\n const tableexp = /(https|http|mailto|tel|dav|ftp|ftps)[:^/s]/i;\n var graph = gAppState.checkValue(\"docNameID\", \"docNameID2\");\n var strLabel = str; // variable for what is show on screen in the href\n\n if (str.includes(\"https://linkeddata.uriburner.com/describe/?url=\")) {// of str is in fct format\n strLabel = strLabel.replace(\"https://linkeddata.uriburner.com/describe/?url=\", \"\");\n strLabel = strLabel.replace(\"%23\", \"#\");\n }\n\n\n if (DOC.iSel(\"uriID\").checked == true) { //if user wants short URIs\n if (strLabel.includes(graph)) { //if str is in fct format it still includes the docname\n strLabel = strLabel.replace(graph, \"\"); //remove the docName from string\n }\n if (strLabel.includes(\"nodeID://\")) {\n strLabel = strLabel.replace(\"nodeID://\", \"_:\");\n } else if (strLabel.includes(\"#\")) {\n strLabel = strLabel.split('#')[1];\n } else if (strLabel.includes(\"/\")) {\n var strList = strLabel.split(\"/\");\n strLabel = strList.pop();\n }\n }\n\n if (tableexp.test(str)) { // if str is an absolute or relative uri\n str = '<a href=\"' + str + '\">' + strLabel + '</a>'\n return str\n }\n else {\n return strLabel\n }\n}", "function dwscripts_getTableNames(connectionName)\n{\n var tableNames = new Array();\n\n if (connectionName)\n { \n var tableObjects = MMDB.getTables(connectionName);\n\n if (tableObjects.length > 0)\n {\n for (var i=0; i < tableObjects.length; i++)\n {\n var tableObj = tableObjects[i];\n var schema = dwscripts.trim(tableObj.schema);\n\n if (schema.length == 0)\n {\n schema = dwscripts.trim(tableObj.catalog);\n }\n \n\t\tif (schema.length > 0)\n {\n schema += \".\";\n }\n\n tableNames.push(String(schema + tableObj.table)); \n }\n }\n }\n\n // Now get the views\n var viewNames = new Array(); \n var viewObjects = MMDB.getViews(connectionName)\n \n for (i = 0; i < viewObjects.length; i++)\n {\n thisTable = viewObjects[i]\n thisSchema = dwscripts.trim(thisTable.schema)\n \n if (thisSchema.length == 0)\n {\n thisSchema = dwscripts.trim(thisTable.catalog)\n }\n \n\tif (thisSchema.length > 0)\n {\n thisSchema += \".\"\n }\n \n\tviewNames.push(String(thisSchema + thisTable.view))\n }\n\n if (viewNames.length > 0) \n {\n var isMySQL = false;\n var tableslen = tableNames.length;\n var viewslen = viewNames.length;\n\n if (tableslen == viewslen)\n {\n if ((tableslen) && (viewslen))\n {\n // Quick check for mysql...\n\n if ((tableNames[0] == viewNames[0]) &&\n (tableNames[tableslen-1] == viewNames[viewslen-1]) &&\n (tableNames[tableslen/2] == viewNames[viewslen/2]))\n {\n isMySQL = true;\n }\n }\n }\n\n if (!isMySQL)\n { \n tableNames = tableNames.concat(viewNames)\n }\n } \n\n return tableNames;\n}", "function getSQLStringForURLVariable(connName,tableName,colName,varStr)\r\n{\r\n var colAndTypes = MMDB.getColumnAndTypeOfTable(connectionName, tableName);\r\n var nItems = colAndTypes.length;\r\n var i;\r\n var colType = \"\";\r\n var retVal = colName;\r\n\r\n // find colName in colAndTypesArr\r\n // note that colAndTypes is single dimensional array in form of\r\n // column name, column type, etc.\r\n\r\n for (i=0;i<nItems;i+=2)\r\n {\r\n if (colAndTypes[i] == colName)\r\n {\r\n colType = colAndTypes[i+1];\r\n }\r\n }\r\n\r\n // hava: is colType number or string type? Will next clause work?\r\n if (colType)\r\n {\r\n retVal = dwscripts.getSQLStringForDBColumnType(varStr,colType);\r\n }\r\n else\r\n {\r\n // this case should not be hit, but if it is, use no delimiters\r\n retVal = varStr;\r\n }\r\n\r\n return retVal;\r\n\r\n\r\n}", "static get table() {\n return 'profile';\n }", "function getTable(nomTab) {\n tab = nomTab;\n choisirTable();\n}// fin getTable", "urlForQuery(query, modelName) {\n switch(modelName) {\n case 'page':\n return `${this.host}/${this.namespace}/search`;\n default:\n return this._super(...arguments);\n }\n }", "function pet_view_db(tx){\n tx.executeSql('SELECT * FROM Pet',[], pet_view_data, errorDB);\n}", "async function displayTable(arg_data, arg_tableName){\n // Query to return all foreign keys in the table\n let t_query = `SELECT CONSTRAINT_NAME FROM information_schema.TABLE_CONSTRAINTS \n WHERE information_schema.TABLE_CONSTRAINTS.CONSTRAINT_TYPE = \"FOREIGN KEY\"\n AND information_schema.TABLE_CONSTRAINTS.TABLE_NAME = \"${arg_tableName}\"`;\n\n // Store all relevant references in a helper variable\n let t_refs = await queryDB(t_query);\n t_refs = t_refs.map(arg_value => arg_value[\"CONSTRAINT_NAME\"].match(/\\w+(?=_label)/g)[0]);\n\n // Filter out any references that aren't used by the data and add employee references if applicable\n let t_columns = Object.keys(arg_data[0]);\n t_refs = t_refs.filter( arg_value => t_columns.includes(arg_value + \"_id\"));\n\n // Add any columns that reference employee\n let t_employeeRefs = t_columns.filter(arg_value => employeeColumns.includes(arg_value));\n if(t_employeeRefs.length > 0){ \n t_refs = t_refs.concat(t_employeeRefs.map(arg_value => arg_value.replace(/_id/g, \"\"))); \n }\n\n // Replace references in data\n let t_data = await updateDataIds(arg_data, t_refs); \n\n // Return log the data\n return tableRenderer(t_data);\n}", "static _getTableName(){\n return \"posts\"\n }", "static get DATABASE_URL() {\n //const port = 8080 // Change this to your server port\n const url = `http://localhost:${PORT}/restaurants`;\n\n return url;\n }", "getTable() {\n const eos = Eos();\n eos.getTableRows({\n \"json\": true,\n \"code\": \"{{ cookiecutter.default_account }}\", // contract who owns the table\n \"scope\": \"{{ cookiecutter.default_account }}\", // scope of the table\n \"table\": \"notestruct\", // name of the table as specified by the contract abi\n \"limit\": 100,\n }).then(result => this.setState({ noteTable: result.rows }));\n }", "static get table() {\n return \"newsletter\";\n }", "constructor() {\n super({ dbName: dbName });\n\n const oThis = this;\n\n oThis.tableName = 'aux_price_oracles';\n }", "function bp_ont_link(ont_acronym){\n return \"/ontologies/\" + ont_acronym;\n}", "async select(table, { filters = null, filterParams = [] } = {}) {\n try {\n let query = \"SELECT * FROM \" + table;\n if (filters) {\n query += \" WHERE \";\n for (let filter of filters) {\n query += `${filter} AND `;\n }\n query = query.slice(0, query.length - 5);\n }\n query += \";\";\n const output = await this.pool.query(query, filterParams);\n return output;\n } catch (e) {\n console.error(\"db.select error: \", e);\n throw e;\n }\n }", "static get tableName() {\n\t\treturn 'promotion_code';\n\t}", "function getTableName(entity) {\n\t\treturn entity.canon$({object:true}).name;\n\t}", "function buildTableRangeName_(tableName) {\n return tableName.replace(/^[0-9]/, '').replace(/[^a-zA-Z0-9]/g, \"\") + ManagementService_.managementSheetName()\n }", "function overviews_view_name(table) {\n var parsed_table = TableNameParser.parse(table);\n parsed_table.table = '_vovw_' + parsed_table.table;\n parsed_table.schema = null;\n return TableNameParser.table_identifier(parsed_table);\n}", "function createURL() {\n var query_url = api_url.concat(patientID,auth,accessToken);\n actualQuery();\n }", "function _getConnectionURL(info) {\n var context = info.registrationContext;\n var scheme = context.https ? \"https\" : \"http\";\n var host = context.serverHost + \":\" + context.serverPort;\n var path = (context.resourcePath.length > 0 && context.resourcePath != 'null' && context.farmId.length > 0 && context.farmId!= 'null') ? (context.resourcePath + \"/\" + context.farmId + \"/\") : \"\";\n return scheme + \"://\" + host + \"/\" + path + \"odata/applications/v1/\" + sap.Logon.applicationId + \"/Connections('\" + info.applicationConnectionId + \"')\";\n }", "function _getWidgetUrl() {\n\n var url = _root + _db + '%26numrec%3D' + settings.count + _format + _proxy + '%26rcounturl%3D&h=&settings=' + settings.covers + ',' + settings.scroll + ',' + settings.auto + ',' + settings.scrollSpeed + ',' + settings.dots;\n return url;\n\n }", "function categoryTable() { }", "function gen_url (connection, collection) {\n\tvar config = connections.connections[connection];\n\tvar url = config.URI;\n\n\turl += '/' + config.orgName + '/' + config.appName + '/' + collection + '?';\n\n\treturn url;\n}", "static TwoTables(req,res){\n var url = req.params.id;\n console.log(url,\" <<<<<<<<<<<<<<<<esto quiero\")\n Citas_Medicas.findAll({\n where : { especialidad : url, estado: \"true\" }, // el url es para identificar si es emergencia o consulta medica\n attributes: ['id','estado','codigo_p','hora','especialidad'],\n include: [\n {model: Pacientes, attributes: ['id','nombre', 'apellidop','apellidom'] }\n ]\n }).then(users => {\n res.status(200).send(users)\n })\n }", "static get table() {\n return 'coupon_order'\n }", "function table() {\n this.table = null;\n this.opts = {};\n this.table_id = \"\";\n}" ]
[ "0.6198736", "0.6198736", "0.61935323", "0.59674555", "0.59411687", "0.56809366", "0.567474", "0.5619201", "0.5613646", "0.56016505", "0.5578619", "0.54963696", "0.5492505", "0.5479175", "0.54001516", "0.5371615", "0.5347333", "0.5295303", "0.52872294", "0.5283839", "0.5271192", "0.52477473", "0.52449006", "0.5235797", "0.5229435", "0.52145827", "0.52131236", "0.5210717", "0.5193375", "0.51801425", "0.5160668", "0.5135762", "0.5133273", "0.51055515", "0.5055717", "0.5046634", "0.5022864", "0.5011245", "0.5008938", "0.50064695", "0.49895948", "0.49536458", "0.4940884", "0.49202257", "0.4916961", "0.49126843", "0.48965606", "0.48960474", "0.48822576", "0.48680955", "0.48651764", "0.48633447", "0.48522672", "0.48294145", "0.4827797", "0.48223776", "0.4805962", "0.48059058", "0.4788204", "0.4779823", "0.4778629", "0.4775744", "0.4771774", "0.4771564", "0.4766079", "0.47637847", "0.47531277", "0.4751402", "0.4744766", "0.47418967", "0.47397754", "0.47363934", "0.47363934", "0.47200817", "0.47188842", "0.47087064", "0.47059092", "0.47032484", "0.46831748", "0.4671258", "0.46664762", "0.4661446", "0.4655269", "0.4651779", "0.465096", "0.46321318", "0.4621784", "0.46189538", "0.4618643", "0.46136817", "0.4610505", "0.46069458", "0.46011975", "0.45919135", "0.4582086", "0.4572828", "0.45583495", "0.45568195", "0.45561767", "0.45521012" ]
0.56059414
9
Get data from a geoserver table. These tables are slightly weird in the way that you have to parse the JSON afterwards.
function getGeoserverTable(url, success, failure) { Ext.Ajax.request({ url : url, success : _.compose(success, parseGeoserverJson), failure : failure }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getTableDataFromJSON() {\n\n }", "function jsonUrl(tableName) {\n var url = \"/geoserver/wfs\"\n url += \"?request=GetFeature\"\n url += \"&version=1.1.0\"\n url += \"&outputFormat=JSON\"\n url += \"&typeName=opencop:\"\n url += tableName\n return url\n }", "getData(table) {\n return this.content.data[table];\n }", "function getDataFromTable() {\n var parameterName = $.request.parameters.get('insert_parameter_here'); // Get the parameters from HTTP GET\n var conn = $.db.getConnection(); // SQL Connection\n var pstmt; // Prepare statement\n var rs; // SQL Query results\n var query; // SQL Query statement\n var output = { // Output object\n results: [] // Result array\n };\n var record = {}; // Record object\n try {\n // # might remove hard-coded schema name, and table name\n query = 'SELECT attribute_id, attribute_name, attribute_country FROM \\\"schema_name\\\".\\\"table_name\\\" WHERE attribute_name = ?';\n pstmt = conn.prepareStatement(query);\n pstmt.setString(1, parameterName);\n rs = pstmt.executeQuery(); // Execute query; Get items from SAP HANA\n\n // Push fetched data to Result array\n while (rs.next()) {\n record = {};\n record.parameterID = rs.getString(1);\n record.parameterName = rs.getString(2);\n record.parameterCountry = rs.getString(3);\n output.results.push(record);\n }\n\n conn.commit(); // Prevent deadlock by allowing a cocurrent SQL query to wait until this statement is fully executed\n rs.close(); // Close statements & connections\n pstmt.close();\n conn.close();\n } catch (e) {\n // Catch error if parameters are incorrect\n $.response.status = $.net.http.INTERNAL_SERVER_ERROR;\n $.response.setBody(e.message);\n return;\n }\n // Output respond into JSON body\n var body = JSON.stringify(output);\n $.response.contentType = 'application/json';\n $.response.setBody(body);\n $.response.status = $.net.http.OK;\n}", "async function getData(){\r\n\r\n //Fetch the data from the geojson file\r\n fetch(\"BEWES_Building_Data.geojson\").then(response => response.json()).then(data => {addToTable(data);});\r\n\r\n }", "function cjAjaxGetTable(handler, queryKey, args, pageSize, pageNumber) {\n return this.data(handler, queryKey, args, pageSize, pageNumber, \"jsontable\", \"data\")\n}", "function getTable () {\n const dataset = bigquery.dataset(\"iot_home\");\n\n return dataset.get()\n .then(([dataset]) => dataset.table(\"sensor_data\").get());\n}", "function getDistanceData() {\n return ddb.get({\n TableName: 'distance_data',\n Key: {region: 'Minnesota'}, //grabs the object from the first table\n }).promise();\n}", "function getData() {\n\t$.ajax({\n\t\turl: \"http://localhost:8080/rest/api/planes\",\n\t\ttype: \"GET\",\n\t\tdataType: \"json\",\n\t\tsuccess: function(data) {\n\t\t\tconsole.log(data);\n\t\t\t\n\t\t\t$.each(data, function(index){\n\t\t\t\tvar tr = $('<tr>');\n\t\t\t\ttr.append('<td>' + data[index].model + '</td>');\n\t\t\t\ttr.append('<td>' + data[index].engine + '</td>');\n\t\t\t\ttr.append('<td>' + data[index].seats + '</td>');\n\t\t\t\ttr.append('<td>' + data[index].maxWeight + '</td>');\n\t\t\t\ttr.append('<td>' + data[index].maxBaggage + '</td>');\n\t\t\t\ttr.append('<td>' + data[index].maxSpeed + '</td>');\n\t\t\t\ttr.append('</tr>');\n\t\t\t\t$('#planes').append(tr);\n\t\t\t});\n\t\t}\n\t});\n}", "function chartTable(response) {\n drawMap(response, 'table', 'Table');\n}", "function getPoints() {\n return tableData;\n }", "async function request_table_data(url)\n{\n const response = await fetch(url);\n const data = await response.json()\n return data; \n}", "function grabTableData() {\n var cache1 = CacheService.getDocumentCache();\n var dataForChart = (cache1.get('mtData'));\n Logger.log('return:' + JSON.parse(dataForChart));\n return dataForChart;\n}", "function getData(req, res) {\n\n var coords = req,\n sql_poly = [],\n points = [];\n\n for (var i in coords) {\n sql_poly.push(coords[i].lng);\n sql_poly.push(coords[i].lat);\n };\n\n // close the polygon\n sql_poly.push(coords[0].lng);\n sql_poly.push(coords[0].lat);\n\n // write the correct number of st_point functions\n for (var j=1; j<=sql_poly.length; j+=2) {\n points.push('ST_SetSRID(ST_Point($' + j + ',' + '$' +(j+1) + '), 4326)');\n }\n\n var sql = \"SELECT address, zipcode, borough, borocode, block, lot, cd, ownername, ownertype,\"+\n \"numfloors, yearbuilt, zonedist1, zonedist2, zonedist3,\" +\n \"zoning_style, \" +\n \" ST_AsGeoJSON(geom)\" + \n \" AS geom FROM map_pluto2014v2 WHERE \" +\n \" ST_Intersects(geom, ST_MakePolygon(ST_MakeLine( ARRAY[\" + \n points.join() +\n \" ] )));\";\n \n console.log('the sql: ', sql);\n\n var fc = {\n \"type\" : \"FeatureCollection\",\n \"features\" : []\n };\n\n\n client.query(sql, sql_poly, function(err, result) {\n \n if (err) { \n console.log(\"error: \", err);\n return;\n }\n\n // console.log('client query sql res: ', result);\n \n result.rows.forEach(function(feature) {\n\n var f = {\n \"type\" : \"Feature\",\n \"geometry\" : JSON.parse(feature.geom),\n \"properties\" : {\n \"borough\" : feature.borough,\n \"boroughcode\" : feature.borocode,\n \"block\": feature.block,\n \"lot\": feature.lot,\n \"address\": feature.address,\n \"zipcode\": feature.zipcode,\n \"communitydistrict\": feature.cd,\n \"ownername\" : feature.ownername,\n \"ownertype\" : feature.ownertype,\n \"numberfloors\" : feature.numfloors,\n \"yearbuilt\" : feature.yearbuilt,\n \"zoningprimary\" : feature.zonedist1,\n \"zoningsecondary\" : feature.zonedist2,\n \"zoningtertiary\" : feature.zonedist3,\n \"zonestyle\" : feature.zoning_style\n }\n };\n fc.features.push(f);\n });\n\n res.setHeader(\"Access-Control-Allow-Origin\", \"*\")\n res.send(fc);\n //client.end(); \n // console.log('queried data: ', fc);\n });\n\n}", "function getDataTable(sample_id) {\n var url_meta = \"/metadata/\" + sample_id;\n\n Plotly.d3.select(\"tbody\").html(\"\");\n\n Plotly.d3.json(url_meta, function (error, initDataMeta) {\n Plotly.d3.select(\"tbody\").selectAll(\"tr\")\n .data(initDataMeta)\n .enter()\n .append(\"tr\")\n .html(function (d) {\n return `<td>${Object.keys(d)}</td><td>${d[Object.keys(d)]}</td>`\n })\n });\n\n\n}", "function getData(tableData){\n tableData.forEach((sighting) => {\n //console.log(sighting)\n var row = tbody.append(\"tr\");\n Object.entries(sighting).forEach(([key, value]) => {\n //console.log(key, value);\n // Append a cell to the row for each value\n // in the weather report object\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function queryFusionTableV1(query){\n query = encodeURIComponent(query);\n var gvizQuery = new google.visualization.Query(\n 'http://www.google.com/fusiontables/gvizdata?tq=' + query);\n\n gvizQuery.send(function(response) {\n var numRows = response.getDataTable().getNumberOfRows();\n\n for (var i = 0; i < numRows; i++) {\n\t\t\t//HACK get first column\n var kml = response.getDataTable().getValue(i, 0); \n\t\t\tvar kmlLayer = new google.maps.KmlLayer(kml, {\n\t\t\t\tsuppressInfoWindows: true,\n\t\t\t\tpreserveViewport: false,\n\t\t\t\tmap: g_map,\n\t\t\t});\n }\n });\n}", "function getData() {\n // data downloaded from the USGS at http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/ on 4/4/16\n // month.geojson represents recorded earthquakes between 03/04/2016 and 04/04/2016\n // week.geojson represents recorded earthquakes betwen 03/28/2016 and 04/04/2016\n var url = \"data/week.geojson\";\n return esriRequest(url, {\n responseType: \"json\"\n });\n }", "rowData() {\n const data = this.mapResponseData();\n let rows = [];\n if (data) {\n for (const property in data) {\n rows = rows.concat(data[property]);\n }\n return rows;\n }\n return null;\n }", "getTable(table, baseId = this.defaultBaseId, apiKey = this.defaultApiKey) {\n // ensure existence of airtable connection to base\n const base = this.getOrConnect(baseId, apiKey);\n if (base == null) {\n return;\n }\n\n let response = [];\n return base(table)\n .select()\n .eachPage(function page(records, fetchNextPage) {\n // This function (`page`) will get called for each page of records.\n records.forEach(function(record) {\n // attach json array with record fields and id to response\n record.fields.id = record.id;\n response.push(record.fields);\n });\n fetchNextPage();\n })\n .then(() => {\n return response;\n });\n }", "function displayTable() {\r\n dayMapsDB.transaction(function (transaction) {\r\n transaction.executeSql('SELECT * FROM dayMapsDB', [], function (tx, results) {\r\n var len = results.rows.length, i;\r\n for (i = 0; i < len; i++) {\r\n console.log(results.rows.item(i).id + \" \" + results.rows.item(i).date + \" \" + results.rows.item(i).efficiency + \" \" + results.rows.item(i).totalStartTime + \" \" + results.rows.item(i).totalStopTime);\r\n }\r\n }, null);\r\n });\r\n }", "function getDataFromTable(table){\n const dataTable = [];\n const cols = getData('columns');\n const rows = Array.from(table.rows).slice(1);\n \n rows.forEach(rowData => {\n let dataRow = {};\n \n for (let col in cols) {\n let data = rowData.cells;\n switch(cols[col]){\n case 'total':\n let total = parseFloat(data[col].innerHTML.slice(1));\n dataRow[cols[col]] = total;\n break;\n case 'order': \n let value = parseInt(data[col].childNodes[0].innerHTML.slice(1));\n dataRow[cols[col]] = value;\n dataRow['order_link'] = data[col].childNodes[0].href;\n break; \n case 'status':\n dataRow[cols[col]] = data[col].childNodes[0].innerHTML;\n break;\n default:\n dataRow[cols[col]] = data[col].innerHTML;\n break;\n }\n }\n dataTable.push(dataRow);\n })\n \n /*for (let i=1; i < rows.length; i++){\n var row_data = {};\n for (let col in cols) {\n let data = rows[i].cells;\n if (cols[col] === 'order'){\n let value = parseInt(data[col].childNodes[0].innerHTML.slice(1));\n row_data[cols[col]] = value;\n row_data['order_link'] = data[col].childNodes[0].href;\n } else if (cols[col] === 'total'){\n let value = parseFloat(data[col].innerHTML.slice(1));\n row_data[cols[col]] = value;\n } else if (cols[col] === 'status'){\n row_data[cols[col]] = data[col].childNodes[0].innerHTML;\n }\n else {\n row_data[cols[col]] = data[col].innerHTML;\n }\n \n }\n data.push(row_data);\n }*/\n return dataTable;\n}", "function eDataDataTable(){\r\n\ttdType='3';\r\n\tvar url = 'productId.testobjectdata.attachments.list?productId='+productId+'&jtStartIndex=0&jtPageSize=10000';\r\n\tvar jsonObj = \t{\r\n\t\t\t\t\t\t\"Title\":\"EData\",\r\n\t\t\t\t\t\t\"url\":url,\r\n\t\t\t\t\t\t\"jtStartIndex\":0,\r\n\t\t\t\t\t\t\"jtPageSize\":1000,\r\n\t\t\t\t\t\t\"componentUsageTitile\":\"Test Data Plan\"\r\n\t\t\t\t\t};\r\n\tassignEDataDataTableValues(jsonObj);\r\n}", "getData() {\r\n return this.table;\r\n }", "get() {\n let options = {\n method: 'GET',\n url: this.url + this.table,\n qs: this.qs\n };\n\n return new Promise((resolve, reject) => {\n this.request(options, (err, response, body) => {\n if(err) {\n return reject(err);\n }\n\n try {\n if(response.statusCode !== 200) {\n return reject(new Error(`Unexpected response status ${response.statusCode}`));\n }\n\n let jsonRes = body.records;\n resolve(jsonRes);\n } catch(e) {\n return reject(e);\n }\n });\n });\n }", "getTable() {\n const endpoint = \"http://localhost:7777\";\n const rpc = new Rpc.JsonRpc(endpoint);\n rpc.get_table_rows({\n \"json\": true,\n \"code\": \"trackeos\", // contract who owns the table\n \"scope\": \"trackeos\", // scope of the table\n \"table\": \"procedures\", // name of the table as specified by the contract abi\n \"limit\": 100,\n }).then(result => console.log(result));\n }", "function getData(map){\r\n $.ajax(\"data/Species.geojson\", {\r\n dataType: \"json\"\r\n ,success: function(response){\r\n var layerWells = createPropSymbols(response, map, processData(response));\r\n getDataMinMax(map, processData(response)[0]);\r\n addLayerControl(layerWells);\r\n createSequenceControls(map, response, processData(response));\r\n }\r\n });\r\n}", "function Populate_Proxy_Tables(){\r\n $.ajax({\r\n type : \"GET\",\r\n url : \"/Proxy_Data\",\r\n dataType : \"json\",\r\n success: function(data){\r\n Grid_Table_Populator();\r\n }\r\n })\r\n }", "function getEntries() {\n return db.get(\"data_entries_point\").value();\n}", "function getGeoJSON(){\r\n $.getJSON(\"https://\"+cartoDBusername+\".cartodb.com/api/v2/sql?format=GeoJSON&q=\"+sqlQuery, function(data) {\r\n cartoDBPoints = L.geoJson(data,{\r\n pointToLayer: function(feature,latlng){\r\n var marker = L.marker(latlng);\r\n marker.bindPopup('' +'Info: '+ feature.properties.description + '<br>Contact: ' + feature.properties.email + '<br>Date: ' + feature.properties.date +'');\r\n return marker;\r\n }\r\n }).addTo(map);\r\n });\r\n}", "function getTableData2021(){\n\tconst xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", \"https://thesportsdb.p.rapidapi.com/lookuptable.php?s=2021-2022&l=4328\");\n\txhr.setRequestHeader(\"x-rapidapi-key\", \"6ac09b72d5msh34d2f29a0d7e971p11ca0djsnf30428cae1c6\");\n\txhr.setRequestHeader(\"x-rapidapi-host\", \"thesportsdb.p.rapidapi.com\");\n\txhr.onload = function(){\n\t\tif(xhr.status == 200){\n\t\t\tlet tablesLoaded = JSON.parse(xhr.response);\n\t\t\trank = tablesLoaded.table.map(element => element.intRank);\n\t\t\tteams = tablesLoaded.table.map(element => element.strTeam);\n\t\t\tbadge = tablesLoaded.table.map(element => element.strTeamBadge);\n\t\t\tplayed = tablesLoaded.table.map(element => element.intPlayed);\n\t\t\tpoints = tablesLoaded.table.map(element => element.intPoints);\n\t\t\tform = tablesLoaded.table.map(element => element.strForm);\n\t\t\ttableElement.innerHTML = `\n\t\t\t<tr>\n\t\t\t<th>Position</th>\n\t\t\t<th></th>\n\t\t\t<th>Team</th>\n\t\t\t<th>Played</th>\n\t\t\t<th>Points</th>\n\t\t\t<th>Form</th>\n\t\t\t</tr>`;\n\t\t\tfor (i = 0; i < rank.length; i++){\n\t\t\t\ttableElement.innerHTML += `\n\t\t\t\t<td>${rank[i]}</td>\n\t\t\t\t<td><img src=\"${badge[i]}\"</td>\n\t\t\t\t<td>${teams[i]}</td>\n\t\t\t\t<td>${played[i]}</td>\n\t\t\t\t<td>${points[i]}</td>\n\t\t\t\t<td>${form[i]}</td>`;\n\t\t\t\t}\n\t\t} else{\n\t\t\tconsole.log(xhr.statusText); // log error to console to allow inspection of error if it occurs\n\t\t\ttableElement.innerHTML = `<p>Error with trying to get table information. Please try again.</p>`;\n\t\t}\n\t};\n\txhr.send();\n\treturn ;\n}", "function infoTable(tableData2) {\n tableData2.map(data => {\n var row = tbody.append(\"tr\");\n // Append each row with data\n row.append(\"td\").text(data.datetime);\n row.append(\"td\").text(data.city);\n row.append(\"td\").text(data.state);\n row.append(\"td\").text(data.country);\n row.append(\"td\").text(data.shape);\n row.append(\"td\").text(data.durationMinutes);\n row.append(\"td\").text(data.comments);\n });\n}", "function getTableData() {\n $.ajax({\n type: \"GET\",\n url: \"/api\",\n dataType: \"JSON\",\n success: function (data) {\n let table = generateTable(data.data);\n $('#tableResult').html(table);\n }, error: function (data) {\n\n }\n });\n}", "function tableToJson(table) {\n let data = [];\n for (i = 1; i < table.rows.length; i++) {\n let tableRow = table.rows[i];\n let rowData = [];\n for (j = 1; j < tableRow.cells.length; j++) {\n rowData.push(tableRow.cells[j].innerHTML);\n }\n data.push(rowData);\n }\n return data;\n}", "function getTableData2020(){\n\tconst xhr = new XMLHttpRequest();\n\txhr.open(\"GET\", \"https://thesportsdb.p.rapidapi.com/lookuptable.php?s=2020-2021&l=4328\");\n\txhr.setRequestHeader(\"x-rapidapi-key\", \"6ac09b72d5msh34d2f29a0d7e971p11ca0djsnf30428cae1c6\");\n\txhr.setRequestHeader(\"x-rapidapi-host\", \"thesportsdb.p.rapidapi.com\");\n\txhr.onload = function(){\n\t\tif(xhr.status == 200){\n\t\t\tlet tablesLoaded = JSON.parse(xhr.response);\n\t\t\trank = tablesLoaded.table.map(element => element.intRank);\n\t\t\tteams = tablesLoaded.table.map(element => element.strTeam);\n\t\t\tbadge = tablesLoaded.table.map(element => element.strTeamBadge);\n\t\t\tplayed = tablesLoaded.table.map(element => element.intPlayed);\n\t\t\tpoints = tablesLoaded.table.map(element => element.intPoints);\n\t\t\tform = tablesLoaded.table.map(element => element.strForm);\n\t\t\ttableElement.innerHTML = `\n\t\t\t<tr>\n\t\t\t<th>Position</th>\n\t\t\t<th></th>\n\t\t\t<th>Team</th>\n\t\t\t<th>Played</th>\n\t\t\t<th>Points</th>\n\t\t\t<th>Form</th>\n\t\t\t</tr>`;\n\t\t\tfor (i = 0; i < rank.length; i++){\n\t\t\t\ttableElement.innerHTML += `\n\t\t\t\t<tr>\n\t\t\t\t<td>${rank[i]}</td>\n\t\t\t\t<td><img src=\"${badge[i]}\"</td>\n\t\t\t\t<td>${teams[i]}</td>\n\t\t\t\t<td>${played[i]}</td>\n\t\t\t\t<td>${points[i]}</td>\n\t\t\t\t<td>${form[i]}</td>\n\t\t\t\t</tr>`;\n\t\t\t}\n\t\t} else{\n\t\t\tconsole.log(xhr.statusText); // log error to console to allow inspection of error if it occurs\n\t\t\ttableElement.innerHTML = `<p>Error with trying to get table information. Please try again.</p>`;\n\t\t}\n\t};\n\txhr.send();\n\treturn ;\n}", "function getData() {\n animate();\n \n var url = window.API.getAPIUrl(\"comps\");\n \n //url += \"?env=development\"; //When needed the development branch, for lab.fermat.org\n\n window.API.getCompsUser(function (list){ \n\n window.loadMap(function() {\n\n window.tileManager.JsonTile(function() {\n\n window.preLoad(function() {\n\n window.tileManager.fillTable(list);\n TWEEN.removeAll();\n window.logo.stopFade();\n window.helper.hide('welcome', 1000, true);\n init();\n\n });\n });\n });\n });\n\n \n//Use when you don't want to connect to server\n/*setTimeout(function(){\n var l = JSON.parse(testData);\n \n window.preLoad(function() {\n \n window.tileManager.JsonTile(function() {\n \n window.loadMap(function() {\n tileManager.fillTable(l);\n\n TWEEN.removeAll();\n logo.stopFade();\n init();\n });\n })\n });\n\n }, 6000);*/\n}", "function getData() {\n animate();\n \n var url = window.API.getAPIUrl(\"comps\");\n \n //url += \"?env=development\"; //When needed the development branch, for lab.fermat.org\n\n window.API.getCompsUser(function (list){ \n\n window.loadMap(function() {\n\n window.tileManager.JsonTile(function() {\n\n window.preLoad(function() {\n\n window.tileManager.fillTable(list);\n TWEEN.removeAll();\n window.logo.stopFade();\n window.helper.hide('welcome', 1000, true);\n init();\n\n });\n });\n });\n });\n\n \n//Use when you don't want to connect to server\n/*setTimeout(function(){\n var l = JSON.parse(testData);\n \n window.preLoad(function() {\n \n window.tileManager.JsonTile(function() {\n \n window.loadMap(function() {\n tileManager.fillTable(l);\n\n TWEEN.removeAll();\n logo.stopFade();\n init();\n });\n })\n });\n\n }, 6000);*/\n}", "function default_populate() {\n // Set default table desctiption\n let table_desc = document.getElementById('table-description');\n table_desc.innerHTML = \"The Top 10 Densest Known Meteorites\";\n\n // SoQL for dataset\n const apiUrl = 'https://data.nasa.gov/resource/gh4g-9sfh.json?' +\n '$where=mass IS NOT NULL' +\n '&$order=mass DESC' +\n '&$limit=10';\n\n const encodedURL = encodeURI(apiUrl);\n\n console.log(encodedURL);\n\n fetch(encodedURL)\n .then(function(response) { // Convert returned JSON String into Array of trees.\n return response.json();\n })\n .then(function(meteorites) { // Add array of retrieved trees to the table.\n add_meteorites_table(meteorites);\n });\n}", "function gettable()\n{\n return table;\n}", "function getData(container, cb) {\n\t\tvar url = '/data/' + container;\n\t\t\n\t\t$.get(url, function(data, status){\n\t\t\tif(status == 'success'){\n\t\t\t\tvar valuePrim = data.con;\n\t\t\t\tvar valueTime = data.ct;\n\t\t\t\t\n\t\t\t\tvar valueDate = valueTime.substr(0, 10);\n\t\t\t\tvar valueTimes = valueTime.substr(11, 8);\n\t\t\t\tvalueTime = valueDate + \" \" + valueTimes;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tvar valuegwl = \"000\";\n\t\t\t\tvar valueGEUI = \"undefined\";\n\t\t\t\tif(data.ppt == null){\n\t\t\t\t\tvalueLat = \"undefined\";\n\t\t\t\t\tvalueLng = \"undefined\";\n\t\t\t\t}\n\t\t\t\telse if(data.ppt != null || data.ppt.gwl != null || data.ppt.gwl.split(\",\")[1] != null){\n\t\t\t\t\tvaluegwl = data.ppt.gwl;\n\t\t\t\t\tvalueGEUI = data.ppt.geui;\n\t\t\t\t\n\t\t\t\t\tresult = valuegwl.split(\",\");\n\t\t\t\t\t\n\t\t\t\t\tvalueLat = result[0];\n\t\t\t\t\tvalueLng = result[1];\n\t\t\t\t\tvalueAlt = result[2];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tresult_lat[nodeIndex] = deepCopy(valueLat);\n\t\t\t\tresult_lng[nodeIndex] = deepCopy(valueLng);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tcb(null, valueTime, valuePrim, valuegwl, valueGEUI);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.log('[Error] /data API return status :'+status);\n\t\t\t\tcb({error: status}, null);\n\t\t\t}\n\t\t});\n\t}", "function getEmp() {\n var conn = new sql.Connection(dbConfig);\n var req = new sql.Request(conn);\n\n conn.connect(function (err) {\n if (err) {\n console.log(err);\n return;\n }\n req.query(selectAll, function (err, recordset) {\n if (err) {\n console.log(err);\n }\n else {\n //var myid = _.chain(recordset).map(function (i) {\n // return i.id\n //}).value()\n //features.properties.id = myid\n\n //console.log( recordset[0])\n for (i = 0; i < recordset.length; i++) {\n var wktGeom = recordset[i].geom\n var sov = recordset[i].sovereign\n var id = recordset[i].fid\n\n if (typeof wktGeom == 'string') {\n //console.log(wktGeom)\n var toGeoJSON = parse(wktGeom);\n features.properties.id = id;\n features.properties.admin = sov;\n features.geometry = toGeoJSON;\n featureCollection.features.push(features)\n }\n else if (typeof wktGeom == 'object') {\n var stringJSON = wktGeom.toString()\n var geoJSON = parse(stringJSON)\n\n if (geoJSON != null) {\n //console.log(toGeoJSON)\n features.properties.id = id;\n features.properties.admin = sov;\n features.geometry = toGeoJSON;\n featureCollection.features.push(features)\n }\n }\n console.log(featureCollection)\n }\n //var topo = topoj.topology({ collection: featureCollection })\n //var topoData = topo.objects.collection.geometries\n //console.log(featureCollection.features.properties.id)\n //console.log(topo.objects.collection.geometries)\n //console.log(topo.objects.collection.geometries)\n }\n conn.close();\n });\n })\n}", "function dataFunc(data) {\n console.log(data.getData());\n console.log(data.getColumns());\n }", "function dataTable(table){\n // Reset table\n tbody.text(\"\");\n\n // Populate table\n table.forEach(function(incident) {\n // console.log(incident);\n var row = tbody.append(\"tr\");\n Object.entries(incident).forEach(function([key, value]) {\n // console.log(key, value);\n var cell = row.append(\"td\");\n cell.text(value);\n });\n});\n}", "get data() {\n\t\treturn this._tableData;\n\t}", "function makeTableFromService(dataArray) {\n //Get field names\n var fieldNames = [];\n for(var i=0; i<dataArray.fields.length; i++) {\n fieldNames.push(dataArray.fields[i].name);\n }\n\n //Build header record\n var result = \"<table>\";\n result += \"<tr>\";\n for (var i=0; i<fieldNames.length; i++) {\n result += \"<th>\" + fieldNames[i] + \"</th>\";\n }\n result += \"</tr>\";\n\n //Build the table\n for(var i=0; i<dataArray.features.length; i++) {\n result += \"<tr>\";\n for (var x in dataArray.features[i].attributes) {\n result += \"<td>\" + dataArray.features[i].attributes[x]; + \"</td>\";\n }\n result += \"</tr>\";\n }\n result += \"</table>\";\n\n replaceDIVContents(\"textContent\", result);\n}", "function getAllData() {\n fetch(\"/items\", {\n headers: { 'Content-Type': 'application/json' },\n method: \"GET\",\n })\n .then(res => {\n if(res.ok) return res.json();\n })\n .then(res => {\n data = res;\n createTable(res);\n })\n .catch(error => console.error(error.message));\n }", "function requestTableData() {\n var sortParams = o.scope.sortParams,\n pp = fs.isO(o.scope.payloadParams),\n payloadParams = pp || {},\n p = angular.extend({}, sortParams, payloadParams, o.query);\n\n if (wss.isConnected()) {\n if (fs.debugOn('table')) {\n $log.debug('Table data REQUEST:', req, p);\n }\n wss.sendEvent(req, p);\n ls.start();\n }\n }", "function displayFeaturesTable () {\n /* Initialize Ajax Request */\n var req = new XMLHttpRequest();\n req.open(\"GET\", FLIP + PORT + \"/select-all-features\", true);\n \n req.addEventListener(\"load\", function generateRows() {\n /* If there was no error, display rows. */\n if (req.status >= 200 && req.status < 400) {\n var res = JSON.parse(req.responseText);\n \n /* If there are no rows to display, inform the user */\n if (res.length == 0) {\n var noDataMessage = document.getElementById('no_data_rcdb_features');\n noDataMessage.style.display = 'block';\n }\n \n /* Otherwise, create a table with the coasters data. */\n else {\n var featuresTable = document.getElementById('features_table');\n featuresTable.style.display = 'block';\n \n var tableBody = document.getElementById('features_table_body')\n /* Remove old table rows from HTML (useful if updating the table so that there aren't duplicate rows).*/\n var childrenArr = Array.from(tableBody.children);\n for (var child of childrenArr) {\n tableBody.removeChild(child);\n }\n \n /* Display table data. */\n for (var row of res) {\n var newRow = document.createElement(\"tr\");\n \n newRow.id = row.id;\n \n var nameCell = document.createElement(\"td\");\n nameCell.textContent = row.name;\n newRow.appendChild(nameCell);\n tableBody.appendChild(newRow);\n }\n }\n }\n else {\n alert(\"An error occurred getting data from the server.\");\n }\n });\n req.send(null);\n}", "function getRowData(tr=false, format=\"JSON\") {\n if(tr) {\n \n if(format === \"JSON\") {\n var obj = [];\n \n\n tds = $(tr).find(\"td\");\n tds.each(function() {\n var data = $(this).text();\n obj.push(data)\n });\n\n return obj;\n }\n }\n}", "function addDataToMap(dataLayer, choice) {\n var url = 'https://eichnersara.cartodb.com/api/v2/sql?' + $.param({\n q: 'SELECT * FROM bk_oddlots ' + choice,\n format: 'GeoJSON'\n });\n $.getJSON(url)\n \n .done(function (data) {\n dataLayer.clearLayers();\n dataLayer.addData(data);\n console.log(data);\n });\n}", "function loadTable() {\n \n STATIONS.getStations(function(stations){\n\n var lang;\n if(TEXT.getLang() === 'fr') {\n lang = \"French\";\n } else {\n lang = \"English\"\n }\n\n $('#table').dataTable({\n 'destroy': true,\n 'aaData': stations,\n 'aoColumns' : [\n { 'mDataProp': 'id' },\n { 'mDataProp': 'name' },\n { 'mDataProp': 'bicycles_available' },\n { 'mDataProp': 'terminals_available' },\n { 'mDataProp': 'blocked',\n 'render' : function(data, type, row, meta) {\n return getStringFromBoolean(data);\n }\n },\n { 'mDataProp': 'suspended',\n 'render' : function(data, type, row, meta) {\n return getStringFromBoolean(data);\n }\n }\n ],\n 'language': {\n 'url': '//cdn.datatables.net/plug-ins/1.10.16/i18n/'+ lang +'.json'\n }\n });\n\n });\n}", "function getDataFromTable (table) {\n let cols = getMedataFromTable(table);\n return Array.from(table.querySelectorAll(\"tbody tr\")).map((row) => {\n return getDataFromRow(row, cols);\n }).filter((item) => {\n return item.grade >= 5.0 || item.grade === RECOGNITION;\n });\n }", "function googleLoaded() {\n\t$.get(\"https://www.googleapis.com/fusiontables/v1/query?sql=SELECT+*+FROM+1NS8sD1CJyw9zjppjdvtHeqO3fJcD-mrFffmK0ukC&key=AIzaSyB-QJux9WIJmey5IJYzPImNzg-xP1gpvU8\", dataLoaded, \"json\");\n}", "function readQueryRowData(data){\n\treturn '<td>'+data.id+'</td><td>'+data.url+'</td><td>'+data.status+'</td>';\n}", "function fetchDemographicColumns() {\n return axios({\n method: 'get',\n url: `${BACKEND_DOMAIN}/api/v1/census/demographicColumns`,\n });\n}", "function generateTable() {\n\tvar request = new XMLHttpRequest();\n\n\trequest.open('GET', url + \"/gentable\", true);\n\trequest.addEventListener('load', function () {\n\t\tif (request.status >= 200 && request.status < 400) {\n\t\t\tvar dataReceived = JSON.parse(request.responseText);\n\t\t\tvar dataReceived2 = JSON.parse(dataReceived.tab);\n\t\t\tcreateTable(dataReceived2);\n\n\t\t} else {\n\t\t\tconsole.log(\"Network request error: \" + request.statusText);\n\t\t}\n\t});\n\trequest.send(null);\n}", "function getTableJSON(tableName, callBackFunction) {\n\n var xhttp = new XMLHttpRequest();\n\n xhttp.onreadystatechange = function() {\n\n if (xhttp.readyState == 4 && xhttp.status == 200) {\n\n response = JSON.parse(xhttp.responseText)\n\n if (typeof callBackFunction === 'function') {\n\n callBackFunction(response);\n }\n else {\n\n console.log(\"Callback was not a function\");\n }\n }\n }\n\n // add tables as needed\n if (tableName == 'Cuisine') {\n\n path = \"/cuisines/JSON\";\n }\n else if (tableName == \"BaseMenuItem\") {\n\n path = \"/base_menu_items/JSON\"\n }\n\n xhttp.open(\"GET\", path, true);\n xhttp.send();\n}", "function getTableData(table) {\n const dataArray = [],\n tipoArray = [],\n cantArray = [];\n\n table.rows({\n search: \"applied\"\n }).every(function() {\n const data = this.data();\n tipoArray.push(data[0]);\n cantArray.push(data[1]);\n });\n\n dataArray.push(tipoArray, cantArray);\n\n return dataArray;\n}", "async function callAPI(){\n\t let rawEtatStations = await fetch('https://data.mulhouse-alsace.fr/api/records/1.0/search/?dataset=68224_stationsvelocite_jcdecaux_tempsreel&rows=40&sort=-number&facet=status&facet=contract_name&facet=name&timezone=Europe%2FBerlin');\n\t return await rawEtatStations.json();\n\t}", "function getFlights(){\n fetch(url_opensky)\n .then(function(response){return response.json();})\n .then(function(data){\n var alt_min;\n var alt_max;\n\n // from https://opensky-network.org/apidoc/rest.html\n console.log(\"Nb Vols :: \" + unixTimeToFormat(data.time) + \" :: \"+data.states.length);\n\n jsonFlightData = {\n \"type\":\"geojson\",\n \"data\":{\n \"type\": \"FeatureCollection\",\n \"features\":[]\n }\n };\n\n for( var i=0; i< data.states.length; i++ ){\n jsonFlightData.data.features.push(\n {\n \"type\":\"flight\",\n \"geometry\":{\n \"type\": \"Point\",\n \"coordinates\":[data.states[i][5], data.states[i][6]]\n },\n \"properties\":{\n \"icao\": data.states[i][0],\n \"callsign\": data.states[i][1],\n \"origin\": data.states[i][2],\n \"timePosition\": data.states[i][3],\n \"lastContact\": data.states[i][4],\n \"altitude\": data.states[i][7],\n \"onGround\": data.states[i][8],\n \"velocity\": data.states[i][9],\n \"heading\": data.states[i][10],\n \"verticalRate\": data.states[i][11],\n \"sensors\": data.states[i][12],\n \"baroAltitude\": data.states[i][13],\n \"squawk\": data.states[i][14],\n \"spi\": data.states[i][15],\n \"positionSource\": data.states[i][16]\n }\n });\n\n if(alt_min == undefined){\n alt_min = data.states[i][7];\n }\n if(alt_max == undefined){\n alt_max = data.states[i][7];\n }\n\n if( data.states[i][7] < alt_min && alt_min != undefined ){\n alt_min = data.states[i][7];\n }\n if( data.states[i][7] > alt_max && alt_max != undefined ){\n alt_max = data.states[i][7];\n }\n }\n // console.log(jsonFlightData);\n console.log(\"alt_min :: \"+alt_min);\n console.log(\"alt_max :: \"+alt_max);\n\n });\n}", "function getFunc() {\n // console.log(\"Get function\");\n fetch(mainURL + \"all\")\n .then(res => res.json())\n .then(data => {\n // console.log(\"data\", data);\n if (data != isNullOrUndefined || TABLEDIV != isNullOrUndefined) {\n tables.list2Table(data.all, \"#tableDiv\") //list2Table comes from tables.js\n }\n\n linking(); // add delete/edit links to table \n })\n}", "function parseGeoserverJson(response) {\n function parseId(idStr) {\n return idStr.match(/\\d*$/)[0] // ex: \"layergroup.24\" -> \"24\"\n }\n\n var features = Ext.util.JSON.decode(response.responseText).features\n return _(features).map(function(feature) {\n return _(feature.properties).defaults({\n id : parseId(feature.id)\n })\n })\n }", "function viewDataAll(table) {\n console.log(\"view data all...\");\n db.transaction(function(transaction) {\n transaction.executeSql('SELECT * FROM '+table, [], function (tx, results) {\n var resLen = results.rows.length;\n console.log(\"table results=\"+JSON.stringify(results));\n for (i = 0; i < resLen; i++){\n console.log(\"id=\"+results.rows.item(i).id+\"-title=\"+results.rows.item(i).title+\"-desc=\"+results.rows.item(i).desc);\n $(\"#data-output\").append(\"<p>id=\"+results.rows.item(i).id+\" - title=\"+results.rows.item(i).title+\" - desc=\"+results.rows.item(i).desc)\n }\n }, null);\n });\n }", "function makeTableFromJSON() {\n\tvar div = document.getElementById('table');\n\tmakeTableStyle(div);\n\t\n\tif(div)\n\t{\n\t\tdiv.innerHTML = \"\";\n\t}\n\tvar displayTable = \"<table id='dataTable' class='table table-striped table-bordered' cellspacing='0' width='100%'><thead><tr>\";\n\tvar data = JSON.parse(datasetToDisplay);\n\tvar headers = [];\n\tfor (var key in data[0]) {\n\t\talert(key);\n\t\tdisplayTable+= \"<th>\" +key+ \"</th>\";\n\t\theaders.push(key);\n\t}\n\tdisplayTable+= \"</tr></thead>\";\n\tdisplayTable+= \"<tbody>\";\n\t\n\t\n\tfor (var i = 1; i < data.length; i++) {\n\t\tdisplayTable+= \"<tr>\";\n\t\tfor(var j=0;j<headers.length;j++){\n\t\tdisplayTable+= \"<td>\" +data[i].headers[j]+\" </td>\";\n\t\t}\n\t\tdisplayTable+=\"</tr>\"\n\t}\n\t\n\tdisplayTable+=\"</table>\";\n\tvar Columns = makeColumnHeaderForTable(colData);\n\tmakeFilterElements();\n makeObjects(colData);\n\t\t\t\n\n\t\n\tdiv.innerHTML = displayTable;\n\t\n\t\t\t$('#dataTable').DataTable({\n\t\t\t\t\"paging\": true,\n\t\t\t\t\"ordering\": true,\n\t\t\t\t\"info\": false,\n\t\t\t\t\"lengthMenu\": [[10, 25, 50, -1], [10, 25, 50, \"All\"]]\n\t\t\t\t\n\t\t\t});\n}", "function displaytable(data){\n tbody.html(\"\");\n data.forEach(function(Table) {\n console.log(Table);\n var row = tbody.append(\"tr\");\n Object.entries(Table).forEach(function([key, value]) {\n console.log(key, value);\n // Append a cell to the row for each value\n // in the weather report object\n var cell = row.append(\"td\");\n cell.text(value);\n });\n });\n}", "function getHouseData(name) {\n // query the database for the address data of the house the user clicked on\n var queryText = encodeURIComponent(\"SELECT 'Address 1', 'Address 2', 'City', 'State', 'ZIP' FROM \" + num + \" WHERE Name LIKE '\" + name + \"'\");\n var query = new google.visualization.Query('http://www.google.com/fusiontables/gvizdata?tq=' + queryText);\n // send the address data to showHouseData\n query.send(showHouseData);\n\n function showHouseData(response) {\n // get the number of columns received from the database (should be 5)\n var cols = response.getDataTable().getNumberOfColumns();\n // open an empty housedata variable; the data from the DB will\n // go into this\n var housedata = \"\";\n // for each column (ie., address 1, city, etc.)\n for (var i = 0; i < cols; i++) {\n // add the data to the housedatavar\n housedata += response.getDataTable().getValue(0, i);\n // separate with a plus\n housedata += \"+\";\n }\n // replace spaces with pluses\n housedata = housedata.replace(\" \", \"+\");\n // put housedata into variable for link to google maps\n var mapslink = \"<a target=\\\"_blank\\\" href=\\\"http://maps.google.com/maps?q=\" + housedata + \"\\\">visit Google Maps</a>\";\n // put link to maps into the mapslink span on the page\n document.getElementById('howomo-mapslink').innerHTML = \"To get directions or print a map of this location, \" + mapslink + \".\";\n }\n}", "function loadTable() {\n const url = '/categoria/data';\n let req = new XMLHttpRequest();\n req.open('GET', url, true);\n\n req.onload = function () {\n let data = JSON.parse(req.responseText);\n if (req.readyState == 4 && req.status == \"200\") {\n createTableRows(data);\n } else {\n console.error('Falha ao carregar dados!');\n }\n }\n req.send(null);\n}", "function loadData() {\n var jsonRovereto = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/rovereto\");\n dataRovereto = JSON.parse(jsonRovereto);\n var jsonPergine = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/pergine_valsugana\");\n dataPergine = JSON.parse(jsonPergine);\n var jsonTrento = httpGet(\"https://os.smartcommunitylab.it/core.mobility/bikesharing/trento\");\n dataTrento = JSON.parse(jsonTrento);\n //console.log(dataTrento);\n}", "async function sampleTest() {\n\n tabQuery.setCols([\n {\n col: {id: \"http://eurostat.linked-statistics.org/dic/geo\", \"label\":\"Geopolitical entity (reporting)\",\"type\": Constants.DATATYPE.SEMANTIC},\n vals: [\n { id: \"http://eurostat.linked-statistics.org/dic/geo#DE\", \"label\":\"Germany\"},\n { id: \"http://eurostat.linked-statistics.org/dic/geo#IE\", \"label\":\"Ireland\"},\n { id: \"http://eurostat.linked-statistics.org/dic/geo#IS\", \"label\":\"Iceland\"},\n { id: \"http://eurostat.linked-statistics.org/dic/geo#ES\", \"label\":\"Spain\"},\n { id: \"http://eurostat.linked-statistics.org/dic/geo#RO\", \"label\":\"Romania\"},\n ]\n },{\n col: {id: \"http://eurostat.linked-statistics.org/dic/time\", \"label\":\"Time\",\"type\": Constants.DATATYPE.TIME},\n vals: [],\n vals: {\n min: '2013-01-01',\n max: '2018-01-01'\n }\n },{\n col: {id: \"http://yavaa.org/ns/eurostat/meas/numberOfSheep\", \"label\":\"Number of sheep\", \"type\": Constants.DATATYPE.NUMERIC},\n vals: []\n },{\n col: {id: \"http://yavaa.org/ns/eurostat/meas/population\", \"label\":\"Population\", \"type\": Constants.DATATYPE.NUMERIC},\n vals: []\n }\n\n ]);\n\n return;\n\n }", "function drawTable() {\n var requestURL = \"getDataTableJSON.php?comm=\"+selectedCommodity+\"&year=\"+selectedYear+\"&start=0&num=105&measure=\"+selectedMeasure+\"&start=\"+tableStart+\"&num=\"+tableNumRecords;\n var jsonData = $.ajax({\n url: requestURL,\n dataType: \"json\",\n async: false\n }).responseText;\n\n //alert(jsonData);\n var options = {\n showRowNumber: true,\n width: \"100%\"\n }\n\n var data = new google.visualization.DataTable(jsonData);\n\n // This draws the table, using the Google API\n var table = new google.visualization.Table(document.getElementById('tablechart'));\n table.draw(data, options);\n}", "function query(options, callback) {\n let { host, id } = options;\n\n // set default host \n host = host || 'https://whosonfirst.mapzen.com';\n\n const subPath = `${id.substr(0, 3)}/${id.substr(3, 3)}/${id.substr(6)}`;\n const query = `${host}/data/${subPath}/${id}.geojson`;\n \n request.get(query, (err, res) => {\n if (err) {\n return callback(err);\n }\n\n var results = JSON.parse(res.body);\n callback(null, results);\n });\n}", "getAll(table, expand) {\n return fetch(`${remoteURL}/${table}/?_expand=${expand}`).then(result => result.json())\n }", "function getEvents(url, showEventsMap, showEventsTable) {\n // default params to false\n showEventsMap = typeof showEventsMap !== 'undefined' ? showEventsMap : false;\n showEventsTable = typeof showEventsTable !== 'undefined' ? showEventsTable : false;\n\n // ajax\n $.getJSON(url, function( data ) {\n if (showEventsTable === true) {\n // if showing table\n // map the locations and add them to the table\n $.each(data, function(index, location) {\n // console.log(location);\n row = \"\";\n row += '<tr>';\n if (location.date) {row += '<td>' + location.date + '</td>';} else {row += '<td></td>';}\n if (location.club_name) {row += '<td>' + location.club_name + '</td>';} else {row += '<td></td>';}\n if (location.phone) {row += '<td>' + location.phone + '</td>';} else {row += '<td></td>';}\n if (location.website) {row += '<td><a href=\"' + location.website + '\" target=\"_blank\">website</a></td>';} else {row += '<td></td>';}\n // if (location.address) {row += '<td>' + location.address + '</td>';} else {row += '<td></td>';}\n row += '</tr>';\n $('#events-table tbody').append(row);\n\n // get address and add to map\n // if showing both map and table\n if (showEventsMap === true) {\n mapEvent(location);\n }\n });\n // make the table a datatable\n $('#events-table').DataTable({\n paging: false,\n info: false\n });\n } else if (showEventsMap === true) {\n // if showing only map\n mapEvent(location);\n }\n\n // console.log(data);\n });\n }", "function get_data() {}", "function tableToJson(table2) {\n let data = [];\n for (i = 1; i < table2.rows.length; i++) {\n let tableRow = table2.rows[i];\n let rowData = [];\n for (j = 1; j < tableRow.cells.length; j++) {\n rowData.push(tableRow.cells[j].innerHTML);\n }\n data.push(rowData);\n }\n return data;\n}", "function getSensorData() {\n $.getJSON('http://flask-env.hhxgagpxbh.eu-west-1.elasticbeanstalk.com/api/all_grow_true_json', initMap);\n}", "function renderTable() {\n tbody.innerHTML = \"\";\n for (var i = 0; i < filterData.length; i++) {\n // Get the current objects and its fields. Calling each dictionary object 'ovni'. This comes from the data.js database where\n //the object dataSet holds an array (list) of dictionaries. Each dictionary is an object and I'm calling it ovni. This will\n // loop through each dictionary/object from the variable dataSet and store their keys in the variable fields. \n\n var ovni = filterData[i];\n var fields = Object.keys(ovni);\n \n // Create a new row in the tbody, set the index to be i + startingIndex\n // fields are the columns\n var row = tbody.insertRow(i);\n for (var j = 0; j < fields.length; j++) {\n // For every field in the address object, create a new cell and set its inner text to be the current value at the current address's field\n // the variable field will gather the columns names. It will loop through the fields(columns). Example, fields index 0 is datetime.\n var field = fields[j];\n var cell = row.insertCell(j);\n // now i will pass to the cell the ovni object, field values.\n cell.innerText = ovni[field];\n }\n }\n}", "async obtieneDatos (tabla, filtro) {\n try {\n tabla = tabla + ((filtro !== undefined) ? '/' + filtro : '') + '.json'\n const res = await fetch((API_URL + tabla), {\n method: 'GET',\n headers: {\n 'content-Type': 'application/json'\n }\n })\n const datoDb = await res.json()\n return datoDb\n } catch (error) {\n console.log(error)\n }\n }", "function getBatteryTable() {\n $http({\n method: 'GET',\n url: '/api/snmp/getTable',\n params: {\n agentIP: $scope.agentConfig.address,\n agentPort: $scope.agentConfig.port,\n oid: \"1.3.6.1.4.1.12619.5.9.6\", //Tabela Bateria\n tableLines: 16,\n tableColumns: 7\n }\n }).then(function successCallback(response) {\n\n //Atualiza variável da tabela\n var table = response.data;\n $scope.tabelaBateria = table;\n\n }, function errorCallback(response) {\n\n });\n }", "function readFromTable() {\n var conn = Jdbc.getCloudSqlConnection(dbUrl, user, userPwd);\n\n var start = new Date();\n var stmt = conn.createStatement();\n stmt.setMaxRows(1000);\n var results = stmt.executeQuery('SELECT * FROM entries');\n var numCols = results.getMetaData().getColumnCount();\n\n while (results.next()) {\n var rowString = '';\n for (var col = 0; col < numCols; col++) {\n rowString += results.getString(col + 1) + '\\t';\n }\n Logger.log(rowString);\n }\n\n results.close();\n stmt.close();\n\n var end = new Date();\n Logger.log('Time elapsed: %sms', end - start);\n}", "function getData(map)\n\t{\n\t\t// get the data from the geojson file\n\t\t$.ajax(PAGE,\n\t\t{\n\t\t\tdataType: \"json\",\n\t\t\tsuccess: function(response)\n\t\t\t{\n\t\t\t\t// attributes is an array of an individual industry by year e.g. ['con2008', 'con2009', ....]\n\t\t\t\tvar attributes = processData(response);\n\n\t\t\t\t// set the global attributes\n\t\t\t\tATTRIBUTES = attributes;\n\n\t\t\t\t// set the global attributes for an industry\n\t\t\t\tINDUSTRYDATA = processData(response);\n\t\n\t\t\t\t// call function to create proportional symbols\n\t\t\t\tcreatePropSymbols(response, map, attributes);\n\t\t\t}\n\t\t});\n\t}", "function RetrieveData(callback)\n{\n apikey=\"0e9bb2bd65868488844a1d5c2e34c7362d5790de\";\n url=\"http://www.animenewsnetwork.com/encyclopedia/anime/upcoming/tv\";\n mainurl='http://api.phantomjscloud.com/single/browser/v1/'+apikey+'/?targetUrl='+ \n url+'&requestType=text'; \n \n\tquery ='select * from html where url=\"'+ mainurl+'\" and xpath=\"//table[@class=\\'datalist\\']\"';\n\tvar yqlAPI = 'https://query.yahooapis.com/v1/public/yql?q=' + encodeURIComponent(query) + ' &format=json&env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys&callback=?';\n \n\t$.getJSON(yqlAPI, function(){\n\t })\n\t.success(function(r){\n\t console.log(\"sucess\"); //.results.table[0]\n\t tablerows= r.query.results.table[0].tbody.tr;\n dict=ParseNewAnimeTable(tablerows); \n callback(dict);\n\t}) \n\t.fail(function(r){\n\t console.log(\"fail\");\n\t console.log(r);\n\t});\n\n}", "function populateTable() {\n let tableContent = '';\n $.getJSON('/index', (data) => {\n data.forEach(d => {\n tableContent +=\n `<tr>\n <td>${d.organism_id}</td>\n <td>${d.organism_desc}</td>\n <td>${d.sequence_location}</td>\n </tr>`;\n });\n $('#results tbody').html(tableContent);\n });\n}", "function loadData() {\n const coordsData = table.getRows();\n length = table.getRowCount();\n\n for (let i = 0; i < length; i++) {\n let name = coordsData[i].getNum(\"array#\");\n let xPos = coordsData[i].getNum(\"x\");\n let yPos = coordsData[i].getNum(\"y\");\n coords[i] = new Coord(name, xPos, yPos);\n }\n}", "function getData(url) { \n $.getJSON( url, function(data) {\n all_data = data;set_count(data);\n next= data.next; prev = data.previous;\n $('#resulttable tbody').empty();\n var header ='<tr><th>Obs. Number</th><th>Genus</th><th>Species</th><th>Common Name</th><th>County</th><th>Year</th><th>Observer</th></tr>';\n $('#resulttable > tbody:last').append(header);\n $.each(data.results, function(i, item) {\n $('#resulttable > tbody:last').append(tr_template(item)) \n });\n });\n }", "function getData(map) {\n\t// load the data\n\t$.ajax(\"data/rent_cities_data.geojson\",{\n\t\tdataType:\"json\",\n\t\tsuccess: function(response){\n\t\t\t//variables \n\t\t\tvar attributes = processData(response);\n\t\t\t//call functions\n\t\t\tcreatePropSymbols(response, map, attributes);\n\t\t\tcreateSequenceControls(map, attributes);\n\t\t\tcreateLegend(map, attributes);\n\t\t\t//createSearch(map,geofeatures)\n\t\t}\n\t});\n}", "function runTableQuery() {\n // The AJAX function uses the URL of our API to GET the data associated with it (initially set to localhost)\n $.ajax({ url: \"/api/tables\", method: \"GET\" })\n .then(function(tableData) {\n\n // Here we then log the tableData to console, where it will show up as an object.\n console.log(tableData);\n console.log(\"------------------------------------\");\n\n // Loop through and display each of the customers\n for (var i = 0; i < tableData.length; i++) {\n\n // Get a reference to the tableList element and populate it with tables\n var tableList = $(\"#tableList\");\n\n // Then display the fields in the HTML (Section Name, Date, URL)\n var listItem = $(\"<li class='list-group-item mt-4'>\");\n\n listItem.append(\n $(\"<h2>\").text(\"Table #\" + (i + 1)),\n $(\"<hr>\"),\n $(\"<h2>\").text(\"ID: \" + tableData[i].customerID),\n $(\"<h2>\").text(\"Name: \" + tableData[i].customerName),\n $(\"<h2>\").text(\"Email: \" + tableData[i].customerEmail),\n $(\"<h2>\").text(\"Phone: \" + tableData[i].phoneNumber)\n );\n\n tableList.append(listItem);\n }\n });\n}", "function getdata() {\n d3.select(\"tbody\").html(\"\");\n d3.event.preventDefault();\n\n var dateTime = d3.select(\"#datetime\").property(\"value\");\n var selectCity = d3.select(\"#city\").property(\"value\");\n var selectState = d3.select(\"#state\").property(\"value\");\n var selectCountry = d3.select(\"#country\").property(\"value\");\n var selectShape = d3.select(\"#shape\").property(\"value\");\n\n // initialize tableData as filteredData\n filteredData = tableData;\n\n if (dateTime) {\n filteredData = filteredData.filter(record => record.datetime === dateTime);}\n\n if (selectCity) {\n filteredData = filteredData.filter(record => record.city === selectCity);}\n\n if (selectState) {\n filteredData = filteredData.filter(record => record.state === selectState);}\n\n if (selectCountry) {\n filteredData = filteredData.filter(record => record.country === selectCountry);}\n\n if (selectShape) {\n filteredData = filteredData.filter(record => record.shape === selectShape);}\n\n\n // Display the filtered dataset\n filteredData.forEach((ufoSightings) => {\n console.log(ufoSightings);\n\n var row = tbody.append('tr');\n\n Object.entries(ufoSightings).forEach(([key, value]) => {\n console.log(key, value);\n var cell = row.append('td');\n cell.text(value);\n });\n });\n}", "function display_table_mongo(id) {\n if(id != null) {\n highlight(id);\n }\n document.getElementById(\"content\").innerHTML = \"\";\n document.getElementById(\"content\").style.padding = \"0\";\n document.getElementById(\"weatherForm\").style.display = \"none\";\n\n table =\n \"<div class='table-wrapper'><table class='resultTable'>\" +\n \"<thead><tr><th>ID pomiaru</th><th>Data</th><th>Temperatura</th><th>Opad</th></tr></thead><tbody>\";\n\n reqObj = getRequestObject();\n reqObj.onreadystatechange = function () {\n if (reqObj.readyState == 4 && reqObj.status == 200) {\n JSONResponse = JSON.parse(reqObj.response);\n\n for (var id in JSONResponse) {\n newDate = new Date(JSONResponse[id][\"dzien\"]);\n dateZero = new Date(\n newDate.getFullYear(),\n newDate.getMonth(),\n newDate.getDate()\n );\n\n table +=\n \"<tr><td>\" +\n id +\n \"</td><td>\" +\n dateZero +\n \"</td><td>\" +\n Number(JSONResponse[id][\"temp\"]) +\n \"</td><td>\" +\n Number(JSONResponse[id][\"opad\"]) +\n \"</td></tr>\";\n }\n\n table += \"</tbody></table></div>\";\n document.getElementById(\"content\").innerHTML = table;\n }\n };\n\n reqObj.open(\n \"GET\",\n \"rest/list\",\n true\n );\n reqObj.send(null);\n}", "function retrieveData(dataObject) {\n\n\ttry {\n\t\tconst extracted_value = Object.values(dataObject)[0];\n\t\n\t\tconst table = document.getElementById(\"data-table\");\n\t\tconst thead = document.createElement(\"thead\");\n\t\tconst tr1 = document.createElement(\"tr\");\n\t\tconst th1 = document.createElement(\"th\");\n\t\tconst th2 = document.createElement(\"th\");\n\t\n\t\tth1.innerHTML = \"Field\";\n\t\tth2.innerHTML = \"Description\";\n\t\ttr1.appendChild(th1);\n\t\ttr1.appendChild(th2);\n\t\n\t\tthead.appendChild(tr1);\n\t\ttable.appendChild(thead);\n\t\n\t\tconst tbody = document.createElement(\"tbody\");\n\t\n\t\tfor (const [key, value] of Object.entries(extracted_value)) {\n\t\t\tconst tr = document.createElement(\"tr\");\n\t\t\tconst td1 = document.createElement(\"td\");\n\t\t\tconst td2 = document.createElement(\"td\");\n\t\t\ttd1.innerHTML = `${key}`;\n\t\t\ttd2.innerHTML = `${value}`;\n\t\t\ttr.appendChild(td1);\n\t\t\ttr.appendChild(td2);\n\t\t\ttbody.appendChild(tr);\n\t\t}\n\t\n\t\ttable.appendChild(tbody);\n\t} catch (error) {\n\t\tconsole.log(error);\n\t}\n}", "function getTables() {\n let request = new XMLHttpRequest();\n request.open('GET', 'http://tiy-28202.herokuapp.com/order');\n request.addEventListener('load', function(){\n\n let response = JSON.parse(request.responseText);\n\n for(let i = 0; i < response.length; i++){\n // if(response[i].in_progress === true){\n addTable(response[i]);\n // }\n };\n });\n\n request.send();\n}", "function getCombustivelTable() {\n //Populates Table with Json\n tableCombustivel = $('table#table-combustivel').DataTable({\n ajax: {\n url: urlApi + \"combustivel\",\n contentType: 'application/json; charset=UTF-8',\n dataType: 'json'\n },\n columns: [{\n data: \"id\"\n }, {\n data: \"tipo\"\n }],\n columnDefs: [\n {\n width: '20%',\n targets: 'combIdCol'\n }\n ],\n select: true,\n lengthChange: false,\n pageLength: 5,\n dom: 'lrti<\"right\"p>',\n language: {\n url: \"../../doc/Portuguese-Brasil.json\"\n }\n });\n}", "getJsonFromServer() {\n fetch(`${servername}/getjson`)\n .then(res => res.json())\n .then(data=>{\n if(data != null) {\n for(let element of data) {\n if(element.jsonstring.df != null) {\n if(element.jsonstring.df.lob != null) {\n // Parse the json points to receive json data.\n let stringConverter = element.jsonstring.df.lob\n let floatStringArray = stringConverter.split(',')\n let latitude = parseFloat(floatStringArray[0])\n let longitude = parseFloat(floatStringArray[1])\n \n // Create a new feature on OpenLayers\n if(!this.doesFeatureExist(latitude, longitude)) {\n let longLat = fromLonLat([longitude, latitude])\n let newFeature = new Feature({\n geometry: new Point(longLat),\n information: element.jsonstring\n })\n this.vectorAlerts.addFeature(newFeature)\n }\n }\n else console.log('lob was null. JSON must be broken:', element)\n }\n else console.log(\"data.df was empty. Consider fixing json string?\", element)\n }\n console.log('Features were updated', this.vectorAlertLayer.getSource().getFeatures())\n }\n else console.log(\"data had returned null\")\n })\n }", "function get_data(){\r\n\t\tvar xhr = new XMLHttpRequest();\r\n\t\txhr.open('GET', 'http://localhost:5001/list', true);\r\n\t\txhr.send(null);\r\n\r\n\t\txhr.onreadystatechange = function() {\r\n\t\t\tif (xhr.readyState == 4 && xhr.status == 200) {\r\n\t\t\t\tmakeTable(xhr.responseText);\r\n\t\t\t\t$(\".table > tbody > tr\").attr(\"style\", \"cursor: pointer\");\r\n\t\t\t\t$(\".table > tbody > tr\").click(function() {\r\n\t\t\t\t\tvar hash = $(this).find('td:first').text();\r\n\t\t\t\t\tmake_details_window(hash);\r\n\t\t\t\t});\t\t\t\r\n\t\t\t}\r\n\t\t\telse if (xhr.status != 200) {\t\r\n\t\t\t\tdocument.write(\"GET request for JSON data failed!\");\r\n\t\t\t\tdocument.close();\r\n\t\t\t}\r\n\t\t};\r\n\t}", "function getJSONData(address) {\n var finalTable;\n $.getJSON(address, function (result) {\n document.getElementById(\"result-region\").innerHTML = \"\";\n finalTable = buildTables();\n $.each(result.CourseInfo, function (i, data) {\n finalTable += '<tr>' +\n '<td>' + data.courseID + '</td>' +\n '<td>' + data.courseName + '</td>' +\n '<td>' + data.courseTutor + '</td>' +\n '<td>' + data.courseCredits + '</td>' +\n '<td>' + data.courseDuration + '</td></tr>'\n\n });\n finalTable += '</table>';\n $(\"#result-region\").append(finalTable);\n\n });\n}", "function getData(map)\n{\n\t// get the data from the geojson file\n\t$.ajax(\"data/agg.geojson\",\n\t{\n\t\tdataType: \"json\",\n\t\tsuccess: function(response)\n\t\t{\n\t\t\t// call function to create proportional symbols\n\t\t\tcreatePropSymbols(response, map);\n\t\t}\n\t});\n}", "function poplulateTable(data){\n data.forEach(sightingData=>{\n const trow = tbody.append(\"tr\");\n columns= [\"datetime\", \"city\", \"state\", \"country\", \"shape\", \"durationMinutes\", \"comments\"];\n columns.forEach(key=>{\n trow.append(\"td\").text(sightingData[key]);\n })\n })\n}", "function loadData() {\n loadTable();\n}", "async function getWOJSON (stationData, needCors = true) {\n let start = moment().subtract(4, 'days').format('YYYY-MM-DD'),\n end = moment().format('YYYY-MM-DD'),\n headers = {'Origin': \"localhost\", 'X-Spot-ID': stationData.slug}\n params = `?param1=47&start_date=${start}&end_date=${end}&station=${stationData[\"gaugeID\"]}`;\n let url = `https://wateroffice.ec.gc.ca/services/real_time_graph/json/inline${params}`;\n if (needCors) {url = `${cors}${url}`;}\n // console.log(url);\n // let target = `${url}${params}`;\n return await fetch(url, {headers: headers})\n .then ( async (res) => {\n // console.log(res.headers.get('Content-Type'))\n return res.json()\n })\n .then ( (json) => { // console.log(json);\n return json[\"47\"].provisional} )\n .catch(function(error){console.log(error);});\n}", "function dataTableFromTable(t) {\n\t\tvar tbl = new google.visualization.DataTable(),\n\t\t\tcol_type = \"string\";\n\n\t\t$(t).find(\"thead th\").each(function(i){\n\t\t\tif (1 === i) {\n\t\t\t\tcol_type = \"number\";\n\t\t\t}\n\t\t\ttbl.addColumn(col_type, $(this).text() );\n\t\t});\n\n\t\t$(t).find(\"tbody tr\").each(function(){\n\t\t\ttbl.addRow(\n\t\t\t\t$(this).find(\"td\").map(function(i){\n\t\t\t\t\tif (0 === i) {\n\t\t\t\t\t\treturn $(this).text();\n\t\t\t\t\t}\n\t\t\t\t\treturn parseFloat( $(this).text() );\n\t\t\t\t})\n\t\t\t\t.get());\n\t\t});\n\t\treturn tbl;\n\t}" ]
[ "0.7149704", "0.6655172", "0.64652574", "0.6449949", "0.61625606", "0.61189616", "0.60623544", "0.60524595", "0.6038257", "0.5977487", "0.59531814", "0.59130573", "0.59113157", "0.59020644", "0.58984786", "0.58950853", "0.5885923", "0.58554006", "0.5847307", "0.5823865", "0.5774064", "0.57722014", "0.57658035", "0.5754264", "0.5737086", "0.57344973", "0.57333654", "0.5732518", "0.5732159", "0.5698046", "0.5684366", "0.5676917", "0.5666801", "0.56563604", "0.5649414", "0.5628529", "0.5628529", "0.5622391", "0.56161183", "0.5609125", "0.5597138", "0.5572963", "0.55642104", "0.5555853", "0.5555003", "0.5533635", "0.5528532", "0.5522106", "0.55218107", "0.55204993", "0.5518663", "0.55179274", "0.5516283", "0.55015725", "0.55002105", "0.5489264", "0.54864186", "0.5479354", "0.5474389", "0.54726493", "0.54634595", "0.54615027", "0.5455806", "0.54381937", "0.54348654", "0.54317135", "0.54305625", "0.54286903", "0.5420643", "0.5416297", "0.5412799", "0.54109854", "0.54004294", "0.5399433", "0.53985137", "0.5391099", "0.5362464", "0.5359892", "0.53596133", "0.53576267", "0.53570104", "0.53542626", "0.53540987", "0.5345095", "0.534424", "0.5338121", "0.5337412", "0.5336862", "0.5335398", "0.53269285", "0.532552", "0.53242356", "0.53226596", "0.5320592", "0.53144985", "0.53097874", "0.53048354", "0.53030205", "0.53009427", "0.5299838" ]
0.7328256
0
Call callback with list of all iconjointable objects that exist in the namespace_name
function getIconInfo(namespace_name, success) { var filter = "&CQL_FILTER=layer='" + namespace_name + "'" var url = jsonUrl("iconmaster") + filter getGeoserverTable(url, success) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function register_iconlist_callback() {\n var icons = document.querySelectorAll(\".icon-list-item img\");\n for (var i=0; i<icons.length; i++) {\n icons[i].addEventListener(\"click\", load_icon);\n }\n}", "buildIcons(){\n for(var i=0; i<this.popUpFltImgs.length; i++){\n this.buildIcon(i, false);\n }\n }", "enumerateOwnFiles(callback) {\n const files = this.getOwnFiles();\n for (const file of files) {\n //either XML components or files without a typedef\n if ((0, reflection_1.isXmlFile)(file) || !file.hasTypedef) {\n callback(file);\n }\n }\n }", "function getPluginElementNames(namespace){\n return getCacheData('/xapi/spawner/ids/' + namespace);\n }", "async function addIcons(window, result, itemSelector) {\n\t// Parses saved data back into inbound and outbound card sets\n\tvar savedInCards = result[\"cards\"][\"inCards\"];\n\tvar savedOutCards = result[\"cards\"][\"outCards\"];\n\t// Attempt to add an icon to every \"card\" on the page\n\tforAllElements(window, itemSelector, (card) => {\n\t\taddIcon(card, savedInCards, savedOutCards, itemSelector);\n\t});\n}", "function displayTempInInspectorID(templateNamespace) {\r\n const namespaceContainer = document.getElementById(\"namespaceContainer\"); \r\n for(let i = 0; i < templateNamespace.length; i++) {\r\n //Create elements to display\r\n const label = document.createElement(\"label\");\r\n const namespaceBtn = document.createElement(\"button\");\r\n const namespaceDiv = document.createElement(\"div\");\r\n\r\n //separate prefix name from url\r\n const templateNamespaceArr = templateNamespace[i].split(' ');\r\n const prefixValue = templateNamespaceArr[0];\r\n const url = templateNamespaceArr[1];\r\n\r\n label.innerHTML = prefixValue;\r\n namespaceBtn.innerHTML = \"X\";\r\n namespaceBtn.className = \"btn btn-danger\" //namespaceBtn\r\n namespaceBtn.style = \"margin:1px\";\r\n namespaceDiv.id = prefixValue;\r\n namespaceDiv.style = \"overflow-y: auto\";\r\n namespaceDiv.appendChild(label);\r\n namespaceDiv.appendChild(namespaceBtn);\r\n\r\n namespaceContainer.appendChild(namespaceDiv);\r\n namespaceArray.prefix[prefixValue] = url;\r\n\r\n displayNamespaceInspecID(prefixValue);\r\n\r\n namespaceBtn.addEventListener(\"click\", function() {\r\n deleteNameSpace(prefixValue);\r\n });\r\n displayNamespaceInspecAttr(prefixValue + \":\");\r\n }\r\n}", "function updateIcons() {\n if (vm.buttons) {\n for (var i = 0 , length = vm.buttons.length; i < length ; i++) {\n constructIconObject(vm.buttons[i]);\n }\n }\n }", "function fetchNamespaces() {\n return services_k8s.getNamespaces().done(function (namespaceDataArray) {\n src_reactor[\"a\" /* default */].dispatch(SITE_RECEIVE_NAMESPACES, namespaceDataArray);\n });\n}", "function getNamespaces() {\n // Signals the namespaces are to be fetched => loader will be shown\n setLoader(true, 'Refreshing namespaces', 'Normally this is a fast operation but it may take longer if a bigger repository needs to be initialised first.');\n RDF4JRepositoriesRestService.getRepositoryNamespaces()\n .success(function (data) {\n const usedPrefixes = {};\n data.results.bindings.forEach(function (e) {\n usedPrefixes[e.prefix.value] = e.namespace.value;\n });\n $scope.namespaces = usedPrefixes;\n })\n .error(function (data) {\n $scope.repositoryError = getError(data);\n })\n .finally(function () {\n // Signals namespaces were fetched => loader will be hidden\n setLoader(false);\n loadTab();\n });\n }", "function parseIconSet(data, callback, list) {\n if ( list === void 0 ) list = 'none';\n\n var added = [];\n // Must be an object\n if (typeof data !== 'object') {\n return list === 'none' ? false : added;\n }\n // Check for missing icons list returned by API\n if (data.not_found instanceof Array) {\n data.not_found.forEach(function (name) {\n callback(name, null);\n if (list === 'all') {\n added.push(name);\n }\n });\n }\n // Must have 'icons' object\n if (typeof data.icons !== 'object') {\n return list === 'none' ? false : added;\n }\n // Get default values\n var defaults = Object.create(null);\n defaultsKeys.forEach(function (key) {\n if (data[key] !== void 0 && typeof data[key] !== 'object') {\n defaults[key] = data[key];\n }\n });\n // Get icons\n var icons = data.icons;\n Object.keys(icons).forEach(function (name) {\n var icon$1 = icons[name];\n if (typeof icon$1.body !== 'string') {\n return;\n }\n // Freeze icon to make sure it will not be modified\n callback(name, Object.freeze(merge_1.merge(icon.iconDefaults, defaults, icon$1)));\n added.push(name);\n });\n // Get aliases\n if (typeof data.aliases === 'object') {\n var aliases = data.aliases;\n Object.keys(aliases).forEach(function (name) {\n var icon$1 = resolveAlias(aliases[name], icons, aliases, 1);\n if (icon$1) {\n // Freeze icon to make sure it will not be modified\n callback(name, Object.freeze(merge_1.merge(icon.iconDefaults, defaults, icon$1)));\n added.push(name);\n }\n });\n }\n return list === 'none' ? added.length > 0 : added;\n}", "function initializeIcons() {\n let deleteIcons = qsa('.deleteBox');\n for (let i = 0; i < deleteIcons.length; i ++) {\n deleteIcons[i].addEventListener('click', deleteTask);\n }\n\n let uncheckedCircle = qsa('.checkCircle');\n for (let i = 0; i < uncheckedCircle.length; i ++) {\n uncheckedCircle[i].addEventListener('click', clickCheckCircle);\n }\n }", "updateDriveSpecificIcons() {}", "updateDriveSpecificIcons() {}", "function parseIconSet(data, callback, list = 'none') {\n const added = [];\n // Must be an object\n if (typeof data !== 'object') {\n return list === 'none' ? false : added;\n }\n // Check for missing icons list returned by API\n if (data.not_found instanceof Array) {\n data.not_found.forEach((name) => {\n callback(name, null);\n if (list === 'all') {\n added.push(name);\n }\n });\n }\n // Must have 'icons' object\n if (typeof data.icons !== 'object') {\n return list === 'none' ? false : added;\n }\n // Get default values\n const defaults = Object.create(null);\n defaultsKeys.forEach((key) => {\n if (data[key] !== void 0 && typeof data[key] !== 'object') {\n defaults[key] = data[key];\n }\n });\n // Get icons\n const icons = data.icons;\n Object.keys(icons).forEach((name) => {\n const icon$1 = icons[name];\n if (typeof icon$1.body !== 'string') {\n return;\n }\n // Freeze icon to make sure it will not be modified\n callback(name, Object.freeze({ ...icon.iconDefaults, ...defaults, ...icon$1 }));\n added.push(name);\n });\n // Get aliases\n if (typeof data.aliases === 'object') {\n const aliases = data.aliases;\n Object.keys(aliases).forEach((name) => {\n const icon$1 = resolveAlias(aliases[name], icons, aliases, 1);\n if (icon$1) {\n // Freeze icon to make sure it will not be modified\n callback(name, Object.freeze({ ...icon.iconDefaults, ...defaults, ...icon$1 }));\n added.push(name);\n }\n });\n }\n return list === 'none' ? added.length > 0 : added;\n}", "function iconList() {\r\n\t\t\t\t\t\r\n\t\t\t\t\tvar $iconListOffsetPos = ($('#nectar_fullscreen_rows').length > 0) ? '250%' : '75%';\r\n\t\t\t\t\t\r\n\t\t\t\t\t$($fullscreenSelector + '.nectar-icon-list[data-animate=\"true\"]').each(function () {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tvar $that = $(this),\r\n\t\t\t\t\t\twaypoint \t= new Waypoint({\r\n\t\t\t\t\t\t\telement: $that,\r\n\t\t\t\t\t\t\thandler: function () {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\tif ($that.parents('.wpb_tab').length > 0 && $that.parents('.wpb_tab').css('visibility') == 'hidden' || $that.hasClass('completed')) {\r\n\t\t\t\t\t\t\t\t\twaypoint.destroy();\r\n\t\t\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$that.each(function () {\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\tvar $listItemAnimationDelay = ($that.is('[data-direction=\"horizontal\"]')) ? 100 : 300;\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t$(this).find('.nectar-icon-list-item').each(function (i) {\r\n\t\t\t\t\t\t\t\t\t\tvar $thatt = $(this);\r\n\t\t\t\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\t\t\t\t$thatt.addClass('animated');\r\n\t\t\t\t\t\t\t\t\t\t}, i * $listItemAnimationDelay);\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t$that.addClass('completed');\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\twaypoint.destroy();\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\toffset: $iconListOffsetPos\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t});\r\n\t\t\t\t}", "registerAllLobbies(callback) {\r\n this._registerOutgoing(Command.ALL_LOBBIES, callback);\r\n }", "function cargarIconos(){\n // iconos para mostrar puntos\n estilosMarcadores[\"carga\"] = styles.marcadorCarga();\n estilosMarcadores[\"traslado\"] = styles.marcadorTraslado();\n }", "get_interfaces_object() {\n return {\n title: 'Interfaces',\n collapsable: true,\n children: this.interfaces\n }\n }", "function interfaces(names) {\n\n // RESPONSE PLACEHOLDER\n const response = {}\n\n // LOOP THROUGH & ATTACH ABI\n names.forEach(name => {\n response[name] = references[name].abi\n })\n\n return response;\n}", "function callbacks_for( endpoints ) {\n var init_callback = function () {\n console.log( \"Getting data\" );\n };\n var callbacks = [];\n callbacks = endpoints.map( function ( e ) {\n return function () {\n _resource.get_sheets_labels( draw_tabs );\n };\n });\n callbacks[0] = function ( data ) {\n draw_endpoint( data['data'] );\n };\n\n return {\n 'init_callback' : init_callback,\n 'callbacks' : callbacks\n };\n }", "getOwnCallables() {\n let result = [];\n this.logDebug('getOwnCallables() files: ', () => this.getOwnFiles().map(x => x.pkgPath));\n //get callables from own files\n this.enumerateOwnFiles((file) => {\n for (let callable of file.callables) {\n result.push({\n callable: callable,\n scope: this\n });\n }\n });\n return result;\n }", "GetAll(objPath, binterface, callback) {\n this.dbus.driver.invoke({\n destination: 'org.freedesktop.NetworkManager',\n path: objPath,\n 'interface': 'org.freedesktop.DBus.Properties',\n member: 'GetAll',\n signature: 's',\n body: [\n new STRING(binterface)\n ]\n }, (err, data) => callback && callback(err, data))\n }", "function cargarIconos(table) {\n styleCheckbox(table);\n updateActionIcons(table);\n updatePagerIcons(table);\n enableTooltips(table);\n}", "static FindObjectsOfType() {}", "static FindObjectsOfType() {}", "static FindObjectsOfType() {}", "static FindObjectsOfType() {}", "static FindObjectsOfType() {}", "static FindObjectsOfType() {}", "function changeArchiveAllIconWhenComplete (iconObj) {\n archivesFinished++\n if (archivesFinished >= 2) {\n $(iconObj).attr('src', chrome.extension.getURL('./images/archives/allListedArchives_success.png'))\n $(iconObj).unbind()\n $(iconObj).removeClass('archiveLogo')\n }\n}", "parseIconFiles() {\n this.iconFiles.forEach(iconFile => {\n const name = path.basename(iconFile, '.svg').substring(2);\n const svgMarkup = fs.readFileSync(path.resolve(this.distIconsFolder, iconFile), 'utf8');\n const content = Parser.getContent(svgMarkup);\n const iconObject = {\n name,\n content,\n };\n\n this.output.icons.push(iconObject);\n });\n }", "function updateCallbacks(provider, prefix) {\n if (pendingUpdates[provider] === void 0) {\n pendingUpdates[provider] = Object.create(null);\n }\n const providerPendingUpdates = pendingUpdates[provider];\n if (!providerPendingUpdates[prefix]) {\n providerPendingUpdates[prefix] = true;\n setTimeout(() => {\n providerPendingUpdates[prefix] = false;\n if (exports.callbacks[provider] === void 0 ||\n exports.callbacks[provider][prefix] === void 0) {\n return;\n }\n // Get all items\n const items = exports.callbacks[provider][prefix].slice(0);\n if (!items.length) {\n return;\n }\n const storage = storage_1.getStorage(provider, prefix);\n // Check each item for changes\n let hasPending = false;\n items.forEach((item) => {\n const icons = item.icons;\n const oldLength = icons.pending.length;\n icons.pending = icons.pending.filter((icon) => {\n if (icon.prefix !== prefix) {\n // Checking only current prefix\n return true;\n }\n const name = icon.name;\n if (storage.icons[name] !== void 0) {\n // Loaded\n icons.loaded.push({\n provider,\n prefix,\n name,\n });\n }\n else if (storage.missing[name] !== void 0) {\n // Missing\n icons.missing.push({\n provider,\n prefix,\n name,\n });\n }\n else {\n // Pending\n hasPending = true;\n return true;\n }\n return false;\n });\n // Changes detected - call callback\n if (icons.pending.length !== oldLength) {\n if (!hasPending) {\n // All icons have been loaded - remove callback from prefix\n removeCallback([\n {\n provider,\n prefix,\n },\n ], item.id);\n }\n item.callback(icons.loaded.slice(0), icons.missing.slice(0), icons.pending.slice(0), item.abort);\n }\n });\n });\n }\n}", "function loadAllGifs(nickname) {\n $.ajax({\n type: 'GET',\n url: '/tweb/home/gifsToJson',\n dataType: 'json',\n success: function (data) {\n\n $.each(data, function (i) {\n var loveBtn = 'loveBtn_' + data[i].id;\n var src = \"/tweb/app/uploads/\" + data[i].src + \".gif\";\n\n var $block = $(' <div class=\"grid-item\">\\n' +\n ' <img href=\"#\" src=\"' + src + '\" />\\n' +\n ' <div class=\"grid-item-color\">\\n' +\n ' <span class=\"bottom-left\">\\n' +\n ' <a href=\"/tweb/artists/profile/' + data[i].owner + '\">' + data[i].title + ' upload by ' + data[i].owner + ' </a>\\n' +\n ' </span>\\n' +\n ' <i id=\"' + loveBtn + '\" class=\"top-right fa fa-3x\"></i></a>\\n' +\n ' </div>\\n' +\n ' </div>');\n\n $('div.grid').append($block);\n\n if (data[i].user === nickname) {\n //è tra i preferiti non permettere di mettere like e riempi il cuore <3\n $('#' + loveBtn).addClass('fa-heart');\n\n } else {\n //non è tra i preferiti\n $('#' + loveBtn).click(loveItEvent);\n $('#' + loveBtn).addClass('fa-heart-o');\n\n }\n });\n initMasonry('');\n }\n });\n}", "async function waitToAddIcons(window) {\n\tvar itemContainerSelector;\n\tvar itemSelector;\n\t// TODO: Add cases here\n\t// Decide what to look for on the page given the global container (window) passed in\n\tif(window.className.includes(\"nm-set-window\")) {\n\t\titemContainerSelector = \"div.columns.loaded\";\n\t\titemSelector = \".print\";\n\n\t\ttry {\n\t\t\tdocument.querySelector(\".set-header .set-header--title a\").title = document.querySelector(\"span.art-sett-large--pack span.loadTarget\")['dataset']['setId'];\n\t\t}\n\t\tcatch(e) {\n\t\t\t// console.log(\"Collection page not for set, skipping id...\");\n\t\t}\n\t}\n\telse if(window.className.includes(\"nm-modal\") && window.className.includes(\"trade\")){\n\t\titemContainerSelector = \"div.trade--side--item-list\";\n\t\titemSelector = \".trade--item\";\n\t}\n\t// Wait for that element to be added to the page\n\tawait waitForElement(window, itemContainerSelector);\n\t// Load stored card data, then add icons to the page\n\tchrome.storage.local.get(['cards'], async function(result) {\n\t\tawait addIcons(window, result, itemSelector);\n\t})\n}", "function possibleInterfaces(classNames) { }", "function loadedNewIcons(provider, prefix) {\n // Run only once per tick, possibly joining multiple API responses in one call\n if (loaderFlags[provider] === void 0) {\n loaderFlags[provider] = Object.create(null);\n }\n const providerLoaderFlags = loaderFlags[provider];\n if (!providerLoaderFlags[prefix]) {\n providerLoaderFlags[prefix] = true;\n setTimeout(() => {\n providerLoaderFlags[prefix] = false;\n callbacks.updateCallbacks(provider, prefix);\n });\n }\n}", "function modifyIcons() {\n document.getElementById(\"panel\").removeEventListener('DOMSubtreeModified', modifyIcons, false);\n\n var icons = document.getElementsByClassName(\"adp-marker\");\n var iconLabelsExist = document.getElementsByClassName(\"icon-label\").length;\n for (var i = 0; i < icons.length; i++) {\n icons[i].src = namespace.markers[i].icon.url;\n if (!iconLabelsExist) {\n $(icons[i]).wrap('<div class=\"icon-container\"></div>');\n $( '<p class=\"icon-label\">' + (i + 1) + '</p>' ).insertAfter(icons[i]);\n }\n }\n}", "async function parseOrchestrionIcons() {\n console.time('OrchestrionIcons');\n const content = require('../../data/content/orchestrion.json');\n\n const files = fs.readdirSync('./icons-raw/orchestrion');\n\n await processIconGroup(\n undefined,\n 'orchestrion',\n undefined,\n files.filter(file => /\\.png$/.test(file))\n );\n\n console.timeEnd('OrchestrionIcons');\n}", "function refreshList() {\n getLinks().then(\n data => {\n data.forEach(element => {\n addIcon(element.url, element.icon, element.id);\n });\n },\n error => {\n console.log('error: ', error)\n }\n );\n}", "function load_all_svg_images(){\n\t//nsole.log(\"Tu jsem\");\n\t$(\"#pok*\").text(\"ahoj\");\n\t$.each($(\"[type=svg]\"), function(i, item) {\n\t\tif ( $(item).attr('src') ) {\n\t\t\tload_svg( $(item).attr('id'),$(item).attr('src') );\n\t\t\tif (isset ($(item).attr('width'))==true) {\n\t\t\t\t$(item).children().css( \"width\", $(item).attr('width') );\n\t\t\t}\n\t\t\tif (isset ($(item).attr('height'))==true) {\n\t\t\t\t$(item).children().css( \"height\", $(item).attr('height') );\n\t\t\t}\n\t\t}\n\t});\n}", "function getValidTagNames(namespace, name) {\n if (INTERFACE_TAG_MAPPING[namespace] && INTERFACE_TAG_MAPPING[namespace][name]) {\n return INTERFACE_TAG_MAPPING[namespace][name];\n }\n\n return [];\n}", "function cargarIconos(){\n // iconos para mostrar puntos\n estilosActuales[\"carga\"] = styles.marcadorCarga();\n //corregir esto\n estilosActuales[\"Taxi/Remis\"] = styles.marcadorTraslado();\n // default\n estilosActuales[\"default\"] = styles.marcadorDefault();\n }", "function getCallbacksListsForNamespace( source, eventName ) {\n\tconst eventNode = getEvents( source )[ eventName ];\n\n\tif ( !eventNode ) {\n\t\treturn [];\n\t}\n\n\tlet callbacksLists = [ eventNode.callbacks ];\n\n\tfor ( let i = 0; i < eventNode.childEvents.length; i++ ) {\n\t\tconst childCallbacksLists = getCallbacksListsForNamespace( source, eventNode.childEvents[ i ] );\n\n\t\tcallbacksLists = callbacksLists.concat( childCallbacksLists );\n\t}\n\n\treturn callbacksLists;\n}", "async function parseItemIcons() {\n console.time('ItemIcons');\n const items = require('../../data/items.json');\n\n const paths = [];\n\n Object.values(items).reduce((arr, itemGroup) => ([\n ...arr,\n ...itemGroup\n ]), []).forEach(item => {\n const {\n iconPath\n } = item;\n\n if (paths.indexOf(iconPath) !== -1) {\n return;\n }\n\n paths.push(iconPath);\n });\n\n await processIconGroup(paths, 'item');\n console.timeEnd('ItemIcons');\n}", "function setIcons() {\n restaurantList.forEach(function(saveID){\n var elem = $(\"#\"+saveID)[0];\n // If this is a collection page, the element might be undefined -- check for that\n if (typeof elem != \"undefined\"){\n if ($(\"i\", elem).hasClass(\"fa-square-o\")) {\n $(\"i\", elem).toggleClass(\"fa-square-o fa-check-square-o\");\n }\n }\n });\n}", "function listAnnotations(isClosed=true) {\n if (isClosed) {\n $('#annotation-items').empty();\n getAnnotationsToList();\n // TODO: FIX ANIMATION\n $('#annotation-items').show();\n $('.annotation-menu').animate({'width': '50%', 'left': '85%'});\n document.getElementById('ann_pop').onclick = function () {\n listAnnotations(false)\n };\n } else {\n // TODO: FIX ANIMATION\n $('#annotation-items').hide();\n $('.annotation-menu').animate({'width': '0%', 'left': '100%'});\n document.getElementById('ann_pop').onclick = function () {\n listAnnotations(true)\n };\n }\n}", "function _setAllIcons() {\n\n // Style all markers.\n var markers = _spiderfier.getMarkers();\n var index = markers.length - 1;\n while(index >= 0) {\n _setIcon(markers[index--], false);\n }\n\n // Style spiderfier markers.\n markers = _spiderfier.markersNearAnyOtherMarker();\n index = markers.length - 1;\n while(index >= 0) {\n _setIcon(markers[index--], true);\n }\n}", "enumerateBrsFiles(callback) {\n const files = this.getAllFiles();\n for (const file of files) {\n //only brs files without a typedef\n if ((0, reflection_1.isBrsFile)(file) && !file.hasTypedef) {\n callback(file);\n }\n }\n }", "function subfunction(object){\n var retval=getIconAddress(object);\n retval.done(function(newString){\n if(newString!==object.icon){\n console.log('marker exists updating icon');\n object.icon=newString;\n object.marker.setIcon(newString);\n }else {\n }\n });\n }", "function procesImages(image, callBack) { //operuje na wszystkich obrazach\n var i, max = images.length;\n for (i = 0; i < max; i++) {\n callBack(image[i]);\n }\n }", "function icons() {\r\n var arr = [], style = 'style=\"width:18px\"';\r\n if (iconMapper.map(link)) add(iconMapper.map(link));\r\n if (iconMapper.map(obj.Type)) add(iconMapper.map(obj.Type));\r\n if (reg !== 'Message' && iconMapper.map(reg)) add(iconMapper.map(reg));\r\n if (detail.contains('email')) add(iconMapper.map('email'));\r\n if (detail.contains('SMS')) add(iconMapper.map('sms'));\r\n\r\n //make sure there is exactly 2 icons\r\n arr.first(2);\r\n while (arr.length < 2) {\r\n arr.push('icon-blank');\r\n }\r\n\r\n if (arr.length) {\r\n return '<i ' + style + ' class=\"' + arr.join(' icon-large muted disp-ib\"></i> <i ' + style + ' class=\"') + ' icon-large muted disp-ib\"></i> ';\r\n } else {\r\n return '';\r\n }\r\n function add(i) {\r\n if (!arr.contains(i)) arr.push(i);\r\n }\r\n }", "function onAllLoaded() {\n console.log('all loaded');\n}", "function getExportedFiles (icon, shotObj)\r\n {\r\n icon.image = icons_folder + \"folder_icon_0.png\";\r\n //\r\n destArray = [];\r\n function FindAllFolders (srcFolderStr, destArray)\r\n { \r\n var fileFolderArray = Folder( srcFolderStr ).getFiles(); \r\n for ( var i = 0; i < fileFolderArray.length; i++ )\r\n { \r\n var fileFoldObj = fileFolderArray[i]; \r\n if ( fileFoldObj instanceof File )\r\n { \r\n destArray.push( Folder(fileFoldObj) ); \r\n }\r\n else\r\n { \r\n destArray.push( Folder(fileFoldObj) ); \r\n FindAllFolders( fileFoldObj.toString(), destArray ); \r\n } \r\n } \r\n return destArray; \r\n }; \r\n var appFolder_Files = FindAllFolders (shotObj['appFolder'],destArray);\r\n var filesToFind = [];\r\n for (obj in appFilesToCheck)\r\n {\r\n cleanName = localize(appFileName_template, shotObj['episodeCode'].replace(\"_\", ''), shotObj['name'], appFilesToCheck[obj]);\r\n filesToFind.push(cleanName);\r\n }\r\n files_found = 0;\r\n if (appFolder_Files.length > 0)\r\n {\r\n for (obj in filesToFind)\r\n {\r\n file_found = false;\r\n for (var i=0; i <appFolder_Files.length ; i++)\r\n {\r\n file_name = appFolder_Files[i].name;\r\n if (file_name.search(filesToFind[obj],\"gi\") != -1)\r\n {\r\n file_found = true;\r\n };\r\n }\r\n if (file_found == true) files_found++;\r\n }\r\n }\r\n if (files_found < 1) icon.image = icons_folder + \"folder_icon_3.png\";\r\n else if (files_found > 2) icon.image = icons_folder + \"folder_icon_4.png\";\r\n else icon.image = icons_folder + \"folder_icon_1.png\";\r\n }", "function tenorCallback_search(responsetext)\n{\n // parse the json response\n var response_objects = JSON.parse(responsetext);\n\n todosGifs = response_objects[\"results\"];\n \n for(let i in todosGifs){\n html += '<div class=\"col-md-4 h-100 w-100\"><div class=\"gif\"><img class=\"rounded\" src=\"'+todosGifs[i][\"media\"][0][\"nanogif\"][\"url\"]+'\"/></div></div>';\n }\n $('.gifs').html(html);\n return;\n\n}", "async getCockpitSingletons() {\n const singletons = await this.getSingletonNames();\n return Promise.all(singletons.map(name => this.getSingletonItems(name)));\n }", "function renderIcons() {\r\n\t\te.renderIcon('#logo', 'logo');\r\n\t\t//e.renderIcon('#loading_msglogo','logo');\r\n\t\te.renderIcon('.menu_icon', 'user_management');\r\n\t\te.renderIcon('.menu_click', 'user_management');\r\n\t\te.renderIcon('.notification', 'notification');\r\n\t\te.renderIcon('header .analysis_status .analysis_icon', 'analysis');\r\n\t\te.renderFontIcon('.input_clear_icon', 'ic-close-sm');\r\n\t\te.renderFontIcon('.search_icon', 'ic-search');\r\n\t\te.renderIcon('#add_bookmark', 'bookmarks');\r\n\t\te.renderIcon('#add_bookmark1', 'bookmarks');\r\n\t\te.renderFontIcon('.tag_icon', 'ic-tags');\r\n\t\t$(document).foundation();\r\n\t\tg.init();\r\n\t}", "function imagesFetched(data) {\n //console.log(\"DATA: \", data);\n data.data.forEach(printImages);\n}", "function forEachLightboxImage(images, callback) {\n for (var i = 0; i < images.length; i++) {\n callback(images[i]);\n }\n } // 1. Attach listeners to the lightbox component", "generateIcons() {\n const terminalBase = Core.atlas.find(this.name);\n const terminalDisplay = Core.atlas.find(this.name + \"-display-icon\");\n return [terminalBase, terminalDisplay];\n }", "function printIcons(iconsArray, container) {\n\tcontainer.html('');\n\n\t//foreach per scrivere le icone nel container\n\t//console.log(iconsArray)\n\n\ticonsArray.forEach((element) => {\n\n\t\t//destrutturiamo element pe rprendere le informazioni\n\t\tconst {name, prefix, family, color} = element;\n\t\tconst nameUpperCase = name.toUpperCase();\n\t\t//console.log(element)\n\t\tconst iconElementHTML = `\n\t\t\t<div class=\"icon\">\n\t\t\t\t<i class=\"${family} ${prefix}${name}\" style=\"color:${color};\"></i>\n\t\t\t\t<div>${nameUpperCase}</div>\n\t\t\t</div> \n\t\t`;\n\n\t\tcontainer.append(iconElementHTML)\n\t});\n}", "function _CallReadyList(){\r\n\t\t\r\n\t\tfor(var i=0,l=_ReadyList.length; i<l; ++i){\r\n\t\t\t_ReadyList[i].call(this);\r\n\t\t}\r\n\t\t\r\n\t}", "forEach(callback) {\n for (let key in connections) {\n if (connections[key] instanceof Function == false)\n if (!connections[key].data.irnore)\n callback(connections[key].data);}\n }", "function printIcons(array, container) {\r\n //rimuovo tutti i figli del DOM -> ripulisco il container\r\n container.html('');\r\n\r\n //ciclo forEach di icons per trovare le info che ho definito\r\n array.forEach((info) => {\r\n //destracturing per ricavare le info che voglio\r\n const {color, family, name, prefix} = info;\r\n \r\n //template literal\r\n const elementHTML =`\r\n <div>\r\n <div class=\"box\">\r\n <i class=\"${family} ${prefix}${name}\" style=\"color: ${color}\"></i>\r\n <div style=\"color: ${color}\" class=\"title\">${name.toUpperCase()}</div>\r\n </div>\r\n </div>\r\n `\r\n //inserisco l'elemento nell'HTML \r\n container.append(elementHTML);\r\n });\r\n}", "function iconsRedraw() {\n setTimeout(function(){\n if(instance.network)\n instance.network.redraw();\n if(instance.legend)\n instance.legend.redraw();\n }, 250);\n }", "function removeFromNamespace(namespaces, callback, options) {\n var retVal = 0 // number of removed callbacks\n , namespace ;\n\n for (var i in namespaces)\n { // so we loop through all namespaces (and __stack is one of them)\n if (namespaces.hasOwnProperty(i) )\n {\n namespace = namespaces[i] ;\n if (i === '__stack')\n {\n retVal += removeCallback(namespace.on, callback, options) ;\n }\n else if (options.traverse) // NO, its a namesapace -> recursion\n {\n retVal += removeFromNamespace.call(this, namespace, callback, options) ;\n }\n }\n }\n\n return retVal ; // a count of removed callback function\n }", "async function nameSpaceCheckNameAvailability() {\n const subscriptionId = \"29cfa613-cbbc-4512-b1d6-1b3a92c7fa40\";\n const parameters = {\n name: \"sdk-Namespace-2924\",\n };\n const credential = new DefaultAzureCredential();\n const client = new NotificationHubsManagementClient(credential, subscriptionId);\n const result = await client.namespaces.checkAvailability(parameters);\n console.log(result);\n}", "function listAll() {\n getFilesFromFolder(\"Backup Binder\").then(function(classes) {\n for (i = 0; i < classes[1].files.length; i++) {\n getFilesFromFolder(classes[1].files[i].name).then(function(classwork) {\n var classID = classwork[0];\n var classContent = classwork[1].files;\n if ($(\"#binderContent\").text() == \"\") { // if binderContent is empty\n var dict = {};\n dict[classID] = classContent;\n $(\"#binderContent\").text(JSON.stringify(dict));\n }\n else { // if it's not empty\n var binderContentDict = $.parseJSON($(\"#binderContent\").text());\n binderContentDict[classID] = classContent;\n $(\"#binderContent\").text(JSON.stringify(binderContentDict));\n }\n }).then(function(cop) {\n\t\t\t addNamesToArray()\n\t\t\t //INIT()\n\t\t }).then(function() {\n\t\t\t addNamesToArray()\n\t\t }).catch(function(error) {console.log(error)});\n }\n\t\t\n\t\t\n\t }).then(function(oofo) {\n\t\t\taddNamesToArray()\n\t\t})\n \n }", "function getAllInfoboxes(svgElement) {\n\n let infoboxes = svgElement.querySelectorAll('[id^=\"infobox\"]');\n let infoxbox1 = svgElement.querySelector(\"#point1\");\n\n // For EACH LOOP FOR \"2-9 INFOBOXES AND SEPERATE FOR THE FIRST ONE / ADD STYLING\n infoxbox1.classList.add(\"infoboxStyles\");\n infoxbox1.addEventListener(\"click\",(event) => {\n \n event.preventDefault();\n ModalClicked(infoxbox1); \n }); \n\n infoboxes.forEach(infobox => {\n console.log(\"Box\",infobox);\n\n infobox.classList.add(\"infoboxStyles\");\n\n infobox.addEventListener(\"click\",(event) => {\n \n event.preventDefault();\n ModalClicked(infobox); \n }); \n });\n\n EventhandleFunction();\n\n}", "getAll(callback) {\n runListContainer(this, {all:true}, callback);\n }", "function printIcons(icons, contenitoreIcone) {\r\n icons.forEach((icon)=>{\r\n const {family, prefix, name, color} = icon;\r\n const html =//parte di html\r\n `<div class=\"icon\">\r\n <i class=\"${family} ${prefix}${name}\"\r\n style=\"color: ${color}\"></i>\r\n <div class=\"nomeIcona\">${name}</div>\r\n </div>\r\n `\r\n contenitoreIcone.append(html);\r\n return\r\n });\r\n\r\n\r\n}", "function getMosaicsFromNamespace() {\r\n let spc = namespace.value;\r\n if (spc == \"\") {\r\n namespace.focus();\r\n return false;\r\n }\r\n _doGet('/namespace/mosaic/definition/page?namespace=' + spc);\r\n }", "function getlabelfiles(callback) {\n _get('getlabelfiles', undefined, callback);\n}", "_getIconIndex(icons, name) {\n\t for (let i = 0; i < icons.length; i++) {\n\t const icon = icons[i];\n\t if (icon.name === name) {\n\t return i;\n\t }\n\t if (icon.aliases) {\n\t const aliases = icon.aliases;\n\t for (let j = 0; j < aliases.length; j++) {\n\t if (aliases[j] === name) {\n\t return i;\n\t }\n\t }\n\t }\n\t }\n\t return false;\n\t }", "function showAnnotationCounterForCNNRelatedURL () {\n //Get the unorder list <ul>\n //<div class=\"ob-widget-section ob-last\">\n var currentElem = document.getElementsByClassName(\"ob-widget-section ob-last\");\n if (currentElem.length > 0)\n {\n currentElem = currentElem[0]; \n var list = currentElem.getElementsByClassName(\"ob-widget-items-container\"); \n \n for (var i = 0; i < list.length; ++i) {\n var links = list[i].getElementsByTagName(\"a\"); //Get all the links\n if (links.length > 0) {\n for (var i = 0; i < links.length; ++i)\n {\n appendAnnotationCounterForURL(links[i]);\n }\n }\n }\n }\n}", "function champIcons() {\n\t\t$.ajax({\n\t\t url: \"champions/champs.json\",\n\t\t type: \"POST\",\n\t\t dataType: \"json\",\n\t })\n\t\t .done(function (data) { \n\t\t \t showIcons(data.data); \n\t\t}) \n\t\t .fail(function (jqXHR, textStatus, errorThrown) { \n\t\t \tconsole.log(\"Failed to retrieve champion data\");\n\t\t});\n\t\t\n\t}", "function scanDOM() {\n if (!SimpleSVG.isReady) {\n return;\n }\n\n // Find new icons\n findNewIcons();\n }", "observeArray (items) {\n for (var i = 0, l = items.length; i < l; i++) {\n observe(items[i]);\n }\n }", "forEachRepresentation(source, callback) {\n const pxm = this.proxyManager;\n pxm\n .getRepresentations()\n .filter((rep) => rep.getInput() === source)\n .forEach((view) => callback(view));\n this[pxmSubsKey].push(\n pxm.onProxyRegistrationChange((info) => {\n if (\n info.proxyGroup === 'Representations' &&\n info.action === 'register' &&\n info.proxy.getInput() === source\n ) {\n callback(info.proxy);\n }\n })\n );\n }", "function updateMarkers(elemName, elem){\n var circleMarker = $(elem).children('i');\n if(checkBoxOptions[elemName] == true){\n circleMarker.attr('class', 'fa fa-circle')\n } else {\n circleMarker.attr('class', 'fa fa-circle-thin')\n } \n }", "function ajxSelectImagesDone(data) {\n for (var val of data) {\n if(definedImage(val.idImage) && definedImage(val.posX) && definedImage(val.posY)){\n if(val.isVisible == 1)\n newImage(val.idImage, val.title, val.imageName, val.posX, val.posY);\n else\n newImageDeleted(val.idImage, val.title, val.imageName, val.posX, val.posY);\n }\n }\n }", "function bindSearchIconEvent(searchElements) {\n\n WM.forEach(searchElements, function (ele) {\n var searchEle = WM.element('<a class=\"app-header-action wi wi-search\"></a>');\n WM.element(ele).before(searchEle);\n //Tap icon to show/hide search box\n bindTapEvtHandler(searchEle, function () {\n toggleSearchContainer(ele);\n });\n });\n\n }", "function satIcons(object, icon) {\n // Iterates through all satellites pulled from N2YO\n object.above.forEach(sat => {\n // Creates marker for each satellite with custom icon\n const satMarker = new google.maps.Marker({\n // Sets icon position per N2YO data\n position: new google.maps.LatLng(sat.satlat, sat.satlng),\n icon: icon,\n map: map\n })\n\n const launchDate = new Date(sat.launchDate);\n\n // Conversions\n const launchYear = launchDate.getFullYear().toString();\n\n let launchDay = (launchDate.getDate() + 1).toString();\n launchDay = launchDay.length > 1 ? launchDay : `0${launchDay}`;\n\n let launchMonth = (launchDate.getMonth() + 1).toString();\n launchMonth = launchMonth.length > 1 ? launchMonth : `0${launchMonth}`;\n\n\n // Sets data to display in infowindow for each satellite\n const contentString = `\n <h5 class=\"satname\">Satellite: ${sat.satname}</h5>\n <ul class=\"satfacts\">\n <li>Launch Date: ${launchMonth}/${launchDay}/${launchYear}</li>\n <li>Altitude: ${(Math.round(((sat.satalt * 0.621371) + Number.EPSILON) * 100) / 100).toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1,')} miles / \n ${(Math.round((((sat.satalt * 0.621371) * 5280) + Number.EPSILON) * 100) / 100).toString().replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, '$1,')} feet</li>\n <li>Latitude: ${sat.satlat}</li>\n <li>Longitude: ${sat.satlng}</li>\n </ul>`;\n\n // Creates new infowindow for each satellite\n const infowindow = new google.maps.InfoWindow({\n content: contentString\n });\n\n // Adds listener to open when satellite icon is clicked\n satMarker.addListener(\"click\", () => {\n infowindow.open(map, satMarker);\n openInfoWindows.push(infowindow);\n })\n\n // Pushes satMarker variables to array for later removal on next search\n satMarkerArray.push(satMarker);\n infoWindowArray.push(infowindow);\n })\n }", "forEach (callback) {\n\t\tObject.getOwnPropertyNames(this.map).forEach(function(name) {\n\t\t\tcallback(name, this.map[name]);\n\t\t});\n\t}", "function listAssociations(itemMirror, groupingItemURI){\n var displayText;\n var cap = MAXFOLDERS;\n var length;\n console.log(itemMirror);\n $('a#upOneLvl').remove();\n $('#modalDialog div.modal-body ul').empty();\n $('div#modalDialog div.modal-footer p').remove();\n $('div#modalDialog div.modal-footer').prepend($('<p>',{text: groupingItemURI}).css('float', 'left'));\n itemMirror.listAssociations(function (error, GUIDs){\n itemMirror.getParent(function(error, parent){\n if (parent) {\n upOneLevel(parent);\n }\n });\n if (GUIDs.length >= cap) {\n length = cap\n }else {\n length = GUIDs.length\n }\n for (var i=0;i<length;i++){\n itemMirror.getAssociationDisplayText(GUIDs[i], function(error, text){\n displayText = text;\n });\n prntAssoc(error, displayText, GUIDs[i], itemMirror);\n }\n if (error) {\n console.log(error);\n }\n });\n }", "children() {\n\t\treturn Object.values(this[_impls]);\n\t}", "getInterfaceFileLink(ifaceName, containingNamespace) {\n const lowerName = ifaceName === null || ifaceName === void 0 ? void 0 : ifaceName.toLowerCase();\n const ifaceMap = this.getInterfaceMap();\n let iface = ifaceMap.get(util_1.util.getFullyQualifiedClassName(lowerName, containingNamespace === null || containingNamespace === void 0 ? void 0 : containingNamespace.toLowerCase()));\n //if we couldn't find the iface by its full namespaced name, look for a global class with that name\n if (!iface) {\n iface = ifaceMap.get(lowerName);\n }\n return iface;\n }", "function infoRecursos(){\n\t\tvar casillas = find(\"//img[starts-with(@class, 'mt')]\", XPList);\n\t\tvar areas = find(\"//map[@name='map2']//area[@shape='poly']\", XPList);\n\n\t\tfor (var i = 0; i < casillas.snapshotLength; i++){\n\t\t\tif (casillas.snapshotItem(i).src.match(/\\/(d|t)\\d*.gif$/)){\n\t\t\t\tvar area = areas.snapshotItem(i);\n\t\t\t\tarea.addEventListener(\"mouseover\", crearEventoRecursosCasilla(area.href), 0);\n\t\t\t\tarea.addEventListener(\"mouseout\", function(){ clearTimeout(timeout); timeout = 0; get(\"tb_tooltip\").style.display = 'none'; }, 0);\n\t\t\t}\n\t\t}\n\t}", "forEach(callbackfn) {\n this.boxes.forEach(callbackfn);\n }", "function extensionAll(){\r\n console.log('inside extensionAll()');\r\n\r\n var gettingAll = browser.management.getAll();\r\n gettingAll.then((infoArray) => {\r\n for (info of infoArray){\r\n \r\n console.dir(info.name,info.id);\r\n browser.activityLog.onExtensionActivity.addListener((details) => {\r\n var sending = browser.runtime.sendMessage(details);\r\n console.dir(details);\r\n },info.id);\r\n \r\n }\r\n });\r\n}", "getNamedSvgIcon(name, namespace = '') {\n // Return (copy of) cached icon if possible.\n const key = iconKey(namespace, name);\n const config = this._svgIconConfigs.get(key);\n if (config) {\n return this._getSvgFromConfig(config);\n }\n // See if we have any icon sets registered for the namespace.\n const iconSetConfigs = this._iconSetConfigs.get(namespace);\n if (iconSetConfigs) {\n return this._getSvgFromIconSetConfigs(name, iconSetConfigs);\n }\n return Object(rxjs__WEBPACK_IMPORTED_MODULE_4__[\"throwError\"])(getMatIconNameNotFoundError(key));\n }", "function getAllItemsCallback(response){\n\tconsole.log(response.count);\n\tresponse.results.forEach(function(items){\n\t\tconsole.log(items.name);\n\t})\n}", "function getGatheringIconPaths() {\n const nodes = require('../../data/methods/gathering.json');\n\n const paths = [];\n\n Object.values(nodes).reduce((arr, nodeGroup) => ([\n ...arr,\n ...nodeGroup.map(node => node.iconPath)\n ]), []).forEach(iconPath => {\n const mappedPath = mapIconPath(iconPath);\n\n if (paths.find(path => path.as === mappedPath.as)) {\n return;\n }\n\n paths.push(mappedPath);\n });\n\n return paths;\n}", "function loadImageList() {\n let filterElem = $('#filter_annotation_type');\n let filter = filterElem.val();\n let params = {\n image_set_id: gImageSetId\n };\n\n // select the corresponding annotation type for the label tool\n if (filter !== '' && !isNaN(filter)) {\n params.filter_annotation_type_id = filter;\n $('#annotation_type_id').val(filter);\n handleAnnotationTypeChange();\n }\n\n $.ajax(API_IMAGES_BASE_URL + 'imageset/load/?' + $.param(params), {\n type: 'GET',\n headers: gHeaders,\n dataType: 'json',\n success: function(data, textStatus, jqXHR) {\n if (data.image_set.images.length === 0) {\n // redirect to image set view.\n displayFeedback($('#feedback_image_set_empty'));\n filterElem.val('').change();\n return;\n }\n displayImageList(data.image_set.images);\n },\n error: function() {\n $('.annotate_button').prop('disabled', false);\n displayFeedback($('#feedback_connection_error'));\n }\n });\n }", "function loadAllOrganizations() {\n }", "function __getObjs($name) {\r\n return __arrayDoms(document.all[$name]);\r\n}", "function showIcons(data) {\n\t\tvar names = [];\n\t\tvar all = [];\n\n\t\tfor(var x in data) {\n\t\t\tnames.push(data[x].name);\n\t\t\tvar obj = {name: data[x].name, id: data[x].id, key: data[x].key};\n\t\t\tall.push(obj);\n\t\t}\n\t\tnames.sort();\n\t\tfor (var i=0; i < names.length; i++) {\n\t\t\tfor (var x in all) {\n\t\t\t\tif (names[i] == all[x].name) {\n\t\t\t\t\tchampionsNames.push(all[x].name);\n\t\t\t\t\tchampionsKeys.push(all[x].key);\n\t\t\t\t\tchampionsIds.push(all[x].id);\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor (var i=0; i < championsKeys.length; i++) {\n\t\t\tcreateImage(championsKeys[i], championsIds[i], championsNames[i]);\n\t\t}\n\t}", "function initIconTable(ids) { \n console.log(\" in initIconTable: \"); \n removeDropdowns(); // gets rid of menus before creating icon menu\n\n if (document.getElementById(ids.containerID).contains(document.querySelector(\".dropdown\"))) { // if already there, remove it instead\n console.log(\" NOPE not creating a new one\");\n //// WHAT DO WE DO HERE \n }\n else { // if not there, create icon table \n console.log(\" creating new icon table\");\n document.querySelector(\".elementForEdit\").appendChild(getIconTableNode());\n for (var iconNum = 0; iconNum < icons.length; iconNum++) { // loops through each icon\n setIcon(iconNum, ids); // calls listeners on each icon \n }\n }\n}", "getAttractsIcons(){\n return this.attracts.join('-');\n }", "function update() {\n\n if (detectionIsOn) {\n for (let a of arrayOfInterfaces) {\n a.track();\n }\n\n }\n \n\n}", "function __objLoop(obj, names, fn){ \n\tif (isGlobalNS(obj, names[0])) names.shift();\n\tvar nsObj = obj, flag = true, i=0, len = names.length; \n\twhile(i<len && flag && nsObj){\n\t\tvar curname = names[i];\n\t\tif (curname === \"\") {\n\t\t\tconsole.error(\"invalid NS name:\" + names.join(\".\"));\n\t\t\treturn undefined;\n\t\t}\n\t\tflag = fn(curname, nsObj);\n\t\tif(flag)\n\t\t\tnsObj = nsObj[curname];\n\t\ti++;\n\t}\n\treturn flag;\n}" ]
[ "0.5754351", "0.54076743", "0.50904495", "0.50842637", "0.5080745", "0.5014423", "0.49508548", "0.4943572", "0.4821361", "0.48196003", "0.48114815", "0.4809634", "0.4809634", "0.4772146", "0.4755873", "0.47359955", "0.4733905", "0.47324297", "0.47245473", "0.472149", "0.47081232", "0.4708069", "0.47078153", "0.46904552", "0.46904552", "0.46904552", "0.46904552", "0.46904552", "0.46904552", "0.46660817", "0.46390146", "0.46371105", "0.4625555", "0.46252272", "0.45923355", "0.45792833", "0.4578187", "0.4575532", "0.45744607", "0.4568618", "0.4566393", "0.45662695", "0.4563332", "0.4537817", "0.45209005", "0.4508855", "0.45083353", "0.45048302", "0.44867796", "0.44738245", "0.44730052", "0.4469908", "0.44675758", "0.44572073", "0.44463184", "0.4441688", "0.44367114", "0.44294238", "0.44278556", "0.44276765", "0.4425408", "0.44214424", "0.4414202", "0.44081837", "0.4405912", "0.44044837", "0.44044766", "0.43965763", "0.43933457", "0.4391769", "0.4389212", "0.43850836", "0.4379643", "0.43770486", "0.43738014", "0.43710378", "0.4368091", "0.43525407", "0.43514743", "0.43439737", "0.4343973", "0.43435863", "0.43406102", "0.43361688", "0.43312123", "0.43277508", "0.43200052", "0.43183917", "0.4317731", "0.43122786", "0.4311335", "0.42996028", "0.42971438", "0.4288435", "0.42859748", "0.42812577", "0.42809808", "0.42766455", "0.42740408", "0.42677277" ]
0.5647813
1
Load layers that are not part of the GetCapabilities
function getAdditionalLayers(layerGroupId, success, failure) { var filter = "&CQL_FILTER=layergroup='" + layerGroupId + "'" var url = jsonUrl("layer") + filter getGeoserverTable(url, success, failure) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function preloadGmxLayers(mapConfig) {\n var ids = [];\n\n function rWalk(node) {\n if (node.type === 'gmxVector' && node.gmxId) {\n ids.push(node.gmxId);\n }\n\n node.children && node.children.map(function(child) {\n rWalk(child);\n });\n }\n\n rWalk(mapConfig);\n\n return Promise.all(ids.map(function(id) {\n return L.gmx.loadLayer(id.split(':')[0], id.split(':')[1]);\n })).then(function(arResolved) {\n var h = {};\n ids.map(function(id, i) {\n h[id.split(':')[1]] = arResolved[i];\n });\n return h;\n });\n }", "function loadMap() {\n\n //Change the cursor\n map.getCanvas().style.cursor = 'pointer';\n\n //NOTE Draw order is important, largest layers (covers most area) are added first, followed by small layers\n\n\n //Add raster data and layers\n rasterLayerArray.forEach(function(layer) {\n map.addSource(layer[0], {\n \"type\": \"raster\",\n \"tiles\": layer[1]\n });\n\n map.addLayer({\n \"id\": layer[2],\n \"type\": \"raster\",\n \"source\": layer[0],\n 'layout': {\n 'visibility': 'none'\n }\n });\n });\n\n //Add polygon data and layers\n polyLayerArray.forEach(function(layer) {\n map.addSource(layer[0], {\n \"type\": \"vector\",\n \"url\": layer[1]\n });\n\n map.addLayer({\n \"id\": layer[2],\n \"type\": \"fill\",\n \"source\": layer[0],\n \"source-layer\": layer[3],\n \"paint\": layer[4],\n 'layout': {\n 'visibility': 'none'\n }\n });\n });\n\n map.setLayoutProperty('wildness', 'visibility', 'visible');\n\n //Add wildness vector data source and layer\n for (i = 0; i < polyArray.length; i++) {\n map.addSource(\"vector-data\"+i, {\n \"type\": \"vector\",\n \"url\": polyArray[i]\n });\n\n //fill-color => stops sets a gradient\n map.addLayer({\n \"id\": \"vector\" + i,\n \"type\": \"fill\",\n \"source\": \"vector-data\" + i,\n \"source-layer\": polySource[i],\n \"minzoom\": 6,\n \"maxzoom\": 22,\n \"paint\": wildPolyPaint\n });\n }\n\n //Add polygon/line data and layers\n for (i=0; i<lineLayerArray.length; i++) {\n map.addSource(lineLayerArray[i][0], {\n \"type\": \"vector\",\n \"url\": lineLayerArray[i][1]\n })\n\n map.addLayer({\n \"id\": lineLayerArray[i][2],\n \"type\": \"line\",\n \"source\": lineLayerArray[i][0],\n \"source-layer\": lineLayerArray[i][4],\n \"paint\": {\n 'line-color': lineLayerArray[i][5],\n 'line-width': 2\n }\n });\n\n map.addLayer({\n \"id\": lineLayerArray[i][3],\n \"type\": \"fill\",\n \"source\": lineLayerArray[i][0],\n \"source-layer\": lineLayerArray[i][4],\n \"paint\": {\n 'fill-color': lineLayerArray[i][5],\n 'fill-opacity': .3\n }\n });\n\n map.setLayoutProperty(lineLayerArray[i][2], 'visibility','none');\n map.setLayoutProperty(lineLayerArray[i][3], 'visibility','none');\n map.moveLayer(lineLayerArray[i][2]);\n map.moveLayer(lineLayerArray[i][3]);\n }\n\n //Add States data set\n map.addSource('states', {\n \"type\": \"vector\",\n \"url\": \"mapbox://wildthingapp.2v1una7q\"\n });\n\n //Add States outline layer, omitting non-state territories\n map.addLayer({\n \"id\": \"states-layer\",\n \"type\": \"line\",\n \"source\": \"states\",\n \"source-layer\": \"US_State_Borders-4axtaj\",\n \"filter\": [\"!in\",\"NAME\",\"Puerto Rico\", \"Guam\",\"American Samoa\", \"Commonwealth of the Northern Mariana Islands\",\"United States Virgin Islands\"]\n });\n\n map.setLayerZoomRange('wildness', 0, 7);\n}", "_selectLayers(frameState) {\n const {layerMap} = this.state;\n const {frameNumber} = frameState;\n const selectedLayers = [];\n const layerMapValues = Object.values(layerMap);\n\n for (const value of layerMapValues) {\n const {tile} = value;\n let {layer} = value;\n\n if (tile.selectedFrame === frameNumber) {\n if (layer && layer.props && !layer.props.visible) {\n // Still has GPU resource but visibility is turned off so turn it back on so we can render it.\n layer = layer.clone({visible: true});\n layerMap[tile.contentUri].layer = layer;\n }\n selectedLayers.push(layer);\n } else if (tile.contentUnloaded) {\n // Was cleaned up from tileset cache. We no longer need to track it.\n delete layerMap[tile.contentUri];\n } else if (layer && layer.props && layer.props.visible) {\n // Still in tileset cache but doesn't need to render this frame. Keep the GPU resource bound but don't render it.\n layer = layer.clone({visible: false});\n layerMap[tile.contentUri].layer = layer;\n }\n }\n\n this.setState({\n layers: selectedLayers\n });\n }", "function loadMapLayer() {\n if (getPreference(\"MAP_CHOICE\") === \"1\"){\n map.removeLayer(_light);\n map.addLayer(_dark);\n }else{\n map.removeLayer(_dark);\n map.addLayer(_light);\n }\n}", "function testLayers(){\n\t\t\t// handle errors in layer loading\n\t\t\trequire([\"dojo/promise/all\",\"dojo/Deferred\",\"dojo/json\"],function(all,Deferred,JSON){\n\t\t\t\tfunction cancelRequest(request){\n\t\t\t\t\tif (request.status==0)\n\t\t\t\t\t\trequest.abort();\n\t\t\t\t}\n\t\t\t\tfunction testService(layer) {\n\t\t\t\t\t\tvar deferred = new Deferred();\n\t\t\t\t\t\tvar request = new XMLHttpRequest();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\trequest.open(\"get\", layer.url + \"?f=json\");\n\t\t\t\t\t\t\tvar timer = setTimeout(cancelRequest.bind(null, request),3000); // timeout after 3 seconds\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (error) {\n\t\t\t\t\t\t\t\tconsole.error(error);\n\t\t\t\t\t\t\t\tdeferred.resolve({ layer: layer, resolution: false });\n\t\t\t\t\t\t\t\treturn deferred.promise;\n\t\t\t\t\t\t}\n\t\t\t\t\t\trequest.onloadend = function () {\n\t\t\t\t\t\t\t\tif (this.status !== 200) {\n\t\t\t\t\t\t\t\t\t\t//console.log(\"Could not load \" + layer.id);\n\t\t\t\t\t\t\t\t\t\tdeferred.resolve({ layer: layer, resolution: false });\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\tvar response = JSON.parse(this.response);\n\t\t\t\t\t\t\t\t\t\tif (response.error) {\n\t\t\t\t\t\t\t\t\t\t\t\t//console.log(\"Could not load \" + layer.id);\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.resolve({ layer: layer, resolution: false });\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\t\tdeferred.resolve({ layer: layer, resolution: true });\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t};\n\t\t\t\t\t\trequest.send();\n\t\t\t\t\t\treturn deferred.promise;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tvar promises = [];\n\t\t\t\tvar layersToAdd = [];\n\t\t\t\tvar layers = xmlDoc.getElementsByTagName(\"operationallayers\")[0].getElementsByTagName(\"layer\");\n\t\t\t\tvar mvum1Index=-1,mvum2Index;\n\t\t\t\tfor (var i=0; i<layers.length; i++){\n\t\t\t\t\tlayersToAdd[i] = {\n\t\t\t\t\t\t\"id\": layers[i].getAttribute(\"label\"),\n\t\t\t\t\t\t\"url\": layers[i].getAttribute(\"url\")\n\t\t\t\t\t};\n\t\t\t\t\t// Save the index to MVUM\n\t\t\t\t\tif (layersToAdd[i].id.indexOf(\"Motor Vehicle\")>-1) mvum1Index = i;\n\t\t\t\t}\n\t\t\t\t// if no MVUM don't add additional services to try\n\t\t\t\tif (mvum1Index > -1){\n\t\t\t\t\t// Test 2 additional MVUM to use if one is down\n\t\t\t\t\tmvum2Index = layersToAdd.length;\n\t\t\t\t\t//layersToAdd[layersToAdd.length] = {\n\t\t\t\t\t//\t\"id\": \"Motor Vehicle Use Map\",\n\t\t\t\t\t//\t\"url\": \"https://apps.fs.usda.gov/arcx/rest/services/EDW/EDW_MVUM_02/MapServer\"\n\t\t\t\t\t//};\n\t\t\t\t\tlayersToAdd[layersToAdd.length] = {\n\t\t\t\t\t\t\"id\": \"Motor Vehicle Use Map\",\n\t\t\t\t\t\t\"url\": \"https://ndismaps.nrel.colostate.edu/ArcGIS/rest/services/mvum/MapServer\"\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\tlayersToAdd.forEach(function (layer) {\n\t\t\t\t\tpromises.push(testService(layer));\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// Process Map Service Responses - Up or Down\n\t\t\t\tvar allPromises = new all(promises);\n\t\t\t\tallPromises.then(function (response) {\n\t\t\t\t\tvar errflag = false; // did any layer have problems? addMapLayers will replace xmlDoc layers with these in response\n\t\t\t\t\tvar mvumflag = false;\n\t\t\t\t\tvar rmLayers = [];\n\t\t\t\t\tfor (var i=0; i<response.length; i++) {\n\t\t\t\t\t\tif (response[i].layer.id.indexOf(\"Motor Vehicle\")>-1) mvumflag = true;\n\t\t\t\t\t\telse mvumflag = false;\n\t\t\t\t\t\tif (response[i].resolution) {\n\t\t\t\t\t\t\t// layer did not have errors\n\t\t\t\t\t\t\tif (mvumflag == true){\n\t\t\t\t\t\t\t\t// The given MVUM worked\n\t\t\t\t\t\t\t\tif (mvum1Index == i) {\n\t\t\t\t\t\t\t\t\tresponse.pop(); // pop 2nd MVUM\n\t\t\t\t\t\t\t\t\t//response.pop(); // pop 3rd MVUM\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// The second MVUM worked replace this URL and remove the last 2 MVUM maps\n\t\t\t\t\t\t\t\telse if (mvum2Index == i) {\n\t\t\t\t\t\t\t\t\tconsole.log(\"Layer loaded: \"+response[i].layer.id+\" \"+response[i].layer.url);\n\t\t\t\t\t\t\t\t\tresponse[mvum1Index].layer.url = response[i].layer.url;\n\t\t\t\t\t\t\t\t\tresponse[mvum1Index].resolution = true;\n\t\t\t\t\t\t\t\t\tresponse.pop(); // pop 2nd MVUM\n\t\t\t\t\t\t\t\t\t//response.pop(); // pop 3rd MVUM\n\t\t\t\t\t\t\t\t\terrflag = true;\n\t\t\t\t\t\t\t\t\tourMVUM = true;// set flag because will need to move this layer to the bottom of TOC later.\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// The third MVUM worked replace this URL and remove the last 2 MVUM maps\n\t\t\t\t\t\t\t\t//else {\n\t\t\t\t\t\t\t\t//\tconsole.log(\"Layer loaded: \"+response[i].layer.id+\" \"+response[i].layer.url);\n\t\t\t\t\t\t\t\t//\tresponse[mvum1Index].layer.url = response[i].layer.url;\n\t\t\t\t\t\t\t\t//\tresponse[mvum1Index].resolution = true;\n\t\t\t\t\t\t\t\t//\tresponse.pop();\n\t\t\t\t\t\t\t\t//\tresponse.pop();\n\t\t\t\t\t\t\t\t//\terrflag = true;\n\t\t\t\t\t\t\t\t//\tourMVUM = true;// set flag because will need to move this layer to the bottom later.\n\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// layer is down\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tconsole.log(\"Layer failed to load: \"+response[i].layer.id+\" \"+response[i].layer.url);\n\t\t\t\t\t\t\t// Not MVUM since that is handled above\n\t\t\t\t\t\t\tif (response[i].layer.id.indexOf(\"Motor Vehicle\")==-1){\n\t\t\t\t\t\t\t\tif (response[i].layer.id.indexOf(\"Wildfire\") > -1)\n\t\t\t\t\t\t\t\t\talert(\"The external map service that provides \"+response[i].layer.id+\" is experiencing problems. This issue is out of CPW control. We will make the National Interagency Fire Center aware of the issue. We apologize for any inconvenience.\",\"External (Non-CPW) Map Service Error\");\n\t\t\t\t\t\t\t\telse if(response[i].layer.id.indexOf(\"BLM\") > -1)\n\t\t\t\t\t\t\t\t\talert(\"The external map service that provides \"+response[i].layer.id+\" is experiencing problems. This issue is out of CPW control. We will make the BLM aware of the issue. We apologize for any inconvenience.\",\"External (Non-CPW) Map Service Error\");\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\talert(response[i].layer.id+\" service is busy or not responding. Please try reloading this page.\",\"Data Error\");\n\t\t\t\t\t\t\t\trmLayers.push(response[i].layer.id); // index of layers to remove\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Remove map services that were down, from the response array\n\t\t\t\t\tif (rmLayers.length > 0){\n\t\t\t\t\t\terrflag = true;\n\t\t\t\t\t\tfor (j=0;j<rmLayers.length;j++){\n\t\t\t\t\t\t\tfor (i=0;i<response.length;i++){\n\t\t\t\t\t\t\t\tif (rmLayers[j] == response[i].layer.id){\t\n\t\t\t\t\t\t\t\t\tresponse.splice(i,1);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// Pass services to use. If there were services that were down errflag = true.\n\t\t\t\t\taddMapLayers(response,errflag,ourMVUM);\n\t\t\t\t});\n\t\t\t});\n\t\t}", "function layerLoadHandler(event) {\n\t\t\t\t// For layers loaded from URL set layer visibility\n\t\t\t\ttry {\n\t\t\t\t\tvar j, layerInfos;\n\t\t\t\t\tvar num = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9);\n\t\t\t\t\tif (layerObj[event.layer.id]) {\n\t\t\t\t\t\tlayerInfos = [];\n\t\t\t\t\t\tlayerInfos = event.layer.layerInfos;\n\t\t\t\t\t\t// See what gmu is turned on\n\t\t\t\t\t\tif (event.layer.id == \"Hunter Reference\") {\n\t\t\t\t\t\t\tfor (j = 0; j < layerObj[event.layer.id].visLayers.length; j++) {\n\t\t\t\t\t\t\t\tif (layerInfos[layerObj[event.layer.id].visLayers[j]].name.substr(layerInfos[layerObj[event.layer.id].visLayers[j]].name.length - 3, 3).indexOf(\"GMU\") > -1) {\n\t\t\t\t\t\t\t\t\tgmu = layerInfos[layerObj[event.layer.id].visLayers[j]].name;\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// if gmu was not visible but a game species was selected then set gmu\n\t\t\t\t\t\telse if (event.layer.id == \"Game Species\") {\n\t\t\t\t\t\t\tfor (j = 0; j < layerObj[event.layer.id].visLayers.length; j++) {\n\t\t\t\t\t\t\t\tif (layerInfos[layerObj[event.layer.id].visLayers[j]].name === \"Bighorn Sheep\") {\n\t\t\t\t\t\t\t\t\tgmu = \"Bighorn GMU\";\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t} else if (layerInfos[layerObj[event.layer.id].visLayers[j]].name === \"Mountain Goat\") {\n\t\t\t\t\t\t\t\t\tgmu = \"Goat GMU\";\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// 2-19-19 use default visibility for old MVUM\n\t\t\t\t\t\tif (!ourMVUM){\n\t\t\t\t\t\t\tfor (j = 0; j < layerInfos.length; j++) {\n\t\t\t\t\t\t\t\tif (layerObj[event.layer.id].visLayers.indexOf(layerInfos[j].id) != -1)\n\t\t\t\t\t\t\t\t\tlayerInfos[j].defaultVisibility = true;\n\t\t\t\t\t\t\t\telse if (layerInfos[j].parentLayerId != -1 && !layerInfos[j].subLayerIds) {\n\t\t\t\t\t\t\t\t\tif (layerInfos[j].name.substr(layerInfos[j].name.length - 3, 3).indexOf(\"GMU\") > -1) {}\n\t\t\t\t\t\t\t\t\telse if ((layerInfos[j].defaultVisibility == true) && (layerObj[event.layer.id].visLayers.indexOf(layerInfos[j].parentLayerId) === -1)) {\n\t\t\t\t\t\t\t\t\t\tlayerObj[event.layer.id].visLayers.push(j);\n\t\t\t\t\t\t\t\t\t\tif (num.indexOf(parseInt(layerInfos[layerInfos[j].parentLayerId].name.substr(0, 1))) > -1) {\n\t\t\t\t\t\t\t\t\t\t\tlayerObj[event.layer.id].visLayers.push(layerInfos[j].parentLayerId);\n\t\t\t\t\t\t\t\t\t\t\tlayerInfos[layerInfos[j].parentLayerId].defaultVisibility = true;\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} else\n\t\t\t\t\t\t\t\t\tlayerInfos[j].defaultVisibility = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tevent.layer.setVisibleLayers(layerObj[event.layer.id].visLayers.sort(function (a, b) {\n\t\t\t\t\t\t\t\t\treturn a - b;\n\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\tevent.layer.refresh();\n\t\t\t\t\t\t} // end if !ourMVUM\n\t\t\t\t\t}\n\t\t\t\t\tcollapsedFlg = true;\n\t\t\t\t\tif (event.layer.visible)\n\t\t\t\t\t\tcollapsedFlg = false;\n\t\t\t\t\tlegendLayers.push({\n\t\t\t\t\t\tlayer : event.layer,\n\t\t\t\t\t\ttitle : event.layer.id,\n\t\t\t\t\t\tautoToggle : true,\n\t\t\t\t\t\tslider : true,\n\t\t\t\t\t\tslider_ticks : 3,\n\t\t\t\t\t\tslider_labels : [\"transparent\", \"50%\", \"opaque\"],\n\t\t\t\t\t\thideGroupSublayers : hideGroupSublayers,\n\t\t\t\t\t\tradioLayers : radioLayers,\n\t\t\t\t\t\tnoLegend : false,\n\t\t\t\t\t\topenSubLayers : [],\n\t\t\t\t\t\tcollapsed : collapsedFlg\n\t\t\t\t\t});\n\t\t\t\t\tmapLayers.push(event.layer);\n\t\t\t\t\tif (mapLayers.length == xmlDoc.getElementsByTagName(\"operationallayers\")[0].getElementsByTagName(\"layer\").length) {\n\t\t\t\t\t\tvar tmp = [layer.length];\n\t\t\t\t\t\tvar m = 0;\n\t\t\t\t\t\tfor (j = layer.length - 1; j > -1; j--) {\n\t\t\t\t\t\t\tfor (k = 0; k < layer.length; k++) {\n\t\t\t\t\t\t\t\tif (legendLayers[k].title === layer[j].getAttribute(\"label\")) {\n\t\t\t\t\t\t\t\t\ttmp[m++] = legendLayers[k];\n\t\t\t\t\t\t\t\t\tbreak;\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\tlegendLayers = tmp;\n\t\t\t\t\t\tfor (var k = 0; k < mapLayers.length; k++) {\n\t\t\t\t\t\t\tif ((mapLayers[k].id == \"Hunter Reference\") && (layerObj[\"Hunter Reference\"])) {\n\t\t\t\t\t\t\t\tlayerInfos = null;\n\t\t\t\t\t\t\t\tlayerInfos = mapLayers[k].layerInfos;\n\t\t\t\t\t\t\t\tfor (j = 0; j < layerInfos.length; j++) {\n\t\t\t\t\t\t\t\t\tif (layerInfos[j].name.substr(layerInfos[j].name.length - 3, 3).indexOf(\"GMU\") > -1) {\n\t\t\t\t\t\t\t\t\t\tif (layerInfos[j].name == gmu) {\n\t\t\t\t\t\t\t\t\t\t\tif (layerObj[\"Hunter Reference\"].visLayers.indexOf(j) == -1)\n\t\t\t\t\t\t\t\t\t\t\t\tlayerObj[\"Hunter Reference\"].visLayers.push(j);\n\t\t\t\t\t\t\t\t\t\t\tlayerInfos[j].defaultVisibility = true;\n\t\t\t\t\t\t\t\t\t\t\tif ((num.indexOf(parseInt(layerInfos[layerInfos[j].parentLayerId].name.substr(0, 1))) > -1) && (layerObj[\"Hunter Reference\"].visLayers.indexOf(layerInfos[j].parentLayerId) == -1)) {\n\t\t\t\t\t\t\t\t\t\t\t\tlayerObj[\"Hunter Reference\"].visLayers.push(layerInfos[j].parentLayerId);\n\t\t\t\t\t\t\t\t\t\t\t\tlayerInfos[layerInfos[j].parentLayerId].defaultVisibility = true;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else\n\t\t\t\t\t\t\t\t\t\t\tlayerInfos[j].defaultVisibility = false;\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\tmapLayers[k].setVisibleLayers(layerObj[\"Hunter Reference\"].visLayers.sort(function (a, b) {\n\t\t\t\t\t\t\t\t\t\treturn a - b;\n\t\t\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tmap.addLayers(mapLayers);\n\t\t\t\t\t\ttocFlag = true;\n\t\t\t\t\t\tinitTOC();\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {\n\t\t\t\t\talert(\"Error in readConfig.js/layerLoadHandler \" + e.message, \"Code Error\", e);\n\t\t\t\t}\n\t\t\t}", "_getFeaturesFromRelevantLayers(): Object[] {\n const features = [...this._handler.featureCollection.getObject().features];\n const { layerIdsToSnapTo } = this._modeConfig || {};\n\n if (layerIdsToSnapTo && layerIdsToSnapTo.length) {\n const otherLayersToSnapTo = this._context.layerManager.layers.filter(layer => {\n const shouldPickFromLayer = layerIdsToSnapTo && layerIdsToSnapTo.includes(layer.id);\n\n // Filter out the current layer since the current layer's features are\n // already populated in the features array.\n return shouldPickFromLayer && layer.id !== this._layerId;\n });\n\n const featuresFromAdditionalLayers = otherLayersToSnapTo\n .map(otherLayer => otherLayer.props.data)\n .reduce((a, b) => [...a, ...b], []);\n\n features.push(...featuresFromAdditionalLayers);\n }\n return features;\n }", "function loadLayers(callback) {\n\t\tcallback = cb(callback);\n\t\t\n\t\tloadDir([ dir, 'layers' ].join('/'), function(dirname) {\n\t\t\treturn {\n\t\t\t\tid: dirname\n\t\t\t}\n\t\t}, function(err, layers) {\n\t\t\tif ( err ) return callback(err);\n\t\t\t\n\t\t\tvar c = layers.length;\n\t\t\tlayers.forEach(function(layer) {\n\t\t\t\tlayer.users = [];\n\t\t\t\tloadDir([ dir, 'layers', layer.id ].join('/'), function(linkname) {\n\t\t\t\t\tvar uid = fileUid(linkname);\n\t\t\t\t\tlayer.users.push(uid);\n\t\t\t\t}, function(err) {\n\t\t\t\t\tif ( err ) \n\t\t\t\t\t\treturn callback(err);\n\t\t\t\t\tif ( 0 === --c )\n\t\t\t\t\t\tcallback(null, layers);\n\t\t\t\t});\n\t\t\t});\n\t\t})\n\t}", "loadAllCatchments() {\n\t\tGoogleMaps.load((google) => {\t\t\n\t\t\tthis.kmlLayer = new google.maps.KmlLayer({\n\t\t\t\turl: this.catchments.all,\n\t\t\t\tpreserveViewport: true\n\t\t\t});\n\n\t\t\tthis.kmlLayer.setMap(this.map);\n\t\t});\t\t\n\t}", "function getLayers() {\n var layerArray = [L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: '#TeamMX',\n maxZoom: 18,\n id: 'mapbox/dark-v9',\n accessToken: 'pk.eyJ1Ijoicm1mNzU3IiwiYSI6ImNrNmp0d2pscDAxY3cza3AxZTJscGM2engifQ.WKqWyaCGIh-g5_3FxgKJhg'\n }),\n \n L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: '#TeamMX',\n maxZoom: 18,\n id: 'mapbox/streets-v11',\n accessToken: 'pk.eyJ1Ijoicm1mNzU3IiwiYSI6ImNrNmp0d2pscDAxY3cza3AxZTJscGM2engifQ.WKqWyaCGIh-g5_3FxgKJhg'\n }),\n L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: '#TeamMX',\n maxZoom: 18,\n id: 'mapbox/light-v9',\n accessToken: 'pk.eyJ1Ijoicm1mNzU3IiwiYSI6ImNrNmp0d2pscDAxY3cza3AxZTJscGM2engifQ.WKqWyaCGIh-g5_3FxgKJhg'\n }),\n L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: '#TeamMX',\n maxZoom: 18,\n id: 'mapbox/outdoors-v9',\n accessToken: 'pk.eyJ1Ijoicm1mNzU3IiwiYSI6ImNrNmp0d2pscDAxY3cza3AxZTJscGM2engifQ.WKqWyaCGIh-g5_3FxgKJhg'\n }),\n L.tileLayer('https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token={accessToken}', {\n attribution: '#TeamMX',\n maxZoom: 18,\n id: 'mapbox/satellite-streets-v9',\n accessToken: 'pk.eyJ1Ijoicm1mNzU3IiwiYSI6ImNrNmp0d2pscDAxY3cza3AxZTJscGM2engifQ.WKqWyaCGIh-g5_3FxgKJhg'\n }),\n esri_streets = L.esri.basemapLayer('Streets')];\n\n\n //Scott's servers are too slow to use our own tile servers :(\n //MX_Dark_Matter = L.tileLayer('192.168.10.9:32768/styles/{id}/?raster#{z}/{x}/{y}/', {\n // attribution: '#TeamMX',\n // maxZoom: 18,\n // id: 'dark-matter',\n // });\n \n return layerArray;\n}", "function GetLayers(cap, baseUrl){\n\t// Get the titile of the data service\n\tvar dataServiceTitle = cap.serviceIdentification.title;\n\t\n\t// Check if there are any feature types in the data service\n\tif (cap.featureTypeList.featureTypes.length == 0)\n\t\talert(\"There are no feature types in '\" + dataServiceTitle + \"'.\");\n\n\telse{\t\t\n\t\t// Get each feature layer listed in the capabilities\n\t\tfor (var i = 0; i < cap.featureTypeList.featureTypes.length; i++) {\n\t\t\tvar featureName = cap.featureTypeList.featureTypes[i].name;\n\t\t\tvar featureNS = cap.featureTypeList.featureTypes[i].featureNS;\n\t\t\t\n\t\t\thits = undefined;\n\t\t\t// Get the number of features in the layer\n\t\t\tGetHits(baseUrl, featureName);\n\t\t\n\t\t\tvar r = true;\n\t\t\tif (hits > 2500)\n\t\t\t\tr = confirm(\"There are \"+hits+\" \"+featureName+\" features. They make take awhile to draw.\\n-Hit cancel\\n-Zoom to a smaller area\\n-Turn on the set extent toggle on the toolbar.\\n-Select the layer again.\\nOr hit OK to attempt to draw anyway.\");\n\t\t\tif (hits == 0){\n\t\t\t\tif (bounds != undefined)\n\t\t\t\t\talert(\"There were 0 \"+featureName+\"s features returned. Try changing the set extent or turn off the set extent toggle on the toolbar.\");\n\t\t\t\telse\n\t\t\t\t\talert(\"There were 0 \"+featureName+\"s features returned. There may be a problem with the server.\");\n\t\t\t\tr = false;\n\t\t\t}\n\n\t\t\tif (r == true) {\n\t\t\t\t// Create the server request for the layer\n\t\t\t\twfsLayers[l] = new OpenLayers.Layer.Vector(featureName+\" (\"+dataServiceTitle+\")\", {\n\t\t\t\t\tstrategies: [new OpenLayers.Strategy.Fixed()],\n\t\t\t\t\tprotocol: new OpenLayers.Protocol.WFS({\n\t\t\t\t\t\t//version: \"1.1.0\", // !!!!!!!!!!!!!! Features aren't drawn if use 1.1.0 !!!!!!!!!!!!!!!!!!\n\t\t\t\t\t\turl: baseUrl,\n\t\t\t\t\t\tfeatureType: featureName,\n\t\t\t\t\t\tfeatureNS: featureNS,\n\t\t\t\t\t\tgeometryName: \"shape\"\n\t\t\t\t\t}),\n\t\t\t\t\tevents: new OpenLayers.Events({\n\t\t\t\t\t\tbeforefeatureadded: Busy()\n\t\t\t\t\t}),\n\t\t\t\t\tstyleMap: SetStyle(),\n\t\t\t\t\tvisibility: true\n\t\t\t\t});\n\t\t\t\t//console.log(bounds);\n\t\t\t\tif (bounds != undefined) {\n\t\t\t\t\tbboxFilter = new OpenLayers.Filter.Spatial({\n\t\t\t\t\t\ttype: OpenLayers.Filter.Spatial.BBOX,\n\t\t\t\t\t\tvalue: bounds\n\t\t\t\t\t});\n\t\t\t\t\twfsLayers[l].filter = bboxFilter;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tmap.addLayer(wfsLayers[l]);\n\t\t\t\tMakeSelectable();\n\t\t\t\t//console.log(map);\n\t\t\t\t\n\t\t\t\t// Set the number of features as the title in the legend\n\t\t\t\twfsLayers[l].events.register(\"featureadded\", wfsLayers[l], function (e) {\n\t\t\t\t\te.object.styleMap.styles.default.rules[0].title = e.object.features.length.toString() + \" features\";\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// Set the cursor to busy while the layer is loading\n\t\t\t\twfsLayers[l].events.register(\"loadstart\", wfsLayers[l], function (e) {\n\t\t\t\t\tBusy();\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\t// Set the cursor back to the default after layer has been loaded\n\t\t\t\twfsLayers[l].events.register(\"loadend\", wfsLayers[l], function (e) {\n\t\t\t\t\tReady();\n\t\t\t\t\t\n\t\t\t\t\t// Set the maximum bounds for all the loaded layers & Zoom to those bounds\n\t\t\t\t\tSetLayersExtent(e.object);\n\t\t\t\t\tZoomToLayersExtent();\t\t\t\t\n\n\t\t\t\t\tif ((e.object == undefined) || (e.object.features.length == 0)) {\n\t\t\t\t\t\talert(featureName+\" wasn't loaded correctly. There maybe a problem with the server.\");\n\t\t\t\t\t\t//map.removeLayer(e.object);\n\t\t\t\t\t\t//activeLayer = undefined;\n\t\t\t\t\t\t//l--;\n\t\t\t\t\t\t//console.log(wfsLayers);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t\tl++;\n\t\t\t}\n\t\t\telse\n\t\t\t\tGetSubregion(cap.featureTypeList.featureTypes[i]);\n\t\t}\n\t}\t\n}", "function collectLayers()\n{\n var layers = [],\n visibleLayers = [],\n layerCount = 0,\n ref = null,\n desc = null;\n \n const idOrdn = charIDToTypeID(\"Ordn\");\n \n // Get layer count reported by the active Document object - it never includes the background.\n ref = new ActionReference();\n ref.putEnumerated(charIDToTypeID(\"Dcmn\"), charIDToTypeID(\"Ordn\"), charIDToTypeID(\"Trgt\"));\n desc = executeActionGet(ref);\n layerCount = desc.getInteger(charIDToTypeID(\"NmbL\"));\n\n if (layerCount == 0) {\n // This is a flattened image that contains only the background (which is always visible).\n activeDocument.backgroundLayer.locked = false;\n var bg = activeDocument.backgroundLayer;\n layers.push(bg);\n visibleLayers.push(bg);\n }\n else {\n // There are more layers that may or may not contain a background. The background is always at 0;\n // other layers are indexed from 1.\n \n const idLyr = charIDToTypeID(\"Lyr \");\n const idLayerSection = stringIDToTypeID(\"layerSection\");\n const idVsbl = charIDToTypeID(\"Vsbl\");\n const idNull = charIDToTypeID(\"null\");\n const idSlct = charIDToTypeID(\"slct\");\n const idMkVs = charIDToTypeID(\"MkVs\");\n \n ref = new ActionReference();\n ref.putEnumerated(idLyr, idOrdn, charIDToTypeID(\"Trgt\"));\n var selectionDesc = executeActionGet(ref);\n \n try {\n // Collect normal layers.\n var visibleInGroup = [true];\n var layerVisible;\n for (var i = layerCount; i >= 1; --i) {\n // check if it's an art layer (not a group) that can be selected\n ref = new ActionReference();\n ref.putIndex(idLyr, i);\n desc = executeActionGet(ref);\n layerVisible = desc.getBoolean(idVsbl);\n layerSection = typeIDToStringID(desc.getEnumerationValue(idLayerSection));\n if (layerSection == \"layerSectionContent\") {\n // select the layer and then retrieve it via Document.activeLayer\n desc.clear();\n desc.putReference(idNull, ref); \n desc.putBoolean(idMkVs, false); \n executeAction(idSlct, desc, DialogModes.NO);\n \n var activeLayer = activeDocument.activeLayer;\n layers.push(activeLayer);\n if (layerVisible && visibleInGroup[visibleInGroup.length - 1]) {\n visibleLayers.push(activeLayer);\n } \n }\n else if (layerSection == \"layerSectionStart\") {\n visibleInGroup.push(layerVisible && visibleInGroup[visibleInGroup.length - 1]);\n }\n else if (layerSection == \"layerSectionEnd\") {\n visibleInGroup.pop();\n } \n }\n \n // Collect the background.\n ref = new ActionReference();\n ref.putIndex(idLyr, 0);\n try {\n desc = executeActionGet(ref);\n var bg = activeDocument.backgroundLayer;\n layers.push(bg);\n if (bg.visible) {\n visibleLayers.push(bg);\n }\n\n }\n catch (e) {\n // no background, move on\n } \n }\n catch (e) {\n if (e.message != \"cancel\") throw e;\n }\n\n // restore selection (unfortunately CS2 doesn't support multiselection, so only the topmost layer is re-selected)\n desc.clear();\n ref = new ActionReference();\n const totalLayerCount = selectionDesc.getInteger(charIDToTypeID(\"Cnt \"));\n ref.putIndex(idLyr, selectionDesc.getInteger(charIDToTypeID(\"ItmI\")) - (totalLayerCount - layerCount));\n desc.putReference(idNull, ref); \n desc.putBoolean(idMkVs, false); \n executeAction(idSlct, desc, DialogModes.NO);\n }\n \n return {layers: layers, visibleLayers: visibleLayers};\n}", "function loadLayer(features){\n try{\n var contents=features;\n var fc = JSON.parse(JSON.stringify(eval(\"(\" + contents + \")\")));\n //var fc = turf.featurecollection(res.geojson);\n var color=geoOperation.get_random_color();\n angular.forEach(fc.features, function(value, key){\n if (fc.features[key].properties==null){\n fc.features[key].properties={};\n }\n });\n leafletData.getMap(\"mapabase2\").then(function(map) {\n map.spin(true);\n var geojson=L.geoJson(fc, {\n style: function (feature) {\n if(feature.properties['stroke']!=null&&feature.properties['stroke-width']!=null&&feature.properties['stroke-opacity']!=null&&feature.properties['fill']!=null&&feature.properties['fill-opacity']!=null){\n return {color:feature.properties['stroke'],weight:feature.properties['stroke-width'],opacity:feature.properties['stroke-opacity'],fillOpacity:feature.properties['fill-opacity'],fillColor:feature.properties['fill']};\n }else if(feature.properties['stroke']!=null&&feature.properties['stroke-width']!=null&&feature.properties['stroke-opacity']!=null){\n if(feature.properties['line-stroke']!=null){\n if(feature.properties['line-stroke']=='stroke1'){\n return {stroke: true, color:feature.properties['stroke'], weight:feature.properties['stroke-width'], opacity:feature.properties['stroke-opacity'],dashArray:'1'};\n }else if(feature.properties['line-stroke']=='stroke2'){\n return {stroke: true, color:feature.properties['stroke'], weight:feature.properties['stroke-width'], opacity:feature.properties['stroke-opacity'],dashArray:'10,10'};\n }else if(feature.properties['line-stroke']=='stroke3'){\n return {stroke: true, color:feature.properties['stroke'], weight:feature.properties['stroke-width'], opacity:feature.properties['stroke-opacity'],dashArray:'15, 10, 1, 10'};\n }\n\n }else{\n return {stroke: true, color:feature.properties['stroke'], weight:feature.properties['stroke-width'], opacity:feature.properties['stroke-opacity']};\n }\n }else {\n return {stroke: true, color: '#000000', weight:2, fillOpacity: 1.0, fillColor: color};\n }\n },\n onEachFeature: function(feature, layer){\n try{\n if(feature.properties['marker-color']!=null&&feature.properties['marker-symbol']!=null){\n\n var markerSymbol=feature.properties['marker-symbol'];\n var markerColor=feature.properties['marker-color'];\n var markerSize=feature.properties['marker-size'];\n var mSize=\"s\";\n\n if(markerSize==\"small\"){\n mSize=\"s\";\n }else if(markerSize==\"medium\"){\n mSize=\"m\";\n }else if(markerSize==\"large\"){\n mSize=\"l\";\n }else{\n mSize=\"s\";\n markerSize=\"small\";\n }\n var iconSize;\n switch (markerSize) {\n case \"small\":\n iconSize = [20, 50];\n break;\n case \"medium\":\n iconSize = [30, 70];\n break;\n case \"large\":\n iconSize = [35, 90];\n break;\n }\n markerColor=markerColor.replace(\"#\",\"\");\n //Set marker icon\n if(markerSymbol!=\"\"){\n if(markerSymbol!=\" \"){\n var iconURL=mapAPI+'pin-'+mSize+'-'+markerSymbol+'+'+markerColor+'.png';\n layer.setIcon(new L.Icon({iconUrl: iconURL, iconSize: iconSize,\n iconAnchor: [iconSize[0] / 2, iconSize[1] / 2],\n popupAnchor: [0, -iconSize[1] / 2]}));\n }\n }\n }\n }catch(err){\n\n }\n var content = '<table class=\"dropchop-table\"><tr>';\n if (layer.feature.properties) {\n for (var prop in layer.feature.properties) {\n if(prop==\"fill\"){\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:100%;height:20px;background-color:' + layer.feature.properties[prop] + ';\"></div></td></tr>';\n }else if(prop==\"stroke\"){\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:100%;height:20px;background-color:' + layer.feature.properties[prop] + ';\"></div></td></tr>';\n }else if(prop==\"line-stroke\"){\n var sColor=layer.feature.properties[\"stroke\"];\n if(layer.feature.properties['line-stroke']=='stroke1'){\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:100%;height:20px;margin-top: -15px;border-bottom:2px solid '+sColor+';\"></div></td></tr>';\n }else if(layer.feature.properties['line-stroke']=='stroke2'){\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:95%;height:20px;margin-top: -15px;border-bottom: 2px dashed '+sColor+';\"></div></td></tr>';\n }else if(layer.feature.properties['line-stroke']=='stroke3'){\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:100%;height:20px;margin-top: -15px;border-bottom: 2px dotted '+sColor+';\"></div></td></tr>';\n }else{\n content += '<tr><td><strong>' + prop + '</strong></td><td><div style=\"width:100%;height:20px;margin-top: -15px;border-bottom:2px solid '+sColor+';\"></div></td></tr>';\n }\n }else if(prop==\"marker-symbol\"){\n var mColor=layer.feature.properties[\"marker-color\"];\n mColor=mColor.replace('#','');\n var mSrc=mapAPI+'pin-m-'+layer.feature.properties[prop]+'+'+mColor+'.png';\n var img='<img src=\"'+mSrc+'\" width=\"20\" height=\"35\" style=\"margin-top: 15px;\">';\n content += '<tr><td><strong>' + prop + '</strong></td><td style=\"text-align:center;\">' + img + '</td></tr>';\n }else{\n if(prop!=\"marker-color\"){\n content += '<tr><td><strong>' + prop + '</strong></td><td>' + layer.feature.properties[prop] + '</td></tr>';\n }\n\n }\n\n }\n }else {\n //content += '<p></p>';\n }\n content += '</table>';\n layer.bindPopup(L.popup({\n maxWidth: 450,\n maxHeight: 200,\n autoPanPadding: [45, 45],\n className: 'dropchop-popup'\n }, layer).setContent(content));\n }\n\n }).addTo(map);\n aLayers.push(geojson);\n map.fitBounds(geojson.getBounds());\n map.spin(false);\n });\n\n }catch(err){\n //console.log(err);\n }\n }", "addFromLayers(){\n let _from = this.props.fromVersion.key;\n //add the sources\n this.addSource({id: window.SRC_FROM_POLYGONS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _from + \"_polygons\" + window.TILES_SUFFIX]}});\n this.addSource({id: window.SRC_FROM_POINTS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _from + \"_points\" + window.TILES_SUFFIX]}});\n //add the layers\n this.addLayer({id: window.LYR_FROM_DELETED_POLYGON, sourceId: window.SRC_FROM_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(255,0,0, 0.2)\", \"fill-outline-color\": \"rgba(255,0,0,0.5)\"}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_DELETED_POINT, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(255,0,0)\", \"circle-opacity\": 0.6}, filter:INITIAL_FILTER, beforeID: window.LYR_TO_POLYGON});\n //geometry change in protected areas layers - from\n this.addLayer({id: window.LYR_FROM_GEOMETRY_POINT_TO_POLYGON, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(255,0,0)\", \"circle-opacity\": 0.5}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_GEOMETRY_POINT_COUNT_CHANGED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"line-color\": \"rgb(255,0,0)\", \"line-width\": 1, \"line-opacity\": 0.5, \"line-dasharray\": [3,3]}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n this.addLayer({id: window.LYR_FROM_GEOMETRY_SHIFTED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"line-color\": \"rgb(255,0,0)\", \"line-width\": 1, \"line-opacity\": 0.5, \"line-dasharray\": [3,3]}, filter:INITIAL_FILTER, beforeId: window.LYR_TO_GEOMETRY_POINT_TO_POLYGON});\n //selection layers\n this.addLayer({id: window.LYR_FROM_SELECTED_POLYGON, sourceId: window.SRC_FROM_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POLYGON, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_FROM_SELECTED_LINE, sourceId: window.SRC_FROM_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _from + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_LINE, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_FROM_SELECTED_POINT, sourceId: window.SRC_FROM_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _from + \"_points\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POINT, filter:INITIAL_FILTER, beforeId: window.LYR_TO_SELECTED_POLYGON});\n }", "set layers(layers) {\n this.cache.layers = [];\n layers.forEach(this.add, this);\n }", "function loadDisplay() {\n loadElevationLayer();\n loadGrid();\n}", "function loadDisplay() {\n loadElevationLayer();\n loadGrid();\n}", "function layersWmsLoad(event){\n\t\t\t\t\t\n\t\t\t\t\t//console.log(\"Chargement de \"+event.object.name);\n\t\t\t\t\t$scope.countLayers.push(event.object.name);\n\n\t\t\t\t\t$scope.isLoaded = false;\n\t\t\t\t\t/////----------SpinJs Options ------------------------\n\t\t\t\t\tvar opts = {\n\t\t\t\t\t\t\t lines: 13, // The number of lines to draw\n\t\t\t\t\t\t\t length: 8, // The length of each line\n\t\t\t\t\t\t\t width: 4, // The line thickness\n\t\t\t\t\t\t\t radius: 8, // The radius of the inner circle\n\t\t\t\t\t\t\t corners: 1, // Corner roundness (0..1)\n\t\t\t\t\t\t\t rotate: 0, // The rotation offset\n\t\t\t\t\t\t\t direction: 1, // 1: clockwise, -1: counterclockwise\n\t\t\t\t\t\t\t color: '#000', // #rgb or #rrggbb or array of colors\n\t\t\t\t\t\t\t speed: 1.5, // Rounds per second\n\t\t\t\t\t\t\t trail: 60, // Afterglow percentage\n\t\t\t\t\t\t\t shadow: false, // Whether to render a shadow\n\t\t\t\t\t\t\t hwaccel: false, // Whether to use hardware acceleration\n\t\t\t\t\t\t\t className: 'spinner', // The CSS class to assign to the spinner\n\t\t\t\t\t\t\t zIndex: 2e9, // The z-index (defaults to 2000000000)\n\t\t\t\t\t\t\t top: 'auto', // Top position relative to parent in px\n\t\t\t\t\t\t\t left: 'auto' // Left position relative to parent in px\n\t\t\t\t\t\t\t};\n\n\n\t\t\t\t\tif($scope.spinner==undefined){\n\n\t\t\t\t\t\tvar target = document.getElementById($scope.divref);\n\t\t\t\t\t\t$scope.spinner = new Spinner(opts).spin(target);\n\n\n\t\t\t\t\t}//-------end spinner start\n\n\t\t\t\t\t\n\t\t\t\t}", "_initSources() {\n // finally load every sources already in our plane html element\n // load plane sources\n let loaderSize = 0;\n if(this.autoloadSources) {\n const images = this.htmlElement.getElementsByTagName(\"img\");\n const videos = this.htmlElement.getElementsByTagName(\"video\");\n const canvases = this.htmlElement.getElementsByTagName(\"canvas\");\n\n // load images\n if(images.length) {\n this.loadImages(images);\n }\n\n // load videos\n if(videos.length) {\n this.loadVideos(videos);\n }\n\n // load canvases\n if(canvases.length) {\n this.loadCanvases(canvases);\n }\n\n loaderSize = images.length + videos.length + canvases.length;\n }\n\n this.loader._setLoaderSize(loaderSize);\n\n this._canDraw = true;\n }", "removeFromLayers(){\n if (this.map.getSource(window.SRC_FROM_POLYGONS)) this.removeSource(window.SRC_FROM_POLYGONS);\n if (this.map.getSource(window.SRC_FROM_POINTS)) this.removeSource(window.SRC_FROM_POINTS);\n }", "addMapLayers() {\r\n // console.log('method: addMapLayers');\r\n let layers = this.map.getStyle().layers;\r\n // Find the index of the first symbol layer in the map style\r\n let firstSymbolId;\r\n for (let i = 0; i < layers.length; i++) {\r\n if (layers[i].type === 'symbol') {\r\n firstSymbolId = layers[i].id;\r\n break;\r\n }\r\n }\r\n this.options.mapConfig.layers.forEach((layer, index) => {\r\n\r\n // Add map source\r\n this.map.addSource(layer.source.id, {\r\n type: layer.source.type,\r\n data: layer.source.data\r\n });\r\n \r\n\r\n // Add layers to map\r\n this.map.addLayer({\r\n \"id\": layer.id,\r\n \"type\": \"fill\",\r\n \"source\": layer.source.id,\r\n \"paint\": {\r\n \"fill-color\": this.paintFill(layer.properties[0]),\r\n \"fill-opacity\": 0.8,\r\n \"fill-outline-color\": \"#000\"\r\n },\r\n 'layout': {\r\n 'visibility': 'none'\r\n }\r\n }, firstSymbolId);\r\n\r\n\r\n // check if touch device. if it's not a touch device, add mouse events\r\n if (!checkDevice.isTouch()) {\r\n this.initMouseEvents(layer);\r\n } // checkDevice.isTouch()\r\n\r\n\r\n // Store all the custom layers\r\n this.customLayers.push(layer.id);\r\n });\r\n }", "function getLayers() {\n // Create layers only if map is available and if layers have not been created before.\n if (getMap() && _config && _config.layers && _layers.length === 0) {\n var layerConfigs = _config.layers;\n // Layer is defined outside of loop and reseted to undefined\n // inside the loop to make sure value is correct for every loop.\n var layer;\n for (var i = 0; i < layerConfigs.length; ++i) {\n var config = layerConfigs[i];\n // Reset layer to undefined for this loop.\n layer = undefined;\n if (config && config.className && config.args) {\n // Layers are created by providing arguments list in configuration.\n // Check from the given arguments if any of them contains animation configuration.\n for (var j = 0; j < config.args.length; ++j) {\n var arg = config.args[j];\n if (arg) {\n var animation = arg.animation;\n if (animation) {\n // Check animation resolution of the layer.\n if (animation.resolutionTime === undefined) {\n // Make sure that at least a default resolution is set for animation layer.\n animation.resolutionTime = getAnimationResolution();\n }\n // Check if layer configuration has set begin and end times for animation.\n // If whole animation has the values but layer itself does not,\n // use animation values also for the layer as default.\n if (animation.beginTime === undefined) {\n animation.beginTime = getAnimationBeginDate();\n }\n if (animation.endTime === undefined) {\n animation.endTime = getAnimationEndDate();\n }\n if (animation.resolutionTime) {\n // Make sure that animation begin time of the layer is set on the correct resolution time.\n // This is required if layer itself has defined its own resolution instead of\n // using animation resolution.\n if (!(animation.beginTime instanceof Date)) {\n animation.beginTime = new Date(animation.beginTime);\n }\n floorDate(animation.beginTime, animation.resolutionTime);\n // Make sure that animation end time of the layer is set on the correct resolution time.\n // This is required if layer itself has defined its own resolution instead of\n // using animation resolution.\n if (!(animation.endTime instanceof Date)) {\n animation.endTime = new Date(animation.endTime);\n }\n ceilDate(animation.endTime, animation.resolutionTime);\n }\n // Use the first animation that is found from the arguments.\n // Therefore, no need to browse other arguments through any more.\n break;\n }\n }\n }\n layer = fi.fmi.metoclient.ui.animator.Utils.createInstance(config.className, config.args);\n }\n if (layer) {\n _layers.push(layer);\n }\n }\n }\n return _layers;\n }", "function prerender() {\n if (tileEngine.layers) {\n tileEngine.layers.forEach(layer => {\n layerMap[layer.name] = layer;\n\n if (layer.visible !== false) {\n tileEngine._r(layer, offscreenContext);\n }\n });\n }\n }", "_updateLayers() {\n const {tileset3d, layerMap} = this.state;\n const {selectedTiles} = tileset3d;\n\n const tilesWithoutLayer = selectedTiles.filter(tile => !(tile.contentUri in layerMap));\n\n for (const tile of tilesWithoutLayer) {\n this._unpackTile(tile);\n\n const layer = this._create3DTileLayer(tile);\n\n tileset3d.addTileToCache(tile); // Add and remove on main thread\n\n layerMap[tile.contentUri] = {\n layer,\n tile\n };\n }\n }", "function removeAllLayers() {\n currentLayer = \"none\";\n map.removeLayer(otherLayer);\n map.removeLayer(todoLayer);\n map.removeLayer(foodLayer);\n map.removeLayer(shelterLayer);\n map.removeLayer(eventsLayer);\n }", "getLayer(utilityNetworkUsageType) {\n\n let domainNetworks = this.dataElement.domainNetworks;\n let layers = []\n for (let i = 0; i < domainNetworks.length; i ++)\n {\n let domainNetwork = domainNetworks[i];\n \n for (let j = 0; j < domainNetwork.junctionSources.length; j ++)\n if (domainNetwork.junctionSources[j].utilityNetworkFeatureClassUsageType === utilityNetworkUsageType)\n layers.push(domainNetwork.junctionSources[j].layerId);\n }\n\n for (let i = 0; i < domainNetworks.length; i ++)\n {\n let domainNetwork = domainNetworks[i];\n \n for (let j = 0; j < domainNetwork.edgeSources.length; j ++)\n if (domainNetwork.edgeSources[j].utilityNetworkFeatureClassUsageType === utilityNetworkUsageType)\n layers.push(domainNetwork.edgeSources[j].layerId)\n }\n\n return layers;\n }", "function clearLayers() {\n\t\tfor (let i = 0; i < layerList.length; i++) {\n\t\t\tif (map.hasLayer(layerList[i])) {\n\t\t\t\tmap.removeLayer(layerList[i]);\n\t\t\t\t// console.log(\"Removed layer\")\n\t\t\t}\n\t\t}\n\t}", "function layersControl () {\r\n if (maptype == \"artmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"geomap\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />': mapnik,\r\n 'Mapquest open <img src=\"./lib/images/external.png\" />': mapquestopen,\r\n 'Mapquest aerial <img src=\"./lib/images/external.png\" />': mapquest\r\n }; \r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />': maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />': boundaries,\r\n 'Radwege <img src=\"./lib/images/external.png\" />': cycling\r\n };\r\n }\r\n \r\n else if (maptype == \"gpxmap\") { \r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen\r\n };\r\n overlays = {\r\n 'WV Artikel <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles\r\n };\r\n }\r\n \r\n else if (maptype == \"monmap\") {\r\n basemaps = {\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik, \r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Denkmäler <img src=\"./lib/images/wv-logo-12.png\" />' : monuments\r\n };\r\n }\r\n\r\n else if (maptype == \"poimap2\") {\r\n basemaps = {\r\n 'Mapnik <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnik,\r\n 'Mapnik s/w <img src=\"./lib/images/wmf-logo-12.png\" />' : mapnikbw,\r\n 'Mapquest Open <img src=\"./lib/images/external.png\" />' : mapquestopen,\r\n 'Mapquest Aerial <img src=\"./lib/images/external.png\" />' : mapquest,\r\n 'Verkehrsliniennetz <img src=\"./lib/images/external.png\" />' : transport,\r\n 'Reliefkarte <img src=\"./lib/images/external.png\" />' : landscape\r\n };\r\n overlays = {\r\n 'Mapquest Beschriftungen <img src=\"./lib/images/external.png\" />' : maplabels,\r\n 'Grenzen <img src=\"./lib/images/external.png\" />' : boundaries,\r\n 'Schummerung <img src=\"./lib/images/wmf-logo-12.png\" />' : hill,\r\n 'Radwege <img src=\"./lib/images/external.png\" />' : cycling,\r\n 'Wanderwege <img src=\"./lib/images/external.png\" />' : hiking,\r\n 'Sehenswürdigkeiten <img src=\"./lib/images/wv-logo-12.png\" />' : markers,\r\n 'Reiseziele <img src=\"./lib/images/wv-logo-12.png\" />' : wvarticles,\r\n 'GPX Spuren / Kartenmaske <img src=\"./lib/images/wv-logo-12.png\" />' : tracks\r\n };\r\n }\r\n}", "function loadLevel(data) {\n //Grab all layers in the data\n let layers = data.layers;\n //The tile width and height for this level\n let th = data.tileheight;\n let tw = data.tilewidth;\n //Loop through every layer\n for (let i = 0; i < layers.length; i++) {\n //If this is a tile layer and code is running on the client\n if (layers[i].name === \"tiles\" && !useNodeJS) {\n //Create a new tile layer in the image module\n app.image.createTileLayer(layers[i]);\n\n //Else, if this is a solid platform object layer\n } else if (layers[i].name === \"solidPlatforms\") {\n //Loop through all objects\n for (let o = 0; o < layers[i].objects.length; o++) {\n let obj = layers[i].objects[o];\n //Create a platform for this object with the json-provided dimensions\n physics.getPlatform(obj.x / tw, obj.y / th, obj.width / tw, obj.height / th);\n }\n\n //Else, if this is a non-solid platform layer\n } else if (layers[i].name === \"nonSolidPlatforms\") {\n //Loop through all objects\n for (let o = 0; o < layers[i].objects.length; o++) {\n let obj = layers[i].objects[o];\n //create a non-solid platform for this object with the json-provided dimensions\n let plat = physics.getPlatform(obj.x / tw, obj.y / th, obj.width / tw, obj.height / th);\n plat.solid = false;\n }\n }\n }\n //Set up the spritesheets the level uses if on the client\n if (!useNodeJS) {\n //Get tileset information\n let tilesets = data.tilesets;\n //Loop through all tilesets used\n for (let i = 0; i < tilesets.length; i++) {\n //Set the starting id for each sheet (sheets load seperately)\n state.image.tilesheets[tilesets[i].source].setStart(tilesets[i].firstgid);\n }\n }\n }", "function dynamiclayerLoad(event) {\n\n }", "getLayer (name) {\n let out = []\n this.getLayers().forEach((lyr) => {\n if (name === lyr.get('name')) {\n out = lyr\n }\n })\n return out\n }", "initLayers() {\n this.level.game.world.setBounds(0, 0, 1920, 1080);\n\n this.level.map = this.level.game.add.tilemap(this.levelName);\n this.level.map.addTilesetImage(this.tileMapImage, 'tiles');\n this.level.backgroundLayer = this.level.map.createLayer('Background Layer');\n this.level.platformLayer = this.level.map.createLayer('Platform Layer');\n this.level.itemLayer = this.level.map.createLayer('ItemLayer');\n this.level.homeBaseLayer = this.level.map.createLayer('HomeBaseLayer');\n this.level.playerLayer = this.level.map.createLayer('Player Layer');\n\n this.level.map.setCollisionBetween(1, 100000, true, 'Platform Layer');\n }", "function InitLayers()\n{\n LayerCollection.push(new RenderLayer(LayerCollection.length));\n CurrentLayer = LayerCollection[0];\n CurrentLayer.IsSelected = true;\n}", "function loadMapServiceLayers(inMapServiceArray, inMap){\n\t \n\t var currentMapService = null;\n\t var mapControl = inMap;\n\t \n\t try {\n\t \n\t //iterate all base map services in json config and add to map control\n\t \tfor (var i = 0, il = inMapServiceArray.length; i < il; i++) {\n\t\t\t\n\t \t\tif (inMapServiceArray[i].mapServiceType == \"fusedCache\") {\n\n\t \t\t\tcurrentMapService = new esri.layers.ArcGISTiledMapServiceLayer(inMapServiceArray[i].restUrl, {\n\t \t\t\t\tid: inMapServiceArray[i].mapServiceId,\n\t \t\t\t\topacity: inMapServiceArray[i].opacity,\n\t \t\t\t\tvisible: inMapServiceArray[i].isVisible\n\t \t\t\t});\n\t \t\t}\t\n\t \t\telse if (inMapServiceArray[i].mapServiceType == \"dynamic\") {\n\t \t\t\t\n\t \t\t\tcurrentMapService = new esri.layers.ArcGISDynamicMapServiceLayer(inMapServiceArray[i].restUrl, {\n\t \t\t\t\tid: inMapServiceArray[i].mapServiceId,\n\t \t\t\t\topacity: inMapServiceArray[i].opacity,\n\t \t\t\t\tvisible: inMapServiceArray[i].isVisible\n\t \t\t\t});\n\t \t\t}\t\t\t\t\n\t\t\t\n\t\t\tmapControl.addLayer(currentMapService);\t\n\t }\n\t}\n\tcatch(err){\n\t\t\n\t\tconsole.error(\"Error at loadMapServiceLayers() method.\" + \"\\nError Description:\" + err.description);\n\t}\n}", "load( resolver ) {\n const nextToLoad = this.layers.find( ( { isready } ) => !isready );\n if( nextToLoad ) {\n const loader = Promise.all( nextToLoad.prop.use.map( ({ type = \"url\", ...use }) =>\n type === \"url\" ? Loader.default.obtain( use ) : this.get( use.path )\n ));\n loader.then(( packs ) => {\n packs.map( (pkj, index) => {\n const { type = \"url\" } = nextToLoad.prop.use[index];\n if(type === \"url\") {\n this.appendData( pkj, nextToLoad.src );\n }\n else {\n this.merge( pkj, true );\n }\n } );\n nextToLoad.isready = true;\n this.load( resolver );\n });\n }\n else {\n resolver( this );\n }\n }", "function limpiar(){\n for(let i in mymap._layers){\n if(mymap._layers[i]._path != undefined){\n try{\n //console.log(mymap._layers[i]);\n mymap.removeLayer(mymap._layers[i]);\n } catch(e){\n console.log(\"problem with \" + e + mymap._layers[i]);\n }\n }\n }\n}", "function layersInDrawingOrder(layers) {\n\t\tvar layerDrawingOrder = wmsLoader.projectSettings.capability.layerDrawingOrder;\n\t\tif (layerOrderPanel != null) {\n\t\t\t// override project settings (after first load)\n\t\t\tif (enableWmtsBaseLayers) {\n\t\t\t\t// prepend ordered WMTS layers\n\t\t\t\tvar orderedLayers = layerOrderPanel.orderedLayers();\n\t\t\t\tvar wmtsLayers = [];\n\t\t\t\tfor (var i = 0; i < layerDrawingOrder.length; i++) {\n\t\t\t\t\tvar layer = layerDrawingOrder[i];\n\t\t\t\t\tif (orderedLayers.indexOf(layer) == -1) {\n\t\t\t\t\t\twmtsLayers.push(layer);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlayerDrawingOrder = wmtsLayers.concat(orderedLayers);\n\t\t\t}\n\t\t\telse {\n\t\t\tlayerDrawingOrder = layerOrderPanel.orderedLayers();\n\t\t}\n\t\t}\n\n\t\tif (layerDrawingOrder != null) {\n\t\t\tvar orderedLayers = [];\n\t\t\tfor (var i = 0; i < layerDrawingOrder.length; i++) {\n\t\t\t\tvar layer = layerDrawingOrder[i];\n\t\t\t\tif (layers.indexOf(layer) != -1) {\n\t\t\t\t\torderedLayers.push(layer);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn orderedLayers;\n\t\t}\n\t\telse {\n\t\t\treturn layers.reverse();\n\t\t}\n\t}", "function parseLayers() {\n _.forEach(config.floorsConfiguration, parseLayer);\n}", "async loadDataLayer(layer) {\n // Our data layers put a URL in the .source.data field. We'll fetch that\n // and then inline the resulting GeoJSON as a new source.\n //\n const sourceUrl = layer.getIn([\"source\", \"data\"]);\n const sourceId = `${layer.get(\"id\")}-source`;\n\n const response = await fetch(sourceUrl);\n const geojson = await response.json();\n\n // Convert layer w/ source url to a source + layer style spec\n //\n const newStyle = immutable({\n sources: {\n [sourceId]: layer.get(\"source\").set(\"data\", geojson)\n },\n layers: [\n layer.set(\"source\", sourceId)\n ]\n });\n\n // Add new source + layer style to the map\n //\n this.newState(state =>\n state.update(\"mapStyle\", mapStyle =>\n mergeMapStyle(mapStyle, newStyle)));\n }", "function checkLayers() {\n if (recentGroup.hasLayer() != true) {\n recentPop();\n } else clearRecents();\n }", "function loadPumpStationlayer(pumpstationdata){\r\nvar pumpstationjson = JSON.parse(pumpstationdata);\r\nvar jproperties = pumpstationjson.features.map(function (el) { return el.properties; });\r\nvar i;\r\nif (pumpstationarray=[]){\r\nfor (i = 0; i < jproperties.length; i++) { \r\n\tpumpstationarray.push(Object.values(jproperties[i]));\r\n}}\r\nif (pumpstapumpinc =[]){\r\nfor (i = 0; i < pumpstationarray.length; i++) { \r\n\tpumpstapumpinc.push([pumpstationarray[i][1],pumpstationarray[i][2]]);\r\n}}\r\n\r\nif (boroughfloodinclayer){\r\n\t\tmymap.removeLayer(boroughfloodinclayer);\r\n\t}\r\n\t\r\nif (pumpstationlayer){\r\n\tmymap.removeLayer(pumpstationlayer);\r\n}\r\n\r\n\r\n// REMOVING PREVIOUS INFO BOX\r\nif (legend != undefined) {\r\nlegend.remove();\r\n}\r\npumpstationlayer=L.geoJson(pumpstationjson,{pointToLayer: pumpstadisplay,onEachFeature:onEachpumpstaFeature});\r\npumpstationlayer.addTo(mymap);\r\npumpstationlayer.bringToFront();\r\n// change the map zoom so that all the data is shown\r\nmymap.fitBounds(pumpstationlayer.getBounds());\r\nanychart.onDocumentReady(chartpumpsta);\r\n}", "function loadfloodIncidentlayer(floodincidentdata){\r\nfloodincidentjson = JSON.parse(floodincidentdata);\r\n\r\nvar features = []; \r\nfeatures = floodincidentjson.features; \r\nvar jproperties = floodincidentjson.features.map(function (el) { return el.properties; });\r\nvar i;\r\nfor (i = 0; i < jproperties.length; i++) { \r\n\tfloodincarray.push(Object.values(jproperties[i]));\r\n}\r\n\r\n}", "function getLayer(capabilities, layerName) {\n var layer;\n if (layerName && capabilities && capabilities.capability && capabilities.capability.layers) {\n // Find layer from layers.\n var layers = capabilities.capability.layers;\n for (var i = 0; i < layers.length; ++i) {\n var l = layers[i];\n if (l && l.name === layerName) {\n // Match found.\n layer = l;\n break;\n }\n }\n }\n return layer;\n }", "function loadfloodrisklayer(floodriskdata){\r\nvar floodriskjson = JSON.parse(floodriskdata);\r\nvar features = []; \r\nfeatures = floodriskjson.features; \r\n// convert data from geojson to anychart data format\r\nvar jproperties = floodriskjson.features.map(function (el) { return el.properties; });\r\nvar i;\r\nif (floodriskarray=[]){\r\nfor (i = 0; i < jproperties.length; i++) { \r\n\tfloodriskarray.push(Object.values(jproperties[i]));\r\n}\r\n}\r\nif (floodriskper=[]){\r\nfor (i = 0; i < floodriskarray.length; i++) { \r\n\tfloodriskper.push([floodriskarray[i][1],floodriskarray[i][2]]);\r\n}\r\n}\r\nif (boroughfloodinclayer){\r\n\t\tmymap.removeLayer(boroughfloodinclayer);\r\n\t}\r\n\t\r\nif (pumpstationlayer){\r\n\tmymap.removeLayer(pumpstationlayer);\r\n}\r\n\r\n\r\n// REMOVING PREVIOUS INFO BOX\r\nif (legend != undefined) {\r\nlegend.remove();\r\n}\r\n\r\n\r\nfloodrisklayer=L.geoJson(floodriskjson, {style: FloodRiskstyle,onEachFeature: onEachfloodriskFeature}).addTo(mymap);\r\n// change the map zoom so that all the data is shown\r\nmymap.fitBounds(floodrisklayer.getBounds());\r\ngetPumpStation();\r\n}", "function preload(){\n //load world map data and contacts data\n url = \"https://raw.githubusercontent.com/holtzy/D3-graph-gallery/master/DATA/world.geojson\";\n geographies = loadJSON(url);\n url2 = \"https://raw.githubusercontent.com/awhite2/CreativeCoding/main/contacts.geojson\";\n contacts = loadJSON(url2);\n \n}", "function getGlobalLayerfromMaps() {\n\tvar layers = Array.from(new Set(getLayersfromMaps())); // get unique layers from #mapN .map_year\n\tvar layer = \"none\";\n\tif (layers.length == 1) layer = layers[0];\n\treturn layer;\n}", "function getOpenLayers() {\n $.ajax({\n url: scriptsUrls.openLayers,\n dataType: \"script\",\n cache: true,\n success: function () {\n //sets a flag which tells that the map scripts has been loaded\n appFlags.mapScriptsLoaded = true;\n\n //broadcasts \"mapScriptsLoaded\" event\n $rootScope.$broadcast('mapScriptsLoaded', {});\n }\n });\n }", "async componentDidMount() {\n await Promise.all(\n dataLayers().map(layer =>\n this.loadDataLayer(layer)\n .catch((error) => { console.error(\"Unable to load data for layer:\", layer, error) })));\n\n this.nextKeyframe();\n }", "function getLayers(options) {\n\n var layers = {};\n\n // Set layer types to return\n // Defaults to return only `streets` layer\n options = angular.merge({\n streets: true,\n satellite: false,\n outdoors: false\n }, options || {});\n\n // Streets\n if(options.streets && isMapboxAvailable && appSettings.mapbox.maps.streets) {\n // Streets: Mapbox\n layers.streets = getMapboxLayer(\n 'Streets',\n 'streets',\n appSettings.mapbox.maps.streets\n );\n // Streets fallback\n } else if(options.streets) {\n // Streets: OpenStreetMap\n layers.streets = {\n name: 'Streets',\n type: 'xyz',\n url: '//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',\n layerOptions: {\n subdomains: ['a', 'b', 'c'],\n attribution: '<a href=\"https://www.openstreetmap.org/\" target=\"_blank\">© OpenStreetMap</a> <a href=\"https://www.openstreetmap.org/login#map=' + location.zoom + '/' + location.lat + '/' + location.lng + '\" target=\"_blank\" class=\"improve-map\">Improve the underlying map</a>',\n continuousWorld: true,\n TRStyle: 'streets' // Not native Leaflet key, required by our layer switch\n }\n };\n }\n\n // Satellite\n if(options.satellite && isMapboxAvailable && appSettings.mapbox.maps.satellite) {\n // Satellite: Mapbox\n layers.satellite = getMapboxLayer(\n 'Satellite',\n 'satellite',\n appSettings.mapbox.maps.satellite\n );\n }\n // Satellite fallback\n else if(options.satellite) {\n // Satellite: MapQuest\n layers.satellite = {\n name: 'Satellite',\n type: 'xyz',\n url: '//otile{s}.mqcdn.com/tiles/1.0.0/sat/{z}/{x}/{y}.jpg',\n layerOptions: {\n subdomains: ['1', '2', '3', '4'],\n attribution: '<a href=\"http://www.mapquest.com/\" target=\"_blank\">© MapQuest</a>',\n continuousWorld: true,\n TRStyle: 'satellite' // Not native Leaflet key, required by our layer switch\n }\n };\n }\n\n // Outdoors (without fallback)\n if(options.outdoors && isMapboxAvailable && appSettings.mapbox.maps.outdoors) {\n // Outdoors: Mapbox\n layers.outdoors = getMapboxLayer(\n 'Outdoors',\n 'streets',\n appSettings.mapbox.maps.outdoors\n );\n }\n\n return layers;\n }", "function onOnline(){\n console.log(\"entering network mode\");\n map.removeLayer(baseLayer);\n baseLayer = L.tileLayer(networkURL, {maxZoom: 19}).addTo(map).redraw();\n networkMode = \"network\";\n}", "_visibilityOfLayerByZoom() {\n let mainLayer = this.get('mainLayer');\n if (Ember.isNone(mainLayer) || Ember.isNone(mainLayer._leafletObject)) {\n return;\n }\n\n if (!this._checkAndSetVisibility(mainLayer)) {\n mainLayer.get('innerLayers').forEach((layer) => {\n if (this._checkAndSetVisibility(layer)) {\n return;\n }\n });\n }\n }", "function get_layers(slices) {\r\n let layers = [];\r\n\r\n for (let i = 0; i < slices.length; i++) {\r\n let current_frame = new Image();\r\n current_frame.src = slices[i];\r\n layers.push(current_frame);\r\n }\r\n\r\n return layers;\r\n}", "function queryLayers(gl, _ref2) {\n var layers = _ref2.layers,\n pickingFBO = _ref2.pickingFBO,\n x = _ref2.x,\n y = _ref2.y,\n width = _ref2.width,\n height = _ref2.height,\n viewport = _ref2.viewport,\n mode = _ref2.mode;\n\n\n // Convert from canvas top-left to WebGL bottom-left coordinates\n // And compensate for pixelRatio\n var pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio : 1;\n var deviceLeft = Math.round(x * pixelRatio);\n var deviceBottom = Math.round(gl.canvas.height - y * pixelRatio);\n var deviceRight = Math.round((x + width) * pixelRatio);\n var deviceTop = Math.round(gl.canvas.height - (y + height) * pixelRatio);\n\n var pickInfos = getUniquesFromPickingBuffer(gl, {\n layers: layers,\n pickingFBO: pickingFBO,\n deviceRect: {\n x: deviceLeft,\n y: deviceTop,\n width: deviceRight - deviceLeft,\n height: deviceBottom - deviceTop\n }\n });\n\n // Only return unique infos, identified by info.object\n var uniqueInfos = new Map();\n\n pickInfos.forEach(function (pickInfo) {\n var info = createInfo([pickInfo.x / pixelRatio, pickInfo.y / pixelRatio], viewport);\n info.devicePixel = [pickInfo.x, pickInfo.y];\n info.pixelRatio = pixelRatio;\n info.color = pickInfo.pickedColor;\n info.index = pickInfo.pickedObjectIndex;\n info.picked = true;\n\n info = getLayerPickingInfo({ layer: pickInfo.pickedLayer, info: info, mode: mode });\n if (!uniqueInfos.has(info.object)) {\n uniqueInfos.set(info.object, info);\n }\n });\n\n return Array.from(uniqueInfos.values());\n}", "function preload() {\n mapimg = loadImage('https://api.mapbox.com/styles/v1/mapbox/dark-v9/static/' +\n clat + ',' + clon + ',' + zoom + '/' +\n ww + 'x' + hh +\n '?access_token=pk.eyJ1IjoiY29kZWxheCIsImEiOiJjajB4YW85ZDAwMDZqMnFvMjV3aTJhcXBjIn0.BVg7IY6eSobwp413mNf6TQ');\n // earthquakes = loadStrings('http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.csv');\n earthquakes = loadStrings('http://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_month.csv');\n\n\n}", "function loadDatasets(datasets, bounds, filter, loadedCallback, skipLoadOutside) {\n datasets = _.filter(datasets, function (dataset) {\n return !dataset.noLoad;\n });\n\n var loaded;\n if (loadedCallback) {\n var featurecollections = [];\n\n var finished = _.after(datasets.length, function () {\n loadedCallback(featurecollections);\n });\n\n loaded = function (featureCollection) {\n featurecollections.push(featureCollection);\n finished();\n };\n }\n\n var res = _.map(datasets, function (dataset) {\n\n //extend with defaults\n dataset = _.extend({}, _defaults, dataset);\n\n //copy properties from parent\n if (dataset.datasets) {\n _copyProperties(dataset);\n }\n\n //set default style\n if (KR.Style.setDatasetStyle) {\n if (dataset.datasets) {\n _.each(dataset.datasets, _setStyle);\n } else {\n _setStyle(dataset);\n }\n }\n\n if (!dataset.visible) {\n dataset.notLoaded = true;\n }\n if (dataset.minZoom && dataset.bbox) {\n dataset.isStatic = false;\n }\n return _addDataset(dataset, filter, bounds, loaded, skipLoadOutside);\n });\n reloads = _.pluck(res, 'reload');\n\n var layers = _.pluck(res, 'layer');\n if (useCommonCluster) {\n commonCluster(layers);\n }\n return layers;\n }", "function removeAllLayers() {\n\tif (tin) controlMap.removeLayer(tin);\n\tif (map.hasLayer(tin)) map.removeLayer(tin);\n\tif (nearest) controlMap.removeLayer(nearest);\n\tif (map.hasLayer(nearest)) map.removeLayer(nearest);\n\tif (ptsWithin) controlMap.removeLayer(ptsWithin);\n\tif (map.hasLayer(ptsWithin)) map.removeLayer(ptsWithin);\n\tif (myPoint) controlMap.removeLayer(myPoint);\n\tif (map.hasLayer(myPoint)) map.removeLayer(myPoint);\n\tif (nav_coordinates_line) controlMap.removeLayer(nav_coordinates_line);\n\tif (map.hasLayer(nav_coordinates_line)) map.removeLayer(nav_coordinates_line);\n\tif (nav_coordinates_point) controlMap.removeLayer(nav_coordinates_point);\n\tif (map.hasLayer(nav_coordinates_point)) map.removeLayer(nav_coordinates_point);\n}", "getDeviceLayers() {\n \n return this.getLayer(\"esriUNFCUTDevice\");\n\n }", "getLayers (deep) {\n let out = []\n if (deep) {\n this.ol.getLayers().forEach((lyr) => {\n if (!(lyr instanceof openlayers.layer.Group)) {\n out.push(lyr)\n }\n })\n } else {\n this.ol.getLayers().forEach((lyr) => {\n if (lyr instanceof openlayers.layer.Group) {\n lyr.getLayers().forEach((sublyr) => {\n out.push(sublyr)\n })\n } else {\n out.push(lyr)\n }\n })\n }\n return out\n }", "function DisplayGEOJsonLayers(){\n map.addLayer({ \n //photos layer\n \"id\": \"photos\",\n \"type\": \"symbol\",\n \"source\": \"Scotland-Foto\",\n \"layout\": {\n \"icon-image\": \"CustomPhoto\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg'); // Place polygon under this labels.\n\n map.addLayer({ \n //selected rout section layer\n \"id\": \"routes-today\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'housenum-label'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"routes\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(120, 180, 244, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"routes-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'routes'); // Place polygon under this labels.\n\n map.addLayer({\n //rout layer\n \"id\": \"walked\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"rgba(80, 200, 50, 1)\",\n \"line-width\": 4\n }\n }, 'routes-today'); // Place polygon under this labels.\n\n map.addLayer({\n //layer used to create lins(borders) arround rout\n \"id\": \"walked-shadow\",\n \"type\": \"line\",\n \"source\": \"Scotland-Routes\",\n \"filter\": [\"==\", \"activities\", \"walking\"],\n \"layout\": {\n },\n \"paint\": {\n \"line-color\": \"#4285F4\",\n \"line-width\": 6\n }\n }, 'walked'); // Place polygon under this labels.\n\n map.addLayer({\n \"id\": \"SelectedMapLocationLayer\",\n \"type\": \"symbol\",\n \"source\": \"SelectedMapLocationSource\",\n \"layout\": {\n \"icon-image\": \"CustomPhotoSelected\",\n \"icon-size\": 1,\n \"icon-offset\": [0, -17],\n \"icon-padding\": 0,\n \"icon-allow-overlap\":true\n },\n \"paint\": {\n \"icon-opacity\": 1\n }\n }, 'country-label-lg');\n //ClickbleMapItemCursor(); //Now that the layers a loaded, have the mouse cursor change when hovering some of the layers\n NewSelectedMapLocation();\n\n}", "function initialize() {\r\n //get the json\r\n $.getJSON('/resources/maps/' + name + '.json', {}, function (data) {\r\n //json loaded\r\n\r\n //get size of map\r\n _self.size = new Size(data.size.width, data.size.height);\r\n\r\n //get the tilesets\r\n for (var k = 0; k < data.tilesets.length; k++) {\r\n var tileset = data.tilesets[k];\r\n\r\n var img = new Image();\r\n img.src = tileset.src;\r\n var set = {\r\n image: img,\r\n autotile: tileset.autotile,\r\n frames: tileset.frames,\r\n size: tileset.size\r\n };\r\n //add tileset to array\r\n _tilesets.push(set);\r\n }\r\n\r\n //separate the layers out into logical layers to be drawn\r\n //get all tiles with prioriry 0, and layer them first\r\n createLayers(data, _bottomLayers, PRIORITY_BELOW);\r\n\r\n //then, get all tiles with priority 1, and layer them last\r\n createLayers(data, _topLayers, PRIORITY_ABOVE);\r\n\r\n //map is loaded\r\n _self.mapLoaded = true;\r\n\r\n //loaded callback\r\n if (typeof loaded == 'function') {\r\n loaded();\r\n }\r\n });\r\n\r\n }", "removeToChangeLayers(){\n if (this.map && !this.map.isStyleLoaded()) return;\n this.props.statuses.forEach(status => {\n if (status.key !== 'no_change'){\n status.layers.forEach(layer => {\n if (this.map.getLayer(layer)) {\n this.map.removeLayer(layer);\n }\n });\n }\n });\n }", "function SetupLayers()\n{\n\t\tConnectionProgressLayer.style.visibility = \"hidden\";\n\t\tRemoteControlLayer.style.visibility = \"hidden\";\n\t\tRemoteControlObject.style.visibility = \"hidden\";\n\t\tChatServerLayer.style.visibility = \"hidden\";\n\t\tLayer2.style.visibility = \"visible\";\n}", "function removeOldTiles() {\r\n mapList.forEach(function (key) { //for(key in lyrGroups){\r\n var dataLayers = lyrGroups[key].data.getLayers();\r\n if (dataLayers.length > 2) { // TODO: if you change the year fast with arrow, the loading can't keep up - could set this value higher, or put a timer on the remove layer function in next line\r\n for (var i = 0; i < (dataLayers.length - 2); i++) {\r\n lyrGroups[key].data.removeLayer(dataLayers[i])\r\n }\r\n //console.log('n layers: '+lyrGroups[key].data.getLayers().length.toString())\r\n }\r\n })\r\n}", "function removeItineraryLayers() {\n map.eachLayer(function(layer) {\n if (layer.feature && layer.feature.properties && layer.feature.properties.from) {\n map.removeLayer(layer);\n }\n });\n }", "addOfflineTileLayer(layerURL, dbStore, proxy, /*Luis*/mapInfo/*luis*/) {\n var tiledLayer = new OfflineTilesEnablerLayer(layerURL, (success) => {\n // FIXME Uncomment this section to re-enable the partial offline functionality on browsers (non-hybrid)\n if (success) {\n /*var maxExtent = this.get('map').extent;\n var map = this.get('map');\n\n //Manage offline mode\n var downloadEvent;\n var reloadEvent;\n var tilesLoaded = false;//Luis E\n\n if (navigator.onLine) {\n downloadEvent = this.get('map').on('update-end', () => {\n if (navigator.onLine) {\n /!**Luis only load the tiles of not already loaded for the levels of the map\n *!/\n if (!tilesLoaded) {\n var minZoomAdjust = -2;\n var maxZoomAdjust = +2;\n /!*get all levels.. *!/\n tiledLayer.getMaxZoom(function (max) {\n maxZoomAdjust = max;\n });\n tiledLayer.getMinZoom(function (min) {\n minZoomAdjust = min;\n });\n var zoom = tiledLayer.getMinMaxLOD(minZoomAdjust, maxZoomAdjust);\n zoom.max = Math.min(mapInfo.maxZoom, maxZoomAdjust);//10;\n zoom.min = Math.max(mapInfo.minZoom, minZoomAdjust);//12;\n /!*Luis*!/\n //Download tiles\n tiledLayer.prepareForOffline(zoom.min, zoom.max, this.get('map').extent, function (progress) {\n //console.log(\"downloading tiles...\");\n if (progress.finishedDownloading) {\n console.log(\"Tile download complete\");\n tilesLoaded = true;\n } else {\n console.log(\"loading (\" + progress.countNow + \"/\" + progress.countMax + \")\");\n }\n });\n }\n } else {\n this.liveReload();\n downloadEvent.remove();\n }\n });\n } else {\n reloadEvent = this.get('map').on('update-end', () => {\n if (navigator.onLine) {\n reloadEvent.remove();\n this.liveReload();\n }\n });\n }*/\n } else {\n Ember.debug(\"Imposible to prepare layer for offline\");\n }\n\n },\n navigator.onLine, {dbName: dbStore.toUpperCase(), objectStoreName: dbStore});\n\n if (proxy) {\n tiledLayer.offline.proxyPath = proxy;\n }\n\n this.get('map').addLayer(tiledLayer);\n }", "function pushLayers(){\t\r\n\tif(oldLayer.features[0] != null){ oldLayer.removeAllFeatures();\t}\r\n\tif(currentLayer.features[0] != null){\r\n\t\toldLayer.features = currentLayer.features \t// old layer is set to current\r\n\t\tcurrentLayer.removeAllFeatures();\t\t\t// remove all features from current layer\r\n\t\toldLayer.redraw();\r\n\t}\r\n}", "function loadMapShapes() {\n // load US state outline polygons from a GeoJson file\n map.data.loadGeoJson('https://storage.googleapis.com/mapsdevsite/json/states.js', { idPropertyName: 'STATE' });\n\n // wait for the request to complete by listening for the first feature to be added\n google.maps.event.addListenerOnce(map.data, 'addfeature', function() {\n google.maps.event.trigger(document.getElementById('census-variable'),\n 'change');\n });\n}", "disableAllLayers() {\n var layerToggles = this.layerSection.querySelectorAll('layer-toggle');\n for(let i = 0; i < layerToggles.length; i++) {\n layerToggles[i].deactivate();\n }\n }", "function preload() {\n // load image\n // imgTimeline = loadImage(\"./timeline.png\")\n layer1 = createImg(\"layer1.png\")\n layer1.position(0, 0)\n layer1.hide()\n\n layer2 = createImg(\"layer2.png\")\n layer2.position(0, 0)\n layer2.hide()\n\n layer3 = createImg(\"layer3.png\")\n layer3.position(0, 0)\n layer3.hide()\n}", "function ny(){ci()(this,{$layersCollection:{enumerable:!0,get:this.getLayersCollection}})}", "function getLayerSelected() {\n layerSelected = document.getElementById(\"layerSelected\").value;\n levels = new Array(),\n tileXY = new Array(),\n geomLayers = new Array(),\n linkInfoLayers = new Array();\n mapObjects.removeAll();\n if(linkDataInfoBubble !== undefined){linkDataInfoBubble.close();}\n}", "function onOffline(){\n console.log(\"entering local mode\");\n map.removeLayer(baseLayer);\n baseLayer = L.tileLayer(localURL, {maxZoom: 14, minZoom:14}).addTo(map);\n map.setZoom(14);\n networkMode = \"local\";\n}", "function load()\n {\n\n var tiles = this.getVisibleTiles( this.latitude, this.longitude, this.zoom, this.viewRect );\n\n if( tiles.length == 0 && this.tiles.length == 0 )\n {\n this.eventEmitter.emit( Map.ON_LOAD_COMPLETE, -1 );\n return;\n }\n\n for ( var i = 0; i < tiles.length; i++ ) {\n tiles[ i ].eventEmitter.on( Tile.ON_TILE_LOADED, this.appendTile );\n tiles[ i ].load();\n }\n\n this.tiles = this.tiles.concat( tiles );\n\n }", "function load()\n {\n\n var tiles = this.getVisibleTiles( this.latitude, this.longitude, this.zoom, this.viewRect );\n\n if( tiles.length == 0 && this.tiles.length == 0 )\n {\n this.eventEmitter.emit( Map.ON_LOAD_COMPLETE, -1 );\n return;\n }\n\n for ( var i = 0; i < tiles.length; i++ ) {\n tiles[ i ].eventEmitter.on( Tile.ON_TILE_LOADED, this.appendTile );\n tiles[ i ].load();\n }\n\n this.tiles = this.tiles.concat( tiles );\n\n }", "function getLayersfromMaps() {\n\tvar layers = [];\n\tfor (var i=0; i<app.m; i++) {\n\t\tvar mapN = \"map\" + i;\n\t var layer = $(\"#\"+mapN+\" select[name=ACSdata]\").val();\n\t\tlayers.push(layer);\n\t}\n\treturn layers;\n}", "async function s(n,s){const u=n.instance.portalItem;return u&&u.id?(await u.load(s),function(t){const r=t.instance.portalItem;if(-1===t.supportedTypes.indexOf(r.type))throw new _core_Error_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](\"portal:invalid-layer-item-type\",\"Invalid layer item type '${type}', expected '${expectedType}'\",{type:r.type,expectedType:t.supportedTypes.join(\", \")})}(n),async function(n,s){const u=n.instance,d=u.portalItem,{url:y,title:f}=d,m=Object(_jsonContext_js__WEBPACK_IMPORTED_MODULE_5__[\"createForItem\"])(d);if(\"group\"===u.type)return u.read({title:f},m),function(n,l){let a;const s=n.portalItem.type;switch(s){case\"Feature Service\":a=_layers_support_lazyLayerLoader_js__WEBPACK_IMPORTED_MODULE_6__[\"layerLookupMap\"].FeatureLayer;break;case\"Stream Service\":a=_layers_support_lazyLayerLoader_js__WEBPACK_IMPORTED_MODULE_6__[\"layerLookupMap\"].StreamLayer;break;case\"Scene Service\":a=_layers_support_lazyLayerLoader_js__WEBPACK_IMPORTED_MODULE_6__[\"layerLookupMap\"].SceneLayer;break;case\"Feature Collection\":a=_layers_support_lazyLayerLoader_js__WEBPACK_IMPORTED_MODULE_6__[\"layerLookupMap\"].FeatureLayer;break;default:throw new _core_Error_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](\"portal:unsupported-item-type-as-group\",`The item type '${s}' is not supported as a 'GroupLayer'`)}let u;return a().then((e=>(u=e,p(l)))).then((e=>c(e)>0?i(n,u,e):function(e,n){if(!e.portalItem.url)return Object(_core_promiseUtils_js__WEBPACK_IMPORTED_MODULE_1__[\"resolve\"])();const l={responseType:\"json\",query:{f:\"json\"}};return Object(_request_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(e.portalItem.url,l).then((t=>{var r,l;const a=t.data;function o(e){return{id:e.id,name:e.name}}a&&i(e,n,{layers:null==(r=a.layers)?void 0:r.map(o),tables:null==(l=a.tables)?void 0:l.map(o)})}))}(n,u)))}(u,n);y&&u.read({url:y},m);const h=await p(n,s);h&&u.read(h,m);return u.resourceReferences={portalItem:d,paths:m.readResourcePaths},u.read({title:f},m),Object(_renderers_support_styleUtils_js__WEBPACK_IMPORTED_MODULE_4__[\"loadStyleRenderer\"])(u,m)}(n,s)):Object(_core_promiseUtils_js__WEBPACK_IMPORTED_MODULE_1__[\"resolve\"])()}", "function loadWMS(evt)\n{\n\t//Get the URL the user added to the Form within the splash screen\n\tvar wmsURL = document.getElementById('wmsTextInput').value;\t \n\t\n\t//Remove everything after the '?' mark\n\tvar questIndex = wmsURL.indexOf('?');\n\tif(questIndex != -1)\n\t{\n\t\twmsURL = wmsURL.substring(0,questIndex);\n\t\tdocument.getElementById('wmsTextInput').value = wmsURL;\n\t}\n\t\n\t//We use an event listener to let us know that we have querried the getcapabilities file\n\t//and parsed all the necessary information out.\t \n\twmsLayer = new WMSLayerWithTime(wmsURL);\n document.addEventListener(\"WMSDimensionsLoaded\",wmsLoaded,false);\n}", "function addMapLayers(layersArray) {\r\n var layers = {};\r\n $.each(layersArray, function(index, value) {\r\n if (value.wmsurl.indexOf(\"{x}\") != -1) {\r\n layers[value.name] = new L.TileLayer( value.wmsurl, value );\r\n }\r\n else {\r\n layers[value.name] = new L.TileLayer.WMS( value.wmsurl, value );\r\n }\r\n if ( value.isVisible ) map.addLayer(layers[value.name]);\r\n });\r\n return layers;\r\n}", "function load18() {\n\tif (!gl)\n\t\treturn;\n\tpreloadimg(\"pics/maptestnck.png\");\n\tpreloadimg(\"pics/panel.jpg\");\n}", "function ResetLayersExtent() {\n\tmaxLeftB = undefined;\n\tmaxRightB = undefined;\n\tmaxTopB = undefined;\n\tmaxBottomB = undefined;\n\t\n\t// Get the extent of loaded layers\n\tfor (var i = 0; i < map.layers.length; i++) {\n\t\tif (map.layers[i].isBaseLayer != true) {\n\t\t\tif (map.layers[i].features.length != 0) {\n\t\t\t\tSetLayersExtent(map.layers[i]);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// If all the layers have been removed set map back to center\n\tif (maxLeftB == undefined || maxRightB == undefined || maxTopB == undefined || maxBottomB == undefined)\n\t\tmap.setCenter(new OpenLayers.LonLat(-98.583, 39.833).transform(wgs84, googleMercator), 5);\n}", "function getData(map) {\n\n // load the states\n $.ajax(\"data/state_4326_map.json\", {\n dataType: \"json\",\n success: function(data) {\n // remove current layer if exists\n if (curStateLayer) {\n map.removeLayer(curStateLayer);\n };\n\n // Define the geojson layer and add it to the map\n curStateLayer = L.geoJson(data, {\n style: stateStyle,\n // filter by location\n /*filter: function(feature, layer){\n return filterStateByName(feature, layer);\n },*/\n // on each feature of states\n onEachFeature: stateOnEachFeature\n });\n map.addLayer(curStateLayer);\n\n }\n });\n\n // load the urban\n $.ajax(\"data/urban_4326_map.json\", {\n dataType: \"json\",\n success: function(data) {\n // remove current layer if exists\n if (curUrbanLayer) {\n map.removeLayer(curUrbanLayer);\n };\n\n // Define the geojson layer and add it to the map\n curUrbanLayer = L.geoJson(data, {\n style: urbanStyle,\n // filter by location\n /*filter: function(feature, layer){\n return filterUrbanByName(feature, layer);\n },*/\n // on each feature of states\n onEachFeature: urbanOnEachFeature\n });\n map.addLayer(curUrbanLayer);\n }\n });\n\n}", "function refreshAndInitMap() {\n // Remove all added layer:\n removeAllLayers();\n // Remove all source:\n removeAllSources();\n}", "function loadsitelayer(sitedata){\r\nsitejson = JSON.parse(sitedata);\r\n\r\nvar features = []; \r\nfeatures = sitejson.features; \r\nvar jproperties = sitejson.features.map(function (el) { return el.properties; });\r\nvar i;\r\nfor (i = 0; i < jproperties.length; i++) { \r\n\tsitearray.push(Object.values(jproperties[i]));\r\n}\r\n\r\n}", "function addLayersOnMap(){\n\n var layers = map.getStyle().layers;\n // Find the index of the first symbol layer in the map style\n var firstSymbolId;\n for (var i = 0; i < layers.length; i++) {\n if (layers[i].type === 'symbol') {\n firstSymbolId = layers[i].id;\n console.log(firstSymbolId);\n break;\n }\n }\n\n // 3d extruded buildings\n // apartments from json\n map.addLayer({\n 'id': 'extrusion',\n 'type': 'fill-extrusion',\n \"source\": {\n \"type\": \"geojson\",\n \"data\": \"https://denyskononenko.github.io/maprebuild/buildigs_appartments.geojson\"\n },\n 'paint': {\n 'fill-extrusion-color': '#696969',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 13,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 13,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': 1.0\n }\n }, firstSymbolId);\n\n // all buildings excepts hospitals and apartments\n map.addLayer({\n 'id': '3d-buildings',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['!=', 'type', 'hospital'], ['!=', 'type' ,'apartments']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#dedede',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .4\n }\n }, firstSymbolId);\n\n // hospitals\n map.addLayer({\n 'id': '3d-buildings-hospitals',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'hospital']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#A52A2A',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .2\n }\n }, firstSymbolId);\n\n // universities\n map.addLayer({\n 'id': '3d-buildings-university',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'university']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n // schools\n map.addLayer({\n 'id': '3d-buildings-school',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'school']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n // kindergarten\n map.addLayer({\n 'id': '3d-buildings-kindergarten',\n 'source': 'composite',\n 'source-layer': 'building',\n 'filter': ['all', ['==', 'extrude', 'true'], ['==', 'type', 'kindergarten']],\n 'type': 'fill-extrusion',\n 'minzoom': 15,\n 'paint': {\n 'fill-extrusion-color': '#e6dabc',\n // use an 'interpolate' expression to add a smooth transition effect to the\n // buildings as the user zooms in\n 'fill-extrusion-height': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"height\"]\n ],\n 'fill-extrusion-base': [\n \"interpolate\", [\"linear\"], [\"zoom\"],\n 15, 0,\n 15.05, [\"get\", \"min_height\"]\n ],\n 'fill-extrusion-opacity': .3\n }\n }, firstSymbolId);\n\n}", "getLayersNamed(layerName) {\n // search all pages\n let filteredArray = NSArray.array()\n const loopPages = this._object.pages().objectEnumerator()\n let page = loopPages.nextObject()\n const predicate = NSPredicate.predicateWithFormat('name == %@', layerName)\n while (page) {\n const scope = page.children()\n filteredArray = filteredArray.arrayByAddingObjectsFromArray(\n scope.filteredArrayUsingPredicate(predicate)\n )\n page = loopPages.nextObject()\n }\n return toArray(filteredArray).map(wrapObject)\n }", "function LoadGEOJsonSources() {\n map.addSource('Scotland-Foto', {\n \"type\": \"geojson\",\n \"data\": \"https://daanvr.github.io/Schotland/geojson/Scotrip-FotoDataFile-RichOnly-Live.geojson\"\n });\n map.addSource('Scotland-Routes', {\n \"type\": \"geojson\",\n \"data\": \"https://daanvr.github.io/Schotland/geojson/Routes.geojson\"\n });\n\n var data = JSON.parse('{\"type\":\"FeatureCollection\",\"features\":[{\"type\":\"Feature\",\"geometry\":{\"type\":\"Point\",\"coordinates\":[-5.096936,57.149319]},\"properties\":{\"FileName\":\"IMG_8571\",\"type\":\"Foto\",\"FileTypeExtension\":\"jpg\",\"SourceFile\":\"/Users/daan/Downloads/Schotlandexpiriment/IMG_8571.JPG\",\"CreateDate\":\"2018-04-13\",\"CreateTime\":\"15:15:34\",\"Make\":\"Apple\",\"Model\":\"iPhoneSE\",\"ImageSize\":\"16382x3914\",\"Duration\":\"\",\"Altitude\":\"276\",\"URL\":\"https://farm1.staticflickr.com/823/26804084787_f45be76bc3_o.jpg\",\"URLsmall\":\"https://farm1.staticflickr.com/823/26804084787_939dd60ebc.jpg\"}}]}');\n map.addSource('SelectedMapLocationSource', {\n type: \"geojson\",\n data: data,\n });\n\n AddMapIcon(); // add img to be used as icon for layer\n}", "function reloadExistingLayers(geojson) {\n map.removeLayer(geojson.layer);\n}", "function initExclusiveLayerGroups() {\n\tif (wmsLoader.projectSettings.capability.exclusiveLayerGroups.length == 0) {\n\t\t// no exclusive layer groups\n\t\treturn;\n\t}\n\n\t// collect initially active layers\n\tvar activeLayers = [];\n\tlayerTree.root.firstChild.cascade(function(node) {\n\t\tif (node.isLeaf() && node.attributes.checked) {\n\t\t\tactiveLayers.push(wmsLoader.layerTitleNameMapping[node.text]);\n\t\t}\n\t});\n\n\t// collect layers of exclusive layer groups\n\tvar layersToUncheck = [];\n\tfor (var i=0; i<wmsLoader.projectSettings.capability.exclusiveLayerGroups.length; i++) {\n\t\tvar exclusiveGroup = wmsLoader.projectSettings.capability.exclusiveLayerGroups[i];\n\n\t\t// get first group layer from active layers\n\t\tvar activeLayerName = null;\n\t\tfor (var l=0; l<exclusiveGroup.length; l++) {\n\t\t\tvar groupLayerName = exclusiveGroup[l];\n\t\t\tif (activeLayers.indexOf(groupLayerName) != -1) {\n\t\t\t\tactiveLayerName = groupLayerName;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// collect inactive group layers\n\t\tfor (var l=0; l<exclusiveGroup.length; l++) {\n\t\t\tvar groupLayerName = exclusiveGroup[l];\n\t\t\tif (groupLayerName != activeLayerName) {\n\t\t\t\t// add layer to uncheck if not yet in list\n\t\t\t\tif (layersToUncheck.indexOf(groupLayerName) == -1) {\n\t\t\t\t\tlayersToUncheck.push(groupLayerName);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\tif (layersToUncheck.length > 0) {\n\t\t// update layer tree\n\t\tlayerTree.root.firstChild.cascade(function(node) {\n\t\t\tif (node.isLeaf() && node.attributes.checked) {\n\t\t\t\t// uncheck layer node\n\t\t\t\tif (layersToUncheck.indexOf(wmsLoader.layerTitleNameMapping[node.text]) != -1) {\n\t\t\t\t\tnode.getUI().toggleCheck(false);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\tlayerTree.fireEvent(\"leafschange\");\n\t}\n}", "addToLayers(){\n try {\n let _to = this.props.toVersion.key;\n //add the sources\n let attribution = \"IUCN and UNEP-WCMC (\" + this.props.toVersion.year + \"), The World Database on Protected Areas (\" + this.props.toVersion.year + \") \" + this.props.toVersion.title + \", Cambridge, UK: UNEP-WCMC. Available at: <a href='http://www.protectedplanet.net'>www.protectedplanet.net</a>\";\n this.addSource({id: window.SRC_TO_POLYGONS, source: {type: \"vector\", attribution: attribution, tiles: [ window.TILES_PREFIX + \"wdpa_\" + _to + \"_polygons\" + window.TILES_SUFFIX]}});\n this.addSource({id: window.SRC_TO_POINTS, source: {type: \"vector\", tiles: [ window.TILES_PREFIX + \"wdpa_\" + _to + \"_points\" + window.TILES_SUFFIX]}});\n //no change protected areas layers\n this.addLayer({id: window.LYR_TO_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: { \"fill-color\": \"rgba(99,148,69,0.2)\", \"fill-outline-color\": \"rgba(99,148,69,0.3)\"}, beforeID: window.LYR_TO_SELECTED_POLYGON});\n this.addLayer({id: window.LYR_TO_POINT, sourceId: window.SRC_TO_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _to + \"_points\", layout: {visibility: \"visible\"}, paint: {\"circle-radius\": CIRCLE_RADIUS_STOPS, \"circle-color\": \"rgb(99,148,69)\", \"circle-opacity\": 0.6}, beforeID: window.LYR_TO_SELECTED_POLYGON});\n //selection layers\n this.addLayer({id: window.LYR_TO_SELECTED_POLYGON, sourceId: window.SRC_TO_POLYGONS, type: \"fill\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POLYGON, filter:INITIAL_FILTER});\n this.addLayer({id: window.LYR_TO_SELECTED_LINE, sourceId: window.SRC_TO_POLYGONS, type: \"line\", sourceLayer: \"wdpa_\" + _to + \"_polygons\", layout: {visibility: \"visible\"}, paint: P_SELECTED_LINE, filter:INITIAL_FILTER});\n this.addLayer({id: window.LYR_TO_SELECTED_POINT, sourceId: window.SRC_TO_POINTS, type: \"circle\", sourceLayer: \"wdpa_\" + _to + \"_points\", layout: {visibility: \"visible\"}, paint: P_SELECTED_POINT, filter:INITIAL_FILTER});\n //add the change layers if needed\n if (this.props.fromVersion.id !== this.props.toVersion.id) this.addToChangeLayers();\n } catch (e) {\n console.log(e);\n }\n }", "function initBasemapLayerTiles() {\n // overlayDescription = my.InitOverlay(my.descriptionContainer);\n\n // Init osmTileLayer base map\n osmTileLayer = new TileLayer({\n name: 'osmTileLayer',\n crossOriginKeyword: 'anonymous',\n source: new OSM(),\n });\n osmTileLayerMini = new TileLayer({\n name: 'osmTileLayerMini',\n crossOriginKeyword: 'anonymous',\n source: new OSM(),\n });\n\n // Init esriWSPTileLayer base map\n esriWSPTileLayer = new TileLayer({\n name: 'esriWSPTileLayer',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/0\">ArcGIS World Street Map</a>'],\n // // rendermode: 'image',\n url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n esriWSPTileLayerMini = new TileLayer({\n name: 'esriWSPTileLayerMini',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/0\">ArcGIS World Street Map</a>'],\n // // rendermode: 'image',\n url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n\n // Init esriWITileLayer base map (Satelite Images)\n esriWITileLayer = new TileLayer({\n name: 'esriWITileLayer',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/0\">ArcGIS World Imagery Map</a>'],\n // rendermode: 'image',\n url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n esriWITileLayerMini = new TileLayer({\n name: 'esriWITileLayerMini',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"https://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer/0\">ArcGIS World Imagery Map</a>'],\n // rendermode: 'image',\n url: 'https://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',\n }),\n });\n\n blackTileLayer = new TileLayer({\n name: 'blackTileLayer',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> &copy; <a href=\"http://cartodb.com/attributions\">CartoDB</a>'],\n // rendermode: 'image',\n url: 'http://{a-c}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png',\n }),\n });\n blackTileLayerMini = new TileLayer({\n name: 'blackTileLayerMini',\n crossOriginKeyword: 'anonymous',\n source: new XYZ({\n attributions: ['&copy; <a href=\"http://www.openstreetmap.org/copyright\">OpenStreetMap</a> &copy; <a href=\"http://cartodb.com/attributions\">CartoDB</a>'],\n // rendermode: 'image',\n url: 'http://{a-c}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}.png',\n }),\n });\n }", "function preload()\n{\n this.load.image('tileset', 'maps/tileset.png');\n this.load.tilemapTiledJSON('island', 'maps/island.json');\n this.load.atlas('hemadi', 'characters/hemadi.png', 'characters/hemadi.json');\n}", "function removeLayers()\n\t{\n\t\tmap.eachLayer(function(layer)\n\t\t{\n\t\t\tif(layer._leaflet_id != 22)\n\t\t\t{\n\t\t\t\tmap.removeLayer(layer);\n\t\t\t}\n\t\t});\n\n\t\t// reset the slider value\n\t\t$('.range-slider').val(RESETSLIDER);\n\n\t\t//resetBegin();\n\n\t\tgetData(map);\t\n\t}", "function addEmptyLayerToWebmap()\r\n\t\t\t{\r\n\t\t\t\tvar layer = MapTourBuilderHelper.getNewLayerJSON(MapTourBuilderHelper.getFeatureCollectionTemplate(true));\r\n\t\t\t\t_webmap.itemData.operationalLayers.push(layer);\r\n\t\t\t\t\r\n\t\t\t\t// Set the extent to the portal default\r\n\t\t\t\tif ( app.portal && app.portal.defaultExtent )\r\n\t\t\t\t\tapp.data.getWebMapItem().item.extent = Helper.serializeExtentToItem(new Extent(app.portal.defaultExtent));\r\n\t\t\t\t\r\n\t\t\t\tvar saveSucceed = function() {\r\n\t\t\t\t\tchangeFooterState(\"succeed\");\r\n\t\t\t\t\tsetTimeout(function(){\r\n\t\t\t\t\t\t_initCompleteDeferred.resolve();\r\n\t\t\t\t\t}, 800);\r\n\t\t\t\t};\r\n\t\t\t\t\r\n\t\t\t\tif( app.isDirectCreationFirstSave || app.isGalleryCreation ) \r\n\t\t\t\t\tsaveSucceed();\r\n\t\t\t\telse\r\n\t\t\t\t\tWebMapHelper.saveWebmap(_webmap, _portal).then(saveSucceed);\r\n\t\t\t}", "function createMapLayers(map) {\n \n var mapLayer1 = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.outdoors\",\n accessToken: apiKey\n });\n \n var mapLayer2 = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.light\",\n accessToken: apiKey\n });\n\n var mapLayer3 = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.dark\",\n accessToken: apiKey\n });\n\n var mapLayer4 = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.streets-satellite\",\n accessToken: apiKey\n });\n\n var mapLayer5 = L.tileLayer(\"https://api.tiles.mapbox.com/v4/{id}/{z}/{x}/{y}.png?access_token={accessToken}\", {\n attribution: \"Map data &copy; <a href=\\\"https://www.openstreetmap.org/\\\">OpenStreetMap</a> contributors, <a href=\\\"https://creativecommons.org/licenses/by-sa/2.0/\\\">CC-BY-SA</a>, Imagery © <a href=\\\"https://www.mapbox.com/\\\">Mapbox</a>\",\n maxZoom: 18,\n id: \"mapbox.streets\",\n accessToken: apiKey\n });\n\n return [mapLayer1, mapLayer2, mapLayer3, mapLayer4, mapLayer5];\n \n}", "function loadFeatures(data) {\n var features = new OpenLayers.Format.GeoJSON().read(data);\n states.addFeatures(features);\n}", "function filterDefaultLayerFilenames(map) {\n return !map.match(/^(.*\\/)?((lines|points|polygons|relations)(_osm)?|selection|location_bbox).gpkg$/)\n}", "function getLayerTree(layer, resultLayers, visibleLayers, printLayers) {\n if (printLayers.indexOf(layer.Name) !== -1) {\n // skip print layers\n return;\n }\n\n var layerEntry = {\n name: layer.Name,\n title: layer.Title\n };\n if (layer.Layer === undefined) {\n if (layer.$.geometryType == \"WKBNoGeometry\") {\n // skip layers without geometry\n return;\n }\n\n // layer\n layerEntry.visibility = layer.$.visible === '1';\n if (layerEntry.visibility) {\n // collect visible layers\n visibleLayers.push(layer.Name);\n }\n layerEntry.queryable = layer.$.queryable === '1';\n if (layerEntry.queryable) {\n layerEntry.displayField = layer.$.displayField;\n }\n if (layer.Attribution !== undefined) {\n layerEntry.attribution = layer.Attribution.Title;\n if (layer.Attribution.OnlineResource !== undefined) {\n layerEntry.attributionUrl = layer.Attribution.OnlineResource.$['xlink:href'];\n }\n }\n layerEntry.opacity = 255;\n if (layer.MinScaleDenominator !== undefined) {\n layerEntry.minScale = parseInt(layer.MinScaleDenominator, 10);\n layerEntry.maxScale = parseInt(layer.MaxScaleDenominator, 10);\n }\n // use geographic bounding box, as default CRS may have inverted axis order with WMS 1.3.0\n layerEntry.crs = \"EPSG:4326\";\n layerEntry.extent = [\n parseFloat(layer.EX_GeographicBoundingBox.westBoundLongitude),\n parseFloat(layer.EX_GeographicBoundingBox.southBoundLatitude),\n parseFloat(layer.EX_GeographicBoundingBox.eastBoundLongitude),\n parseFloat(layer.EX_GeographicBoundingBox.northBoundLatitude)\n ];\n } else {\n // group\n layerEntry.sublayers = [];\n for (var subLayer of toArray(layer.Layer)) {\n getLayerTree(subLayer, layerEntry.sublayers, visibleLayers, printLayers);\n }\n if (layerEntry.sublayers.length === 0) {\n // skip empty groups\n return;\n }\n }\n resultLayers.push(layerEntry);\n}", "function collectLayerData(rootLayer, extendedRootLayer) {\n for (var i = 0; i < rootLayer.layers.length; i++) {\n\n // We never even process locked or hidden layers\n if ((!rootLayer.layers[i].locked) && (rootLayer.layers[i].visible)) {\n\n var extendedLayer = new ExtendedLayer(rootLayer.layers[i]);\n\n // Set up parent\n extendedLayer.parentLayer = extendedRootLayer;\n\n // Also add this layer to the parents child collection\n if (extendedRootLayer != null) {\n extendedRootLayer.childLayers.push(extendedLayer);\n }\n\n layerData.push(extendedLayer);\n\n // Tag these layers so that we later can find out if we should export these layers or not\n if (rootLayer.layers[i].name.substring(0, 1) == exportLayersStartingWith) {\n extendedLayer.tag = \"include\";\n } else if (rootLayer.layers[i].name.substring(0, 1) == exportLayersWithArtboardClippingStartingWith) {\n extendedLayer.tag = \"include_and_clip\";\n } else {\n extendedLayer.tag = \"skip\";\n }\n\n // We should not export this layer but we continue looking for sub layers that might need to be exported\n collectLayerData(rootLayer.layers[i], extendedLayer);\n }\n }\n}", "function _initLayerList() {\n $('#layerspage').page();\n $('<li>', {\n \"data-role\": \"list-divider\",\n text: \"Base Layers\"\n })\n .appendTo('#layerslist');\n var baseLayers = map.getLayersBy(\"isBaseLayer\", true);\n $.each(baseLayers, function() {\n _addLayerToList(this);\n });\n $('<li>', {\n \"data-role\": \"list-divider\",\n text: \"Overlay Layers\"\n })\n .appendTo('#layerslist');\n var overlayLayers = map.getLayersBy(\"isBaseLayer\", false);\n $.each(overlayLayers, function() {\n _addLayerToList(this);\n });\n $('#layerslist').listview('refresh'); \n map.events.register(\"addlayer\", this, function(e) {\n _addLayerToList(e.layer);\n });\n}", "function ready() {\n for (var i = 0; i < preloadTiles.length; i++) {\n var state = layerAbove.textureStore().query(preloadTiles[i]);\n if (!state.hasTexture) {\n return false;\n }\n }\n return true;\n}" ]
[ "0.6625302", "0.64319044", "0.6393501", "0.63875425", "0.6341155", "0.61690897", "0.6113296", "0.60826665", "0.60141975", "0.5985674", "0.5939575", "0.59233296", "0.5913019", "0.5906488", "0.5893629", "0.5853021", "0.5853021", "0.5846863", "0.5842979", "0.5834298", "0.5827821", "0.5827468", "0.58257836", "0.5818232", "0.58138275", "0.5803511", "0.57781476", "0.5775285", "0.5774568", "0.57706255", "0.5767734", "0.5765729", "0.5751329", "0.5740544", "0.5734884", "0.5717163", "0.5678508", "0.56656426", "0.56652623", "0.5655319", "0.56540865", "0.56471384", "0.5638594", "0.5629079", "0.5628614", "0.56238204", "0.56232613", "0.56166637", "0.56063515", "0.5601874", "0.55999404", "0.55869836", "0.5582299", "0.5581895", "0.5576832", "0.55728555", "0.5567382", "0.55643207", "0.55609226", "0.5559775", "0.5557937", "0.5556168", "0.5551368", "0.5549164", "0.55460775", "0.5546058", "0.55380666", "0.5523494", "0.55214465", "0.55140954", "0.5504333", "0.54955924", "0.5491508", "0.5491508", "0.54903823", "0.5485215", "0.54820263", "0.5479283", "0.54647493", "0.5456671", "0.54489005", "0.54479504", "0.5447659", "0.5445562", "0.5444893", "0.54349786", "0.54319596", "0.54264855", "0.542619", "0.5424262", "0.54000443", "0.5399607", "0.539693", "0.539058", "0.5390051", "0.5387525", "0.5382222", "0.5378473", "0.53610307", "0.5350559" ]
0.54632145
79
Take a geoserver ajax response object and convert it into what you'd expect: a list of javascript objects. Pulls the response out of the FeatureCollection
function parseGeoserverJson(response) { function parseId(idStr) { return idStr.match(/\d*$/)[0] // ex: "layergroup.24" -> "24" } var features = Ext.util.JSON.decode(response.responseText).features return _(features).map(function(feature) { return _(feature.properties).defaults({ id : parseId(feature.id) }) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function processResults() {\n var results = JSON.parse(this.responseText);\n if (results.list.length > 0) {\n for (var i = 0; i < results.list.length; i++) {\n geoJSON.features.push(convertToGeoJson(results.list[i]));\n }\n map.data.addGeoJson(geoJSON);\n }\n}", "function queryResponseToFeatureCollection (queryResponse) {\n let prop = null;\n featureCollection.features = []\n\n for (let i = 0; i < queryResponse.length; i++) {\n // For each queryResponse item, create a feature\n\n let feature = {\n 'type': 'Feature',\n 'id': i + 1,\n 'geometry': JSON.parse(queryResponse[i].geometry),\n 'properties': {\n 'country': queryResponse[i].country,\n 'region': queryResponse[i].adm_area_1,\n 'date': queryResponse[i].date,\n 'data': queryResponse[i].data,\n 'value': parseFloat(queryResponse[i].value)\n }\n }\n\n for (prop in queryResponse[i]) {\n // For each property in queryResponse, add to featureCollection as a property\n if (prop !== 'geometry' && queryResponse[i].hasOwnProperty(prop)) {\n if (prop == 'value') {\n feature[prop] = parseFloat(queryResponse[i][prop])\n } else {\n feature[prop] = queryResponse[i][prop]\n }\n }\n }\n\n // Push the feature into the featureCollection object feature array\n featureCollection.features.push(feature)\n }\n\n console.log(featureCollection)\n return featureCollection\n}", "function getWFSjson(wfsURL, wfsTypeName, wfsProperties, wfsCallback, wfsCQLfilter,\n wfsBbox= \"-139.1782824917356, 47.60393449638617, -110.35337939457779, 60.593907018763396, 'epsg:4326'\",\n wfsGeometryProperty='GEOMETRY'){\n //case wfsCQLfilter is null\n var cqlString = (function(){\n if (wfsCQLfilter==null){\n return \"bbox(\" + wfsGeometryProperty + \",\" + wfsBbox + \")\"\n }\n else {return \"bbox(\" + wfsGeometryProperty + \",\" + wfsBbox + \") AND \" + wfsCQLfilter}\n })();\n \n var defaultParameters = {\n service: 'WFS',\n version: '2.0',\n request: 'GetFeature',\n typeName: wfsTypeName,\n outputFormat: 'text/javascript', //or application/json (but won't work w/ ajax dataType=jsonp )\n format_options: 'callback:' + wfsCallback,\n SrsName: 'EPSG:4326',\n propertyName: wfsProperties,\n cql_filter: cqlString\n };\n\n var parameters = L.Util.extend(defaultParameters);\n var URL = wfsURL + L.Util.getParamString(parameters);\n\n var ajax = $.ajax({\n url: URL,\n dataType: 'jsonp',\n jsonpCallback: wfsCallback,\n success: function(response) {\n console.log('executed wfs request');\n //map.spin(false);\n }\n });\n}", "function getValues(response) {\nvar features = response.features;\nvar values = features.map(function(feature) {\n return feature.attributes.CP;\n});\nreturn values;\n}", "function loadSmallTrail(evt) {\n var req = $.ajax({\n url: \"http://localhost:3000/w_pathnondistinct\",\n type: \"GET\",\n });\n req.done(function (resp_json) {\n console.log(JSON.stringify(resp_json));\n var listaFeat = jsonAnswerDataToListElements(resp_json);\n var linjedata = {\n \"type\": \"FeatureCollection\",\n \"features\": listaFeat\n };\n smallTrailArray.addFeatures((new ol.format.GeoJSON()).readFeatures(linjedata, { featureProjection: 'EPSG: 3856' }));\n });\n}", "function d3_json(request) {\n return JSON.parse(request.responseText);\n }", "function jsonAnswerDataToListElements(json_answer) {\n var data = json_answer;\n var n = data.length;\n var r = []\n for (var i = 0; i < n; ++i) {\n var row = data[i];\n var geomJson = $.parseJSON(row.st_asgeojson);\n r.push(geomJson);\n }\n return r;\n}", "getJsonFromServer() {\n fetch(`${servername}/getjson`)\n .then(res => res.json())\n .then(data=>{\n if(data != null) {\n for(let element of data) {\n if(element.jsonstring.df != null) {\n if(element.jsonstring.df.lob != null) {\n // Parse the json points to receive json data.\n let stringConverter = element.jsonstring.df.lob\n let floatStringArray = stringConverter.split(',')\n let latitude = parseFloat(floatStringArray[0])\n let longitude = parseFloat(floatStringArray[1])\n \n // Create a new feature on OpenLayers\n if(!this.doesFeatureExist(latitude, longitude)) {\n let longLat = fromLonLat([longitude, latitude])\n let newFeature = new Feature({\n geometry: new Point(longLat),\n information: element.jsonstring\n })\n this.vectorAlerts.addFeature(newFeature)\n }\n }\n else console.log('lob was null. JSON must be broken:', element)\n }\n else console.log(\"data.df was empty. Consider fixing json string?\", element)\n }\n console.log('Features were updated', this.vectorAlertLayer.getSource().getFeatures())\n }\n else console.log(\"data had returned null\")\n })\n }", "function productList(e) {\n data = JSON.parse(e.target.responseText);\n}", "function parseJSONP(data) {\n\t\t//we call the function to turn it into geoJSON and write a callback to add it to the geojson object\n\t\ttoGeoJSON(data,\n\t\t\tfunction(georesponse) {\n\t\t\t\tif (georesponse.features.length > 0) {\n\t\t\t\t\tvar selected = new L.geoJson(georesponse);\n\t\t\t\t\tvar selectedbounds = selected.getBounds();\n\t\t\t\t\tmap.fitBounds(selectedbounds);\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\t}", "function fetchGeoData(){\n $.ajax({\n dataType: \"json\",\n url: \"data/map.geojson\",\n success: function(data) {\n $(data.features).each(function(key, data) {\n geoDataLocations.push(data);\n });\n startMap();\n },\n error: function(error){\n console.log(error);\n return error;\n }\n });\n }", "function n$1(r){return r&&g.fromJSON(r).features.map((r=>r))}", "function initMap() {\n $.ajax({\n url: 'http://localhost/FP/API/station_data_api.php',\n dataType: 'json',\n success: function onSuccess(jsonReturn) {\n for (var i = 0; i<jsonReturn.length; i++) {\n features[i] = {\n name: jsonReturn[i].name,\n latitude: jsonReturn[i].latitude,\n longtitude: jsonReturn[i].longtitude,\n bowser: jsonReturn[i].provider,\n prices: jsonReturn[i].prices \n }\n }\n loadMap(features);\n },\n error: function onError(xhr) {\n alert(xhr.responseText);\n }\n });\n\n}", "function debugCallback(response){\n\t$(mydiv).append('<br><b>GeoJSON data:</b><br>'+ JSON.stringify(response));// using stringify to convert JavaScript object to string, since \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//when sending data to a web server, the data has to be a string\n}", "function createGraphics(response) {\n // raw GeoJSON data\n var geoJson = response.data;\n // Create an array of Graphics from each GeoJSON feature\n return arrayUtils.map(geoJson.features, function (feature, i) {\n return {\n geometry: new Point({\n x: feature.geometry.coordinates[0],\n y: feature.geometry.coordinates[1]\n }),\n // select only the attributes you care about\n attributes: {\n ObjectID: i,\n title: feature.properties.title,\n type: feature.properties.type,\n place: feature.properties.place,\n depth: feature.geometry.coordinates[2] + \" km\",\n time: feature.properties.time,\n mag: feature.properties.mag,\n mmi: feature.properties.mmi,\n felt: feature.properties.felt,\n sig: feature.properties.sig,\n url: feature.properties.url\n }\n };\n });\n }", "function getBboxes(xhr, evt) {\n\n\t\tvar olFeatures = Ext.decode(xhr.responseText);\n\t\t\n\t\tlayerVector.addFeatures(olFeatures);\n\n\t\tExt.getCmp('map-tab').add(mapPanel);\n\t\tExt.getCmp('map-tab').doLayout();\n\t}", "function loadfloodIncidentlayer(floodincidentdata){\r\nfloodincidentjson = JSON.parse(floodincidentdata);\r\n\r\nvar features = []; \r\nfeatures = floodincidentjson.features; \r\nvar jproperties = floodincidentjson.features.map(function (el) { return el.properties; });\r\nvar i;\r\nfor (i = 0; i < jproperties.length; i++) { \r\n\tfloodincarray.push(Object.values(jproperties[i]));\r\n}\r\n\r\n}", "function gotFeatureInfo(response)\n{\n var xmldoc = response.responseXML;\n var lon = xmldoc.getElementsByTagName('longitude')[0];\n var lat = xmldoc.getElementsByTagName('latitude')[0];\n var val = xmldoc.getElementsByTagName('value')[0];\n if (lon) {\n $('featureInfo').innerHTML = \"<b>Lon:</b> \" + lon.firstChild.nodeValue + \n \"&nbsp;&nbsp;<b>Lat:</b> \" + lat.firstChild.nodeValue + \"&nbsp;&nbsp;<b>Value:</b> \" +\n toNSigFigs(parseFloat(val.firstChild.nodeValue), 4);\n if (timeSeriesSelected()) {\n // Construct a GetFeatureInfo request for the timeseries plot\n // Get a URL for a WMS request that covers the current map extent\n var urlEls = featureInfoUrl.split('&');\n // Replace the parameters as needed. We generate a map that is half the\n // width and height of the viewport, otherwise it takes too long\n var newURL = urlEls[0];\n for (var i = 1; i < urlEls.length; i++) {\n if (urlEls[i].startsWith('TIME=')) {\n newURL += '&TIME=' + $('firstFrame').innerHTML + '/' + $('lastFrame').innerHTML;\n } else if (urlEls[i].startsWith('INFO_FORMAT')) {\n newURL += '&INFO_FORMAT=image/png';\n } else {\n newURL += '&' + urlEls[i];\n }\n }\n // Image will be 400x300, need to allow a little elbow room\n $('featureInfo').innerHTML += \"&nbsp;&nbsp;<a href='#' onclick=popUp('\"\n + newURL + \"',450,350)>Create timeseries plot</a>\";\n }\n } else {\n $('featureInfo').innerHTML = \"Can't get feature info data for this layer <a href=\\\"javascript:popUp('whynot.html', 200, 200)\\\">(why not?)</a>\";\n }\n}", "function selectFeature(response) {\n sel_features.push(response);\n console.log(\"Selected \" + response + \" as Feature!\");\n }", "function getGeoJson() {\n return {\n \"type\": \"FeatureCollection\",\n \"features\": [\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"LineString\",\n \"coordinates\": [\n [\n 13.25441561846926,\n 38.162839676288336\n ],\n [\n 13.269521819641135,\n 38.150961340209484\n ],\n [\n 13.250982390930197,\n 38.150961340209484\n ],\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.250982390930197,\n 38.150961340209484\n ],\n [\n 13.269521819641135,\n 38.150961340209484\n ],\n [\n 13.25441561846926,\n 38.162839676288336\n ],\n [\n 13.24342929034426,\n 38.150691355539586\n ]\n ]\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.277074920227072,\n 38.18335224460118\n\n ],\n [\n 13.30660067706301,\n 38.18389197106355\n\n ],\n [\n 13.278104888488791,\n 38.165808957979515\n\n ]\n ]\n ]\n }\n },\n {\n \"type\": \"Feature\",\n \"properties\": {},\n \"geometry\": {\n \"type\": \"Polygon\",\n \"coordinates\": [\n [\n [\n 13.309476005126974,\n 38.13233005362,\n ],\n [\n\n 13.337628470947287,\n 38.135030534863766\n ],\n [\n 13.31805907397463,\n 38.11153300139878\n ]\n ]\n ]\n }\n }\n ]\n }\n}", "function heatmap() {\n var points = []\n $.ajax({\n type: \"GET\",\n url: \"php/postgis_geojson.php?geotable=upit_lokinfo&geomfield=geom_wgs\",\n contentType: \"application/x-www-form-urlencoded;charset=utf-8\",\n dataType: 'json',\n\n success: function (data) {\n for (var i = 0; i < data.features.length; i++) {\n var a = [];\n a.push(data.features[i].geometry.coordinates[1]);\n a.push(data.features[i].geometry.coordinates[0]);\n a.push(\"10\");\n points.push(a);\n };\n },\n })\n return points\n}", "function earthquakeResponse() {\n // this function listens out for the server to say that the data is ready - i.e. has state 4\n if (client.readyState == 4) {\n // once the data is ready, process the data\n var earthquakedata = client.responseText;\n loadGeoJSONLayer(earthquakedata);\n }\n}", "function vgt_parse_json_output(response)\n{\n var return_data = response.split(VGT_UNIQUE_WRAPER);\n\n return jQuery.parseJSON(return_data[1]);\n}", "function getGeolocation() {\n // console.log(this.responseText);\n var data = JSON.parse(this.responseText);\n var results = data.results;\n results.forEach(function (element) {\n console.log(element.geometry.location);\n var ubication = {\n lat: element.geometry.location.lat,\n lng: element.geometry.location.lng\n };\n });\n }", "function loadBodyAJAX(xhttp) {\n\n // separate each of the bodies and their fields\n var bodies = xhttp.responseText.split(\"|\");\n \n // push each body into the array\n bodies.forEach(function(item) {\n bodyCatalog.push(rsToObj(item)); \n });\n console.log(bodyCatalog);\n $(\"#figureDialog\").spin(false);\n}", "function convert(data, options) {\n var features = [];\n\n if (data.type === 'FeatureCollection') {\n for (var i = 0; i < data.features.length; i++) {\n convertFeature(features, data.features[i], options);\n }\n\n } else if (data.type === 'Feature') {\n convertFeature(features, data, options);\n\n } else {\n // single geometry or a geometry collection\n convertFeature(features, {geometry: data}, options);\n }\n\n return features;\n}", "function loadHandler(){\n\tvar data = JSON.parse(event.target.responseText);\n\tconsole.log (\"data\", data);\n\t//parse data that comes back and store in variable\n\toutputDataToNewArray(data.dog_brands); //should give function access to dogbrands array as the variable data\n}", "function geojson_callback(geojson_text) {\n features = JSON.parse(geojson_text);\n if(layer) layer.remove();\n layer = L.geoJSON(null,options).addTo(map);\n layer.addData(features);\n}", "function updatePointList()\n{\n //load area selected points\n $.ajax({\n type: \"POST\",\n url: \"AreaHandler.php\",\n data: {getAreaPoints:document.getElementById(\"currentAreas\").value},//change search ID for multiple searches\n dataType: \"json\",\n success: function(areaData){\n pointArray = [];\n areaIDData = areaData[0].areaName;\n var tempPointsArray = JSON.parse(areaData[0].areaPoints);\n for(var cnt=0; cnt < tempPointsArray.length; cnt++)\n {\n //gotta split up JSON string\n \n //alert(dataObj[0].k);\n pointArray.push(new google.maps.LatLng(tempPointsArray[cnt].k,tempPointsArray[cnt].A));\n }\n }});\n}", "function createFeatures(UFOPlots) {\nconsole.log(\"-----------\");\nconsole.log(UFOPlots.features[20][\"geometry\"].properties.index);\ncurindx =UFOPlots.features[20][\"geometry\"].properties.index \nurlcall =\"/api_getUFOText_v1.1 <\" + curindx + \">\"\nconsole.log(getText(urlcall))\nconsole.log(UFOPlots.features[20][\"geometry\"].properties.Date_Time);\n console.log(UFOPlots.features[20][\"geometry\"].properties.Shape);\n console.log(UFOPlots.features[20][\"geometry\"].properties.Duration); \nconsole.log(UFOPlots.features[20][\"geometry\"].coordinates[0]);\nconsole.log(UFOPlots.features[20][\"geometry\"].coordinates[1]);\n\nlet plot = [];\nlet plot2 =[];\nvar test=[]; \n// let features = UFOPlots.features;\n// features.forEach(f => {\n// coords = f.geometry.coordinates;\n// plot.push([coords[1]['latitude'], coords[0]['longitude']])\n// });\n\n let features = UFOPlots[\"features\"];\n console.log(\"Point 20:\",features[20]['geometry'].coordinates[0] ,features[20]['geometry'].coordinates[1] );\nfor (let i = 0; i < UFOPlots[\"features\"].length; i++){\n let test = [features[i]['geometry'].coordinates[0] , features[i]['geometry'].coordinates[1]] \n let lng =features[i]['geometry'].coordinates[0]//['longitude']\n let lat =features[i]['geometry'].coordinates[1]//['latitude']\n plot.push([lng,lat])\n plot2.push([lat,lng])\n //plot.push(test);\n} \nconsole.log(\"here\");\n// console.log(plot);\n\nvar MiB2 = L.geoJson(plot,{\n pointToLayer: function (features, plot) {\n return L.circleMarker(plot, geojsonMarkerOptions_MiB)\n .bindPopup(\"<h3>\" + \"Base: \" + features.properties[2] +\n \"</h3><hr><p>\" + \"Military Branch: \" + features.properties[2] + \"<br>\" +\n \"State: \" + features.properties[2] + \"</p>\");\n }\n});\n // createMap(MiB,true);\n //if you used the heat map with the for loop above, this will work \nvar MiB2 = L.heatLayer(plot, {\n radius: 10,\n blur: 1\n}); \nconsole.log(\"here after\");\n// Sending our UFO layer to the createMap function\ncreateMap(MiB2,true);\n}", "function populateDropDown(){\r\n return fetch(\r\n `https://njroberts3.carto.com/api/v2/sql?format=geojson&q=SELECT the_geom, trlname FROM parktrails ORDER BY trlname ASC`\r\n ).then((resp) => resp.json())\r\n .then((response) => {\r\n return response['features'].map(function(feature){\r\n option = document.createElement(\"option\")\r\n option.setAttribute(\"value\", feature.properties.trlname)\r\n option.textContent = feature.properties.trlname\r\n document.getElementById(\"selectDrop\").appendChild(option);\r\n });\r\n }).catch((error) => {\r\n console.log(error)\r\n })\r\n}", "function jsAjax(){\n // Step 1: Create the request\n var ajaxRequest = new XMLHttpRequest();\n\n //Step 2: Create an event handler to send received data to a callback function\n ajaxRequest.onreadystatechange = function(){\n if (ajaxRequest.readyState === 4){\n callback(ajaxRequest.response);\n };\n };\n\n //Step 3: Open the server connection\n ajaxRequest.open('GET', 'data/MegaCities.geojson', true);\n\n //Step 4: Set the response data type\n ajaxRequest.responseType = \"json\";\n\n //Step 5: Send the request\n ajaxRequest.send();\n}", "function getAreaCallback(response) {\n // Get data form response:\n var responseJsonText = response.documentElement.textContent;\n var responseJsonObject = JSON.parse(responseJsonText);\n console.log(responseJsonObject);\n // Set area list:\n tmpThis.areaList = responseJsonObject.areas;\n }", "function parseJSON(response) {\n \treturn response.json()\n}", "function gotFeatureInfo(response)\n{\n var xmldoc = response.responseXML;\n var lon = xmldoc.getElementsByTagName('longitude')[0];\n var lat = xmldoc.getElementsByTagName('latitude')[0];\n var val = xmldoc.getElementsByTagName('value')[0];\n if (lon) {\n $('featureInfo').innerHTML = \"<b>Lon:</b> \" + toNSigFigs(lon.firstChild.nodeValue, 4) + \n \"&nbsp;&nbsp;<b>Lat:</b> \" + toNSigFigs(lat.firstChild.nodeValue, 4) + \"&nbsp;&nbsp;<b>Value:</b> \" +\n toNSigFigs(val.firstChild.nodeValue, 4);\n } else {\n $('featureInfo').innerHTML = \"Can't get feature info data for this layer <a href=\\\"javascript:popUp('whynot.html')\\\">(why not?)</a>\";\n }\n \n}", "function transformFeaturesPaginated(features) {\n return features.map(function (response) {\n var mappedResults = _.map(response.results, function (feature) { return transformFeature(feature); });\n return _.assign({}, response, { results: mappedResults });\n });\n}", "function createLatLon(response) {\n // Pull the features data \n let features = response.features;\n\n // Initialize an array to hold the earthquake markers\n var earthquakeLatLon = [];\n\n // Loop through the features\n for (var index = 0; index < features.length; index++) {\n\n // Extract all of the data we will need about the earthquake\n let longitude = features[index].geometry.coordinates[0];\n let latitude = features[index].geometry.coordinates[1];\n\n earthquakeLatLon.push([latitude,longitude]);\n }\n // Return the earthquakeLatLon\n return earthquakeLatLon;\n }", "function fetchParsedJson() {\n\treturn JSON.parse(datasetToDisplay);\n}", "function getQuestions() {\r\n client = new XMLHttpRequest();\r\n\r\nclient.open('GET','http://developer.cege.ucl.ac.uk:30276/getGeoJSON/questions/geom');\r\n client.onreadystatechange = questionsResponse; \r\n client.send();\r\n}", "function GeoJSONWrapper (features) {\n\t this.features = features\n\t this.length = features.length\n\t}", "function GeoJSONWrapper (features) {\n\t this.features = features\n\t this.length = features.length\n\t}", "function convert(data, tolerance) {\n\t var features = [];\n\t\n\t if (data.type === 'FeatureCollection') {\n\t for (var i = 0; i < data.features.length; i++) {\n\t convertFeature(features, data.features[i], tolerance);\n\t }\n\t } else if (data.type === 'Feature') {\n\t convertFeature(features, data, tolerance);\n\t\n\t } else {\n\t // single geometry or a geometry collection\n\t convertFeature(features, {geometry: data}, tolerance);\n\t }\n\t return features;\n\t}", "function getGeoserverTable(url, success, failure) {\n Ext.Ajax.request({\n url : url,\n success : _.compose(success, parseGeoserverJson),\n failure : failure\n })\n }", "function convert(data, tolerance) {\n\t var features = [];\n\n\t if (data.type === 'FeatureCollection') {\n\t for (var i = 0; i < data.features.length; i++) {\n\t convertFeature(features, data.features[i], tolerance);\n\t }\n\t } else if (data.type === 'Feature') {\n\t convertFeature(features, data, tolerance);\n\n\t } else {\n\t // single geometry or a geometry collection\n\t convertFeature(features, {geometry: data}, tolerance);\n\t }\n\t return features;\n\t}", "function populateGrp2Arr(response) {\n $.each(response.features, function (index, feature) {\n Grp2NamDescArr.push(feature.attributes);\n });\n }", "function loadsitelayer(sitedata){\r\nsitejson = JSON.parse(sitedata);\r\n\r\nvar features = []; \r\nfeatures = sitejson.features; \r\nvar jproperties = sitejson.features.map(function (el) { return el.properties; });\r\nvar i;\r\nfor (i = 0; i < jproperties.length; i++) { \r\n\tsitearray.push(Object.values(jproperties[i]));\r\n}\r\n\r\n}", "function GeoJSONWrapper (features) {\n this.features = features\n this.length = features.length\n}", "function GeoJSONWrapper (features) {\n this.features = features\n this.length = features.length\n}", "function getData(map){\r\n $.ajax(\"data/Species.geojson\", {\r\n dataType: \"json\"\r\n ,success: function(response){\r\n var layerWells = createPropSymbols(response, map, processData(response));\r\n getDataMinMax(map, processData(response)[0]);\r\n addLayerControl(layerWells);\r\n createSequenceControls(map, response, processData(response));\r\n }\r\n });\r\n}", "function convert(data, tolerance) {\n var features = [];\n\n if (data.type === 'FeatureCollection') {\n for (var i = 0; i < data.features.length; i++) {\n convertFeature(features, data.features[i], tolerance);\n }\n } else if (data.type === 'Feature') {\n convertFeature(features, data, tolerance);\n\n } else {\n // single geometry or a geometry collection\n convertFeature(features, {geometry: data}, tolerance);\n }\n return features;\n}", "function convert(data, tolerance) {\n var features = [];\n\n if (data.type === 'FeatureCollection') {\n for (var i = 0; i < data.features.length; i++) {\n convertFeature(features, data.features[i], tolerance);\n }\n } else if (data.type === 'Feature') {\n convertFeature(features, data, tolerance);\n\n } else {\n // single geometry or a geometry collection\n convertFeature(features, {geometry: data}, tolerance);\n }\n return features;\n}", "function getData(map){\r\n $.ajax(\"data/MidWesternCities5.geojson\", {\r\n dataType: \"json\",\r\n success: function(response){\r\n \r\n var attributes = processData(response);\r\n \r\n createPropSymbols(response, map, attributes);\r\n createSequenceControls(map, attributes);\r\n createLegend(map, attributes);\r\n \r\n \r\n }\r\n \r\n });\r\n}", "function getEarthquakes()\r\n{\r\n\tclient = new XMLHttpRequest();\r\n\tvar url = \"http://developer.cege.ucl.ac.uk:\"+httpPortNumber;\r\n\turl = url + \"/getGeoJSON/london_highway/geom\";\r\n\tclient.open(\"GET\", url, true);\r\n\tclient.onreadystatechange = earthquakeResponse;// not earthquakeResponse()\r\n\tclient.send();\r\n}", "function getData(map){\n //load the data\n $.ajax(\"data/Deposits.geojson\",{\n dataType: \"json\",\n success: function(response){\n\n //create an array for the attributes\n var attributes = processData(response);\n\n //call function to create and style prop symbols\n createPropSymbols(response, map, attributes);\n\n //create slider to sequence through the years\n createSlider(map, attributes);\n }\n });\n}", "function ksfData_pagelet(data)\n{\n\tvar res = new Array();\n\tres['body'] = data;\n\treturn res;\n}", "function get_mysites(features) {\n let mysites = []\n features.map(feature => {\n mysites.push({\n title : feature['properties']['title'],\n description : feature['properties']['description'],\n position : [feature['geometry']['coordinates'][0],\n feature['geometry']['coordinates'][1]],\n mapOn: true\n\n })\n return(null)\n });\n return mysites\n}", "function GetPAObjectClientTypes() {\n //debugger;\n\n $.ajax({\n type: \"POST\",\n url: \"../my-gallery.aspx/GetPAObjectClientTypes\",\n data: \"\",\n contentType: \"application/json; charset=utf-8\",\n dataType: \"json\",\n success: OnGetPAObjectClientTypesSuccess,\n error: OnGetPAObjectClientTypesError\n });\n\n}", "function parseJSON(response) {\n return response.json()\n }", "function fc() {\n return {\n type: 'FeatureCollection',\n features: []\n };\n }", "function addWSfeatures(){\n var features = [];\n for (var i = 0; i < workshops.length; i++){\n var feature = {\n // feature for Mapbox DC\n 'type': 'Feature',\n 'geometry': {\n 'type': 'Point',\n 'coordinates': workshops[i].coordinates\n },\n 'properties': {\n 'title': workshops[i].title,\n 'description':workshops[i].description\n }\n };\n features[i] = feature;\n }\n return features;\n}", "function json(response) {\n return response.json()\n }", "function getBldgJSON() {\n\n\tmap.on('click', onMapClick);\n\n\tfunction onMapClick(e) {\n\n\t\tvar latlngStr = 'ST_Point(' + e.latlng.lng + ',' + e.latlng.lat + ')';\n\n\t\tvar bldgQryURL = 'http://nickchamberlain.cartodb.com/api/v1/sql/?q=SELECT bldg_type FROM buildings WHERE ST_Contains(buildings.the_geom,ST_SetSRID(' + latlngStr + ',4326))&format=json&callback=?';\n\n\t\t$.getJSON(bldgQryURL, function(data) {\n\n\t\t\tvar items = [];\n\n\t\t\tif ($.type(data.rows[0]) !== \"undefined\") {\n\n\t\t\t\t//console.log(data.rows[0]);\n\n\t\t\t\t$.each(data.rows[0], function(key, val) {\n\n\t\t\t\t\t\titems.push('<li id=\"' + key + '\"><strong>' + key + '</strong>: ' + val + '</li>');\n\n\t\t\t\t});\n\n\t\t\t\tvar popupHTML = $('<ul/>', {\n\n\t\t\t\t\t'id': 'my-new-list',\n\n\t\t\t\t\thtml: items.join('')\n\n\t\t\t\t});//.appendTo(popupHTML);\n\n\t\t\t\t//console.log(popupHTML)\n\n\t\t\t\t//console.log(e.latlng);\n\n\t\t\t\t$.each(popupHTML, function(index) {\n\n\t\t\t\t\tconsole.log(popupHTML.text());\n\n\t\t\t\t});\n\n\t\t\t\tvar popup = new L.Popup();\n\n\t\t\t\t\tpopup.setLatLng(e.latlng);\n\n\t\t\t\t\tpopup.setContent(popupHTML.html());\n\n\t\t\t\tmap.openPopup(popup);\n\n\t\t\t}//if the user clicks a feature make the popup\n\n\t\t});//populates popup with cartodb JSON\n\n\t}\n\n}", "function getResults(response) {\n\n // Loop through each of the results and assign a symbol and PopupTemplate\n // to each so they may be visualized on the map\n var fuelResults = arrayUtils.map(response.features, function (feature) {\n\n // Sets the symbol of each resulting feature to a cone with a\n // fixed color and width. The height is based on the mountain's elevation\n feature.symbol = {\n type: \"simple-fill\", // autocasts as new PointSymbol3D()\n color: \"yellow\",\n };\n\n feature.popupTemplate = popupTemplate;\n return feature;\n });\n\n resultsLyr.addMany(fuelResults);\n\n // animate to the results after they are added to the map \n view.goTo(fuelResults).then(function () {\n view.popup.open({\n features: fuelResults,\n featureMenuOpen: true,\n updateLocationEnabled: true\n });\n });\n\n // print the number of results returned to the user\n dom.byId(\"printResults\").innerHTML = fuelResults.length +\n \" results found!\";\n }", "function processData(data) {\n var geoJsonObject = {\n \"type\": \"FeatureCollection\",\n \"features\": []\n };\n\n var i;\n for (i=0; i < data.length; i++) {\n var result = data[i];\n\n // Only process the data if the result listing is currently active\n if (result[\"active\"] == \"1\") {\n\n /**\n * Sort promotional leases into groups based on the building they are in (buildid)\n */\n\n // Get the index of a listing if there are other promotional listings already present with the same buildid\n var listingIndex = getOtherListings(result.buildid, geoJsonObject[\"features\"]);\n\n /**\n * Process object into GeoJSON\n * Subleases get their own entry in \"features.\"\n * Promos are sorted into building groups by buildid.\n *\n * GeoJSON is a format used by Google Maps and probably other mapping APIs. It has a strict format but we can put\n * whatever we want into \"properties\", which is where we put things like the listing name, price, and associated URL.\n *\n * Note: This is ONE GeoJSON object, not many, and we push each listing into its \"features\" property.\n */\n\n if (listingIndex != null && !isSublease(result[\"aid\"])) {\n geoJsonObject[\"features\"][listingIndex].properties[\"floor_plans\"].push({\n \"weight\": i + 1,\n \"name\": result[\"floor_plan\"],\n \"buildid\": result[\"buildid\"],\n \"price\": result[\"price\"],\n \"gender\": result[\"gender\"],\n \"baths\": result[\"baths\"],\n \"beds\": result[\"beds\"],\n \"sublease\": false,\n \"url\": result[\"url\"]\n });\n } else if (listingIndex == null && !isSublease(result[\"aid\"])) {\n geoJsonObject[\"features\"].push(\n {\n \"type\": \"Feature\",\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [parseFloat(result[\"lng\"]), parseFloat(result[\"lat\"])]\n },\n \"properties\": {\n \"weight\": i + 1,\n // Gets the building name, assuming \"Cordelia at Brentwood\" etc\n \"name\": result[\"building_name\"],\n \"buildid\": result[\"buildid\"],\n \"image\": getThumbnail(result[\"images\"]),\n \"sublease\": false,\n \"url\": result[\"url\"],\n \"floor_plans\": [{\n \"name\": result[\"list\"].split(\" at \")[0],\n \"number\": i,\n \"buildid\": result[\"buildid\"],\n \"price\": result[\"price\"],\n \"gender\": result[\"gender\"],\n \"baths\": result[\"baths\"],\n \"beds\": result[\"beds\"],\n \"sublease\": false,\n \"url\": result[\"url\"]\n }]\n }\n }\n );\n } else {\n geoJsonObject[\"features\"].push(\n {\n \"type\": \"Feature\",\n \"geometry\": {\n \"type\": \"Point\",\n \"coordinates\": [parseFloat(result[\"lng\"]), parseFloat(result[\"lat\"])]\n },\n \"properties\": {\n \"weight\": i + 1,\n \"name\": \"Sublease\",\n \"price\": result[\"price\"],\n \"gender\": result[\"gender\"],\n \"baths\": result[\"baths\"],\n \"beds\": result[\"beds\"],\n \"image\": getThumbnail(result[\"images\"]),\n \"sublease\": true,\n \"url\": result[\"url\"]\n }\n }\n );\n }\n }\n }\n\n // Before saving data: Loop through once more for promotional buildings and get the lowest price of each\n // We'll use this to display the lowest listing price on the DOM\n\n for (i=0; i<geoJsonObject.features.length; i++) {\n var listing = geoJsonObject.features[i].properties;\n var j, price, lowestPrice;\n if (listing.floor_plans) {\n for (j=0; j<listing.floor_plans.length; j++) {\n price = listing.floor_plans[j].price;\n if (!lowestPrice || price < lowestPrice) {\n lowestPrice = price;\n }\n }\n listing.price = lowestPrice;\n }\n }\n\n // Save the geoJSON object globally\n processedData = geoJsonObject;\n}", "function GeoJSONWrapper(features) {\n this.features = features;\n this.length = features.length;\n this.extent = EXTENT;\n}", "function GeoJSONWrapper(features) {\n\t this.features = features;\n\t this.length = features.length;\n\t this.extent = EXTENT;\n\t}", "function GeoJSONWrapper(features) {\n\t this.features = features;\n\t this.length = features.length;\n\t this.extent = EXTENT;\n\t}", "function convertToMapObject(response) {\n let map_response = response.map(({id, name, description, transcript, latitude, longitude, filters, stop_num}) =>\n ({id, name, description: description, transcript, filters: parseFilters(filters), position: [latitude, longitude], stop_num}));\n return map_response;\n}", "parse(response) {\n // separate the response into objects which will be separately parsed\n var _rawFeatures = _.pick(response, ['rows', 'data', 'columns']);\n var _rawGo = _.pick(response, ['go_slim_terms', 'go_slim_relationships']);\n var _rawPhenotypes = _.pick(response, [\n 'phenotype_slim_terms',\n 'phenotype_slim_relationships',\n ]);\n\n // return the parsed versions, using helper parse methods\n return {\n featuresData: this._parseFeatures(_rawFeatures),\n goData: this._parseGo(_rawGo),\n phenotypeData: this._parsePhenotypes(_rawPhenotypes),\n };\n }", "function parseJson(entry){\n\t\t\t\t\t\t\t\t\t\t\tvar polygon=entry[\"cap:polygon\"],\n\t\t\t\t\t\t\t\t\t\t\t\tfeature=null;\n\n\t\t\t\t\t\t\t\t\t\t\t//polygon exists\n\t\t\t\t\t\t\t\t\t\t\tif(polygon&&polygon!=\"\"&&!(polygon instanceof Object)){\n\t\t\t\t\t\t\t\t\t\t\t\tpolygon=polygon.split(\" \");\n\t\t\t\t\t\t\t\t\t\t\t\tvar coordinates=[polygon.map(function(coords){coords=coords.split(\",\"); return [parseFloat(coords[1]), parseFloat(coords[0])]})];\n\n\t\t\t\t\t\t\t\t\t\t\t\tfeature={\n\t\t\t\t\t\t\t\t\t\t\t\t\ttype:\"Feature\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tgeometry:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype:\"Polygon\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcoordinates: coordinates\n\t\t\t\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t\t\t\t\tproperties:(function(){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tvar out={}, feed=json.feed;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(var k in feed){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(k!='entry'){out[k]=feed[k]}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tfor(var k in entry){\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tout['entry-'+k]=entry[k]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\treturn out\n\t\t\t\t\t\t\t\t\t\t\t\t\t})()\n\t\t\t\t\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\treturn feature\n\t\t\t\t\t\t\t\t\t\t}", "function json(response){\n return response.json();\n}", "function deserialize() {\n var element = document.getElementById('text');\n var type = document.getElementById(\"formatType\").value;\n var features = formats['in'][type].read(element.value);\n var bounds;\n if(features) {\n if(features.constructor != Array) {\n features = [features];\n }\n for(var i=0; i<features.length; ++i) {\n if (!bounds) {\n bounds = features[i].geometry.getBounds();\n } else {\n bounds.extend(features[i].geometry.getBounds());\n }\n\n }\n vectors.addFeatures(features);\n map.zoomToExtent(bounds);\n var plural = (features.length > 1) ? 's' : '';\n element.value = features.length + ' feature' + plural + ' aggiunte'\n } else {\n element.value = 'Nessun input ' + type;\n }\n}", "function buildFeatureHtml(resultRecs) {\n\n var html = '';\n\n /* \n * outer loop: loop over each record in results\n */\n for(var i=0; i < resultRecs.length; i++) {\n\n\t // get attribute/values for record\n\t atts = resultRecs[i]['@graph'][0];\n\n\t var idx = -1;\n\n\t /*\n\t * inner loop: loop over each attribute/value in record\n\t */\n\n\t // parse the json-ld to get attributes + values\n\t for(var attUri in atts) {\n\t\tvar att = '';\n\t\tvar value = atts[attUri][0]['@value']; // get literal value\n\t\tif(!value) { // get uri vs. literal\n\t\t value = atts[attUri][0]['@id'];\n\t\t // val should be a uri, so strip off namespace\n\t\t if(value) {\n\t\t\tidx = value.lastIndexOf('#');\n\t\t\tif(idx < 0)\n\t\t\t idx = value.lastIndexOf('/');\n\t\t\tif(idx > 0)\n\t\t\t value = value.substring(idx+1);\n\t\t }\n\t\t}\n\n\t\t// skip over feature ID or geometry coord string\n\t\tif(attUri == '@id')\n\t\t continue;\n\t\tif(attUri.includes('asWKT'))\n\t\t continue;\n\t\t// @type has to be handled sep from other atts\n\t\tif(attUri == '@type') {\n\t\t att = 'type';\n\t\t value = atts[attUri][0];\n\t\t // val should be a uri, so strip off namespace\n\t\t idx = value.lastIndexOf('#');\n\t\t if(idx < 0)\n\t\t\tidx = value.lastIndexOf('/');\n\t\t if(idx > 0)\n\t\t\tvalue = value.substring(idx+1);\n\t\t}\n\t\telse { \n\t\t // get attribute name (right of slash or hash in uri)\n\t\t idx = attUri.lastIndexOf('#');\n\t\t if(idx < 0)\n\t\t\tidx = attUri.lastIndexOf('/');\n\t\t att = attUri.substring(idx+1);\n\t\t}\n\n\t\t// clean up any null literals if present\n\t\tif(value == 'null')\n\t\t value = '';\n\t\t// append attribute and value to the html\n\t\thtml += '<b>' + att + ': &nbsp; </b>' + value + '<br>'; \n\t }\n }\n \n return html;\n}", "function parseDefinitions(response)\n{\n //Take a JSON file - parse it into the array for use later\n definitionList = JSON.parse(response);\n\n addPopupDesc();\n\n}", "function getPopTypes () \n{\n jQuery.support.cors = true; // for IE8+\n\n var jsonObject = new Array();\n \n $query = queryPrefix;\n $query += 'SELECT DISTINCT ?popType WHERE { \\n';\n $query += '?popType rdfs:subClassOf hxl:Displaced . \\n';\n $query += '} \\n';\n //console.log($query);\n\n $.ajax\n ({\n url: 'http://hxl.humanitarianresponse.info/sparql',\n headers: \n {\n Accept: 'application/sparql-results+json'\n },\n data: \n { \n query: $query \n },\n datatype: \"json\",\n success: displayData, \n error: displayError,\n async: false\n });\n\n function displayError(xhr, textStatus, errorThrown) \n {\n jsonObject = false;\n alert(textStatus + ': ' + errorThrown);\n }\n\n function displayData(data) \n {\n if (/Firefox[\\/\\s](\\d+\\.\\d+)/.test(navigator.userAgent))\n {\n jsonObject = jQuery.parseJSON(data);\n if (jsonObject == null) // Necessary for FF on blackmesh\n {\n jsonObject = data.results.bindings;\n }\n } \n else \n {\n jsonObject = data.results.bindings;\n }\n }\n return jsonObject;\n}", "function floodincidentResponse(){\r\nif(client.readyState == 4){\r\n\tvar floodincidentdata = client.responseText;\r\n\tloadfloodIncidentlayer(floodincidentdata);\r\n\t}\r\n}", "function uploadImageListFromServer(){\n\tvar xhr = new XMLHttpRequest();\n\t\n\txhr.open(\"GET\", \"/listImages\");\n\txhr.onload = function() {\n\t\tvar response = JSON.parse(xhr.responseText);\n\t\t\n\t\tif(xhr.status == 200){\n\t\t\t\n\t\t\tresponseList = response;\n\t\t\t\n\t\t\t// data null check\n\t\t\tif(response == null || response == undefined)\n\t\t\t\treturn;\n\t\t\t// append valid data to gallery.\n\t\t\tresponse.forEach(element => {\n\t\t\t\tappendResponseToGallery(element.preview);\n\t\t\t});\n\t\t\t// add listeners.\n\t\t\tloadGallery(true, 'a.thumbnail');\n\t\t}\n\t\tif(xhr.status == 400){\n\t\t\t// show error message\n\t\t\talert(response.message);\n\t\t}\n\t};\n\txhr.send();\n}", "function convertEPSG3857to4326(geojson) {\n\tvar geom = [];\n\tvar vectorSource = new ol.source.Vector({\n\t\tfeatures: (new ol.format.GeoJSON()).readFeatures(geojson)\n\t});\n\tvectorSource.forEachFeature(function(feature) {\n\t\tgeom.push(new ol.Feature(feature.getGeometry().clone().transform('EPSG:3857', 'EPSG:4326')));\n\t});\n\tvar writer = new ol.format.GeoJSON();\n\tvar geoJsonStr = writer.writeFeatures(geom);\n\tgeojson = JSON.parse(geoJsonStr);\n\tconsole.log(geojson)\n\treturn geojson;\n}", "function updateEntityFeatures\n(\n features\n)\n{\n var res;\n var dataToSend = \n {\n \"action\" : UPDATE_ENTITY_FEATURES,\n \"features\" : JSON.stringify(features)\n }\n $.ajax({\n type : \"POST\",\n url : API_URL,\n data : dataToSend, \t \n dataType : \"json\",\n async : false, \n headers : HEADER,\n error : function (e) \n { \n res = -1;\n },\n success : function(jsonResult)\n { \n res = jsonResult;\n }\n }); \n\n return res;\n}", "function getPointsList(){\n var t = js_data;\n var tmp=JSON.parse(js_data);\n\n let power = 2147483648;\n \n let pointslist = [];//[-75, 37,-95, 36,-125, 37];\n\n for(x in tmp){\n \n var z=tmp[x];\n var lat= z.fields.position_lat; // * ( 180 / power );\n var lon= z.fields.position_long; // * ( 180 / power );\n //var alt = z.fields.altitude;\n pointslist.push(lon);\n pointslist.push(lat);\n // pointslist.push(alt);\n }\n return pointslist;\n \n}", "function responseParser (response) {\n let data = [];\n response.data.results.forEach(character => {\n data.push({\n 'id': character.id,\n 'name': character.name,\n 'description': character.description,\n 'wiki': character.urls[0].url,\n 'comics': character.urls[1].url\n });\n });\n return data;\n}", "function getFeatureEvents() {\n\n //force iOS to clear cache by adding junk parameter\n var jsonURL = 'http://www.makeascenedowntown.com/CMSPages/jaxHappenings/jh_eventsJson.aspx?callback=?&nocache=' + date.getTime();\n\n // turns off caching for all ajax calls\n $.ajaxSetup({ cache: false });\n\n // ajax - get data - use POST to deal with iOS caching\n $.ajax({\n type: 'POST',\n url: jsonURL,\n processData: false,\n timeout: 60000,\n dataType: 'json',\n\n beforeSend: function onBeforeSend(xhr, settings) {\n xhr.setRequestHeader('cache-control', 'max-age=0, no-cache, no-store, must-revalidate, proxy-revalidate');\n }, // beforeSend\n\n error: function onError(XMLHttpRequest, textStatus, errorThrown) {\n $(\"<span />\", { style: \"color:white;\", text: \"Please check your data connection.\" }).appendTo(\"#featureEventsList\");\n uploadError = true;\n }, // error\n\n success: function showData(data) {\n var items = [];\n\n // output to screen\n var output = '<ul data-role=\"listview\" data-filter=\"false\" data-inset=\"true\" data-theme=\"a\">';\n\n for (var i = 0; i < 3; i++) {\n\n var eventID = data.events.items[i].eventID;\n var EventName = data.events.items[i].EventName;\n var EventTeaser = data.events.items[i].EventTeaser;\n var EventDate = data.events.items[i].EventDate;\n var EventLocation = data.events.items[i].EventLocation;\n var EventPrice = data.events.items[i].EventPrice;\n\n output += '<li>';\n output += '<a href=\"#eventItemDetails\" onclick=\"showEventSSM(' + eventID + ')\">';\n output += '<h2>' + EventName + '</h2>';\n output += (EventTeaser) ? // use feature image if no image use default, designer note: images must be square cropped\n \t\t'<img src=\"' + EventTeaser + '\" alt=\"' + EventName + '\" />' :\n \t\t'<img src=\"images/jaxHappeningsLogo.png\" alt=City of Jacksonville\" />';\n output += '<p>' + EventDate + '</p>';\n output += '<p>' + EventLocation + '</p>';\n output += '<p>' + EventPrice + '</p>';\n output += '</a>';\n output += '</li>';\n\n }; // each\n\n output += '</ul>';\n $('#featureEventsList').html(output);\n\n // turn ajax caching back on\n $.ajaxSetup({ cache: true });\n } // success\n\n }); // ajax\n\n}", "function parseResponse(response){\n // debugger;\n var name = response.name;\n var latitude = response.latitude;\n var longitude = response.longitude;\n var live_data = JSON.parse(response.live_data);\n var all_stations = live_data.stationBeanList;\n var current_station = all_stations.filter(function(station){\n return station.stationName === name;\n })[0] //bad code make this better.\n\n $(\"#executionTime\").html(\"Time of obtaining data is: \" + live_data.executionTime);\n $(\"#location\").html(\"Address is: \" + current_station.location);\n $(\"#availableDocks\").html(\"Number of available docks is: \"+current_station.availableDocks);\n $(\"#totalDocks\").html(\"Total number of docks is: \" + current_station.totalDocks);\n $(\"#availableBikes\").html(\"Number of bikes available is: \" + current_station.availableBikes);\n}", "function getHeatmapList(){\n $.ajax({\n type: 'GET',\n url: backendURL + FRDO_HEATMAPS,\n dataType : 'json',\n success: function(d){\n if(d) {\n console.log('Got heatmaps: ' + d);\n for (var i = 0; i < d.length; i++) {\n heatmaps.push(d[i]);\n }\n $('#current-heatmap').html('current: ' + heatmaps[currentHeatmapPointer]);\n }\n },\n error: function(msg){\n $('#current-heatmap').html('<p>can\\'t load heatmaps: <code>' + msg.responseText + '</code>');\n } \n });\n}", "function getEarthquakes() {\n client = new XMLHttpRequest();\n client.open('GET','https://earthquake.usgs.gov/earthquakes/feed/v1.0/summary/all_day.geojson');\n client.onreadystatechange = earthquakeResponse; \n client.send();\n}", "function flattenFeature (feature) {\n let features = []\n if (feature.geometry != null) {\n switch (window.mapcache.GeometryType.fromName(feature.geometry.type.toUpperCase())) {\n case window.mapcache.GeometryType.MULTIPOINT:\n case window.mapcache.GeometryType.MULTILINESTRING:\n case window.mapcache.GeometryType.MULTIPOLYGON:\n feature.geometry.coordinates.forEach(coordinates => {\n flattenFeature({\n type: 'Feature',\n geometry: {\n type: feature.geometry.type.substring(5),\n coordinates\n },\n properties: {}\n }).forEach(feature => {\n features.push(feature)\n })\n })\n break\n case window.mapcache.GeometryType.GEOMETRYCOLLECTION:\n feature.geometry.geometries.forEach(geometry => {\n let result = flattenFeature({\n type: 'Feature',\n geometry: geometry,\n properties: {}\n })\n result.forEach(feature => {\n features.push(feature)\n })\n })\n break\n default:\n features.push(feature)\n break\n }\n }\n return features\n}", "function CS_parseJSON(xhr) {\n return JSON.parse(xhr.responseText.substr(5));\n}", "function getJSON(){\n //console.log('getTexts');\n var nameArray = document.querySelectorAll('#lawyerList > div.floatDiv > a');\n var jsonData = [];\n Array.prototype.map.call(nameArray, function(e){\n var item = {};\n item['name'] = e.innerHTML;\n jsonData.push(item);\n });\n return jsonData;\n}", "function parseFlickrImages(responseData){\n\t\t//console.log(responseData);\n\t\tvar images = JSON.parse(responseData.responseText);\n\t\trenderImages(images);\n\t}", "async function getDataArrond2() {\r\n const response = await fetch(\"php/arrondissements.php\");\r\n const data = await response.json();\r\n\tconst geojson = L.geoJSON(data, \r\n\t\t{style:{\r\n\t\t\tcolor: '#858585'\r\n\t\t},\r\n\t\tonEachFeature: function(feature, layer) {\r\n\t\t\t\tlayer.on({\r\n\t\t\t\t\t'add': function(){\r\n\t\t\t\t\t layer.bringToBack()}})}});\r\n geojson.addTo(map2);\r\n return geojson;\r\n }", "function json(response) {\n return response.json();\n}", "function json(response) {\n return response.json();\n}", "function json(response) {\n return response.json();\n}", "function json(response) {\n return response.json();\n}", "function getData(map){\n //load the data from the pertussis json\n $.ajax(\"data/ca_pertussis.geojson\", {\n dataType: \"json\",\n success: function(response){ \n\t\t\t//create an attributes array\n var attributes = processData(response);\n createPropSymbols(response, map, attributes);\n createSequenceControls(map, attributes);\n createLegend(map, attributes);\n\t\t}\n });\n}", "function handleAddArtworkSuccess(artworkResponse){\n console.log(artworkResponse);\n var artList = $('#gallery');\n artList.html(artworkResponse.map(getSummary));\n}", "function jsonResponse(feed) {\r\n\r\n if (feed && feed.value && feed.value.items && feed.value.items.length > 0) {\r\n\r\n // here we shall generate geo (or adr) uFormat\r\n\r\n var locationName = document.getElementById('insertGeoLocation').value;\r\n\r\n var geoUFormat = '';\r\n\r\n var lat = feed.value.items[0].lat;\r\n\r\n var lon = feed.value.items[0].lon;\r\n\r\n if (lat != null && lon != null) {\r\n\r\n insertAtCursor(\r\n\r\n document.getElementById('textarea'), \r\n\r\n createGeoMicroformat(locationName, lat, lon));\r\n\r\n }\r\n\r\n }\r\n\r\n $(WAIT_ELEM_ID).style.display = 'none';\r\n\r\n document.getElementsByTagName('body')[0].style.cursor = body_cursor_bak;\r\n\r\n insertGeoFormCancel();\r\n\r\n}", "function getUnderlyingList()\r\n\t{\r\n\t\t$.ajax({\r\n\t\t url: contextPath + \"/underlyings/all\", \r\n\t\t type: 'GET', \r\n\t\t dataType: 'json', \r\n\t\t contentType: 'application/json',\r\n\t\t mimeType: 'application/json',\r\n\t\t timeout: 5000,\r\n\t\t cache: false,\r\n\t\t success: function(underlyings) \r\n\t\t {\r\n\t\t },\r\n error: function (xhr, textStatus, errorThrown) \r\n {\r\n \tconsole.log(xhr.responseText);\r\n alert('Failed to get list of underlyings because of a server error.');\r\n }\r\n\t\t});\t\r\n\t}", "function addGeoJSON() {\r\n $.ajax({\r\n url: \"https://potdrive.herokuapp.com/api/map_mobile_data\",\r\n type: \"GET\",\r\n success: function(data) {\r\n window.locations_data = data\r\n console.log(data)\r\n //create markers from data\r\n addMarkers();\r\n //redraw markers whenever map moves\r\n map.on(plugin.google.maps.event.MAP_DRAG_END, addMarkers);\r\n setTimeout(function(){\r\n map.setAllGesturesEnabled(true);\r\n $.mobile.loading('hide');\r\n }, 300);\r\n },\r\n error: function(e) {\r\n console.log(e)\r\n alert('Request for locations failed.')\r\n }\r\n }) \r\n }", "function extractNeededData(data) {\n // declare empty array\n const venuesForMap = [];\n // Loop through json response\n data.forEach(venue => {\n // Push the name, ID, and latlng into an array to use for the map\n venuesForMap.push({\n name: venue.name,\n id: venue.id,\n latlng: \n [\n venue.location.lat,\n venue.location.lng\n ]\n });\n });\n // Create the map with the data gathered. Function located in main.js\n createMap(venuesForMap);\n}" ]
[ "0.6901172", "0.6388696", "0.6012852", "0.6001298", "0.58722615", "0.57966226", "0.5773272", "0.5745927", "0.5685376", "0.56702584", "0.5646436", "0.5639588", "0.5618963", "0.5588468", "0.5580618", "0.55773145", "0.5541827", "0.55210596", "0.55192965", "0.55164355", "0.5510356", "0.55084693", "0.55073464", "0.5463486", "0.54509187", "0.54396915", "0.5420821", "0.53979415", "0.53931284", "0.5379289", "0.5361046", "0.5347035", "0.53441674", "0.53406703", "0.5338686", "0.5332757", "0.532709", "0.53245974", "0.5323486", "0.5319224", "0.5319224", "0.5303599", "0.52937686", "0.5273195", "0.52678216", "0.52676374", "0.52477646", "0.52477646", "0.52401805", "0.5239995", "0.5239995", "0.52369887", "0.5224954", "0.5222492", "0.52172834", "0.5195699", "0.5194533", "0.5186227", "0.51842886", "0.5181079", "0.5172258", "0.5168478", "0.51595443", "0.515408", "0.5148089", "0.51404995", "0.51404995", "0.5138909", "0.5127038", "0.51175416", "0.511418", "0.51082814", "0.5102141", "0.51006824", "0.50933427", "0.507308", "0.5069133", "0.50662774", "0.50654113", "0.50644696", "0.5064268", "0.506365", "0.5057698", "0.505498", "0.50527734", "0.5052647", "0.5050603", "0.5049671", "0.50492144", "0.5045664", "0.5041109", "0.5041109", "0.5041109", "0.5041109", "0.50379246", "0.5034227", "0.502396", "0.50162315", "0.50041497", "0.5002461" ]
0.693679
0
pmY = []//len =8 sig = []//len=8 N = pmY.length N=32 xs = 200; ys = 220;; //starting coods xx = []; // xposition holder eps = 10; // tolerance backgnd = [255, 255, 0] foregnd = [255, 0, 0] var x = [0] Xcos = []; Xsin = []; Xmag = []; Xph = [] ========================= ===== setup() ==========
function setup() { createCanvas(800,600); backgnd = [255, 255, 0] foregnd = [255, 0, 0] var x = [0] Xcos = [];sig=[] Xsin = []; Xmag = []; Xph = [] pmY=[];sig=[] xx = []; // xposition holder eps = 10; // tolerance N=9 xs=-width/2.1;ys=-height/4 //xs=0;ys=0 angleMode(DEGREES) background(backgnd) initSig() }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function setup() {\n createCanvas(1820,540);\n //colorMode(RGB, 255, 255, 255, 100);\n w = width + 16;\n\n for (var i = 0; i < maxwaves; i++) {\n amplitude.push(random(100, 400));\n var period = random(500,800); // How many pixels before the wave repeats\n dx.push((TWO_PI / period) * xspacing/2);\n }\n //console.log(amplitude, dx);\n\n yvalues = [];\n}", "function createSpec(nsizex,nsizey) {\r\n var imgMod, x, y, r, g, b, a, l, offset, ix, iy, newset\r\n var lammax = 300; // max color angle according hsv colorspace\r\n var lambmax = 0;\r\n//\r\n// the color angle from 0 (red) to 300 (blue/violet) is roughly the wavelength between 700 and 400 nm\r\n// (polynom-fit third order) \r\n var specval = new Array(lammax); lambda = new Array(lammax)\r\n for (ix = 0; ix < lammax+1; ix++) {\r\n specval[ix] = 0;\r\n// lambda[ix] = 700*(-1.116*(ix/lammax)*(ix/lammax)*(ix/lammax)+1.938*(ix/lammax)*(ix/lammax)-1.251*(ix/lammax)+1); \r\n lambda[ix] = 700*(-1.20*(ix/lammax)*(ix/lammax)*(ix/lammax)+2.00*(ix/lammax)*(ix/lammax)-1.25*(ix/lammax)+1); \r\n\r\n // lambda[ix] = 700 - ix;\r\n }\r\n var sumspec = 0, lsumspec = 0, coltemp = 0, colsum = 0;\r\n var img = new Image();\r\n var canpic = document.getElementById(\"myCanvasPic\");\r\n var ctxp = canpic.getContext(\"2d\");\r\n img.height = canpic.height;\r\n img.width = canpic.width;\r\n var canspec = document.getElementById(\"myCanvasSpec\");\r\n var ctxs = canspec.getContext(\"2d\");\r\n var imgData = ctxp.getImageData(0, 0, img.width, img.height);\r\n var imgMod = ctxs.createImageData(nsizex, nsizey);\r\n for (ix = 0; ix < img.width; ix++) {\r\n for (iy = 0; iy < img.height; iy++) { \r\n offset = (imgData.width * iy + ix) * 4;\r\n r = imgData.data[offset]/255; // rot\r\n g = imgData.data[offset + 1]/255; // grün\r\n b = imgData.data[offset + 2]/255; // blau\r\n a = imgData.data[offset + 3]; // Transparenz \r\n//\r\n// look for the highets na lowest r,g,b values \r\n hmax = r;\r\n hmin = r;\r\n seg = \"r\";\r\n if (g > hmax) {\r\n hmax = g;\r\n seg = \"g\";\r\n } \r\n if (b > hmax) {\r\n hmax = b;\r\n seg = \"b\";\r\n } \r\n if (g < hmin) {\r\n hmin = g;\r\n } \r\n if (b < hmin) {\r\n hmin = b;\r\n } \r\n//\r\n// calculate the hsv-color angle according wikipedia https://de.wikipedia.org/wiki/HSV-Farbraum \r\n if (hmax > hmin) { \r\n if (seg == \"r\") {\r\n x = colorRange(60*(0+(g-b)/(hmax-hmin)))\r\n }\r\n if (seg == \"g\") {\r\n x = colorRange(60*(2+(b-r)/(hmax-hmin)))\r\n } \r\n if (seg == \"b\") {\r\n x = colorRange(60*(4+(r-g)/(hmax-hmin)))\r\n }\r\n y = Math.floor(hmax*nsizey); \r\n specval[x] = specval[x] + hmax;\r\n }\r\n//\r\n// in the case of white/gre< light add values to all color angles \r\n if (hmax == hmin) {\r\n for (jx = 0; jx < lammax+1; jx++) {\r\n specval[jx] = specval[jx] + hmax/lammax ;\r\n }\r\n }\r\n\r\n }\r\n }\r\n//\r\n// normalize the values to 0...1 \r\n maxs = 0;\r\n for (ix = 0; ix < lammax+1; ix++) {\r\n if (specval[ix] > maxs) {\r\n maxs = specval[ix];\r\n lambmax = lambda[ix];\r\n }\r\n }\r\n//\r\n// calculate the intensity per color angle \r\n for (gx = 0; gx < nsizex; gx++) {\r\n ix = Math.round(gx/nsizex*lammax)\r\n specval[ix] = Math.sqrt(specval[ix]/maxs);\r\n hseg = Math.floor(ix/60);\r\n fseg = ix/60 - hseg;\r\n qval = 1-fseg;\r\n tval = fseg;\r\n//\r\n// Segment 0..60 Grad (red)\r\n if (hseg == 0) {\r\n r = 1;\r\n g = tval;\r\n b = 0;\r\n }\r\n//\r\n// Segment 60..120 Grad (yellow) \r\n if (hseg == 1) {\r\n r = qval;\r\n g = 1;\r\n b = 0;\r\n }\r\n//\r\n// Segment 120..180 Grad (green) \r\n if (hseg == 2) {\r\n r = 0;\r\n g = 1;\r\n b = tval;\r\n }\r\n//\r\n// Segment 180..240 Grad (cyan) \r\n if (hseg == 3) {\r\n r = 0;\r\n g = qval;\r\n b = 1;\r\n }\r\n//\r\n// Segment 240..3000 Grad (blue) \r\n if (hseg == 4) {\r\n r = tval;\r\n g = 0;\r\n b = 1;\r\n }\r\n//\r\n// Segment 300..360 Grad (violet-purple) - not relevant for light sprctra \r\n if (hseg == 5) {\r\n r = 1;\r\n g = 0;\r\n b = qval;\r\n }\r\n//\r\n// calculate the center of the wavelength\r\n sumspec = sumspec + specval[ix]*specval[ix];\r\n lsumspec = lsumspec + specval[ix]*specval[ix]*lambda[ix];\r\n//\r\n// determine/estimate the color temperature accoridng to the CIE Normtafel\r\n if (r > 0) { \r\n ra = r/(r+g+b);\r\n if (ra > 0.25) {\r\n if (ra < 0.65) {\r\n colsum = colsum + specval[ix]*specval[ix];\r\n coltemp = coltemp + specval[ix]*specval[ix]*310/Math.pow(ra,2.8);\r\n // console.log(ra,310/Math.pow(ra,2.8),specval[ix]*specval[ix]);\r\n }\r\n }\r\n }\r\n \r\n\r\n for (iy = 0; iy < Math.floor(specval[ix]*nsizey); iy++) {\r\n newset = (nsizex * (nsizey-iy) + gx) * 4;\r\n imgMod.data[newset] = byteRange(r*255);\r\n imgMod.data[newset + 1] = byteRange(g*255);\r\n imgMod.data[newset + 2] = byteRange(b*255);\r\n imgMod.data[newset + 3] = byteRange(255);\r\n }\r\n }\r\n\r\n\r\n // ctxp.clearRect(0, 0, img.width, img.height);\r\n canspec.width = nsizex;\r\n canspec.height = nsizey;\r\n ctxs.putImageData(imgMod, 0, 0);\r\n// console.log (specval, lambda, lsumspec/sumspec, coltemp/colsum);\r\n\r\n coltemp = coltemp/colsum;\r\n lambavg = lsumspec/sumspec;\r\n txtout(\"max = \"+form(lambmax,0)+\" nm\",\"c_lambmax\");\r\n txtout(\"Temp = \"+form(coltemp,0)+\" K\",\"c_coltemp\");\r\n txtout(\"avg = \"+form(lambavg,0)+\" nm\",\"c_lambavg\"); \r\n if (coltemp < 3300) {\r\n txtout(\"Warm White\",\"c_tempname\");\r\n }\r\n if (coltemp > 3300) {\r\n if (coltemp < 5300) {\r\n txtout(\"Neutral White\",\"c_tempname\");\r\n }\r\n }\r\n if (coltemp > 5300) {\r\n txtout(\"Cold White\",\"c_tempname\");\r\n }\r\n \r\n\r\n }", "function setup() {\n cnv = createCanvas(800, 600);\n cnv.mousePressed(canvasPressed);\n background('grey');\n\n\n //---------------------------------------create pattens-----------------------------------------------\n h1Pat = [1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 0, 1, 1];\n h2Pat = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n snPat = [0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1];\n shPat = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];\n k1Pat = [1, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0];\n k2Pat = [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0];\n stepPat = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32];\n\n\n //-------------------------------------------declare important variables------------------------------\n trackAMT = 6;\n beatLength = 16;\n r = 20;\n indexClicked = 0;\n trackClicked = 0;\n cellWidth = width / beatLength;\n cellHeight = height / trackAMT;\n buttonCenters = [];\n //--------------------------------------------array of track listener functions ------------------------------//\n //-------------------------------------calculate indexClicked and hard code trackClicked-----------------------//\n trackListeners = [\n function track1Listener(x1, y1, x2, y2) {\n let d = dist(x1, y1, x2, y2);\n if (d < r) {\n indexClicked = floor(beatLength * mouseX / width);\n trackClicked = 1;\n }\n },\n function track2Listener(x1, y1, x2, y2) {\n let d = dist(x1, y1, x2, y2);\n if (d < r) {\n indexClicked = floor(beatLength * mouseX / width);\n trackClicked = 2;\n }\n },\n function track3Listener(x1, y1, x2, y2) {\n let d = dist(x1, y1, x2, y2);\n if (d < r) {\n indexClicked = floor(beatLength * mouseX / width);\n trackClicked = 3;\n }\n },\n function track4Listener(x1, y1, x2, y2) {\n let d = dist(x1, y1, x2, y2);\n if (d < r) {\n indexClicked = floor(beatLength * mouseX / width);\n trackClicked = 4;\n }\n },\n function track5Listener(x1, y1, x2, y2) {\n let d = dist(x1, y1, x2, y2);\n if (d < r) {\n indexClicked = floor(beatLength * mouseX / width);\n trackClicked = 5;\n }\n },\n function track6Listener(x1, y1, x2, y2) {\n let d = dist(x1, y1, x2, y2);\n if (d < r) {\n indexClicked = floor(beatLength * mouseX / width);\n trackClicked = 6;\n }\n },\n ];\n}", "function setup()\n{\n planet_name = [\"the Sun\",\"Mercury\",\"Venus\",\"Mars\",\"Jupiter\",\"Saturn\",\"Moon\",\"the Pleiades\",\"Aldebaran\",\"the Beehive\",\"Regulus\",\"Spica\",\"Antares\",\"Pollux\",\"Elnath\",\"Alhena\",\"Nunki\"];\n planet_decl = new Array(16);\n planet_r_a = new Array(16);\n planet_altitude = new Array(6);\n planet_azimuth = new Array(6);\n planet_mag = new Array(6);\n planet_decl[7] = 0.42121;\n planet_r_a[7] = 0.99222;\n planet_decl[8] = 0.28827;\n planet_r_a[8] = 1.20559;\n planet_decl[9] = 0.34296;\n planet_r_a[9] = 2.27242;\n planet_decl[10] = 0.20828;\n planet_r_a[10] = 2.65595;\n planet_decl[11] = -0.19548;\n planet_r_a[11] = 3.51466;\n planet_decl[12] = -0.46164;\n planet_r_a[12] = 4.31882;\n planet_decl[13] = 0.48898;\n planet_r_a[13] = 2.03199;\n planet_decl[14] = 0.49946;\n planet_r_a[14] = 1.42549;\n planet_decl[15] = 0.28623;\n planet_r_a[15] = 1.73704;\n planet_decl[16] = -0.45873;\n planet_r_a[16] = 4.95543;\n phenomena = \"...\";\n phases = new Array(3);\n phase = new Array(3);\n moon_data = \"...\";\n new_moon = 0;\n var nowdate = new Date();\n var utc_day = nowdate.getUTCDate();\n var utc_month = nowdate.getUTCMonth() + 1;\n var utc_year = nowdate.getUTCFullYear();\n zone_comp = nowdate.getTimezoneOffset() / 1440;\n var utc_hours = nowdate.getUTCHours();\n var utc_mins = nowdate.getUTCMinutes();\n var utc_secs = nowdate.getUTCSeconds();\n utc_mins += utc_secs / 60.0;\n utc_mins = Math.floor((utc_mins + 0.5));\n if (utc_mins < 10) utc_mins = \"0\" + utc_mins;\n if (utc_mins > 59) utc_mins = 59;\n if (utc_hours < 10) utc_hours = \"0\" + utc_hours;\n if (utc_month < 10) utc_month = \"0\" + utc_month;\n if (utc_day < 10) utc_day = \"0\" + utc_day;\n if (UTdate == \"now\")\n {\n document.planets.date_txt.value = utc_month + \"/\" + utc_day + \"/\" + utc_year;\n }\n else\n {\n document.planets.date_txt.value = UTdate;\n }\n if (UTtime == \"now\")\n {\n document.planets.ut_h_m.value = utc_hours + \":\" + utc_mins;\n }\n else\n {\n document.planets.ut_h_m.value = UTtime;\n }\n planets();\n dst();\n}", "function setup(){\n createCanvas(windowWidth, windowHeight);\n strokeWeight( 1 );\n frameRate(60);\n\n // Create the waypoints for the target dot to follow\n let w_op = [width/10, width/2, width*9/10];\n let h_op = [height/20, height/2, height*19/20];\n // // center,mid-right,topright,topleft, midleft, botleft, botright, mid-right again\n // nx_arr = [w_op[1], w_op[2], w_op[2], w_op[0], w_op[0], w_op[0], w_op[2], w_op[2]]\n // ny_arr = [h_op[1], h_op[1], h_op[0], h_op[0], h_op[1], h_op[2], h_op[2], h_op[1]];\n\n //center botmid, botleft, mid left, topleft, topright, midright, botright\n nx_arr = [w_op[1], w_op[1], w_op[0], w_op[0], w_op[0], w_op[2], w_op[2], w_op[2]]\n ny_arr = [h_op[1], h_op[2], h_op[2], h_op[1], h_op[0], h_op[0], h_op[1], h_op[2]]\n\n // Set initial target dot position\n X = nx_arr[calib_counter];\n Y = ny_arr[calib_counter];\n nX = nx_arr[(calib_counter+1) % 5];\n nY = ny_arr[(calib_counter+1) % 5];\n\n moveAmountPerFrame = [(nX-X)/numSteps , (nY-Y)/numSteps];\n\n // Start it in a stopped state\n stillsTaken = num_ims_still\n stopped = true;\n\n // Load instruction images\n instructions_imgs.push(\"static/headshot3.jpg\")\n\n}", "function initDFT() {\n for (i = 0; i < N; i++) {\n Xcos[i] = 0;\n Xsin[i] = 0;\n Xmag[i] = 0;\n }; // end of for loop\n}//end of function initDFT()", "function setup() {\n \n createCanvas (400, 400);\n \n //start the particles in the middle\n x = 200;\n y = 200;\n \n x2 = 200;\n y2 = 200;\n \n x3 = 200;\n y3 = 200;\n \n numSteps = 0;\n}", "function setup() {\n\tpixelDensity(HD);\n\tcnv = createCanvas(100, 100);\n\tcnv.parent(\"bottomCenter\");\n\tplot1 = new GPlot(this);\n\tplot1.setPos(10, 0);\n\tplot1.setOuterDim(100, 100);\n\tplot1.setYLim(0, 1);\n\tplot1.getXAxis().getAxisLabel().setText(\"time (s)\");\n\tplot1.getYAxis().getAxisLabel().setText(\"mass of ice melted (g)\");\n\tplot1.getTitle().setText(\"mass of ice melted\");\n\n\tplot2 = new GPlot(this);\n\tplot2.setPos(10, 0);\n\tplot2.setOuterDim(100, 100);\n\tplot2.setYLim(0, 400);\n\tplot2.getXAxis().getAxisLabel().setText(\"time (s)\");\n\tplot2.getYAxis().getAxisLabel().setText(\"temperature (°C)\");\n\tplot2.getTitle().setText(\"temperature of blocks\");\n\n\tsmooth();\n }", "function setup() {\r\n for (var y = 0; y < n; y++) {\r\n matrix[y] = [];\r\n for (var x = 0; x < n; x++) {\r\n var k = random([ 0,0, 0, 3, 2, 2, 2, 0, 0, 0,0,0, 1, 1, 1, 1, 1, 3, 2, 2,1,1,1,1,1,1,1\r\n ]);\r\n matrix[y][x] = k;\r\n }\r\n }\r\n for(var i = 0; i< 20; i++){\r\n var y = Math.floor(random(n));\r\n var x = Math.floor(random(n));\r\n matrix[y][x]=4;\r\n }\r\n \r\n for(var i = 0; i< 5; i++){\r\n var y = Math.floor(random(n));\r\n var x = Math.floor(random(n));\r\n matrix[y][x]=5;\r\n }\r\n\r\n\r\n\r\n\r\n frameRate(10);\r\n createCanvas(matrix[0].length * side, matrix.length * side);\r\n background('#acacac');\r\n //xot\r\n for (var y = 0; y < matrix.length; y++) {\r\n for (var x = 0; x < matrix[y].length; x++) {\r\n if (matrix[y][x] == 1) {\r\n grrasArr.push(new Grass(x, y));\r\n\r\n }\r\n }\r\n\r\n }\r\n\r\n //xotaker\r\n for (var y = 0; y < matrix.length; y++) {\r\n for (var x = 0; x < matrix[y].length; x++) {\r\n if (matrix[y][x] == 2) {\r\n grasseat.push(new Grasseater(x, y));\r\n\r\n }\r\n }\r\n\r\n }\r\n\r\n\r\n for (var y = 0; y < matrix.length; y++) {\r\n for (var x = 0; x < matrix[y].length; x++) {\r\n if (matrix[y][x] == 3) {\r\n meateater.push(new Meateater(x, y));\r\n\r\n }\r\n }\r\n\r\n }\r\n\r\n for (var y = 0; y < matrix.length; y++) {\r\n for (var x = 0; x < matrix[y].length; x++) {\r\n if (matrix[y][x] == 4) {\r\n hunter.push(new Hunter(x, y));\r\n\r\n }\r\n }\r\n\r\n }\r\n for (var y = 0; y < matrix.length; y++) {\r\n for (var x = 0; x < matrix[y].length; x++) {\r\n if (matrix[y][x] == 5) {\r\n mine.push(new Mine(x, y));\r\n\r\n }\r\n }\r\n\r\n }\r\n // for (var y = 0; y < matrix.length; y++) {\r\n // for (var x = 0; x < matrix[y].length; x++) {\r\n // if (matrix[y][x] == 6) {\r\n // mak.push(new Mak(x, y));\r\n\r\n // }\r\n // }\r\n\r\n // }\r\n\r\n\r\n}", "function setup() {\n createCanvas(600, 600);\n\n frameRate(20);\n\n distX = endX - beginX; //code snippet from curved motion from p5js site\n distY = endY - beginY;\n\n distyellowX = endyellowX - beginyellowX; //code snippet from curved motion from p5js site\n distyellowY = endyellowY - beginyellowY;\n}", "function setup() {\n createCanvas(windowWidth,windowHeight);\n background(\"#ffff00\");\n imageMode(CENTER);\n\n // Use a for loop to draw as many decoys as we need\n for (var i = 0; i < numDecoys; i++) {\n // Choose a random location for this decoy\n var x = random(0,width);\n var y = random(0,height);\n\n // Generate a random number we can use for probability\n var r = random();\n\n var sizeX=random(500,1000);\n var sizeY=random(500,1000);\n\n var ds1x=decoyImage1.width*noise(sizeX);\n var ds2x=decoyImage2.width*noise(sizeX);\n var ds3x=decoyImage3.width*noise(sizeX);\n var ds4x=decoyImage4.width*noise(sizeX);\n var ds5x=decoyImage5.width*noise(sizeX);\n var ds6x=decoyImage6.width*noise(sizeX);\n var ds7x=decoyImage7.width*noise(sizeX);\n var ds8x=decoyImage8.width*noise(sizeX);\n var ds9x=decoyImage9.width*noise(sizeX);\n var ds10x=decoyImage10.width*noise(sizeX);\n var ds1y=decoyImage1.height*noise(sizeY);\n var ds2y=decoyImage2.height*noise(sizeY);\n var ds3y=decoyImage3.height*noise(sizeY);\n var ds4y=decoyImage4.height*noise(sizeY);\n var ds5y=decoyImage5.height*noise(sizeY);\n var ds6y=decoyImage6.height*noise(sizeY);\n var ds7y=decoyImage7.height*noise(sizeY);\n var ds8y=decoyImage8.height*noise(sizeY);\n var ds9y=decoyImage9.height*noise(sizeY);\n var ds10y=decoyImage10.height*noise(sizeY);\n var tix=targetImage.width*noise(sizeX);\n var tiy=targetImage.height*noise(sizeY);\n // Use the random number to display one of the ten decoy\n // images, each with a 10% chance of being shown\n // We'll talk more about this nice quality of random soon enough\n if (r < 0.1) {\n image(decoyImage1,x,y,ds1x,ds1y);\n }\n else if (r < 0.2) {\n image(decoyImage2,x,y,ds2x,ds2y);\n }\n else if (r < 0.3) {\n image(decoyImage3,x,y,ds3x,ds3y);\n }\n else if (r < 0.4) {\n image(decoyImage4,x,y,ds4x,ds4y);\n }\n else if (r < 0.5) {\n image(decoyImage5,x,y,ds5x,ds5y);\n }\n else if (r < 0.6) {\n image(decoyImage6,x,y,ds6x,ds6y);\n }\n else if (r < 0.7) {\n image(decoyImage7,x,y,ds7x,ds7y);\n }\n else if (r < 0.8) {\n image(decoyImage8,x,y,ds8x,ds8y);\n }\n else if (r < 0.9) {\n image(decoyImage9,x,y,ds9x,ds9y);\n }\n else if (r < 1.0) {\n image(decoyImage10,x,y,ds10x,ds10y);\n }\n }\n\n//draw rectangle.\nvar rectangle = {\n x:0,\n y:0,\n w:150,\n h:150,\n color:color(38, 78, 142),\n};\n\nfill(rectangle.color);\nnoStroke();\nrect(rectangle.x,rectangle.y,rectangle.w,rectangle.h);\n\n//draw image of dog we are looking for in the corner.\nvar iconImage = {\n x:rectangle.w/2,\n y:rectangle.h/2,\n};\n\nimage(targetImage, iconImage.x, iconImage.y-20, targetImage.width/1.5,targetImage.height/1.5);\n\n//write the WANTED text\nvar wantedTxt ={\n x:iconImage.x,\n y:iconImage.y,\n};\ntextAlign(CENTER);\ntextSize(32);\nfill(175);\nnoStroke();\n\ntext(\"WANTED\",wantedTxt.x,wantedTxt.y+40)\n\n// Once we've displayed all decoys, we choose a location for the target\ntargetX = random(0,width);\ntargetY = random(0,height);\n\nwhile(targetX<rectangle.w && targetY<rectangle.h){\n console.log(\"OVERLAP\");\n targetX = random(0,width);\n targetY = random(0,height);\n }\n\n // And draw it (this means it will always be on top)\n image(targetImage,targetX,targetY,tix,tiy);\n//define tx, ty for noise value at (t)\n tx=random(0,windowWidth);\n ty=random(0,windowHeight);\n\n}", "function setup() {\n createCanvas(600, 600); // Defines the size of the canvas (width, height) in pixels.\n x = width / 2;\n y = height;\n ds = new PenroseLSystem();\n //please, play around with the following line\n\n ds.simulate(4);\n\n}", "function setup() {\n createCanvas(800, 800);\n smooth();\n //noLoop();\n \n n = 1600;\n \n // put bounding circles\n circles.push(new Circ(-10, height/2, 20));\n circles.push(new Circ(width+10, height/2, 20));\n circles.push(new Circ(width/2, -10, 20));\n circles.push(new Circ(width/2, height+10, 20));\n \n //for (var i=0; i<n; i++) {\n //circles.push(new Circ()); \n //}\n}", "function setup() {\n\n //camelCase, UPPERCASE, lowercase\n\n //crear lienzo para dibujar \n //por defecto es blanco\n //createCanvas(dimHor, dimVer); \n //dimensiones en px\n createCanvas(windowWidth, windowHeight);\n\n //pintar el fondo\n //background(color);\n //1: grayscale, 0 es negro, 255 es blanco\n //2: grayscale + alpha\n //3: rgb, redgreenblue, 0 nada, 255 todo\n //4: rgb + alpha\n //alpha: 0 es transparente, 255 es solido\n background(70, 20, 220, 70)\n \n //framRate (tasa de cuadros por segundo)\n frameRate(8);\n\n //variable local x\n var x\n x = 10\n\n //variable local y\n //modo rapido de DECLARAR\n //y asignar valor inmediatamente \n var y = 10;\n //asignar otro valor\n y = 100;\n\n\n //No borrar las llaves \n}", "function setup() {\n createCanvas(700, 300);\n fft = new p5.FFT();\n \n basso=[50, 50, 45, 45, 47, 47, 43, 43, 44, 44, 38, 38, 44, 44, 46, 46, 50, 50, 45, 45, 47, 47, 43, 43, 44, 44, 38, 38, 44, 44, 46, 46, 50, 50, 45, 45, 47, 47, 43, 43, 44, 44, 38, 38, 44, 44, 46, 46, 50, 50, 45, 45, 47, 47, 43, 43, 44, 44, 38, 38, 44, 44, 46, 46]; // the Basso Continuo\n \n violino=[78, 78, 76, 76, 74, 74, 73, 73, 71, 71, 69, 69, 71, 71, 73, 73, 74, 74, 73, 73, 71, 71, 69, 69, 67, 67, 66, 66, 67, 67, 64, 64, 62, 66, 69, 67, 66, 62, 66, 64, 62, 61, 62, 69, 67, 71, 69, 67, 66, 62, 64, 73, 74, 78, 81, 69, 71, 67, 69, 66, 62, 74, 74, 74]; // the three violine voices are actually the same, just shifted by two bars.\n\ni=0;\ns=0;\nv=[];\nb=new Canon(basso,0); // the basso\n}", "function setup() { //////FIXED\n createCanvas(windowWidth, windowHeight);\n tiger = new Predator(100, 100, 5, color(200, 200, 0), 40); /////FIXED\n antelope = new Prey(100, 100, 10, color(255, 100, 10), 50);\n zebra = new Prey(100, 8, 69, color(255, 255, 255), 60); /////FIXED\n bee = new Prey(100, 100, 20, color(255, 255, 0), 10);\n}", "function setup() {\n createCanvas(600,600);\n noStroke();\n for (let i=0;i<8;i++) {\n steps[i] = i%3\n }\n console.log(steps);\n// let n = 10;\n// console.log('i can fit number 8', floor(n/8), 'times into number', n, 'and the remainder is', n%8);\n// t0 = new Tone.MembraneSynth().chain(reverb)\n\tt0.oscillator.type = 'sine';\n// t0.envelope.attack = 1.1;\n// t0.envelope.decay = 0.1;\n// t0.envelope.sustain = 0.1;\n// t0.envelope.release = 0.1;\n t0.toMaster();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n background(24);\n fill(100);\n textSize(height/30);\n\n numRectangles = 100; // Number of rectangles\n gaussianNumbers = [];\n generations = 50;\n rectWidth = width/numRectangles;\n\n // Populating the gaussianNumbers array with 0's\n for (let i = 0; i < numRectangles; i++) {\n gaussianNumbers[i] = 0;\n }\n}", "function setup() {\r\n\tClearCanvasOnLoop = false;\r\n\r\n\tCanvas.Rectangle((-wid-100),(-hei-100),(wid+100)*2,(hei+100)*2,\"fill\",\"black\")\r\n\tCanvas.ctx.lineWidth = wid/20;\r\n\tfor(let i=0;i<=9;i++) {\r\n\tconst ang1 = AM.map(i-0.2,0,10,0,Math.PI*2);\r\n\tconst ang2 = AM.map(i+0.2,0,10,0,Math.PI*2);\r\n\tconst ang3 = AM.map(i,0,10,0,Math.PI*2);\r\n\tlet p1 = new V2D(Math.cos(ang1)*(wid+wid/20) , Math.sin(ang1)*(hei+hei/20));\r\n\tlet p2 = new V2D(Math.cos(ang2)*(wid+wid/20) , Math.sin(ang2)*(hei+hei/20));\r\n\tlet p3 = new V2D(Math.cos(ang3)*(wid+wid/20) , Math.sin(ang3)*(hei+hei/20));\r\n\r\n\tCanvas.ctx.beginPath();\r\n\tCanvas.ctx.moveTo(p1.x,p1.y);\r\n\tCanvas.ctx.bezierCurveTo(p3.x, p3.y, p3.x, p3.y,p2.x,p2.y);\r\n\tCanvas.ctx.strokeStyle = color[i];\r\n\tCanvas.ctx.stroke();\r\n}\r\n\tCanvas.alpha(0.2);\r\n\r\n\tCanvas.ctx.lineWidth = 1;\r\n}", "function init_conf()\n {\n var to_sconf = {};\n\n //----------------------------------\n // //\\\\ original material parameters\n //----------------------------------\n //var pictureWidth = 928;\n //var pictureHeight = 850;\n var pictureWidth = 1856;\n var pictureHeight = 1700;\n\n //to comply standard layout, one must add these 2 lines:\n var realSvgSize = ( pictureWidth + pictureHeight ) / 6;\n var controlsScale = realSvgSize / sconf.standardSvgSize\n\n var masterCenterX = 850;\n var masterCenterX = 853;\n var masterCenterY = 976;\n var masterCenterY = 978;\n\n var centerX_onPicture = 384;\n var centerY_onPicture = 551;\n var centerY_onPicture = 553;\n\n var mod2inn_scale;\n\n var pointsOnPicture =\n {\n //C : [56, 550],\n C : [50, 550],\n //B : [836, 552],\n B : [838, 552],\n //B : [834, 554],\n P : [548, 77],\n M : [391,634],\n N : [380, 476],\n T : [411, 219],\n O : [centerX_onPicture, centerY_onPicture],\n R : [734, 346],\n AA : [568, 244],\n };\n //----------------------------------\n // \\\\// original material parameters\n //----------------------------------\n\n\n var gamma = Math.PI*0.49;\n var a;\n var beta;\n var alpha;\n\n var initial_g;\n\n ///derives initial model parameters from picture's points\n (function() {\n var pp = pointsOnPicture;\n var B = pp.B;\n var C = pp.C;\n var O = pp.O;\n var M = pp.M;\n var N = pp.N;\n var AA = pp.AA;\n var BC = [ B[0] - C[0], B[1] - C[1] ];\n mod2inn_scale = mat.unitVector(BC).abs;\n var wwb = ( B[0] - O[0] ) / ( B[0] - C[0] ); //0.6\n a = 1 - wwb;\n a = 0.428;\n a = 0.435;\n\n //---sets initial param g\n var OM = [ M[0] - O[0], M[1] - O[1] ];\n initial_Munit = mat.unitVector(OM);\n initial_g = initial_Munit.abs/mod2inn_scale;\n initial_g = 0.105;\n //is an absolute value of an angle:\n gamma = Math.acos( initial_Munit.unitVec[0] ); \n gamma *= 1.01;\n\n //---sets initial decorational param gN\n var ON = [ N[0] - O[0], N[1] - O[1] ];\n initial_Nunit = mat.unitVector(ON);\n to_sconf.initial_gN = -initial_Nunit.abs/mod2inn_scale;\n\n\n var BAA = mat.p1_to_p2( B, AA );\n beta = -Math.asin( BAA.unitVec[1] ); \n beta = 0.862;\n beta = 0.870;\n beta = 0.859;\n beta = 0.863;\n\n //ccc( 'beta fraction=' + (beta/Math.PI).toFixed(3) );\n var CAA = mat.p1_to_p2( C, AA );\n alpha = -Math.asin( CAA.unitVec[1] ); \n alpha = 0.543;\n alpha = 0.528;\n\n //ccc( 'alpha fraction=' + (alpha/Math.PI).toFixed(3) );\n })();\n\n //----------------------------------\n // //\\\\ app view parameters\n //----------------------------------\n // application coordinate Y\n // -1 if it goes in opposite-to-screen\n // direction starting from\n // centerY_onPicture\n // 1 codirectional with the screen\n // which means from screen-top to\n // screen bottom\n var MONITOR_Y_FLIP = -1;\n //var mod2inn_scale = ...\n var activeAreaOffsetOnPictureY = centerY_onPicture;\n //----------------------------------\n // \\\\// app view parameters\n //----------------------------------\n\n\n //----------------------------------------------------\n // //\\\\ prepares sconf data holder\n //----------------------------------------------------\n fapp.normalizeSliders( pictureHeight / 500 ); //todo not automated, prolifer.\n sconf.default_tp_lightness = 30;\n Object.assign( to_sconf, {\n mediaBgImage : \"diagram.png\",\n dontRun_ExpandConfig : true,\n initialPoints : pointsOnPicture,\n\n //CBAng : CBAng,\n gamma : gamma,\n a : a,\n beta : beta,\n alpha : alpha,\n\n initial_g : initial_g,\n\n //----------------------------------\n // //\\\\ model-view parameters\n //----------------------------------\n MONITOR_Y_FLIP : MONITOR_Y_FLIP,\n\n modorInPicY : masterCenterY,\n originX_onPicture : masterCenterX, //needed for common sliders\n originY_onPicture : masterCenterY, //needed for common sliders\n\n modorInPicX : masterCenterX,\n innerMediaHeight : pictureHeight + sconf.SLIDERS_LEGEND_HEIGHT,\n innerMediaWidth : pictureWidth,\n\n thickness : 1,\n //----------------------------------\n // \\\\// model-view parameters\n //----------------------------------\n\n //----------------------------------\n // //\\\\ scenario\n //----------------------------------\n hideProofSlider : true, //false,\n enableStudylab : false,\n enableTools : true,\n //----------------------------------\n // \\\\// scenario\n //----------------------------------\n\n default_tp_stroke_opacity : 0.5,\n default_tp_stroke_width : Math.floor( 10 * controlsScale ),\n defaultLineWidth : Math.floor( 2 * controlsScale ),\n handleRadius : Math.floor( 25 * controlsScale ),\n });\n sconf.pointDecoration.r = sconf.handleRadius;\n\n\n //----------------------------------\n // //\\\\ spawns to_conf\n //----------------------------------\n (function () {\n var inn2mod_scale = 1/mod2inn_scale;\n\n //for Y:\n\n to_sconf.APP_MODEL_Y_RANGE = 1;\n to_sconf.mod2inn_scale = mod2inn_scale;\n to_sconf.inn2mod_scale = inn2mod_scale;\n\n to_sconf.mod2inn_scale_initial = //todm rid\n mod2inn_scale;\n\n to_sconf.inn2mod_scale_initial = inn2mod_scale;\n })();\n //----------------------------------\n // \\\\// spawns to_conf\n // \\\\// prepares sconf data holder\n //----------------------------------------------------\n\n\n\n //----------------------------------------------------\n // //\\\\ copy-pastes to sconf\n //----------------------------------------------------\n Object.keys( to_sconf ).forEach( function( key ) {\n sconf[ key ] = to_sconf[ key ];\n });\n //----------------------------------------------------\n // \\\\// copy-pastes to sconf\n //----------------------------------------------------\n }", "function setup() {\n var canvas = createCanvas(parseInt(document.getElementById(\"sketch-container\").offsetWidth), parseInt(document.getElementById(\"sketch-container\").offsetHeight));\n canvas.parent(\"sketch-container\");\n // creating points and settings for the random movement\n points = [];\n noiseT = [];\n numPoints = document.getElementById(\"num-of-dots\").value;\n var moveSpeed = document.getElementById(\"speed-of-dots\").value\n for (var i = 0; i < numPoints; i++) {\n var tempNoiseX = random(-noiseOffset, noiseOffset);\n var tempNoiseY = random(-noiseOffset, noiseOffset);\n var tempNoiseXplus = random(-moveSpeed, moveSpeed);\n var tempNoiseYplus = random(-moveSpeed, moveSpeed);\n noiseT.push([tempNoiseX, tempNoiseY, tempNoiseXplus, tempNoiseYplus]);\n var tempX = width * noise(noiseT[i][0]);\n var tempY = height * noise(noiseT[i][1]);\n points.push([tempX, tempY]);\n }\n stroke(0, 0, 255);\n background(0);\n noSmooth();\n fill(0, 0, 255);\n}", "function dispSig() {\n mY = (mouseY - (height / 2))\n if (mY < -358) {\n mY = -358\n } //restrict height within graph\n if (mY > -82) {\n mY = -82\n } // restrict height within graph\n //print('mY='+mY)\n mx = mouseX - width / 2;\n for (i = 0; i < N; i++) {\n xx[i] = xs + i * 30 // hori spacing\n ellipse(xx[i], ys, 5)\n line(xx[i], ys, xx[i], ys - 140) //vert lines up\n line(xx[i], ys, xx[i], ys + 140) //vert lines down\n\n line(xs, ys - 20 * i, xs + N * 26, ys - 20 * i) //horiz lines up\n line(xs, ys + 20 * i, xs + N * 26, ys + 20 * i) //horiz lines dn\n }; //end of for loop for plotting small circles\n for (i = 0; i < N; i++) {\n dx = abs(xx[i] - mx)\n\n if (dx < eps) {\n\n ellipse(xx[i], ys, 10);\n push()\n strokeWeight(9); //did the trick!\n stroke(backgnd)\n line(xx[i], ys, xx[i], pmY[i]) //signal bar\n pop()\n push()\n stroke(foregnd)\n strokeWeight(4)\n line(xx[i], ys, xx[i], mY) //signal bar\n pop()\n pmY[i] = mY; // y decreses upwords !\n sig[i] = -(mY - ys);\n }; // end of if block\n }; //end of for loop\n\n}", "function setup() {\r\n\r\n for (var i = 0; i < bar; i++) {\r\n matrix.push([]);\r\n for (var j = 0; j < erk; j++) {\r\n matrix[i][j] = 0;\r\n }\r\n }\r\n\r\n\r\n var c = 0;\r\n while (c < xotCount) {\r\n var x = Math.floor(random(0, erk));\r\n var y = Math.floor(random(0, bar));\r\n if (matrix[y][x] == 0) {\r\n matrix[y][x] = 1;\r\n c++;\r\n }\r\n }\r\n var q = 0;\r\n while (q < eatCount) {\r\n var x = Math.floor(random(0, erk));\r\n var y = Math.floor(random(0, bar));\r\n if (matrix[y][x] == 0) {\r\n matrix[y][x] = 2;\r\n q++;\r\n }\r\n }\r\n var w = 0;\r\n while (w < gishCount) {\r\n var x = Math.floor(random(0, erk));\r\n var y = Math.floor(random(0, bar));\r\n if (matrix[y][x] == 0) {\r\n matrix[y][x] = 3;\r\n w++;\r\n }\r\n }\r\n var r = 0;\r\n while (r < patCount) {\r\n var x = Math.floor(random(0, erk));\r\n var y = Math.floor(random(0, bar));\r\n if (matrix[y][x] == 0) {\r\n matrix[y][x] = 4;\r\n r++;\r\n }\r\n }\r\n var t = 0;\r\n while (t < mardCount) {\r\n var x = Math.floor(random(0, erk));\r\n var y = Math.floor(random(0, bar));\r\n if (matrix[y][x] == 0) {\r\n matrix[y][x] = 5;\r\n t++;\r\n }\r\n }\r\n\r\n\r\n noStroke()\r\n frameRate(60);\r\n createCanvas(matrix[0].length * side, matrix.length * side);\r\n background('#acacac');\r\n\r\n\r\n\r\n for (var i = 0; i < matrix.length; i++) {\r\n for (var j = 0; j < matrix[i].length; j++) {\r\n if (matrix[i][j] == 2) {\r\n var eatgrass = new Eatgrass(j, i, 2);\r\n eatArr.push(eatgrass);\r\n } else if (matrix[i][j] == 1) {\r\n var grass = new Grass(j, i, 1);\r\n xotArr.push(grass);\r\n } else if (matrix[i][j] == 3) {\r\n var gishatich = new Gishatich(j, i, 3);\r\n gishatichArr.push(gishatich);\r\n } else if (matrix[i][j] == 4) {\r\n var pat = new Pat(j, i, 4);\r\n patArr.push(pat);\r\n } else if (matrix[i][j] == 5) {\r\n var mard = new Mard(j, i, 5);\r\n mardArr.push(mard);\r\n }\r\n }\r\n\r\n }\r\n}", "function setup() {\n // Create our canvas\n createCanvas(640,640);\n\n // Start the circle off screen to the bottom left\n // We divide the size by two because we're drawing from the center\n circleX = -circleSize/2;\n circleY = height + circleSize/2;\n\n // Start the square off screen to the bottom right\n // We divide the size by two because we're drawing from the center\n squareX = width + squareSize/2;\n squareY = height + squareSize/2;\n\n //*R Start the rectangle off the left side of the canvas\n //*R The negative width divided by two is to make sure it's first drawn outside the canvas\n //*R We divide the height by 2 to start drawing in the middle of the canvas\n rectX = -rectWidth/2;\n rectY = height/2;\n\n //*R Set the file path for John's head\n johnImg = loadImage(\"assets/images/john.png\");\n //*R Set the size for John\n johnSize = 80;\n\n //*R Set the file path for the prism\n prismImg = loadImage(\"assets/images/prism.png\");\n //*R Start the prism at the top of the canvas\n //*R We divide the width by 2 to start drawing in the center of the canvas\n //*R I'm using the negative value of the image's height divided by 2 to start it off the canvas\n prismX = width/2;\n prismY = -prismImg.height/2;\n\n //*R Set the file path for the javascript logo\n jsLogoImg = loadImage(\"assets/images/jsLogo.png\");\n //*R I'm using the negative value of the image's width divided by 2 to start it off the canvas\n //*R I want to start drawing the logo at 7/8 of the height\n jsLogoX = -jsLogoImg.width/2;\n\n //*R Set the values for the sine wave\n sineSpeed = 0.03;\n sineAngle = 0.0;\n sineScale = 80;\n //*R Set the offset to draw the sine wave, this is the value that the wave is going to \"orbit\"\n sineOffset = 500;\n\n // We'll draw rectangles from the center\n rectMode(CENTER);\n //*R We'll draw images from the center\n imageMode(CENTER);\n // We won't have a stroke in this\n noStroke();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n background(0);\n err[1] = loadImage('images/error1.jpg');\n err[2] = loadImage('images/error2.png');\n err[3] = loadImage('images/error3.png');\n err[4] = loadImage('images/error5.png');\n err[7] = loadImage('images/heaven.jpg');\n err[9] = loadImage('images/furby.png');\n err[5] = loadImage('images/error4.jpg');\n err[6] = loadImage('images/error6.jpg');\n err[8] = loadImage('images/hell.jpg');\n furby = loadImage('images/furby.png');\n xPos=random(windowWidth);\n yPos=random(windowHeight);\n errorWW=random(windowWidth);\n errorWH=random(windowHeight);\n print(\"x Position\" + xPos);\n\n xSpeed= 2;\n ySpeed= 2;\n\n start = true;\n}", "function setup() {\n createCanvas(640, 760);\n\n background(0, 50, 10);\n noStroke();\n rectMode(CENTER);\n\n // Draw the body.\n fill(0, 30, 225);\n ellipse(320, 680, 300, 200);\n rect(320, 840, 300, 300);\n\n // Draw a collar.\n fill(225, 170, 0);\n ellipse(320, 640, 160, 140);\n rect(320, 800, 50, 300);\n\n // Draw the head.\n fill(155, 255, 0);\n ellipse(320, 370, 280, 320);\n ellipse(320, 440, 280, 320);\n rect(320, 580, 100, 100);\n ellipse(320, 630, 100, 100);\n\n // Draw the antenna.\n fill(155, 255, 0);\n rect(320, 200, 30, 200);\n ellipse(320, 80, 70, 70);\n\n // Draw the eye.\n fill(255);\n ellipse(320, 380, 180, 180);\n\n // Draw the ears.\n fill(155, 255, 0);\n ellipse(470, 380, 50, 180);\n ellipse(170, 380, 50, 180);\n\n // Draw the pupil.\n fill(0);\n stroke(155, 255, 0);\n strokeWeight(20);\n ellipse(320, 380, 80, 80);\n\n // Draw the mouth.\n noFill();\n stroke(0, 0, 0);\n strokeWeight(20);\n bezier(400, 520, 360, 560, 280, 560, 240, 520);\n\n // Draw the eyebrow.\n noFill();\n stroke(0, 0, 0);\n strokeWeight(20);\n bezier(380, 280, 360, 240, 280, 240, 260, 280);\n\n // Draw freckles.\n strokeWeight(10);\n point(210, 480);\n point(225, 465);\n point(240, 480);\n point(430, 480);\n point(415, 465);\n point(400, 480);\n\n }", "function setup() {\n createCanvas(windowWidth, windowHeight, WEBGL);\n // Create object\n\n for(var i=0; i < 30; i++){ //loop 5 times\n //put an object in the array for each loop\n // var d=random(100,200);\n // pulse[i] = new Pulser(width/2, height/2, d,d); \n // spirits = new ghost();\n spirits[i] = new ghost();\n }\n\n colorMode(HSB, 360, 100, 100);\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n w = 1600;\n dx = (TWO_PI / period) * xspacing;\n\n\n\n // var step = 0.4;\n}", "function setup() {\n\t// createCanvas must be the first statement\n createCanvas(width, height); \n stroke(255); // Set line drawing color to white\n frameRate(60);\n p_s = [];\n p_s2 = [];\n var sum = 0;\n for (var i = 0; i < 26; i++) {\n p_s[i] = random();\n sum += p_s[i];\n\n var sum2 = 0;\n p_s2[i] = [];\n for (var j = 0; j < 26; j++) {\n p_s2[i][j] = random();\n sum2 += p_s2[i][j];\n }\n\n for (var j = 0; j < 26; j++) {\n p_s2[i][j] /= sum2;\n }\n }\n\n for (var i = 0; i < 26; i++) {\n p_s[i] /= sum;\n }\n}", "function generate_tc() {\n var r1 = 0.05;\n var r2 = 0.1;\n var theta = Math.PI / 6;\n var height = 1;\n var topx = [], topy = [];\n var bottomx = [], bottomy = [];\n for (var i = 0; i < 13; i++) {\n var top_x = r1 * Math.cos(i * theta);\n var top_y = r1 * Math.sin(i * theta);\n var bottom_x = r2 * Math.cos(i * theta);\n var bottom_y = r2 * Math.sin(i * theta);\n topx.push(top_x);\n topy.push(top_y);\n bottomx.push(bottom_x);\n bottomy.push(bottom_y);\n }\n for (var i = 0; i < 12; i++) {\n points.push(topx[i + 1]);\n points.push(topy[i + 1]);\n points.push(height);\n points.push(topx[i]);\n points.push(topy[i]);\n points.push(height);\n points.push(bottomx[i]);\n points.push(bottomy[i]);\n points.push(0.0);\n points.push(topx[i + 1]);\n points.push(topy[i + 1]);\n points.push(height);\n points.push(bottomx[i]);\n points.push(bottomy[i]);\n points.push(0.0);\n points.push(bottomx[i + 1]);\n points.push(bottomy[i + 1]);\n points.push(0.0);\n }\n}", "function setup() {\n // Setting up variables to use for the size of the canvas and colours\n var width = 500;\n var height = 545;\n var bgR = 176;\n var bgG = 126;\n var bgB = 247;\n var hairR = 47;\n var hairG = 7;\n var hairB = 76;\n var beigeR = 252;\n var beigeG = 244;\n var beigeB = 227;\n var brownR = 56;\n var brownG = 37;\n var brownB = 0;\n var shadeR = 244;\n var shadeG = 216;\n var shadeB = 171;\n\n // Set up the canvas with a gradient light purple background\n // In superposed rectangle frames of various sizes.\n createCanvas(width,height);\n background(bgR,bgG,bgB,20);\n noStroke();\n rectMode(CENTER);\n fill(bgR,bgG,bgB,20);\n rect(width/2,height/2,width-25,height-25);\n rect(width/2,height/2,width-25,height-25*5);\n fill(bgR,bgG,bgB,40);\n rect(width/2,height/2,width-25*2,height-25*2);\n rect(width/2,height/2,width-25*2,height-25*4);\n fill(bgR,bgG,bgB,60);\n rect(width/2,height/2,width-25*3,height-25*3);\n fill(bgR,bgG,bgB,80);\n rect(width/2,height/2,width-25*4,height-25*4);\n rect(width/2,height/2,width-25*4,height-25*2);\n fill(bgR,bgG,bgB,100);\n rect(width/2,height/2,width-25*5,height-25*5);\n rect(width/2,height/2,width-25*5,height-25);\n\n // Draw the head\n\n // Draw the dark purple hair with strands on the sides and shadings\n fill(hairR,hairG,hairB);\n arc(width/2,250,330,360,HALF_PI+QUARTER_PI,QUARTER_PI);\n fill(hairR,hairG,hairB,50);\n arc(width/2,250,335,365,HALF_PI+QUARTER_PI-0.01,QUARTER_PI+0.01);\n // Left strand of hair\n fill(hairR,hairG,hairB);\n arc(190,350,110,250,HALF_PI,PI+HALF_PI);\n fill(hairR,hairG,hairB,50);\n arc(190,350,115,255,HALF_PI-0.01,PI+HALF_PI+0.01,OPEN);\n // Right strand of hair\n fill(hairR,hairG,hairB);\n arc(310,350,110,250,PI+HALF_PI,HALF_PI);\n fill(hairR,hairG,hairB,50);\n arc(310,350,115,255,PI+HALF_PI-0.01,HALF_PI+0.01,OPEN);\n\n // Draws the ear beige and shading\n fill(beigeR,beigeG,beigeB);\n ellipse(136,258,50,65);\n // Shading in ear\n stroke(shadeR,shadeG,shadeB,90);\n fill(shadeR,shadeG,shadeB,160);\n ellipse(136,258,35,45);\n\n // Draws the shape of the face in a beige colour with shadings\n //shadings\n ellipse(253,251,241,281);\n fill(beigeR, beigeG, beigeB);\n ellipse(252,250,240,280);\n\n // Draws her right eye\n // White of the eye (lower part)\n fill(250);\n noStroke();\n arc(192,194,100,100,QUARTER_PI,QUARTER_PI+HALF_PI,OPEN);\n // Eyeliner, black outline to the (upper) white of the eye\n stroke(0);\n strokeWeight(3);\n strokeCap(PROJECT);\n arc(192,265,100,100,PI+QUARTER_PI,PI+QUARTER_PI+HALF_PI,OPEN);\n // Iris, dark brown\n stroke(0);\n fill(brownR,brownG,brownB);\n ellipse(192,230,27,27);\n // Pupil, black\n fill(0);\n ellipse(192,230,5,5);\n // Highlight, white\n fill(250);\n noStroke();\n ellipse(182,224,10,10);\n\n // Draws her left eye\n // White of the eye (lower part)\n noStroke();\n arc(310,194,100,100,QUARTER_PI,QUARTER_PI+HALF_PI,OPEN);\n // Eyeliner, black outline to the (upper) white of the eye\n stroke(0);\n strokeWeight(3);\n strokeCap(PROJECT);\n arc(310,265,100,100,PI+QUARTER_PI,PI+QUARTER_PI+HALF_PI,OPEN);\n // Iris, dark brown\n stroke(0);\n fill(brownR, brownG, brownB);\n ellipse(310,230,27,27);\n // Pupil, black\n fill(0);\n ellipse(310,230,5,5);\n // Highlight, white\n fill(250);\n noStroke();\n ellipse(300,224,10,10);\n\n // Draws her dark brown eyebrows\n // Her left eyebrow\n noFill();\n stroke(brownR,brownG,brownB,230);\n strokeWeight(4);\n strokeCap(SQUARE);\n arc(303,260,150,150,PI+QUARTER_PI+0.35,PI+QUARTER_PI+HALF_PI);\n // Her right eyebrow\n arc(199,260,150,150,PI+QUARTER_PI,PI+QUARTER_PI+HALF_PI-0.35);\n\n // Draws dark purple colored hair on top of face (bangs) and shadings\n // Shadings\n noStroke();\n fill(hairR, hairG, hairB,120);\n // Right part shadow\n arc(width/2,251,236,300,PI+0.23,0-QUARTER_PI+0.1,OPEN);\n // Left part shadow\n arc(width/2,251,250,300,PI+HALF_PI+0.3,0-0.24,OPEN);\n fill(hairR, hairG, hairB);\n // Right part hair\n arc(width/2,250,280,320,PI+0.15,0-QUARTER_PI+0.1,OPEN);\n // Left part hair\n arc(width/2,250,280,320,PI+HALF_PI+0.2,0-0.1,OPEN);\n\n // Draws a nose by shadow outline\n fill(shadeR, shadeG, shadeB);\n // Top shadow\n triangle(267,299,253,252,271,292);\n // Bottom shadow\n triangle(247,303,270,290,266,300);\n\n // Draws a dark brown beauty mark\n noStroke();\n fill(brownR, brownG, brownB);\n ellipse(330,330,5,5);\n\n // Draws a mouth\n // Inside of mouth, dark pink\n fill(221, 108, 108);\n arc(width/2,330,65,60,0-0.2,PI+0.2,CHORD);\n // Tongue, light pink\n fill(255, 183, 183);\n arc(229,389,100,100,PI+QUARTER_PI+0.2,0-QUARTER_PI+0.4,OPEN);\n // Teeth, white\n fill(250);\n arc(width/2,271,132,132,QUARTER_PI+0.15,HALF_PI+QUARTER_PI-0.15,OPEN);\n // Shape corretion, beige\n strokeWeight(20);\n stroke(beigeR, beigeG, beigeB);\n noFill();\n arc(width/2,324,86,94,0-0.2,PI+0.2,CHORD);\n\n // Draws lips with red lipstick\n strokeWeight(2);\n stroke(221, 79, 79);\n noFill();\n arc(width/2,330,65,60,0-0.2,PI+0.2,CHORD);\n}", "function setup() {\n //store window width and height for sizing the canvas later\n canvasWidth = windowWidth-125;\n canvasHeight = windowHeight-200;\n \n //calculate constant attractor and particle density, based on screen size\n attractorDensity = Math.floor(1/13000*canvasWidth*canvasHeight);\n particleNumberLimit = Math.floor(1/8000*canvasWidth*canvasHeight);\n \n //associate canvas with #canvas object in the DOM\n var canvas = createCanvas(canvasWidth,canvasHeight);\n \n //change refresh rate to 30 frames/second\n frameRate(30);\n \n //set color mode hue(0-360) saturation(0-100) brightness transparency\n colorMode(HSB,360,100,100,1);\n \n //and background color\n background(240,100,15,0.2);\n \n //create a set of GeneralAttractors with the right density\n for (var i=0; i<attractorDensity; i++){\n \n //create a new instance, push it into the attractors array\n var at = new GeneralAttractor(createVector\n (canvasWidth*Math.random(),canvasHeight*Math.random()),5);\n attractors.push(at);\n }\n\n //add a group of AttractorA attractors as well\n for (var i=0; i<attractorDensity; i++){\n \n var attA = new AttractorA(createVector\n (canvasWidth*Math.random(),canvasHeight*Math.random()),5);\n attractors.push(attA);\n }\n \n}", "function setup() {\n\ncreateCanvas(640,480);\n\n// Set the background to green.\nbackground(178,224,121);\nnoStroke();\n\n// Draw the color gradient effect behind Centella.\n\nnoStroke();\n\nfill(76,14,115);\ncircle(320,220,360);\n\nfill(66,14,115);\ncircle(320,220,350);\n\nfill(53,14,115);\ncircle(320,220,340);\n\nfill(39,14,115);\ncircle(320,220,330);\n\nfill(14,27,115);\ncircle(320,220,320);\n\nfill(14,46,115);\ncircle(320,220,310);\n\nfill(14,75,115);\ncircle(320,220,300);\n\nfill(14,100,115);\ncircle(320,220,290);\n\nfill(14,115,115);\ncircle(320,220,280);\n\nfill(14,115,91);\ncircle(320,220,270);\n\nfill(14,115,73);\ncircle(320,220,260);\n\nfill(14,115,59);\ncircle(320,220,250);\n\nfill(14,115,33);\ncircle(320,220,240);\n\nfill(22,115,14);\ncircle(320,220,230);\n\nfill(63,115,14);\ncircle(320,220,220);\n\nfill(81,115,14);\ncircle(320,220,210);\n\nfill(105,115,14);\ncircle(320,220,200);\n\nfill(212,224,34,40);\ncircle(320,220,190);\n\nfill(224,227,34,50);\ncircle(320,220,190);\n\nfill(227,166,34,90);\ncircle(320,220,180);\n\nfill(227,98,34,100);\ncircle(320,220,170);\n\nfill(34,227,227,150);\ncircle(320,220,160);\n\nfill(185,34,227,190);\ncircle(320,220,150);\n\nfill(227,34,114,180);\ncircle(320,220,140);\n\nfill(105,227,34,190);\ncircle(320,220,130);\n\nfill(69,34,227,200);\ncircle(320,220,120);\n\nfill(224,227,34,220);\ncircle(320,220,110);\n\nfill(227,34,34);\ncircle(320,220,104);\n\n// Draw the body of Centella.\nfill(164,129,235,60);\nellipse(320,480,230,290);\n\nfill(164,129,235,100);\nellipse(320,480,215,290);\n\nfill(164,129,235);\nellipse(320,480,200,300);\n\n// Draw the translucent hovering neck.\nfill(222,212,252);\nellipse(320,325,100,10);\n\nfill(207,255,204,90);\nrect(270,295,100,30);\n\nfill(222,212,252);\nellipse(320,295,100,10);\n\nfill(222,212,252,150);\nellipse(320,325,100,10);\n\n// Draw the head of Centella.\n\nfill(222,212,252);\nellipse(320,196,120,150);\n\n// Draw the eyes of Centella.\n\nstroke(74,92,84, 150);\nline(270,180,300,180);\nline(340,180,370,180);\n\nfill(255,255,255,100);\nnoStroke();\narc(285,194,30,50,150, PI + QUARTER_PI, OPEN);\narc(355,194,30,50,150, PI + QUARTER_PI, OPEN);\n\nfill(167,222,91, 150);\nnoStroke();\narc(300,181,40,50, HALF_PI,PI);\narc(370,181,40,50, HALF_PI,PI);\n\nfill(255, 51, 51,180);\nnoStroke();\narc(300,181,25,40, HALF_PI, PI);\narc(370,181,25,40, HALF_PI, PI);\n\nfill(51,245,255);\narc(300,181,20,30, HALF_PI, PI);\narc(370,181,20,30, HALF_PI, PI);\n\n// Draw the mouth of Centella.\n\n\n// Draw the hair of Centella.\nellipseMode(RADIUS);\nfill(102,59,49);\nnoStroke();\nellipse(320,100,40,30);\nellipse(265,120,45,35);\nellipse(290,125,40,20);\nellipse(240,140,40,30);\nellipse(225,210,40,30);\nellipse(229,175,40,30);\nellipse(365,125,40,20);\nellipse(380,115,40,30);\nellipse(405,150,40,30);\nellipse(415,180,40,30);\nellipse(415,210,40,30);\n\n\n\n}", "function init() {\n for(let i = K; i <= 5 * N; i += delta) {\n M.push(i);\n }\n drawSvgContainer(svgWidth, svgHeight, svgMargin);\n drawAxes(xAxisLength, yAxisLength, startPoint, scale);\n task1();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n // Extra comma inside the first parenthesis.\n tiger = new Predator(100, 100, 5, color(200, 200, 0), 40);\n antelope = new Prey(100, 100, 10, color(255, 100, 10), 50);\n // Missing the y position value. I assigned 100 to y parameter\n // so that the Zebra will have an intial value for y position just like other objects.\n zebra = new Prey(100, 100, 8, color(255, 255, 255), 60);\n bee = new Prey(100, 100, 20, color(255, 255, 0), 10);\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n setStationLocations();\n initDots();\n}", "function setup (){\n \n pjCol = 0; //pixeles\n pjFill = 0; // pixeles\n xPos = (pjCol * 40)+ 20;\n xPos = (pjFill * 40)+ 20;\n\n\n// Crear arreglo de arreglos\nfor (let index = 0; index < 20; index ++){\n\n mapa.push (new Array(20));\n}\n\n//Asignar valores iniciales\nfor (let fill = 0; fill < 20; fill++){\n for (let col = 0; col < 6; col++){\n mapa [fill][col] = 0;\n }\n}\n\n//seleccionamos algunos [fill][col] --> y, x\nmapa [0][0] = 1;\nmapa [0][1] = 1;\nmapa [0][4] = 1;\nmapa [0][5] = 1;\nmapa [1][0] = 1;\nmapa [1][1] = 1;\nmapa [1][4] = 1;\nmapa [1][5] = 1;\nmapa [2][0] = 1;\nmapa [2][1] = 1;\nmapa [2][4] = 1;\nmapa [2][5] = 1;\nmapa [3][4] = 1;\nmapa [4][4] = 1;\nmapa [3][5] = 1;\n \n}", "function setupPrey() {\n preyX = width/5;\n preyY = height/2;\n preyVX = -preyMaxSpeed;\n preyVY = preyMaxSpeed;\n preyHealth = preyMaxHealth;\n\n}", "function setup() {\n // log the whole dataset to the console so we can poke around in it\n // print(table)\n\n // print(above3000m)\n // print(below3000m)\n // print(above6000m)\n // print(below6000m)\n // print(otherExposures)\n print(highyears)\n\n\n\n // do initialization\n var plotwidth = canvaslx * 0.5;\n var plotheight = canvasly * 0.5;\n var x = xzero;\n var y = 100\n var rowweight = 20\n var barfrac = 1;\n // var colWidth = 10\n\n\n\n\n // set up typography\n textFont(\"Calibri Light\")\n textSize(16)\n fill(30)\n noStroke()\n\n\n\n createCanvas(canvaslx, canvasly)\n background(\"#FEFCF5\") //(\"#FEFCF0\")\n // c1 = color(255, 204, 0);\n // c1 = color(100, 100, 100);\n // c2 = color(255);\n // setGradientTop(c1, c2);\n // setGradientBottom(c1,c2);\n\n\n\n\n\n\n\n\n // ---------------------------Plot #bottom bottom---------------------------\n xx = xd\n yy = ye\n ww = xe - xd;\n hh = ye - yd - ypadding1 * 5;\n majorint = 5;\n bb = barfrac * 0.2;\n szescale = 0.075;\n yscale = 1;\n // data xstrt y wdth hgt rowcount majorgridlines\n drawgrid(table, xd, yy, ww, hh, table.getRowCount(), majorint);\n\n textStyle(NORMAL);\n textAlign(CENTER);\n textSize(16);\n stroke(0);\n fill(0);\n text('Nuclear Test Altitudes with Atomic Yields', (xd + ww / 2), ye - hh - ypadding1)\n text('Year of Test', (xd + ww / 2), ye + ypadding1 * 4)\n xaxislabel(table, \"WorldExternal\", xx, yy + ypadding1, ww, hh, 12, 0, 1, '#e00', 5)\n yaxislabel('Height of Burst (km)', xx-25, yy, ww, hh, 12)\n // data value x y w h scl or strW str fill palette \n var palette = getpalette(table, [\"WorldExternal\", \"WorldIngestiona\", \"WorldInhalation\", \"WorldTotal\"], \"BuPu\", 9);\n // bubblePlot(table, \"WorldExternal\", xx, yy, ww, hh, szescale, 0, 0.2, '#000', palette)\n // bubblePlot(table, \"WorldIngestiona\", xx, yy, ww, hh, szescale, 0, 0.2, '#000', palette)\n // bubblePlot(table, \"WorldInhalation\", xx, yy, ww, hh, szescale, 0, 0.2, '#000', palette)\n\n // print(pallet)\n // (tabinput, colName, x, y, wdth, hgt, zerorat scal scal, offset,strkWght, strkClr, palette)\n stroke(0);\n fill(0);\n bubblePlot(below3000m, \"YEAR\", \"HOB\", \"YIELD\", \"MON_NUM\", xx, yy, ww, hh, 1, yscale, szescale, 0, 0.2, '#000', palette)\n strokeWeight(1);\n stroke(0);\n yaxistics(below3000m, \"YEAR\", \"HOB\", xx, yy, ww, hh, 1000,360/2,0.001,0.4 ,\"#000\",8)\n\n\n\n\n\n\n\n\n\n // ---------------------------Plot middle---------------------------\n xx = xd\n yy = yd\n ww = xe - xd;\n hh = yd - yc;\n majorint = 5;\n bb = barfrac * 0.2;\n // data xstrt y wdth hgt rowcount majorgridlines\n drawgrid(table, xd, yy, ww, hh, table.getRowCount(), majorint);\n textStyle(NORMAL);\n textAlign(CENTER);\n textSize(16);\n stroke(0);\n fill(0);\n text('Radiation Fallout Worldwide Average Exposure (UNSCEAR 2000)', (xd + ww / 2), yy - hh - ypadding1)\n xaxislabel(table, \"Years\", xx, yy + ypadding1, ww, hh, 12, 0, 1, '#e00', 5)\n yaxislabel('Radiation (mSv)', xx-25, yy, ww, hh, 12)\n\n // linegraph(table,\"NH_Total\",xx,yy,ww,hh,bb,0,1,'#777')\n // linegraph(table,\"NH_Inhalation\",xx,yy,ww,hh,bb,0,1,'#ggg')\n linegraph(table, \"WorldTotal\", xx, yy, ww, hh, bb, 0, 1, '#000')\n // scale stroke strkclr\n yaxistics(table, \"Year\", \"WorldTotal\", xx, yy, ww, hh, 20, 0,0.001,0.4 ,\"#000\",8)\n //\"Year\", \"NH_External\", \"NH_Ingestional\", \"NH_Inhalation\", \"NH_Total\", \n // \"SH_External\", \"SH_Ingestional\", \"SH_Inhalation\", \"SH_Total\", \n //\"WorldExternal\", \"WorldIngestiona\", \"WorldInhalation\", \"WorldTotal\"\n\n\n\n\n\n\n\n\n\n\n\n\n // ---------------------------Plot left #left---------------------------\n xx = xb\n yy = ye - ypadspecial1;\n ww = xc - xb;\n hh = ye - yb - ypadspecial1;\n majorint = 3;\n bb = barfrac * 0.2;\n szescale = 0.075;\n yscale = 1;\n // data xstrt y wdth hgt rowcount majorgridlines\n // print(xx);\n // print(hh)\n // print(xc)\n // drawgrid(highyears, xx, yy, ww, hh, highyears.getRowCount(),majorint);\n textStyle(NORMAL);\n textAlign(CENTER);\n textSize(16);\n stroke(0);\n fill(0);\n text('Peak Test Years:\\n High Altitudes and Yields', (xb + ww / 2 + xb/4), yy - hh -16 - ypadding1);\n xaxislabel(highyears, \"YEAR\", xx, yy + ypadding1*2, ww, hh, 12, 0, 1, '#e00', majorint);\n yaxislabel('Height of Burst (km)', xx-25, yy, ww, hh, 12);\n // data value x y w h scl or strW str fill palette \n var palette = getpalette(table, [\"WorldExternal\", \"WorldIngestiona\", \"WorldInhalation\", \"WorldTotal\"], \"BuPu\", 9);\n // (tabinput, colName, x, y, wdth, hgt, zerorat scal scal, offset,strkWght, strkClr, palette)\n bubblePlot(gapHighyears, \"YEAR\", \"HOB\", \"YIELD\", \"MON_NUM\", xx, yy, ww, hh, 0, yscale, szescale, 0, 0.2, '#000', palette)\n\n // bubblePlot(below3000m, \"YEAR\",\"HOB\",\"YIELD\",\"MON_NUM\", xx, yy, ww, hh, 1 , yscale ,szescale, 0, 0.2, '#000', palette)\n yaxistics(gapHighyears, \"YEAR\", \"HOB\", xx, yy, ww, hh, 100000, 1375/2,0.001,0.4 ,\"#000\",8)\n stroke('#999');\n // var thislimit = 50;\n // line(xx,yy-thislimit,xx+ww,yy-thislimit)\n\n // stroke(0);\n\n\n\n\n\n\n\n\n\n\n\n // ---------------------------------------Plot right #right\n\n\n xx = xf\n yy = yd;\n ww = xg - xf;\n hh = yd - yb;\n majorint = 2;\n bb = barfrac * 0.5;\n szescale = 0.075;\n yscale = 1;\n\n\n drawgrid(otherExposures, xf, yd, ww, hh-ypadding2, otherExposures.getRowCount(), majorint);\n textStyle(NORMAL);\n textAlign(CENTER);\n textSize(16);\n stroke(0);\n fill(0);\n text('Comparative Local Fallout and \\n other sources of radiation', (xf + ww / 2), yd - hh - ypadding1)\n textStyle(NORMAL);\n textAlign(RIGHT);\n // xaxislabel(otherExposures, \"Years\", xx, yy+ypadding1, ww, hh, 12, 0, 1, '#e00',5)\n yaxislabel('Radiation (mSv)', xx-25, yy, ww, hh, 12)\n yaxistics(otherExposures, \"Place\", \"mSv\", xx, yy, ww, hh -ypadding2, 20, 0,1,0.4 ,\"#000\",8)\n \n \n print(\"Otherexposures \" + otherExposures)\n barplotColumn(otherExposures, \"mSv\", xf, yd, ww, hh -ypadding2, bb, 0.5, '#e00')\n // barplotColumn(table,\"WorldIngestiona\",xx,yy,ww,hh,bb,1,'#0e0')\n // barplotColumn(table,\"WorldInhalation\",xx,yy,ww,hh,bb,2,'#00e')\n var thislimit = 133;\n line(xx,yy-thislimit,xx+ww,yy-thislimit)\n\n\n\n\n\n\n // Text\n\n\n stroke(50)\n fill(50)\n strokeWeight(0.1)\n textFont(fontBody)\n textSize(14)\n textAlign(LEFT)\n let s = 'Atmospheric radioactive fallout from nuclear weapons testing reached \\\n its peak in 1963 after an initial moratorium on testing temporarily failed. \\\n However radiation was dramatically reduced after the signing of the Partial \\\n Test Ban Treaty (PTBT) in 1963. The treaty banned nuclear tests in the atmosphere, \\\n outer space and under water, which mostly kept subsequent nuclear bomb tests \\\n underground. However, not all nations signed the treaty and some Countries continued atmospheric \\\n nuclear testing. France conducted its last atmospheric test in 1974 and China in 1980. \\\n Underground testing did not prove to be entirely safe and some containment \\\n failures occurred through venting and seepage. Human populations close to test sites \\\n were mostly at risk of local exposure to nuclear radiation, but radiation containment failures \\\n and fear of global radiation exposure kept nuclear testing in the public eye.\\\n Subsequently the Comprehensive Test Ban Treaty (CTBT) aims to stop all \\\n nuclear tests; even those under ground.';\n text(s, xd, yb + ypadding1 * 4, xe - xd, yc - yb); // Text wraps within text box\n\n textFont('Helvetica')\n textAlign(CENTER)\n textSize(20)\n // let t = \"Radiation fallout effects of atmospheric and upper atmospheric Nuclear testing\"\n let t = \"ATMOSPHERIC AND UPPER ATMOSPHERIC NUCLEAR TESTS \\n AND THEIR WORLDWIDE FALLOUT\"\n text(t, canvaslx / 2, ypadding1 * 4); // Text wraps within text box\n\n\n\n\n\n\n // for (var i=0; i<years.length; i++){\n // // draw the box\n // var color = palette.colorForValue(totals[i])\n // fill(color)\n // rect(x, y, dim, dim)\n\n // // draw the year number on top\n // fill('white')\n // text(years[i], x+dim*.5, y+dim*.6)\n // x+=dim\n // }\n\n\n\n // // draw country name labels on the left edge of the table\n // // textStyle(BOLD)\n // // textAlign(RIGHT)\n // // for (var c=0; c<table.countries.getRowCount(); c++){\n // // var country = table.countries[c]\n // // text(country, x-colWidth, y)\n // // y += rowHeight\n // // }\n\n\n\n\n\n\n\n\n // // --------------------draw linegraph\n // strokeWeight(lineweight);\n // stroke(linestroke);\n // var x2 = xzero;\n // for (var i=0; i < (table.Year.getRowCount()-1); i++){\n\n // var thisinfo = table.Year[i] // grab the data\n // var nextinfo = table.Year[i+1] // grab the next data\n // var thisyearund = 0; \n // var nextyearund = 0; \n // var colwidth = canvaslx/table.Year.getRowCount();\n // // calculate totals one column at a time---------------------------\n // table.countries.forEach(function(country){\n // thisyearund += thisinfo.details[country].underground;\n // nextyearund += nextinfo.details[country].underground;\n // print(thisyearund + ' ' + nextyearund + ' ' + colwidth)\n // })\n // line(x2,yzero+thisyearund,x2+colwidth,yzero+nextyearund)\n // x2 += colwidth;\n // }\n\n\n // textStyle(NORMAL)\n // textAlign(CENTER)\n // stroke(230);\n // strokeWeight(0.5);\n // fill(230)\n // text('TOTAL AMOUNT OF NUCLEAR TESTS PER YEAR', canvaslx/2,20);\n\n // legend(900,50,barwidth)\n // ylabel()\n\n\nlegendnew(xe,ye)\n\nannotations();\n\n // save('mysketch.svg')\n\n}", "function init()\n {\n particleArray = [];\n\n for (let y = 0, y2 = data.height; y < y2; y++)\n {\n for (let x = 0, x2 = data.width; x < x2; x++)\n {\n if (data.data[(y * 4 * data.width) + (x * 4) + 3] > 128)\n {\n let positionX = x;\n let positionY = y;\n let color = \"rgba(\" + data.data[(y * 4 * data.width) + (x * 4)] + \",\" + \n data.data[(y * 4 * data.width) + (x * 4) + 1] + \",\" + \n data.data[(y * 4 * data.width) + (x * 4) + 2] + \")\"; \n particleArray.push(new Particle(positionX * 4, positionY * 4, color));\n\n }\n }\n }\n }", "function setup() {\n createCanvas(windowWidth, windowHeight);\n\n x_hour = width/4;\n x_min = width/2;\n x_sec = (width/4)*3;\n\n yPos = height/2;\n}", "function setupPrey() {\n preyX = width/5;\n preyY = height/2;\n preyVX = -preyMaxSpeed;\n preyVY = preyMaxSpeed;\n preyHealth = preyMaxHealth;\n tx = random(0,1000);\n ty = random(0,1000);\n}", "function setup() {\n\n // set pixel resolution\n pixelDensity(1);\n\n canvas = createCanvas(windowWidth, windowHeight);\n\n // set text properties\n textAlign(CENTER);\n fill(255, 255, 255, 60);\n textSize(width * 0.67 / textWidth('this text fits 67% of the canvas width') * textSize());\n\n bar = new HueBar(width / 2, height / 2, 30, height / 4, 255, 150);\n\n dev_mic = new p5.AudioIn(startMicError);\n \n // mic used to pick a color\n mic1 = new Mic(dev_mic, 0, true, 0.015, 0.3);\n\n // mic used to control brush\n mic2 = new Mic(dev_mic, 50, true, 0.015, 0.5);\n\n // mic must be started by an user gesture\n canvas.mousePressed(startMicGesture);\n startMicMsg();\n\n phase = 0;\n brush = new Brush();\n layer = new Layer();\n\n // timer used to pickColor\n timer1 = new Timer(15000, startPaint);\n\n // timer used to finish painting\n timer2 = new Timer(5000, finishPaint);\n\n // timer used to contemplation\n timer3 = new Timer(10000, fadeOut);\n\n // timer used to fade out\n timer4 = new Timer(3000, newPaint);\n\n //fft = new p5.FFT();\n //start();\n}", "function setup() {\nnoStroke();\n createCanvas(1000,1000);\n background(0,0,255,200);\n\nrectMode(CENTER);\nellipseMode(CENTER);\n\n//sun\nfill(249,255,84);\nellipse(0,0,300,300);\n\nfill(249,255,84,200);\nellipse(0,0,400,400);\n\nfill(249,255,84,150);\nellipse(0,0,500,500);\n\nfill(249,255,84,100);\nellipse(0,0,600,600);\n\nfill(249,255,84,50);\nellipse(0,0,700,700);\n\n//clouds\nfill(255,255,255,100);\nellipse(800,100,600,200);\nellipse(300,500,1000,200);\nellipse(570,140,400,150);\n\n//hair\n fill(255,0,0);\n rect(500,750,420,500);\n\n//face\nfill(245,245,220);\nellipse(500,500,400,400);\n\n//hair\nnoFill();\nstrokeWeight(40);\nstroke(255,0,0);\nellipse(500,600,400,630);\n\nrectMode(CENTER)\n\n//neck\nfill(245,245,220);\nnoStroke();\nrect(500,750,200,500);\n\n//body\nfill(100,0,100);\nellipse(500,1000,500,600);\n\n//neckline\nfill(245,245,220);\nellipse(500,730,200,200);\n\n//mouth\nfill(0);\nellipse(500,600,40,40);\nfill(245,245,220);\nrect(500,580,40,40);\n\n//eyes\nfill(255);\nellipse(400,500,60,60);\nellipse(600,500,60,60);\nfill(0);\nellipse(400,500,10,10);\nellipse(600,500,10,10);\n\n}", "function setup() {\n createCanvas(641, 904);\n angleMode(DEGREES);\n\n //Seting the variable of the cordinates of y so the shapes can move up and down,\n //for both Left side and right side.\n yLeftbrow = 336; \n yRightbrow = 381;\n\n }", "function setup() {\n createCanvas(640, 800);\n // alignSlider = createSlider(0, 3, 1.5, 0.1);\n // cohesionSlider = createSlider(0, 3, 1.5, 0.1);\n // seperationSlider = createSlider(0, 3, 1.5, 0.1);\n // deadCount = 0;\n // surviveCount = 0;\n force = new Force();\n for (let i = 0; i < 100; i++){\n obstacles.push(new Obstacle(i));\n }\n\n for (let i = 0; i < 100; i++){\n particles.push(new Particle());\n }\n}", "function testPF (p, inc, pnc, mnc) {\n var M = parseInt(p) // Number of particles\n var P0 = inc // Initial noise covariance\n var Q = pnc // Process noise covariance\n var R = mnc // Measurement noise covariance\n var x = math.zeros(1, 100)\n var y = math.zeros(1, 100)\n x.subset(math.index(0, 0), math.multiply(math.sqrt(P0), randn(1, 1).subset(math.index(0, 0))))\n y.subset(math.index(0, 0), (h(math.matrix([[x.subset(math.index(0, 0))]])).subset(math.index(0, 0)) + math.sqrt(R) + randn(1, 1).subset(math.index(0, 0))))\n\n for (let t = 1; t < 100; t++) {\n x.subset(math.index(0, t), (f(math.matrix([[x.subset(math.index(0, t - 1))]]), (t - 1)).subset(math.index(0, 0)) + math.multiply(math.sqrt(Q), randn(1, 1).subset(math.index(0, 0)))))\n y.subset(math.index(0, t), (h(math.matrix([[x.subset(math.index(0, t))]])).subset(math.index(0, 0)) + math.multiply(math.sqrt(R), randn(1, 1).subset(math.index(0, 0)))))\n }\n\n store.commit('setMatrixTrue', x)\n var xhat = xhatPF(Q, P0, M, y)\n\n return xhat\n}", "function setup() {\n\ncreateCanvas(600, 400);\n \nball1= new Ball(width/2, 0, 20, 2, 255, 140, 101, 175);// start ball at 100, with size of 20 pixels\nball2= new Ball (width/2, 0, 10, 3, 101, 255, 220, 170);\nball3= new Ball(width/2, random(height), 5, 5, 217, 25, 175);\nball4= new Ball(width/2, random(height), 12, 8, 174, 255, 170);\nball5= new Ball (width/2, random(height), random(5,20), 6, 255, 243, 31, 185);\nball6= new Ball(width/2, 0, 20, 2, 255, 140, 101, 200);\n\n\nfor (var d=0; d<20; d++){ //setting up for array of dots\n dots[d]= new Jiggle (d, 0, 20+d, 100);\n}\n\n//drop1= new Square (50, 25);//initialize drop 1 object\n//drop2= new Square (random(10, 30), 125);// initialize drop 2 object\n/*\nfor (var i=0; i< width; i++) { //initialize dot object at bottom of screen, radius 40 pixels, color white?\n dot= new Fallup (i, height, 40, 255);\n}\nball2=new Ball(random(0,width/2), random(100), random(10,15),6, 140);\ndot2= new Fallup(random(width), random(height), random(50,100), random(255));\ndrop3= new Square (random(100,200), random(255));\nball3= new Ball(random(width/2, width), height/2, 75, -2, 255);\nfor (var d=0; d<10; d++){ //setting up for array of dots\n dots[d]= new Fallup (d, width/2, 25, 100);\n}*/\n}", "function setup(){\n createCanvas(800,600);\n var bounceX = float(x);\n var bounceY = float(y);\n var plusX = int(xAdd);\n var plusY = int(yAdd);\n var ballDia = int(ballWidth); //dia = diameter\\\n\n}", "function setupPrey() {\n preyX = width / 5;\n preyY = height / 2;\n preyVX = -preyMaxSpeed;\n preyVY = preyMaxSpeed;\n preyHealth = preyMaxHealth;\n}", "function setupPrey() {\n preyX = width / 5;\n preyY = height / 2;\n preyVX = -preyMaxSpeed;\n preyVY = preyMaxSpeed;\n preyHealth = preyMaxHealth;\n}", "function setupCanvas(){\n\tctx.clearRect(0, 0, canvas.width, canvas.height);\n\tctx.strokeStyle = \"#222\";\n\tvar spacing = 20;\n\t// draws gridlines\n\tfor( var i=spacing; i< 800; i+=spacing ){\n\t\tctx.beginPath();\n\t\tctx.moveTo(0, i);\n\t\tctx.lineTo(800,i);\n\t\tctx.closePath();\n\t\tctx.stroke();\n\t\t\n\t\tctx.beginPath();\n\t\tctx.moveTo(i,0);\n\t\tctx.lineTo(i,800);\n\t\tctx.closePath();\n\t\tctx.stroke();\n\t}\n\t\n\t// center dot\n\tctx.fillStyle = \"#555\";\n\tctx.beginPath();\n\tctx.arc(400, 400, 3, 0, 2*Math.PI, true);\n\tctx.closePath();\n\tctx.fill();\n\t\n\t// circles at 1 AU, 2 AU\n\tctx.strokeStyle = \"#555\";\n\tfor( var i=1; i<3; i++ ){ \n\t\tctx.beginPath();\n\t\tctx.arc(400, 400, i*metersPerAU/metersPerPixel, 0, 2*Math.PI, true);\n\t\tctx.closePath();\n\t\tctx.stroke();\n\t}\n}", "function setup() {\n createCanvas(640,480);\n\n background(0,0,0);\n\n noStroke();\n\n // body\n fill(70, 94, 68);\n ellipse(320,480,300,200);\n\n // head\n fill(225, 235, 28);\n ellipse(320,240,250,350);\n ellipse(320,60,40,35);\n\n //eyes\n fill(255,255,255);\n ellipse(260,240,70,25);\n ellipse(260,240,70,25);\n ellipse(390,240,70,25);\n fill(0);\n ellipse(260,240,5,5);\n ellipse(390,240,5,5);\n\n //nostrils\n fill(0);\n ellipse(290,300,15,15);\n ellipse(350,300,15,15);\n\n //mouth\n fill(117, 48, 68);\n stroke(0);\n ellipse(320,390,20,20);\n\n}", "function setup(){\n createCanvas(windowWidth, windowHeight);\n rectMode(CENTER);\n ellipseMode(CENTER);\n rand = false;\n rotation = 0;\n rotFactor = 0.06;\n col = document.getElementById(\"color_picker\");\n \n myCenter = new Center(windowWidth/2, windowHeight/2, center_size, 255, ellipse);\n for(let i=0; i<num_dots; i++){\n myDots[i] = new Dot(myCenter.x, myCenter.y, random(-10, 10), random(-10, 10), 20, 255, ellipse);\n }\n}", "function setup() {\n createCanvas(1000, 400);\n textFont(\"Courier\"); \n textAlign(LEFT);\n textSize(16);\n strokeWeight(0.1);\n\n // Train(color c_, float xpos_, float ypos_, float xspeed_, int serial_, float offset_, int direction_) \n\n for (var i = 0; i < trainLength; i++ ) {\n redtrains.push(new Train(color(250, 120, 120), width/2 - 4 - 70*i, 60, -1, i+1, i*.02, -1));\n }\n for (var i = 0; i < trainLength; i++ ) {\n bluetrains.push(new Train(color(120, 120, 250), width/2 + 4 + 70*i, 100, 1, i+1, i*.02, 1));\n }\n}", "function setup() {\r\n canv = createCanvas(800,600);\r\n button = createButton('Save Image');\r\n button.position(50,dims[1] + 25);\r\n button.attribute(\"onclick\",\"saveImage()\");\r\n\r\n background(color('rgba(169,169,169,.5)'));\r\n textSize(18);\r\n stroke(0);\r\n fill(0);\r\n line(50,550,750,550);\r\n triangle(750,545,750,555,760,550);\r\n line(50,50,50,550);\r\n triangle(45,50,55,50,50,40);\r\n text(\"x2\",45,25);\r\n text(\"x1\",769,555);\r\n\r\n HorizDotLine(300,300);\r\n VertiDotLine(300,300);\r\n\r\n\r\n text(\"0\",295,575);\r\n text(\"2\",30,305);\r\n\r\n\r\n\r\n\r\n // Create the grid lines\r\n\r\n //stroke(\"blue\");\r\n //drawVector(a,origin); // Draw 'a' at the origin\r\n\r\n //stroke(\"green\");\r\n //drawVector(b,toCoords(a)); // Draw 'b' at 'a'\r\n\r\n //stroke(\"yellow\");\r\n //drawVector(c,origin); // Draw 'c' (a+b) at the origin\r\n\r\n //stroke(\"pink\");\r\n //scatter(points); // Draw the scatter plot\r\n\r\n //stroke(\"red\");\r\n // Graph the function, where 2,5,1 represents amplitude, angular frequency, and y-offset respectively.\r\n}", "function setup() {\n createCanvas(500,500);\n background(200,0,20);\n noStroke();\n //head\n fill(\"#FFE5B4\")\n ellipseMode(CENTER);\n ellipse(250,180,180,250);\n //neck\n rectMode(CENTER)\n rect(250,400,80,250);\n //eyelashes\n //white eyes\n fill(255);\n ellipse(220,140,35,15);\n ellipse(280,140,35,15);\n //color eyes\n stroke(0);\n strokeWeight(3);\n fill(0,200,40);\n ellipse(222,140,11,11);\n ellipse(282,140,11,11);\n //iris\n fill(0);\n noStroke();\n ellipse(222,140,5,5);\n ellipse(282,140,5,5);\n //mouth\n fill(\"#FFC0CB\");\n ellipse(250,230,45,15);\n\n}", "function draw() {\n\n ctx.clearRect(0, 0, canvas.width, canvas.height); //clear canvas\n var space = 0; //x\n //console.log(trainingData);\n retrain();\n\n for (var i = 0; i <= 90; i++) {\n var sin = i / 90;\n input.activate([sin]); // Whistle\n var result = output.activate(); //result of new generation\n\n //sin NN\n ctx.beginPath();\n ctx.arc(space + i * 9.9, -(result[0] * 250) + 300, 2, 0, 2 * Math.PI);\n ctx.stroke();\n ctx.fillStyle = \"red\";\n ctx.fill();\n ctx.closePath();\n\n //sin math\n ctx.beginPath();\n ctx.arc(space + i * 9.9, -(Math.sin(i * (Math.PI / 180))) * 250 + 300, 2, 0, 2 * Math.PI);\n ctx.stroke();\n ctx.fillStyle = \"blue\";\n ctx.fill();\n ctx.closePath();\n\n //difference\n ctx.beginPath();\n ctx.moveTo(space + i * 9.9, -(result[0] * 250) + 300);\n ctx.lineTo(space + i * 9.9, -(Math.sin(i * (Math.PI / 180))) * 250 + 300);\n ctx.strokeStyle = \"green\";\n ctx.stroke();\n\n //range\n ctx.beginPath();\n ctx.moveTo(100, 0);\n ctx.lineTo(100, 400);\n ctx.strokeStyle = \"black\";\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(0, 310);\n ctx.lineTo(900, 310);\n ctx.strokeStyle = \"black\";\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(895, 0);\n ctx.lineTo(895, 400);\n ctx.strokeStyle = \"black\";\n ctx.stroke();\n ctx.beginPath();\n ctx.moveTo(0, 45);\n ctx.lineTo(900, 45);\n ctx.strokeStyle = \"black\";\n ctx.stroke();\n }\n //console.log(trainingData);\n}", "function setup() {\n createCanvas( windowWidth, windowHeight );\n //creating a canvas//\n frameRate(60);\n //setting framerate//\n background('white');\n let dotBlue = color( 0, 100, 0, 100);\n let dotGreen = color( 0, 0, 100, 100);\n let dotRed = color( 100, 0, 0, 100);\n let rainArray = [dotBlue, dotGreen, dotRed];\n//defining rain array variables for canvas\n\n\n}", "function Particle(x, y) {\n this.pos = createVector(x, y);\n this.vel = createVector(0, 0);\n this.acc = createVector(0, 0);\n this.a = 255;\n this.val = sin(frameCount*10)*random(10,30);\n this.rand = this.val*3 +1;\n\n this.addForce = function(force) {\n this.acc.add(force);\n }\n\n this.checkEdges = function() {\n\n // Left edge\n if (this.pos.x < 0){\n this.vel.x = Math.abs(this.vel.x);\n }\n\n // Bottom\n if (this.pos.y > height){\n this.vel.y = -Math.abs(this.vel.y);\n }\n\n // right edge\n if (this.pos.x > width){\n var normalisedY = this.pos.y / height;\n send(IP_VOISIN, { y: normalisedY});\n\n // enlever\n var index = particles.indexOf(this);\n particles.splice(index, 1);\n\n }\n\n }\n\n this.update = function() {\n this.vel = this.vel.add(this.acc);\n\n this.pos.add(this.vel);\n this.acc.mult(0);\n\n this.checkEdges();\n }\n\n this.createDot = function() {\n noStroke();\n fill(245, 65, 35, this.a);\n ellipse(this.pos.x, this.pos.y, this.val, this.val);\n ellipse(this.pos.x, this.pos.y, this.val, this.val);\n\n }\n\n this.createAura = function() {\n\n fill(0, 152, 216,this.a*.05);\n strokeWeight(.5);\n stroke(0, 152, 216,this.a);\n ellipse(this.pos.x, this.pos.y, this.val*10, this.val*10);\n\n }\n\n this.createCircles = function() {\n push();\n strokeWeight(.5);\n stroke(11, 53, 54,this.a);\n noFill();\n var rand = random(5,10);\n ellipse(this.pos.x, this.pos.y,rand*this.val,rand*this.val);\n }\n\n\n this.alpha = function () {\n\n this.a -= .1;\n }\n\n this.wiggle = function() {\n\n this.pos.x = random(this.pos.x-30, this.pos.x+30);\n this.pos.y = random(this.pos.y-this.rand, this.pos.y+this.rand);\n }\n\n\n this.isOut = function() {\n if (this.pos.x > width || this.pos.y > height){\n return true;\n }\n return false;\n }\n\n this.evolving = function() {\n\n var k = random(.7,1.3);\n\n this.val *=k;\n }\n\n}", "function setup() {\r\n\tcreateCanvas(200, 200);\r\n\tpixelDensity(1);\r\n\r\n\tgrid = [];\r\n\tnext = [];\r\n\r\n\tfor(var x = 0; x < width; x++){\r\n\t\tgrid[x] = [];\r\n\t\tnext[x] = [];\r\n\t\tfor(var y = 0; y < height; y++){\r\n\t\t\tgrid[x][y] = { a: 1 , b: 0};\r\n\t\t\tnext[x][y] = { a: 1 , b: 0};\r\n\t\t}\r\n\t}\r\n\r\n\r\n\tvar sizX = random(35);\r\n\tvar centX = floor((width/2-sizX) + sizX);\r\n\r\n\tvar sizY = random(35);\r\n\tvar centY = floor((height/2-sizY) + sizY);\r\n\r\n\r\n\tfor(var i = centX; i < (centX + sizX); i++){\r\n\t\tfor(var j = centY; j < (centY + sizY); j++){\r\n\t\t\tgrid[i][j].a = 0.1;\r\n\t\t\tgrid[i][j].b = 1;\r\n\t\t}\r\n\t}\r\n\r\n}", "constructor(spacing, width, theta, amplitude, period) {\n this.spacing = 2;\n this.size = 20;\n this.width = 800;\n this.theta = 0;\n this.amplitude = 175;\n this.period = 600;\n this.objs = [];\n }", "function setup() {\n\t// cria o quadro, com dimensoes 900 x 400\n\tcreateCanvas(800, 560);\n\n\tx = 40;//Posicao do x da estrela\n\ty = 10;//Posicao do y da estrela\n\t\n\t//Cria o vetor\n\t//Escreve as coordenadas para desenhar o floco\n\trosaClaro_pos = createVector(325, 125);\n\t// flocoUm = new FlocoUm(325, 125, 55, -1); // -1 gera um erro\n\tflocoUm = new FlocoUm(425, 85, 55, 3, random(1, 3));//Posicao x e y, tamanho e velocidade em que o floco vai girar \n\toutroFlocoUm = new FlocoUm(135, 35, 85, 8, random(1, 3));//Desenha outro floco; posicao x e y, tamanho e velocidade \n\t\n\trosa_pos = createVector(525, 135);\n\tflocoDois = new FlocoDois(65, 90, 50, 9, random(1, 3));//Posicao x e y, tamanho e velocidade \n\toutroFlocoDois = new FlocoDois(495, 50, 80, 2, random(1, 3));//Desenha outro floco; posicao x e y, tamanho e velocidade\n\t\n\tlilas_pos = createVector(435, 145);\n\tflocoTres = new FlocoTres(600, 95, 35, 5, random(1, 3));\n\toutroFlocoTres = new FlocoTres(330, 55, 65, 7, random(1, 3));\n\t\n\tvermelho_pos = createVector(675, 155);\n\tflocoQuatro = new FlocoQuatro(245, 85, 45, 4, random(1, 3));\n\toutroFlocoQuatro = new FlocoQuatro(680, 55, 75, 6, random(1, 3));\n\n\tmerry.setVolume(1.0);//Define o volume da musica\n\tmerry.loop();//Faz a musica repitir, quando terminar\n\n\tvar floco;\n\tfor(var i = 0; i < 100; i++) {\n\t\tif (i % 4 == 0) floco = new FlocoUm(random(0, width), random(0, height), random(20, 80), random(0, 10), random(1, 3));\n\t\tif (i % 4 == 1) floco = new FlocoDois(random(0, width), random(0, height), random(20, 80), random(0, 10), random(1, 3));\n\t\tif (i % 4 == 2) floco = new FlocoTres(random(0, width), random(0, height), random(20, 80), random(0, 10), random(1, 3));\n\t\tif (i % 4 == 3) floco = new FlocoQuatro(random(0, width), random(0, height), random(20, 80), random(0, 10), random(1, 3));\n\t\tlista_flocos.push(floco);\n\t}\n}", "function setup() {\n\tcreateCanvas(1000,1000);\n\n\t/*rSlider = createSlider(0, 255, 200);//range and starting value of slider\nrSlider.position(20, height - rSlider.height + 20);//position sliders\n\ngSlider = createSlider(0, 255, 200);\ngSlider.position(gSlider.width + 30, height - gSlider.height + 20);\n\nbSlider = createSlider(0, 255, 180);\nbSlider.position(bSlider.width + 180, height - bSlider.height + 20);\n\n}*/\n\n\tbackground(0);\n\n\tb = 10;\n\th = 10;\n\n\nrectWidth = width/b;\nrectHeight= height/h;\n\n\tellipseMode(CORNER);\n\n\tfor(var y = 0; y < h; y++){\n\t\tfor(var x = 0; x < b; x++){\n\t//for(var y = 0; y < height; y = y + 30){\n\t\t//for(var x = 0; x < width; x = x + 30){\n\t\t //hier wird das raster gezeichnet\n\t\t var zufall = random(3);\n\t\t print(zufall);\n\t\t \t//0-1\n\t\t \tif(zufall < 1){\n\t\t \t\traster1(x,y,rectWidth,rectHeight);\n\t\t \t}\n\n\t\t \t//1-2\n\n\t\t \telse if (zufall > 1 && zufall < 2){\n\t\t \t\traster2(x,y,rectWidth,rectHeight);\n\t\t \t}\n\t\t \t// 2 - 3\n\t\t \telse{\n\t\t \t\traster3(x,y,rectWidth,rectHeight);\n\n\t\t \t}\n\n\t\t /*if(zufall > 1 && zufall < 2){ \n\n\t\t raster1(x,y,rectWidth,rectHeight);\n\n\t\t}else{\n raster3(x,y,rectWidth,rectHeight);\n\n\t\t /*rect(x,y,30,30);\n\t\t //ellipse(x,y,30,30);\n\n\t\t */\n\t\t}\n\t\t}\n\t}", "function Noise(seed) {\n\t function Grad(x, y, z) {\n\t this.x = x; this.y = y; this.z = z;\n\t }\n\t\n\t Grad.prototype.dot2 = function(x, y) {\n\t return this.x*x + this.y*y;\n\t };\n\t\n\t Grad.prototype.dot3 = function(x, y, z) {\n\t return this.x*x + this.y*y + this.z*z;\n\t };\n\t\n\t this.grad3 = [new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0),\n\t new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1),\n\t new Grad(0,1,1),new Grad(0,-1,1),new Grad(0,1,-1),new Grad(0,-1,-1)];\n\t\n\t this.p = [151,160,137,91,90,15,\n\t 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,\n\t 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,\n\t 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,\n\t 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,\n\t 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,\n\t 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,\n\t 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,\n\t 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,\n\t 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,\n\t 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,\n\t 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,\n\t 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];\n\t // To remove the need for index wrapping, double the permutation table length\n\t this.perm = new Array(512);\n\t this.gradP = new Array(512);\n\t\n\t this.seed(seed || 0);\n\t }", "function setup(){\n\n // Creating the canvas\n var canvas = createCanvas(800,600);\n\n // Creating the engine\n engine = Engine.create();\n\n // Adding world to the engine\n world = engine.world;\n\n // Creating a canvas mouse\n var canvasmouse = Mouse.create(canvas.elt);\n\n // Changing the pixel ratio according to the density of the screen\n canvasmouse.pixelRatio = pixelDensity();\n\n // Adding canvas mouse to the mouse constraint\n var op = {\n Mouse: canvasmouse\n }\n\n // Creating the mouse constraint\n mConstraint = MouseConstraint.create(engine, op);\n\n // Adding it to the world\n World.add(world,mConstraint);\n \n // Creating a ground\n ground = new Ground(400,585,800,30);\n fill(\"purple\");\n\n // Adding ground to the world\n World.add(world,ground);\n\n // Creating an object that will keep track of the previous particle\n var prev = null;\n\n // Creating a chain at the left side\n for(x = 15; x > -570; x -= 40) {\n\n // Creating a variable fixed\n var fixed = false;\n\n // Making the fixed true if there is no previous particle\n if(!prev) {\n fixed = true;\n }\n\n // Creating a particle\n p = new SideChain(x,80,10,fixed);\n\n // Adding it to particles array\n particles.push(p);\n\n // Adding the particle to the world\n World.add(world,p);\n\n // Creating an invisible chain with the previous particle\n if(prev) {\n\n // Adding the properties to the chain with the help of a variable\n var options = {\n \n // Setting the chain start and end point\n bodyA: p.body,\n bodyB: prev.body,\n\n // Setting the length of the chain\n length: 20,\n\n // Setting the stiffness of the chain\n stiffness: 0.4\n }\n\n // Creating a constraint\n var constre = Constraint.create(options);\n\n // Adding the constraint to the world\n World.add(world,constre);\n }\n\n // Adding the particle to the previous\n prev = p;\n }\n\n // Creating another object that will keep track of the previous particle\n var prev1 = null;\n\n // Creating a chain on the right side\n for(i = 785; i < 1350; i = i + 40) {\n\n // Creating a fixed variable and giving it false value\n var fixed = false;\n\n // Giving fixed as true value when there is no previous particle\n if(!prev1) {\n fixed = true;\n }\n\n // Creating another particle\n p1 = new SideChain(i,80,10,fixed);\n\n // Adding it to particles array\n particles.push(p1);\n\n // Adding the particle to the world\n World.add(world,p1);\n\n // Creating an invisible chain with the previous particle\n if(prev1) {\n\n // Adding the properties to the particles\n var option = {\n\n // Setting the start and end position of the chain\n bodyA: p1.body,\n bodyB: prev1.body,\n\n // Setting the length of the chain\n length: 20,\n\n // Setting the stiffness of the chain\n stiffness: 0.4\n }\n\n // Creating a constraint\n var constra = Constraint.create(option);\n\n // Adding the constraint to the world\n World.add(world,constra);\n }\n\n // Adding the particle to the previous\n prev1 = p1;\n }\n\n // Displaying the wall's design\n var X=100;\n var Y=240;\n var Z=20;\n for(var i=1;i<=144;i++){\n if(i%16 == 0){\n\n var rectangle1 = new Rectangle1(X,Y,Z,Z);\n rectangle.push(rectangle1);\n X= 100;\n Y = Y + 40;\n }else{ \n var rectangle1 = new Rectangle1(X,Y,Z,Z);\n rectangle.push(rectangle1);\n X= X+40;\n }\n \n }\n\n // Creating the castlepillars\n castlepillar1 = new Castlepillar(55,320,50,500);\n castlepillar2 = new Castlepillar(745,320,50,500);\n\n // Creating a wall\n wall = new Wall(400,395,640,350);\n\n // Creatiing the gates\n gate1 = new Gate(350,470,100,200);\n gate2 = new Gate(450,470,100,200);\n\n var A=325;\n var B=400;\n var C=20;\n for(var a=1;a<=16;a++){\n if(a%4 == 0){\n\n var design1 = new Rectangle(A,B,C,C);\n design.push(design1);\n A= 325;\n B = B + 45;\n }else{ \n var design1 = new Rectangle(A,B,C,C);\n design.push(design1);\n A= A+50;\n }\n \n }\n\n var D=100;\n var E=180;\n var F=40;\n var G = 80;\n for(var b=1;b<=16;b++){\n if(b%2 == 0){\n\n var part1 = new Rectangle2(D,E,F,G);\n part.push(part1);\n D = D + 40;\n E = E + 20;\n G = G - 40;\n }else{ \n var part1 = new Rectangle2(D,E,F,G);\n part.push(part1);\n D = D + 40;\n E = E - 20;\n G = G + 40;\n }\n \n }\n}", "function setup() {\n \n // Configure the world.\n w = new p$.World(\"canvasContainer\", draw, resize);\n\n // Configure box for displaying which variables are being plotted.\n labels.x = box.addLabel(55, 14, { name: \"X:\", labelWidth: 20 });\n labels.y = box.addLabel(55, 14, { name: \"Y:\", labelWidth: 20 });\n\n // Configure box for displaying regression results.\n labels.formula = regressionBox.addLabel(120, 14, { name: \"f(x)\", units: \"\", labelWidth: 40 });\n labels.formula.setPosition(0, 0);\n labels.r2 = regressionBox.addLabel(120, 14, { name: \"R²\", units: \"\", decPlaces: 2, labelWidth: 40 });\n labels.r2.setPosition(0, 25);\n regressionBox.calculateDimensions();\n\n // Configure stats labels.\n labels.mean = statsBox.addLabel(55, 14, { name: \"x̄:\", labelWidth: 25, decPlaces: 3 });\n labels.variance = statsBox.addLabel(55, 14, { name: \"s²:\", labelWidth: 25, decPlaces: 3 });\n\n // Add plots to data cursor.\n dc.add(plot, regressionPlot);\n\n // Configure z-index.\n plot.setZ(1);\n regressionPlot.setZ(2);\n box.setZ(3);\n regressionBox.setZ(4);\n statsBox.setZ(5);\n dc.setZ(6);\n\n // Add objects to world.\n w.add(plot, box, regressionPlot, regressionBox, statsBox, dc);\n\n}", "function setup() {\n let matrixsize = getselectsize()\n // the size of the matrix is what you give to it (10-25)\n matrix = genMatrix(matrixsize);\n // generates a new matrix by the given size\n frameRate(5);\n // framerate\n createCanvas(matrix[0].length * side, matrix.length * side);\n // the size of the canvas\n background('#acacac');\n // sets the background gray\n\n\n for (var y = 0; y < matrix.length; y++) {\n for (var x = 0; x < matrix[y].length; x++) {\n if (matrix[y][x] == 1) {\n var gr = new Grass(x, y, 1)\n grassArr.push(gr)\n }\n else if (matrix[y][x] == 2) {\n var deer = new GrassEater(x, y, 2)\n grassEatArr.push(deer)\n }\n else if (matrix[y][x] == 3) {\n var wolf = new Predator(x, y, 3)\n PredatorArr.push(wolf)\n }\n else if (matrix[y][x] == 4) {\n var Zeus = new God(x, y, 4)\n GodArr.push(Zeus)\n }\n else if (matrix[y][x] == 5) {\n var Pix = new Bishop(x, y, 5)\n BishopArr.push(Pix)\n }\n }\n }\n // adds new characters to the arrays\n}", "function setup() {\r\n createCanvas(400,400);\r\n background(0,255,0);\r\n // The number of cycles a generation is allowed to live\r\n lifetime = 300;\r\n\r\n // Initialize variables\r\n lifecycle = 0;\r\n recordtime = lifetime;\r\n\r\n target = new TargetClass(width / 2 - 12, 24, 24, 24);\r\n\r\n // Create a population with a mutation rate, and population max\r\n let mutationRate = 0.01;\r\n population = new Population(mutationRate, 50);\r\n\r\n // Create the obstacle course\r\n obstacles = [];\r\n obstacles.push(new Obstacle(width / 2 - 100, height / 2, 200, 10));\r\n}", "function initializeVariables(){\n MAX_POINTS = 500;\n drawCount = 0;\n colors = [0x8f00ff,0x4b0082,0x0000ff,0x00ff00,0xffff00,0xff7f00,0xff0000];\n cords = [2.02,2.11,2.18,2.25,2.32,2.40,2.47];\n cords2 = [1.55,1.74,1.94,2.18,2.34,2.52,2.70];\n \n randAllgeometries = new Array(4);\n randAllMaterials = new Array(4);\n randAllLines = new Array(4);\n randAllPositions = new Array(4);\n\n allgeometries = new Array(7);\n allMaterials = new Array(7);\n allLines = new Array(7);\n allPositions = new Array(7);\n\n allgeometries2 = new Array(7);\n allMaterials2 = new Array(7);\n allLines2 = new Array(7);\n allPositions2 = new Array(7);\n\n allgeometries3 = new Array(7);\n allMaterials3 = new Array(7);\n allLines3 = new Array(7);\n allPositions3 = new Array(7);\n}", "function setup() {\n\t// object containing P5 colors that are commonly reused\n\tcolors = {\n\t\tbg: color(40, 50, 60),\n\t\tbg_quad: color(220, 160, 80),\n\t\tbg_dark: color(20, 30, 40),\n\t\tr: color(200, 50, 50),\n\t\tbr: color(80, 50, 50),\n\t\tblk: color(0, 0, 0),\n\t\tpine: color(20, 50, 30),\n\t\tlt_bl: color(50, 100, 120),\n\t\tbl: color(80, 100, 120),\n\t\tg: color(45, 80, 50),\n\t\tpale_pink: color(180, 120, 120, 150),\n\t\tw: color(230, 230, 240)\n\t};\n\t// create canvas and assign to global variable cnv\n\t// canvas has width equal to half the window and height based on set aspect ratio\n\tcnv = createCanvas(window.innerWidth / 2, \n\t\twindow.innerWidth / 2 / 475 * 600);\n\t// position canvas so it occupies right half of screen\n\tcnv.position(window.innerWidth / 2, 0, \"absolute\");\n\t// initialize Shape obejcts to be drawn later\n\tinit_shapes();\n}", "function setup() {\n createCanvas(640,480);\n background(255,100,100);\n //Draw body\n fill(225, 225, 110);\n noStroke();\n rect(295,350,50,200);\n //Draw head\n fill(255, 255, 112);\n noStroke();\n arc(320,240,300,300,radians(0),radians(180),OPEN);\n fill(255,100,100);\n ellipse(320,240,250,200);\n fill(255, 255, 112);\n arc(320,240,250,200,radians(91),radians(91));\n //Draw eyes\n fill(255, 255, 112);\n noStroke();\n fill(255, 255, 112);\n ellipse(185,225,75,75);\n fill(255);\n ellipse(185,225,50,50);\n fill(0);\n ellipse(185,225,35,35);\n fill(255, 255, 112);\n ellipse(455,225,75,75);\n fill(255);\n ellipse(455,225,50,50);\n fill(0);\n ellipse(455,225,35,35);\n //Draw mouth\n fill(0);\n ellipse(320,375,20,20);\n}", "constructor(){\r\n\t\tthis.G = undefined;\r\n\t\tthis.d = undefined;\r\n\t\tthis.dist = undefined;\r\n\t\tthis.steepness = 20;\r\n\t\tthis.inflexiosPontHelye = 0.5;\r\n\t\tthis.shapeOfDif = 1/2;\r\n\t\tthis.z = 3;\r\n\t}", "function setup() {\n // Create a new canvas to match the browser size\n createCanvas(windowWidth, windowHeight); \n \n for (let i=0; i < n; i++) {\n x[i] = 0;\n y[i] = 0;\n speedX[i] = random(-2, 2);\n speedY[i] = random(-2, 2); \n diameter[i] = 100; \n }\n}", "function Noise(seed) {\n function Grad(x, y, z) {\n this.x = x; this.y = y; this.z = z;\n }\n\n Grad.prototype.dot2 = function(x, y) {\n return this.x*x + this.y*y;\n };\n\n Grad.prototype.dot3 = function(x, y, z) {\n return this.x*x + this.y*y + this.z*z;\n };\n\n this.grad3 = [new Grad(1,1,0),new Grad(-1,1,0),new Grad(1,-1,0),new Grad(-1,-1,0),\n new Grad(1,0,1),new Grad(-1,0,1),new Grad(1,0,-1),new Grad(-1,0,-1),\n new Grad(0,1,1),new Grad(0,-1,1),new Grad(0,1,-1),new Grad(0,-1,-1)];\n\n this.p = [151,160,137,91,90,15,\n 131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,\n 190, 6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,\n 88,237,149,56,87,174,20,125,136,171,168, 68,175,74,165,71,134,139,48,27,166,\n 77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,\n 102,143,54, 65,25,63,161, 1,216,80,73,209,76,132,187,208, 89,18,169,200,196,\n 135,130,116,188,159,86,164,100,109,198,173,186, 3,64,52,217,226,250,124,123,\n 5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,\n 223,183,170,213,119,248,152, 2,44,154,163, 70,221,153,101,155,167, 43,172,9,\n 129,22,39,253, 19,98,108,110,79,113,224,232,178,185, 112,104,218,246,97,228,\n 251,34,242,193,238,210,144,12,191,179,162,241, 81,51,145,235,249,14,239,107,\n 49,192,214, 31,181,199,106,157,184, 84,204,176,115,121,50,45,127, 4,150,254,\n 138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180];\n // To remove the need for index wrapping, double the permutation table length\n this.perm = new Array(512);\n this.gradP = new Array(512);\n\n this.seed(seed || 0);\n }", "function genLRS480(){\r\n\tvar adjust = 0.4;\r\n\tvar adjustBase = 0.15;\r\n\tvar Su0 = BEZIER(S0)([[0,0,0],[0,trainHeight/3,0],[-adjust,trainHeight*2/3,0],[-adjustBase,trainHeight,0]]);\r\n\tvar Su1 = BEZIER(S0)([[0,0,-trainLength],[0,trainHeight/3,-trainLength],[-adjust,trainHeight*2/3,-trainLength],[-adjustBase,trainHeight,-trainLength]]);\r\n\tvar Sv0 = BEZIER(S1)([[0,0,0],[0,0,-trainLength]]);\r\n\tvar Sv1 = BEZIER(S1)([[-adjustBase,trainHeight,0],[-adjustBase,trainHeight,-trainLength]]);\r\n\tvar out1 = MAP(COONS_PATCH([Su0,Su1,Sv0,Sv1]))(dom2D);\r\n\tvar sU0 = BEZIER(S0)([[trainWidth,0,0],[trainWidth,trainHeight/3,0],[trainWidth+adjust,trainHeight*2/3,0],[trainWidth+adjustBase,trainHeight,0]]);\r\n\tvar sU1 = BEZIER(S0)([[trainWidth,0,-trainLength],[trainWidth,trainHeight/3,-trainLength],[trainWidth+adjust,trainHeight*2/3,-trainLength],[trainWidth+adjustBase,trainHeight,-trainLength]]);\r\n\tvar sV0 = BEZIER(S1)([[trainWidth,0,0],[trainWidth,0,-trainLength]]);\r\n\tvar sV1 = BEZIER(S1)([[trainWidth+adjustBase,trainHeight,0],[trainWidth+adjustBase,trainHeight,-trainLength]]);\r\n\tvar out2 = MAP(COONS_PATCH([sU0,sU1,sV0,sV1]))(dom2D);\r\n\tvar out = STRUCT([R([0,2])(PI),R([0,1])(PI/2),R([1,2])(PI/2),out1,out2]);\r\n\treturn out;\r\n}", "function setup() {\r\n\r\n let c = createCanvas(S, S);\r\n img.resize(S, S);\r\n c.parent('logo');\r\n\t\r\n\tfor (let i = 0; i < n*n; i++) {\r\n\t\tlet x = (i*s)%S;\r\n\t\tlet y = Math.floor(i/n)*s;\r\n\t\tlet img_ = new Square(img.get(x,y,s,s), i);\r\n\t\tsquares.push(img_);\t\t\r\n\t}\r\n\r\n //console.log(squares);\r\n frameRate(3);\r\n\r\n}", "function setup() {\n createCanvas(640, 360);\n man = new Person();\n for (let i = 0; i < 100; i++) {\n bad[i] = new obstacle();\n }\n for (let l = 0; l < 100; l++) {\n bad2[l] = new obstacle2();\n}\n}", "function setup() {\n\tcreateCanvas(windowWidth, windowHeight);\n\tbackground(255);\n\tnoFill();\n\tstroke(0);\n\n\td = 20;\n\tincr = radians(22.5);\n\tx[0] = width/2; // our x position\n\ty[0] = height; // our y position\n\ta[0] = -PI/2; // our angle\n\n\n}", "function calc() {\n\n // How long canvas refreshing\n var p = document.getElementById(\"sinsum\");\n p.innerHTML = 12 - trainingData.length;\n if (trainingData.length > 12) {\n p.innerHTML = \"END\";\n return;\n }\n\n // calc angles 0-90 degree and insert to NN \n for (var i = 0; i <= 90; i++) {\n var sin = i / 90;\n input.activate([sin]); // Whistle\n var result = output.activate(); //result of new generation\n\n //console.log(result[0]);\n //console.log(Math.sin(i * Math.PI / 180));\n\n if (result[0] >= Math.sin(i * Math.PI / 180) - 0.00005 && result[0] <= Math.sin(i * Math.PI / 180) + 0.00005) { //0.00005=error +/- \n trainingData.push({ //inserting to training data array\n input: [sin],\n output: [result[0]]\n });\n }\n }\n retrain();\n draw();\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n covid19.y = random(0, height);\n covid19.vx = covid19.speed;\n noStroke();\n noCursor();\n}", "function setup() {\n createCanvas(900,600);\n cellsize = 600 /cols -1;\n grid = createRandom2dArray(cols, rows);\n music.setVolume(0.7);\n music.loop();\n playX = 0;\n playY = 0;\n play2X = rows -1;\n play2Y = cols -1;\n}", "function pos_pianeticr(njd,np){\n // by Salvatore Ruiu Irgoli-Sardegna (Italy) settembre 2010\n // termini di correzione per i pianeti Giove e Saturno.\n // np=numero identificativo del pianeta.\n\n var T=(njd-2415020.0)/36525;\n\n M=358.47583+35999.049750*T-0.000150*T*T-0.0000033*T*T*T; // Sole.\n\n M1=102.27938+149472.51529*T+0.000007*T*T; // Mercurio.\n M2=212.60322+ 58517.80387*T+0.001286*T*T; // Venere.\n M4=319.51913+ 19139.85475*T+0.000181*T*T; // Marte.\n M5=225.32833+ 3034.69202*T-0.000722*T*T; // Giove.\n M6=175.46622+ 1221.55147*T-0.000502*T*T; // Saturno.\n \n \n \n var Delta_LP=0; // termini correzione di lungo periodo.\n //var Delta_L=0; // correzione per la longitudine.\n var Delta_R=0; // correzione per il raggio vettore.\n\n var Delta_LL=0; // correzione per la longitudine.\n var Delta_P=0; // correzione per il perielio.\n var Delta_AS=0; // correzione semiasse maggiore.\n var Delta_EC=0; // correzione eccentricità.\n var Delta_MM=0; // correzione anomalia media.\n var Delta_LAT_ELIO=0; // correzione latitudine eliocentrica.\n \n\n// Correzioni per Mercurio - Perturbazioni in longitudine.\n// Da aggiungere dopo aver risolto l'E.Keplero\n\n if (np==0) {\n\n // longitudine\n\n Delta_LL=0.00204*Math.cos(Rad(5*M2-2*M1+12.220))\n +0.00103*Math.cos(Rad(2*M2-M1-160.6920))\n +0.00091*Math.cos(Rad(2*M5-M1-37.00300))\n +0.00078*Math.cos(Rad(5*M2-3*M1+10.137));\n\n // perturbazioni in raggio vettore\n\n Delta_R=0.000007525*Math.cos(Rad(2*M5-M1+53.013))\n +0.000006802*Math.cos(Rad(5*M2-3*M1-259.918))\n +0.000005457*Math.cos(Rad(2*M2-2*M1-71.188))\n +0.000003569*Math.cos(Rad(5*M2-M1-77.75));\n \n }\n\n// Correzioni per Venere -Perturbazioni in longitudine. \n// Delta_LP da aggiungere alla longitudine e anomalia media prima di aver risolto l'E.Keplero.\n// gli altri 2 termini dopo aver risolto l'E.Keplero.\n\nelse if(np==1) {\n\n // longitudine e anomalia media\n\n Delta_LP=0.00077*Math.sin(Rad(237.24+150.27*T));\n Delta_MM=Delta_LP;\n\n // longitudine\n\n Delta_LL=0.00313*Math.cos(Rad(2*M-2*M2-148.225))\n +0.00198*Math.cos(Rad(3*M-3*M2+2.565))\n +0.00136*Math.cos(Rad(M-M2-119.107))\n +0.00096*Math.cos(Rad(3*M-2*M2-135.912))\n +0.00082*Math.cos(Rad(M5-M2-208.087));\n\n // perturbazioni in raggio vettore\n\n Delta_R=0.000022501*Math.cos(Rad(2*M-2*M2-58.208))\n +0.000019045*Math.cos(Rad(3*M-3*M2+92.577))\n +0.000006887*Math.cos(Rad(M5-M2-118.090))\n +0.000005172*Math.cos(Rad(M-M2-29.110))\n +0.000003620*Math.cos(Rad(5*M-4*M2-104.208))\n +0.000003283*Math.cos(Rad(4*M-4*M2+63.513))\n +0.000003074*Math.cos(Rad(2*M5-2*M2-55.167));\n\n}\n\n// Correzioni per la Terra\n\nelse if (np==2) {\n\n Delta_LP=0;\n\n // correzioni ***************\n\n var A=153.23+22518.7541*T;\n var B=216.57+45037.5082*T;\n var C=312.69+32964.3577*T;\n var D=350.74+445267.1142*T-0.00144*T*T;\n var E=231.19+20.20*T;\n var H=353.40+65928.7155*T;\n\n // angoli in radianti.\n\n A=Rad(A); \n B=Rad(B); \n C=Rad(C); \n D=Rad(D); \n E=Rad(E); \n H=Rad(H); \n\n // correzione per la longitudine.\n\n var Delta_LL=0.00134*Math.cos(A)\n +0.00154*Math.cos(B)\n +0.00200*Math.cos(C)\n +0.00179*Math.sin(D)\n +0.00178*Math.sin(E);\n\n // correzioni per il raggio vettore.\n\n var Delta_R=0.00000543*Math.sin(A)\n +0.00001575*Math.sin(B)\n +0.00001627*Math.sin(C)\n +0.00003076*Math.cos(D) \n +0.00000927*Math.sin(H);\n \n}\n\n// correzioni per il pianeta Marte ******************************** INIZIO .\n// Delta_LP da aggiungere alla longitudine e anomalia media prima di aver risolto l'E.Keplero.\n// gli altri 2 termini dopo aver risolto l'E.Keplero.\n\n\nif (np==3) {\n\n // longitudine e anomalia media\n\nDelta_LP=-0.01133*Math.sin(Rad(3*M5-8*M4+4*M))\n -0.00933*Math.cos(Rad(3*M5-8*M4+4*M)); // termine lungo periodo.\nDelta_MM=Delta_LP;\n\n // longitudine\n\nDelta_LL=0.00705*Math.cos(Rad(M5-M4-48.958))\n +0.00607*Math.cos(Rad(2*M5-M4-118.350))\n +0.00445*Math.cos(Rad(2*M5-2*M4-191.897))\n +0.00388*Math.cos(Rad(M-2*M4+20.495))\n +0.00238*Math.cos(Rad(M-M4+35.097))\n +0.00204*Math.cos(Rad(2*M-3*M4+158.638))\n +0.00177*Math.cos(Rad(3*M4-M2-57.602))\n +0.00136*Math.cos(Rad(2*M-4*M4+154.093))\n +0.00104*Math.cos(Rad(M5+17.618));\n\n // raggio vettore\n\nDelta_R=0.000053227*Math.cos(Rad(M5-M4+41.1306))\n +0.000050989*Math.cos(Rad(2*M5-2*M4-101.9847))\n +0.000038278*Math.cos(Rad(2*M5-M4-98.3292))\n +0.000015996*Math.cos(Rad(M-M4-55.555))\n +0.000014764*Math.cos(Rad(2*M-3*M4+68.622))\n +0.000008966*Math.cos(Rad(M5-2*M4+43.615))\n +0.000007914*Math.cos(Rad(3*M5-2*M4-139.737))\n +0.000007004*Math.cos(Rad(2*M5-3*M4-102.888))\n +0.000006620*Math.cos(Rad(M-2*M4+113.202)) \n +0.000004930*Math.cos(Rad(3*M5-3*M4-76.243))\n +0.000004693*Math.cos(Rad(3*M-5*M4+190.603))\n +0.000004571*Math.cos(Rad(2*M-4*M4+244.702))\n +0.000004409*Math.cos(Rad(3*M5-M4-115.828));\n}\n\n// correzioni per il pianeta Marte ******************************** FINE.\n\n// correzioni per il pianeta Giove ******************************* INIZIO.\n// tutti i termini di Giove sono da aggiungere prima dell'equazione di Keplero\n\n\nif (np==4) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var V=5*Q-2*P;\n var W=2*P-6*Q+3*S;\n var Z=Q-P;\n\n // ************************* A\n // correzione per la longitudine media da aggiungere prima dell'equazione di Keplero\n // solo per la longitudine media.\n\n Delta_LL=(0.331364-0.010281*X-0.004692*X*X)*Math.sin(Rad(V)) \n +(0.003228-0.064436*X+0.002075*X*X)*Math.cos(Rad(V)) \n -(0.003083+0.000275*X-0.000489*X*X)*Math.sin(Rad(2*V))\n +0.002472*Math.sin(Rad(W))\n +0.013619*Math.sin(Rad(Z))\n +0.018472*Math.sin(Rad(2*Z))\n +0.006717*Math.sin(Rad(3*Z))\n +0.002775*Math.sin(Rad(4*Z))\n +(0.007275-0.001253*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +0.006417*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n +0.002439*Math.sin(Rad(3*Z))*Math.sin(Rad(Q)) \n -(0.033839+0.001125*X)*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n -0.003767*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n -(0.035681+0.001208*X)*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n -0.004261*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n +0.002178*Math.cos(Rad(Q))\n +(-0.006333+0.001161*X)*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n -0.006675*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n -0.002664*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n -0.002572*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n -0.003567*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.002094*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n +0.003342*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q));\n\n // correzione per l'anomalia media -- più in fondo nel listato.\n\n // perturbazioni perielio da utilizzare per calcolare M. (vedi in fondo nel listato)\n\n Delta_P=(0.007192-0.003147*X)*Math.sin(Rad(V))\n +(-0.020428-0.000675*X+0.000197*X*X)*Math.cos(Rad(V))\n +(0.007269+0.000672*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -0.004344*Math.sin(Rad(Q))\n +0.034036*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +0.005614*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +0.002964*Math.cos(Rad(3*Z))*Math.sin(Rad(Q))\n +0.037761*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n +0.006158*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -0.006603*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n -0.005356*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +0.002722*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.004483*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n -0.002642*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.004403*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n -0.002536*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +0.005547*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -0.002689*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q));\n\n // correzione per l'anomalia media da aggiungere prima dell'equazione di Keplero\n\n var el_orb=orb_plan(njd,4); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità non corretta.\n\n Delta_MM=Delta_LL-(Delta_P/eccent);\n\n\n // semiasse maggiore da aggiungere prima dell'equazione di Keplero.\n\n Delta_AS=-263*Math.cos(Rad(V))\n +205*Math.cos(Rad(Z))\n +693*Math.cos(Rad(2*Z))\n +312*Math.cos(Rad(3*Z))\n +147*Math.cos(Rad(4*Z))\n +299*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +181*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +204*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n +111*Math.sin(Rad(3*Z))*Math.cos(Rad(Q))\n -337*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n -111*Math.cos(Rad(2*Z))*Math.cos(Rad(Q));\n \n Delta_AS=Delta_AS/1000000;\n \n // eccentricità da aggiungere prima dell'equazione di Keplero\n\n Delta_EC=(3606+130*X-43*X*X)*Math.sin(Rad(V))\n +(1289-580*X)*Math.cos(Rad(V))\n -6764*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -1110*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -224*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n -204*Math.sin(Rad(Q))\n +(1284+116*X)*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +188*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +(1460+130*X)*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n +224*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -817*Math.cos(Rad(Q))\n +6074*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +992*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +508*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n +230*Math.cos(Rad(4*Z))*Math.cos(Rad(Q))\n +108*Math.cos(Rad(5*Z))*Math.cos(Rad(Q))\n -(956+73*X)*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +448*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +137*Math.sin(Rad(3*Z))*Math.sin(Rad(2*Q))\n +(-997+108*X)*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +480*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +148*Math.cos(Rad(3*Z))*Math.sin(Rad(2*Q))\n +(-956+99*X)*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +490*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +158*Math.sin(Rad(3*Z))*Math.cos(Rad(2*Q))\n +179*Math.cos(Rad(2*Q))\n +(1024+75*X)*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -437*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n -132*Math.cos(Rad(3*Z))*Math.cos(Rad(2*Q));\n\n Delta_EC=Delta_EC/10000000;\n}\n\n// correzioni per il pianeta Giove ********************************* FINE.\n\n// correzioni per il pianeta Saturno ****************************** INIZIO.\n// tutti i termini di Saturno sono da aggiungere prima dell'equazione di Keplero\n// tranne il termine della latitudine eliocentrica\n\n\nif (np==5) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var V=5*Q-2*P;\n var W=2*P-6*Q+3*S;\n var Z=Q-P;\n var PS=S-Q;\n\n // perturbazioni in longitudine media\n\n Delta_LL=+(-0.814181+0.018150*X+0.016714*X*X)*Math.sin(Rad(V))\n +(-0.010497+0.160906*X-0.004100*X*X)*Math.cos(Rad(V))\n +0.007581*Math.sin(Rad(2*V))\n -0.007986*Math.sin(Rad(W))\n -0.148811*Math.sin(Rad(Z))\n -0.040786*Math.sin(Rad(2*Z))\n -0.015208*Math.sin(Rad(3*Z))\n -0.006339*Math.sin(Rad(4*Z))\n -0.006244*Math.sin(Rad(Q))\n +(0.008931+0.002728*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -0.016500*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -0.005775*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n +(0.081344+0.003206*X)*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +0.015019*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n +(0.085581+0.002494*X)*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n +(0.025328-0.003117*X)*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +0.014394*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +0.006319*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n +0.006369*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +0.009156*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.007525*Math.sin(Rad(3*PS))*Math.sin(Rad(2*Q))\n -0.005236*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -0.007736*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n -0.007528*Math.cos(Rad(3*PS))*Math.cos(Rad(2*Q));\n\n // eccentricità\n\n Delta_EC=+(-7927+2548*X+91*X*X)*Math.sin(Rad(V))\n +(13381+1226*X-253*X*X)*Math.cos(Rad(V))\n +(248-121*X)*Math.sin(Rad(2*V))\n -(305+91*X)*Math.cos(Rad(2*V))\n +412*Math.sin(Rad(Z))\n +12415*Math.sin(Rad(Q))\n +(390-617*X)*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +(165-204*X)*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n +26599*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n -4687*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n -1870*Math.cos(Rad(3*Z))*Math.sin(Rad(Q))\n -821*Math.cos(Rad(4*Z))*Math.sin(Rad(Q))\n -377*Math.cos(Rad(5*Z))*Math.sin(Rad(Q))\n +497*Math.cos(Rad(2*PS))*Math.sin(Rad(Q))\n +(163-611*X)*Math.cos(Rad(Q))\n -12696*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n -4200*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -1503*Math.sin(Rad(3*Z))*Math.cos(Rad(Q))\n -619*Math.sin(Rad(4*Z))*Math.cos(Rad(Q))\n -268*Math.sin(Rad(5*Z))*Math.cos(Rad(Q))\n -(282+1306*X)*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +(-86+230*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +461*Math.sin(Rad(2*PS))*Math.cos(Rad(Q))\n -350*Math.sin(Rad(2*Q))\n +(2211-286*X)*Math.sin(Rad(Z))*Math.sin(Rad(2*Q)) \n -2208*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n -568*Math.sin(Rad(3*Z))*Math.sin(Rad(2*Q))\n -346*Math.sin(Rad(4*Z))*Math.sin(Rad(2*Q))\n -(2780+222*X)*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +(2022+263*X)*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +248*Math.cos(Rad(3*Z))*Math.sin(Rad(2*Q))\n +242*Math.sin(Rad(3*PS))*Math.sin(Rad(2*Q))\n +467*Math.cos(Rad(3*PS))*Math.sin(Rad(2*Q))\n -490*Math.cos(Rad(2*Q))\n -(2842+279*X)*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +(128+226*X)*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +224*Math.sin(Rad(3*Z))*Math.cos(Rad(2*Q))\n +(-1594+282*X)*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n +(2162-207*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n +561*Math.cos(Rad(3*Z))*Math.cos(Rad(2*Q))\n +343*Math.cos(Rad(4*Z))*Math.cos(Rad(2*Q))\n +469*Math.sin(Rad(3*PS))*Math.cos(Rad(2*Q))\n -242*Math.cos(Rad(3*PS))*Math.cos(Rad(2*Q))\n -205*Math.sin(Rad(Z))*Math.sin(Rad(3*Q))\n +262*Math.sin(Rad(3*Z))*Math.sin(Rad(3*Q))\n +208*Math.cos(Rad(Z))*Math.cos(Rad(3*Q))\n -271*Math.cos(Rad(3*Z))*Math.cos(Rad(3*Q))\n -382*Math.cos(Rad(3*Z))*Math.sin(Rad(4*Q))\n -376*Math.sin(Rad(3*Z))*Math.cos(Rad(4*Q));\n\n Delta_EC=Delta_EC/10000000; \n\n // correzione del perielio\n\n Delta_P=+(0.077108+0.007186*X-0.001533*X*X)*Math.sin(Rad(V))\n +(0.045803-0.014766*X-0.000536*X*X)*Math.cos(Rad(V))\n -0.007075*Math.sin(Rad(Z))\n -0.075825*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n -0.024839*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -0.008631*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n -0.072586*Math.cos(Rad(Q))\n -0.150383*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +0.026897*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +0.010053*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n -(0.013597+0.001719*X)*Math.sin(Rad(Z))*Math.sin(Rad(2*Q))\n +(-0.007742+0.001517*X)*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +(0.013586-0.001375*X)*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +(-0.013667+0.001239*X)*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +0.011981*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +(0.014861+0.001136*X)*Math.cos(Rad(Z))*Math.cos(Rad(2*Q))\n -(0.013064+0.001628*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q));\n\n\n // correzione per l'anomalia media da aggiungere prima dell'equazione di Keplero\n\n var el_orb=orb_plan(njd,5); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità senza correzione.\n\n Delta_MM=Delta_LL-(Delta_P/eccent);\n\n\n// semiasse maggiore.\n\n Delta_AS=572*X*Math.sin(Rad(V))\n +2933*Math.cos(Rad(V))\n +33629*Math.cos(Rad(Z))\n -3081*Math.cos(Rad(2*Z))\n -1423*Math.cos(Rad(3*Z))\n -671*Math.cos(Rad(4*Z))\n -320*Math.cos(Rad(5*Z))\n +1098*Math.sin(Rad(Q))\n -2812*Math.sin(Rad(Z))*Math.sin(Rad(Q))\n +688*Math.sin(Rad(2*Z))*Math.sin(Rad(Q))\n -393*Math.sin(Rad(3*Z))*Math.sin(Rad(Q))\n -228*Math.sin(Rad(4*Z))*Math.sin(Rad(Q))\n +2138*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n -999*Math.cos(Rad(2*Z))*Math.sin(Rad(Q))\n -642*Math.cos(Rad(3*Z))*Math.sin(Rad(Q))\n -325*Math.cos(Rad(4*Z))*Math.sin(Rad(Q))\n -890*Math.cos(Rad(Q))\n +2206*Math.sin(Rad(Z))*Math.cos(Rad(Q))\n -1590*Math.sin(Rad(2*Z))*Math.cos(Rad(Q))\n -647*Math.sin(Rad(3*Z))*Math.cos(Rad(Q))\n -344*Math.sin(Rad(4*Z))*Math.cos(Rad(Q))\n +2885*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +(2172+102*X)*Math.cos(Rad(2*Z))*Math.cos(Rad(Q))\n +296*Math.cos(Rad(3*Z))*Math.cos(Rad(Q))\n -267*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n -778*Math.cos(Rad(Z))*Math.sin(Rad(2*Q))\n +495*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +250*Math.cos(Rad(3*Z))*Math.sin(Rad(2*Q))\n -856*Math.sin(Rad(Z))*Math.cos(Rad(2*Q))\n +441*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n +296*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q))\n +211*Math.cos(Rad(3*Z))*Math.cos(Rad(2*Q))\n -427*Math.sin(Rad(Z))*Math.sin(Rad(3*Q))\n +398*Math.sin(Rad(3*Z))*Math.sin(Rad(3*Q))\n +344*Math.cos(Rad(Z))*Math.cos(Rad(3*Q))\n -427*Math.cos(Rad(3*Z))*Math.cos(Rad(3*Q));\n \nDelta_AS=Delta_AS/1000000;\n\n\n\n// aggiungere alla latitudine eliocentrica.\n\n Delta_LAT_ELIO= +0.000747*Math.cos(Rad(Z))*Math.sin(Rad(Q))\n +0.001069*Math.cos(Rad(Z))*Math.cos(Rad(Q))\n +0.002108*Math.sin(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.001261*Math.cos(Rad(2*Z))*Math.sin(Rad(2*Q))\n +0.001236*Math.sin(Rad(2*Z))*Math.cos(Rad(2*Q))\n -0.002075*Math.cos(Rad(2*Z))*Math.cos(Rad(2*Q)); \n\n}\n\n// correzioni per il pianeta Saturno******************************** FINE.\n\n// correzioni per il pianeta Urano******************************** INIZIO.\n\nif (np==6) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var W=2*P-6*Q+3*S;\n var G=83.76922+218.4901*T;\n var H=2*G-S;\n var Z=S-P;\n var N=S-Q;\n var OM=G-S;\n \n // perturbazioni in longitudine media A\n\n Delta_LP=+(0.864319-0.001583*X)*Math.sin(Rad(H))\n +(0.082222-0.006833*X)*Math.cos(Rad(H))\n +0.036017*Math.sin(Rad(2*H))\n -0.003019*Math.cos(Rad(2*H))\n +0.008122*Math.sin(Rad(W));\n\n var B=0.120303*Math.sin(Rad(H))\n +(0.019472-0.000947*X)*Math.cos(Rad(H))\n +0.006197*Math.sin(Rad(2*H));\n\n // correzione per l'anomalia media di Urano\n\n var el_orb=orb_plan(njd,6); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità senza correzione.\n\n Delta_MM=Delta_LP-(B/eccent);\n\n // eccentricità\n\nDelta_EC=+(-3349+163*X)*Math.sin(Rad(H)) \n +20981*Math.cos(Rad(H))\n +1311*Math.cos(Rad(2*H));\n\nDelta_EC=Delta_EC/10000000;\n\n // correzione semiasse maggiore.\n\nDelta_AS=-0.003825*Math.cos(Rad(H));\n\n // correzione per la longitudine vera.\n\n Delta_LL=+(0.010122-0.000988*X)*Math.sin(Rad(S+N))\n +(-0.038581+0.002031*X-0.001910*X*X)*Math.cos(Rad(S+N))\n +(0.034964-0.001038*X+0.000868*X*X)*Math.cos(Rad(2*S+N))\n +0.005594*Math.sin(Rad(S+3*OM))\n -0.014808*Math.sin(Rad(Z))\n -0.005794*Math.sin(Rad(N))\n +0.002347*Math.cos(Rad(N))\n +0.009872*Math.sin(Rad(OM))\n +0.008803*Math.sin(Rad(2*OM))\n -0.004308*Math.sin(Rad(3*OM));\n\n// aggiungere alla latitudine eliocentrica.\n\n Delta_LAT_ELIO=+(0.000458*Math.sin(Rad(N))-0.000642*Math.cos(Rad(N))-0.000517*Math.cos(Rad(4*OM)))*Math.sin(Rad(S))\n -(0.000347*Math.sin(Rad(N))+0.000853*Math.cos(Rad(N))+0.000517*Math.sin(Rad(4*N)))*Math.cos(Rad(S))\n +0.000403*(Math.cos(Rad(2*OM))*Math.sin(Rad(2*S))+Math.sin(Rad(2*OM))*Math.cos(Rad(2*S))); \n\n// correzione al raggio vettore.\n\nDelta_R=-25948+ (5795*Math.cos(Rad(S))-1165*Math.sin(Rad(S))+1388*Math.cos(Rad(2*S)))*Math.sin(Rad(N))\n +4985*Math.cos(Rad(Z))+(1351*Math.cos(Rad(S))+5702*Math.sin(Rad(S))+1388*Math.sin(Rad(2*S)))*Math.cos(Rad(N))\n -1230*Math.cos(Rad(S))+904*Math.cos(Rad(2*OM))\n +3354*Math.cos(Rad(N))+894*(Math.cos(Rad(OM))-Math.cos(Rad(3*OM)));\n\nDelta_R=Delta_R/1000000;\n \n \n\n}\n// correzioni per il pianeta Urano ************************************ FINE.\n\n// correzioni per il pianeta Nettuno ******************************** INIZIO.\n\nif (np==7) {\n\n var X=(T/5)+0.1;\n var P=237.47555+3034.9061*T;\n var Q=265.91650+1222.1139*T;\n var S=243.51721+428.46770*T;\n var W=2*P-6*Q+3*S;\n var G=83.76922+218.4901*T;\n var H=2*G-S;\n var Z=G-P;\n var N=G-Q;\n var OM=G-S;\n \n // perturbazioni in longitudine media A\n\n Delta_LP=+(-0.589833+0.001089*X)*Math.sin(Rad(H))\n +(-0.056094+0.004658*X)*Math.cos(Rad(H)) \n -0.024286*Math.sin(Rad(2*H));\n\n var B=0.024039*Math.sin(Rad(H))\n -0.025303*Math.cos(Rad(H))\n +0.006206*Math.sin(Rad(2*H))\n -0.005992*Math.cos(Rad(2*H));\n\n// correzione per l'anomalia media di Urano\n\n var el_orb=orb_plan(njd,7); // recupera l'eccentricità del pianeta.\n var eccent=el_orb[4]; // eccentricità senza correzione.\n\n Delta_MM=Delta_LP-(B/eccent);\n\n // eccentricità\n\n Delta_EC=+4389*Math.sin(Rad(H))\n +4262*Math.cos(Rad(H))\n +1129*Math.sin(Rad(2*H))\n +1089*Math.cos(Rad(2*H));\n\n Delta_EC=Delta_EC/10000000;\n\n// correzione semiasse maggiore.\n\n Delta_AS=-817*Math.sin(Rad(H))+8189*Math.cos(Rad(H))+781*Math.cos(Rad(2*H));\n\n Delta_AS=Delta_AS/1000000;\n\n // correzione per la longitudine vera.\n\n Delta_LL=-0.009556*Math.sin(Rad(Z))\n -0.005178*Math.sin(Rad(N))\n +0.002572*Math.sin(Rad(2*OM))\n -0.002972*Math.cos(Rad(2*OM))*Math.sin(Rad(G))\n -0.002833*Math.sin(Rad(2*OM))*Math.cos(Rad(G));\n \n // aggiungere alla latitudine eliocentrica.\n\n Delta_LAT_ELIO=+0.000336*Math.cos(Rad(2*OM))*Math.sin(Rad(G))\n +0.000364*Math.sin(Rad(2*OM))*Math.cos(Rad(G));\n\n // correzione al raggio vettore.\n\n Delta_R=-40596\n +4992*Math.cos(Rad(Z))\n +2744*Math.cos(Rad(N))\n +2044*Math.cos(Rad(OM))\n +1051*Math.cos(Rad(2*OM));\n\nDelta_R=Delta_R/1000000;\n \n\n}\n// correzioni per il pianeta Nettuno ******************************** FINE\n\n\n// variabili correzioni\n// lperiodo, rvett long. assemagg ecc M lat\n var correzioni=new Array(Delta_LP,Delta_R,Delta_LL,Delta_AS,Delta_EC,Delta_MM,Delta_LAT_ELIO);\n\n return correzioni;\n\n}", "function ExtendXPassages() {\n for(let i=0; i<x_buffer.length; i++) {\n var j = x_buffer[i].length - 1;\n var rand = $.random.nextInt(0, 99);\n for(var k=0; k<X_PROBABILITY_MAP[j].length; k++) {\n rand -= X_PROBABILITY_MAP[j][k];\n if(rand < 0) break;\n }\n\n var x_array;\n if(x_buffer[i].direction==NORTH) {\n x_array = JSON.parse(JSON.stringify(TEMPLATE_NORTH_X_ARRAY[k]));\n }else if(x_buffer[i].direction==SOUTH) {\n x_array = JSON.parse(JSON.stringify(TEMPLATE_SOUTH_X_ARRAY[k]));\n }\n //console.log(x_array.lengths)\n \n if(x_buffer[i].length < 4) {\n x_array.lengths[0] += 1;\n }else{\n var min = 1;\n var max = x_array.lengths.length - 2;\n var repeat_num = x_buffer[i].length - x_array.rand_base_num + 2;\n if(x_buffer[i].start_side_closed) {\n repeat_num -= 1;\n x_array.lengths[0] = 1;\n min -= 1;\n }\n if(x_buffer[i].end_side_closed) {\n repeat_num -= 1;\n x_array.lengths[x_array.lengths.length - 1] = 1;\n max += 1;\n }\n\n for(let n=0; n<repeat_num; n++) {\n var rand_index = $.random.nextInt(min, max);\n x_array.lengths[rand_index] += 1;\n }\n }\n //console.log(x_array.lengths)\n\n var x = x_buffer[i].x;\n var y = x_buffer[i].y;\n for(let n in x_array.lengths) {\n for(let m=0; m<x_array.lengths[n]; m++) {\n map2d[y][x] = x_array.type[n];\n x++;\n }\n }\n }\n //var fuga = \"\";\n //for(let y=0; y<target_data_map.height; y++) {\n // for(let x=0; x<target_data_map.width; x++) {\n // if(map2d[y][x] == 0) {\n // fuga += \" 0\";\n // }else if (map2d[y][x] == 1) {\n // fuga += \" 1\";\n // }else {\n // fuga += String(map2d[y][x]);\n // }\n // }\n // fuga += \"\\n\";\n //}\n //console.log(fuga);\n }", "function setup() {\n\n// creating the canvas\n let canvas = createCanvas(800,450);\n background(\"#000000\");\n\n// initial planet values\n planetPink = new planet(canvas.width/2,canvas.height/2,30,30,0,0,\"#F7ACCF\",canvas.width/2,canvas.height/2,0,50,100,0.05);\n planetRed = new planet (0,0,21,21,0,0,\"#AF1B3F\",canvas.width/2,canvas.height/2,0);\n planetOrange = new planet (500,350,28,28,0,0,\"#FF8552\");\n planetYellow = new planet (600,200,70,70,0,0,\"#E9B872\");\n\n// initial orbit values\n\n orbit1B = new orbit (canvas.width/2,canvas.height/2,150,100,canvas.width/2,canvas.height/2);\n\n\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n background(24);\n noStroke();\n smooth();\n\n x = 0; // Starting on the left hand side\n t = random(10000);\n y = noise(t);\n}", "function Noise(seed) {\n function Grad(x, y, z) {\n this.x = x;\n this.y = y;\n this.z = z;\n }\n\n Grad.prototype.dot2 = function(x, y) {\n return this.x * x + this.y * y;\n };\n\n Grad.prototype.dot3 = function(x, y, z) {\n return this.x * x + this.y * y + this.z * z;\n };\n\n this.grad3 = [\n new Grad(1, 1, 0),\n new Grad(-1, 1, 0),\n new Grad(1, -1, 0),\n new Grad(-1, -1, 0),\n new Grad(1, 0, 1),\n new Grad(-1, 0, 1),\n new Grad(1, 0, -1),\n new Grad(-1, 0, -1),\n new Grad(0, 1, 1),\n new Grad(0, -1, 1),\n new Grad(0, 1, -1),\n new Grad(0, -1, -1)\n ];\n\n this.p = [\n 151,\n 160,\n 137,\n 91,\n 90,\n 15,\n 131,\n 13,\n 201,\n 95,\n 96,\n 53,\n 194,\n 233,\n 7,\n 225,\n 140,\n 36,\n 103,\n 30,\n 69,\n 142,\n 8,\n 99,\n 37,\n 240,\n 21,\n 10,\n 23,\n 190,\n 6,\n 148,\n 247,\n 120,\n 234,\n 75,\n 0,\n 26,\n 197,\n 62,\n 94,\n 252,\n 219,\n 203,\n 117,\n 35,\n 11,\n 32,\n 57,\n 177,\n 33,\n 88,\n 237,\n 149,\n 56,\n 87,\n 174,\n 20,\n 125,\n 136,\n 171,\n 168,\n 68,\n 175,\n 74,\n 165,\n 71,\n 134,\n 139,\n 48,\n 27,\n 166,\n 77,\n 146,\n 158,\n 231,\n 83,\n 111,\n 229,\n 122,\n 60,\n 211,\n 133,\n 230,\n 220,\n 105,\n 92,\n 41,\n 55,\n 46,\n 245,\n 40,\n 244,\n 102,\n 143,\n 54,\n 65,\n 25,\n 63,\n 161,\n 1,\n 216,\n 80,\n 73,\n 209,\n 76,\n 132,\n 187,\n 208,\n 89,\n 18,\n 169,\n 200,\n 196,\n 135,\n 130,\n 116,\n 188,\n 159,\n 86,\n 164,\n 100,\n 109,\n 198,\n 173,\n 186,\n 3,\n 64,\n 52,\n 217,\n 226,\n 250,\n 124,\n 123,\n 5,\n 202,\n 38,\n 147,\n 118,\n 126,\n 255,\n 82,\n 85,\n 212,\n 207,\n 206,\n 59,\n 227,\n 47,\n 16,\n 58,\n 17,\n 182,\n 189,\n 28,\n 42,\n 223,\n 183,\n 170,\n 213,\n 119,\n 248,\n 152,\n 2,\n 44,\n 154,\n 163,\n 70,\n 221,\n 153,\n 101,\n 155,\n 167,\n 43,\n 172,\n 9,\n 129,\n 22,\n 39,\n 253,\n 19,\n 98,\n 108,\n 110,\n 79,\n 113,\n 224,\n 232,\n 178,\n 185,\n 112,\n 104,\n 218,\n 246,\n 97,\n 228,\n 251,\n 34,\n 242,\n 193,\n 238,\n 210,\n 144,\n 12,\n 191,\n 179,\n 162,\n 241,\n 81,\n 51,\n 145,\n 235,\n 249,\n 14,\n 239,\n 107,\n 49,\n 192,\n 214,\n 31,\n 181,\n 199,\n 106,\n 157,\n 184,\n 84,\n 204,\n 176,\n 115,\n 121,\n 50,\n 45,\n 127,\n 4,\n 150,\n 254,\n 138,\n 236,\n 205,\n 93,\n 222,\n 114,\n 67,\n 29,\n 24,\n 72,\n 243,\n 141,\n 128,\n 195,\n 78,\n 66,\n 215,\n 61,\n 156,\n 180\n ];\n // To remove the need for index wrapping, double the permutation table length\n this.perm = new Array(512);\n this.gradP = new Array(512);\n\n this.seed(seed || 0);\n }", "function setup() {\n createCanvas(windowWidth-100, 400);\n\n // Request the data from apixu.com\n var url = 'http://api.apixu.com/v1/current.json?key=1b2ae85d8ffa4cf59b6203012180302&q=providence';\n loadJSON(url, gotWeather);\n\n wind = createVector();\n BGtemp = 255;\n\n for(var i=0; i<5; i++){\n bubbles[i] = {\n position : createVector(windowWidth-120, 10),\n displayIt: function(){\n noFill();\n stroke(BGtemp);\n // fill(random(10,200),random(10,200),random(10,200));\n ellipse(this.position.x, this.position.y, 20, 20);\n },\n move: function(){\n this.position.x = this.position.x + random(-2,2);\n this.position.y = this.position.y + random(-2,2);\n this.position.add(wind);\n\n if (this.position.x > width) this.position.x = 0;\n if (this.position.x < 0) this.position.x = width;\n if (this.position.y > height) this.position.y = 0;\n if (this.position.y < 0) this.position.y = height;\n }\n }\n }\n\n\n }", "function Interpolation(gs1, gs2)\n{\n var s1 = stn(gs1);\n var s2 = stn(gs2);\n var i1 = [ s1[0], s1[1], s1[2], s1[3], s1[5], s1[6], s1[8], s1[9], s1[11], s1[12] ];\n var i2 = [], i3 = [], i4 = [], i5 = [], i6 = [], i7 = [], i8 = [], i9 = [], i10 = [];\n \n //ball positive on X\n if (s2[0] > s1[0])\n {\n i2.push(s1[0] + 1);\n i3.push(s1[0] + 2);\n i4.push(s1[0] + 3);\n i5.push(s1[0] + 4);\n }\n else\n {\n i2.push(s1[0] - 1);\n i3.push(s1[0] - 2);\n i4.push(s1[0] - 3);\n i5.push(s1[0] - 4);\n }\n \n //ball positive on Y\n if (s2[1] > s1[1])\n {\n \ti2.push(s1[1] + 1);\n \ti3.push(s1[1] + 2);\n \ti4.push(s1[1] + 3);\n \ti5.push(s1[1] + 4);\n }\n else\n {\n \ti2.push(s1[1] - 1);\n \ti3.push(s1[1] - 2);\n \ti4.push(s1[1] - 3);\n \ti5.push(s1[1] - 4);\n }\n \n for (var i = 0; i<4; ++i)\n {\n if (i == 0)\n var iX = 2; //2, 5, 8, 11\n else if (i == 1)\n var iX = 5;\n else if (i == 2)\n var iX = 8;\n else if (i == 3)\n var iX = 11;\n var iY = iX+1; //3, 6, 9, 12\n var xDelta = s2[iX] - s1[iX];\n var xAct = Math.floor(xDelta/5);\n var yDelta = s2[iY] - s2[iY];\n var yAct = Math.floor(yDelta/5);\n \n if (xDelta >= 0)\n {\n i2.push(s1[iX] + xAct);\n i3.push(s1[iX] + 2*xAct);\n i4.push(s1[iX] + 3*xAct);\n i5.push(s1[iX] + 4 * xAct);\n }\n else\n {\n \ti2.push(s1[iX] - xAct);\n \ti3.push(s1[iX] - 2 * xAct);\n \ti4.push(s1[iX] - 3 * xAct);\n \ti5.push(s1[iX] - 4 * xAct);\n }\n \n if (yDelta >= 0)\n {\n i2.push(s1[iY] + yAct);\n i3.push(s1[iY] + 2*yAct);\n i4.push(s1[iY] + 3*yAct);\n i5.push(s1[iY] + 4 * yAct);\n }\n else\n {\n \ti2.push(s1[iY] - yAct);\n \ti3.push(s1[iY] - 2 * yAct);\n \ti4.push(s1[iY] - 3 * yAct);\n \ti5.push(s1[iY] - 4 * yAct);\n }\n }\n \n var i11 = [ s2[0], s2[1], s2[2], s2[3], s2[5], s2[6], s2[8], s2[9], s2[11], s2[12] ];\n \n var result = new Array();\n result.push(i1);\n result.push(i2);\n result.push(i3);\n result.push(i4);\n result.push(i5);\n result.push(i11);\n \n return result;\n}", "function generateBottom480(){\r\n\tvar p1 = COLOR([0,0,0])(STRUCT([T([0,1,2])([-0.19,trainWidth+0.1,-trainHeight]),R([0,1])(-PI/2),\r\n\t\tCUBOID([trainWidth+0.15,trainLength+0.18])]));\r\n\tvar p2 = function(){\r\n\t\tvar adjust = 0.85;\r\n\t\tvar adjustBase = 0.25;\r\n\t\tvar c1 = BEZIER(S0)([[-adjustBase+0.2,trainHeight,-etr450adjust-0.3],[-adjustBase,trainHeight,-0.2],\r\n\t\t\t[trainWidth/2,trainHeight,1.8],[trainWidth+adjustBase,trainHeight,-0.2],\r\n\t\t\t[trainWidth+adjustBase-0.2,trainHeight,-etr450adjust-0.3]]);\r\n\r\n\t\tvar c2 = BEZIER(S0)([[-adjustBase+0.2,trainHeight,-etr450adjust-0.3-1],[-adjustBase,trainHeight+0.5,-0.2-0.5],\r\n\t\t\t[trainWidth/2,trainHeight+1,0.8],[trainWidth+adjustBase,trainHeight+0.5,-0.2-0.5],\r\n\t\t\t[trainWidth+adjustBase-0.2,trainHeight,-etr450adjust-0.3-1]]);\r\n\r\n\t\tvar c3 = BEZIER(S0)([[-adjustBase+0.2,trainHeight,-etr450adjust-0.3-1],[-adjustBase,trainHeight+0.5,-0.2-0.5],\r\n\t\t\t[trainWidth/2,trainHeight+1,2.5],[trainWidth+adjustBase,trainHeight+0.5,-0.2-0.5],\r\n\t\t\t[trainWidth+adjustBase-0.2,trainHeight,-etr450adjust-0.3-1]]);\r\n\r\n\t\tvar out = MAP(BEZIER(S1)([c1,c2,c3]))(dom2D);\r\n\r\n\t\treturn COLOR([0.5,0.5,0.5])(STRUCT([T([0,1,2])([-2.2,trainWidth,-trainHeight*2]),R([0,1])(-PI/2),R([1,2])(PI/2),out]));\r\n\r\n\t};\r\n\treturn STRUCT([p1,p2()]);\r\n}", "function setup() {\r\n\tcreateCanvas(500, 500);\r\n\tframeRate(40);\r\n\tsing_width = 20;\r\n\r\n\tcolumns = width / sing_width;\r\n\trows = height / sing_width;\r\n\tcolumns = floor(columns);\r\n\trows = floor(rows);\r\n\r\n\tfor (let j = 0; j < rows; j++) {\r\n\t\tfor (let i = 0; i < columns; i++) {\r\n\t\t\tlet unit = new Unit(i, j);\r\n\t\t\tmaze_grid.push(unit);\r\n\t\t}\r\n\t}\r\n\r\n\t// sets up first position for both generation and path finding\r\n\tcurrent_unit = maze_grid[0];\r\n\tpath_iteration = maze_grid[0];\r\n}", "function Journal(start, blowradius)\n{\n this.annotations = {};\n this.artificialright = null;\n this.artificialrightframe = null;\n this.blowradius = blowradius;\n this.start = start;\n\n /*\n * Marks the boxes position.\n */\n this.mark = function(frame, position)\n {\n // Implementation for target doubtPath (0315)\n //console.log(this)\n\n //console.log(\"blowradius :\" + this.blowradius);\n //console.log(\"Marking \" + frame);\n //console.log(this.annotations);\n var newannotations = {};\n\n for (var i in this.annotations) // check all positions in all frames\n {\n if (Math.abs(i - frame) >= this.blowradius)\n {\n newannotations[i] = this.annotations[i];\n }\n else if (i == this.start)\n {\n //console.log(\"Start would blow, so propagating\");\n newannotations[i] = position;\n }\n else\n {\n //console.log(\"Blowing out annotation at \" + i); // blow out (not saving to newannotation) because the interval of ket frames(blowradius) < 3\n }\n }\n\n this.annotations = newannotations;\n this.annotations[frame] = position; // store the operation result in \"this.annotations[frame] \"\n }\n\n // Implementation, suspend on 0313\n this.mark0313suspend = function(frame, position) // for exsiting and new create object\n {\n console.log(\"blowradius :\" + this.blowradius);\n console.log(\"Marking(Current frame) \" + frame);\n\n console.log(\"Linear regression before change:\");\n\n //get regression from API\n var coordinateX = [], coordinateY = [];\n for (var i in this.annotations){\n if( i != 0 && i != 299){\n var midx = (parseInt(this.annotations[i].xtl) + parseInt(this.annotations[i].xbr)) / 2.0;\n var midy = (parseInt(this.annotations[i].ytl) + parseInt(this.annotations[i].ybr)) / 2.0;\n var tempX = [i, midx];\n var tempY = [i, midy];\n //console.log(temp);\n coordinateX.push(tempX);\n coordinateY.push(tempY);\n }\n }\n console.log(\"X array \" + coordinateX);\n console.log(\"Y array \" + coordinateY);\n var regressionX = methods.linear(coordinateX, { order: 2, precision: 2, period: null });\n var regressionY = methods.linear(coordinateY, { order: 2, precision: 2, period: null });\n\n var expectedX = regressionX.points.find(function (item, index, array){ return item.includes(frame)}); // find the expected coordinate in modified frame\n var expectedY = regressionY.points.find(function (item, index, array){ return item.includes(frame)}); // find the expected coordinate in modified frame\n\n var deviationX = 0;\n var deviationY = 0;\n\n if (expectedX != null){\n console.log(\"Expected value :\" + expectedX);\n var observeredX = (parseInt(this.annotations[frame].xtl) + parseInt(this.annotations[frame].xbr)) / 2.0;\n var modifiedX = (parseInt(position.xtl) + parseInt(position.xbr)) / 2.0;\n console.log(\"Observered value X:\" + observeredX);\n console.log(\"Deviation value(before modified) X: \" + (observeredX - expectedX[1]));\n console.log(\"Deviation value(after modified) X: \" + (modifiedX - expectedX[1]));\n\n if (Math.abs(modifiedX - expectedX[1]) > Math.abs(observeredX - expectedX[1])){ // if modified location does not fit the regression\n if((modifiedX - expectedX[1]) * (observeredX - expectedX[1]) > 0){ // same side of the regression line\n deviationX = modifiedX - observeredX;\n }\n if((modifiedX - expectedX[1]) * (observeredX - expectedX[1]) < 0){ // different side of the regression line\n deviationX = Math.abs(modifiedX - expectedX[1]) - Math.abs(observeredX - expectedX[1]);\n if(observeredX > modifiedX){\n deviationX *= -1;\n }\n }\n }\n console.log(\"update deviationX :\" + deviationX);\n console.log(\"-------------------------------------\");\n\n console.log(\"Expected value :\" + expectedY);\n var observeredY = (parseInt(this.annotations[frame].ytl) + parseInt(this.annotations[frame].ybr)) / 2.0;\n var modifiedY = (parseInt(position.ytl) + parseInt(position.ybr)) / 2.0;\n console.log(\"Observered value Y:\" + observeredY);\n console.log(\"Deviation value(before modified) Y: \" + (observeredY - expectedY[1]));\n console.log(\"Deviation value(after modified) Y: \" + (modifiedY - expectedY[1]));\n\n if (Math.abs(modifiedY - expectedY[1]) > Math.abs(observeredY - expectedY[1])){ // if modified location does not fit the regression\n if((modifiedY - expectedY[1]) * (observeredY - expectedY[1]) > 0){ // same side of the regression line\n deviationY = modifiedY - observeredY;\n }\n if((modifiedY - expectedY[1]) * (observeredY - expectedY[1]) < 0){ // different side of the regression line\n deviationY = Math.abs(modifiedY - expectedY[1]) - Math.abs(observeredY - expectedY[1]);\n if(observeredY > modifiedY){\n deviationY *= -1;\n }\n }\n }\n\n console.log(\"update deviationY :\" + deviationY);\n\n }\n else{\n console.log(\"No existing point in this frame!\");\n }\n\n console.log(regressionY);\n\n\n\n\n // Update to new annotation\n\n var newannotations = {};\n\n console.log(\"coordinateX.length : \" + coordinateX.length);\n for (var i in this.annotations) // check all positions in all frames\n {\n if (Math.abs(i - frame) >= this.blowradius)\n {\n if(Math.abs(frame - i) < (coordinateX.length) ){\n this.annotations[i].xbr += deviationX;\n this.annotations[i].xtl += deviationX;\n this.annotations[i].ybr += deviationY;\n this.annotations[i].ytl += deviationY;\n console.log(\"Adjust by the regression deviation at frame [\" + i + \"]\");\n }\n newannotations[i] = this.annotations[i];\n\n }\n else if (i == this.start)\n {\n console.log(\"Start would blow, so propagating\");\n newannotations[i] = position; //position.xbr, position.xtl, position.ybr, position.ytl\n }\n else\n {\n console.log(\"Blowing out annotation at \" + i); // blow out (not saving to newannotation) because the interval of ket frames(blowradius) < 3\n }\n }\n\n this.annotations = newannotations;\n this.annotations[frame] = position; // store the operation result in \"this.annotations[frame] \"\n\n console.log(\"After change:\")\n\n for (var i in this.annotations){\n console.log(this.annotations[i]);\n }\n\n // calculate the linear regression,(implementation) of the path\n /*\n var xa = 0.0; // frame\n var yaX = 0.0; // x axis\n var yaY = 0.0; // y axis\n var ax, bx, ay, by;\n var Lxx = 0.0, LxyX = 0.0, LxyY = 0.0;\n var count = 0.0;\n\n for (var i in this.annotations){\n if (i != 0){\n var midx = (parseInt(this.annotations[i].xtl) + parseInt(this.annotations[i].xbr)) / 2.0;\n var midy = (parseInt(this.annotations[i].ytl) + parseInt(this.annotations[i].ybr)) / 2.0;\n xa += parseInt(i);\n yaX += midx;\n yaY += midy;\n count ++;\n }\n }\n\n xa /= count;\n yaX /= count; // minX\n yaY /= count; // minY\n\n for (var i in this.annotations){\n if( i != 0){\n var midx = (parseInt(this.annotations[i].xtl) + parseInt(this.annotations[i].xbr)) / 2.0;\n var midy = (parseInt(this.annotations[i].ytl) + parseInt(this.annotations[i].ybr)) / 2.0;\n Lxx += (i - xa) * (i - xa);\n LxyX += (i - xa) * (midx - yaX);\n LxyY += (i - xa) * (midy - yaY);\n }\n }\n\n // Result\n bx = (LxyX / Lxx);\n ax = (yaX - bx * xa);\n\n by = (LxyY / Lxx);\n ay = (yaY - by * xa);\n\n console.log(\"y = x * \" + bx + \" + \" + ax);\n console.log(\"y = x * \" + by + \" + \" + ay);\n // measurements\n var SSRx = 0, SSRy = 0, SSEx = 0, SSEy = 0, SSTx, SSTy;\n\n for (var i in this.annotations){\n if( i != 0){\n var midx = (parseInt(this.annotations[i].xtl) + parseInt(this.annotations[i].xbr)) / 2.0;\n var midy = (parseInt(this.annotations[i].ytl) + parseInt(this.annotations[i].ybr)) / 2.0;\n var expX = i * bx + ax; // calculate expected coordinate x with formula\n var expY = i * by + ay; // calculate expected coordinate x with formula\n\n SSRx += (expX - yaX) * (expX - yaX);\n SSRy += (expY - yaY) * (expY - yaY);\n SSEx += (midx - expX) * (midx - expX);\n SSEy += (midy - expY) * (midy - expY);\n\n var weight = parseInt(this.annotations[i].xbr) - parseInt(this.annotations[i].xtl);\n var height = parseInt(this.annotations[i].ybr) - parseInt(this.annotations[i].ytl);\n var area = weight * height;\n\n console.log(\"Frame \" + i + \", Obeserve X: \" + midx + \", Expect X: \" + expX.toFixed(2));\n console.log(\"Frame \" + i + \", Obeserve Y: \" + midy + \", Expect Y: \" + expY.toFixed(2));\n console.log(\"Weight : \" + weight + \", height : \" + height + \", Area : \" + area);\n console.log(\"-----------------------------\");\n\n if(parseInt(i) == parseInt(frame)){ // current frame information : location and size\n var updatedArea = (parseInt(position.xbr) - parseInt(position.xtl)) * (parseInt(position.ybr) - parseInt(position.ytl))\n var positionX = (parseInt(position.xtl) + parseInt(position.xbr)) / 2.0; // changed coordinate X\n var positionY = (parseInt(position.ytl) + parseInt(position.ybr)) / 2.0; // changed coordinate Y\n\n console.log(\"--------------------------Chagned Frame---------------------------- \" + frame);\n console.log(\"Obeserve X(changed) : \" + positionX + \", expect X: \" + expX.toFixed(2));\n console.log(\"Previous deviation x : [\" + (midx - expX).toFixed(2) + \"], after update deviation x : [\" + (positionX - expX).toFixed(2) + \"]\");\n console.log(\"Obeserve Y(changed) : \" + positionY + \", expect Y: \" + expY.toFixed(2));\n console.log(\"Previous deviation y : [\" + (midy - expY).toFixed(2) + \"], after update deviation y : [\" + (positionY - expY).toFixed(2) + \"]\");\n\n console.log(\"Previous area : \" + area + \", after update area : \" + updatedArea + \"\");\n console.log(\"------------------------------------------------------------------- \");\n console.log();\n }\n }\n }\n SSTx = SSRx + SSEx;\n SSTy = SSRy + SSEy;\n\n\n\n console.log(\"this.start = \" + this.start);\n console.log(\"x list :\"); // ���� this.annotations[i].xtl, this.annotations[i].ytl, this.annotations[i].xbr, this.annotations[i].ybr\n //console.log(midXList);\n */\n\n }\n\n\n this.bounds = function(frame)\n {\n if (this.annotations[frame])\n {\n var item = this.annotations[frame];\n return {'left': item,\n 'leftframe': frame,\n 'right': item,\n 'rightframe': frame};\n }\n\n var left = null;\n var right = null;\n var lefttime = 0;\n var righttime = 0;\n\n for (t in this.annotations)\n {\n var item = this.annotations[t];\n itemtime = parseInt(t);\n\n if (itemtime <= frame)\n {\n if (left == null || itemtime > lefttime)\n {\n left = item;\n lefttime = itemtime;;\n }\n }\n else\n {\n if (right == null || itemtime < righttime)\n {\n right = item;\n righttime = itemtime;\n }\n }\n }\n\n return {'left': left,\n 'leftframe': lefttime,\n 'right': right,\n 'rightframe': righttime};\n }\n\n /*\n * Gets the right most annotation.\n */\n this.rightmost = function()\n {\n var item = null\n var itemtime = null;\n for (var t in this.annotations)\n {\n if (itemtime == null || t > itemtime)\n {\n item = this.annotations[t];\n itemtime = t;\n }\n }\n return item;\n }\n\n /*\n * Serializes this journal based on position.\n */\n this.serialize = function()\n {\n if (this.annotations.length == 0)\n {\n return \"{}\";\n }\n\n str = \"{\";\n for (var frame in this.annotations)\n {\n var dat = this.annotations[frame];\n if (dat instanceof Object)\n {\n dat = dat.serialize();\n }\n str += \"\\\"\" + frame + \"\\\":\" + dat + \",\";\n }\n\n if (this.artificialrightframe != null && this.annotations[this.artificialrightframe] == null)\n {\n console.log(\"Using artificial in serialization\");\n var dat = this.artificialright;\n if (dat instanceof Object)\n {\n dat = dat.serialize();\n }\n str += \"\\\"\" + this.artificialrightframe + \"\\\":\" + dat + \",\";\n }\n return str.substr(0, str.length - 1) + \"}\";\n }\n}", "function draw() {\n\tbackground(241);\n\tstroke(210);\n\tvar t = 1.0*(frameCount - 1)/numFrames;\n\tnoiseDetail(1, 0.5);\n\tfor(var i = 0; i < m; i++){\n\t\tvar p = 1.0*i/m;\n\t\t//squiggly line 1\n\t\tvar dx1 = 100*noise(13.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy1 = 100*noise(2*13.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx1, dy1);\n\t\t//squiggly line 2\n\t\tvar dx2 = 100*noise(23.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy2 = 100*noise(2*23.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx2, height/6 + dy2);\n\t\t//squiggly line 3\n\t\tvar dx3 = 100*noise(33.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy3 = 100*noise(2*33.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx3, 2*height/6 + dy3);\n\t\t//squiggly line 4\n\t\tvar dx4 = 100*noise(43.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy4 = 100*noise(2*43.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx4, 3*height/6 + dy4);\n\t\t//squiggly line 5\n\t\tvar dx5 = 100*noise(53.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy5 = 100*noise(2*53.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx5, 4*height/6 + dy5);\n\t\t//squiggly line 6\n\t\tvar dx6 = 100*noise(63.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tvar dy6 = 100*noise(2*63.3 + rad*cos(TWO_PI*(nperiod*p - t)), rad*sin(TWO_PI*(nperiod*p - t)), 50.0*p);\n\t\tpoint(p*width + dx6, 5*height/6 + dy6);\n\t}\n}", "function setup() {\n /* var cnv = createCanvas(800, 800);\n cnv.position((windowWidth-width)/2, 30);\n background(5, 5, 5);\n fill(200, 30, 150);\n*/ //unused setup normally reserved for visual/graphics\n new numbarraygenerator(50)\n new insertionsorter(numbarray) \n}", "function init() {\n if (this.es === undefined || this.es <= 0) {\n throw new Error('incorrect elliptical usage');\n }\n\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n this.cgb = [];\n this.cbg = [];\n this.utg = [];\n this.gtu = [];\n\n var f = this.es / (1 + Math.sqrt(1 - this.es));\n var n = f / (2 - f);\n var np = n;\n\n this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 ))))));\n this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));\n\n np = np * n;\n this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));\n this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));\n\n np = np * n;\n this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));\n this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));\n\n np = np * n;\n this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));\n this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175)));\n\n np = np * n;\n this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));\n this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));\n\n np = np * n;\n this.cgb[5] = np * (601676 / 22275);\n this.cbg[5] = np * (444337 / 155925);\n\n np = Math.pow(n, 2);\n this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));\n\n this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));\n this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));\n\n this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));\n this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));\n\n np = np * n;\n this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 ))));\n this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));\n\n np = np * n;\n this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));\n this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));\n\n np = np * n;\n this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));\n this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));\n\n np = np * n;\n this.utg[5] = np * (-20648693 / 638668800);\n this.gtu[5] = np * (212378941 / 319334400);\n\n var Z = __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_3__common_gatg__[\"a\" /* default */])(this.cbg, this.lat0);\n this.Zb = -this.Qn * (Z + __webpack_require__.i(__WEBPACK_IMPORTED_MODULE_4__common_clens__[\"a\" /* default */])(this.gtu, 2 * Z));\n}", "function init() {\n if (this.es === undefined || this.es <= 0) {\n throw new Error('incorrect elliptical usage');\n }\n\n this.x0 = this.x0 !== undefined ? this.x0 : 0;\n this.y0 = this.y0 !== undefined ? this.y0 : 0;\n this.long0 = this.long0 !== undefined ? this.long0 : 0;\n this.lat0 = this.lat0 !== undefined ? this.lat0 : 0;\n\n this.cgb = [];\n this.cbg = [];\n this.utg = [];\n this.gtu = [];\n\n var f = this.es / (1 + Math.sqrt(1 - this.es));\n var n = f / (2 - f);\n var np = n;\n\n this.cgb[0] = n * (2 + n * (-2 / 3 + n * (-2 + n * (116 / 45 + n * (26 / 45 + n * (-2854 / 675 ))))));\n this.cbg[0] = n * (-2 + n * ( 2 / 3 + n * ( 4 / 3 + n * (-82 / 45 + n * (32 / 45 + n * (4642 / 4725))))));\n\n np = np * n;\n this.cgb[1] = np * (7 / 3 + n * (-8 / 5 + n * (-227 / 45 + n * (2704 / 315 + n * (2323 / 945)))));\n this.cbg[1] = np * (5 / 3 + n * (-16 / 15 + n * ( -13 / 9 + n * (904 / 315 + n * (-1522 / 945)))));\n\n np = np * n;\n this.cgb[2] = np * (56 / 15 + n * (-136 / 35 + n * (-1262 / 105 + n * (73814 / 2835))));\n this.cbg[2] = np * (-26 / 15 + n * (34 / 21 + n * (8 / 5 + n * (-12686 / 2835))));\n\n np = np * n;\n this.cgb[3] = np * (4279 / 630 + n * (-332 / 35 + n * (-399572 / 14175)));\n this.cbg[3] = np * (1237 / 630 + n * (-12 / 5 + n * ( -24832 / 14175)));\n\n np = np * n;\n this.cgb[4] = np * (4174 / 315 + n * (-144838 / 6237));\n this.cbg[4] = np * (-734 / 315 + n * (109598 / 31185));\n\n np = np * n;\n this.cgb[5] = np * (601676 / 22275);\n this.cbg[5] = np * (444337 / 155925);\n\n np = Math.pow(n, 2);\n this.Qn = this.k0 / (1 + n) * (1 + np * (1 / 4 + np * (1 / 64 + np / 256)));\n\n this.utg[0] = n * (-0.5 + n * ( 2 / 3 + n * (-37 / 96 + n * ( 1 / 360 + n * (81 / 512 + n * (-96199 / 604800))))));\n this.gtu[0] = n * (0.5 + n * (-2 / 3 + n * (5 / 16 + n * (41 / 180 + n * (-127 / 288 + n * (7891 / 37800))))));\n\n this.utg[1] = np * (-1 / 48 + n * (-1 / 15 + n * (437 / 1440 + n * (-46 / 105 + n * (1118711 / 3870720)))));\n this.gtu[1] = np * (13 / 48 + n * (-3 / 5 + n * (557 / 1440 + n * (281 / 630 + n * (-1983433 / 1935360)))));\n\n np = np * n;\n this.utg[2] = np * (-17 / 480 + n * (37 / 840 + n * (209 / 4480 + n * (-5569 / 90720 ))));\n this.gtu[2] = np * (61 / 240 + n * (-103 / 140 + n * (15061 / 26880 + n * (167603 / 181440))));\n\n np = np * n;\n this.utg[3] = np * (-4397 / 161280 + n * (11 / 504 + n * (830251 / 7257600)));\n this.gtu[3] = np * (49561 / 161280 + n * (-179 / 168 + n * (6601661 / 7257600)));\n\n np = np * n;\n this.utg[4] = np * (-4583 / 161280 + n * (108847 / 3991680));\n this.gtu[4] = np * (34729 / 80640 + n * (-3418889 / 1995840));\n\n np = np * n;\n this.utg[5] = np * (-20648693 / 638668800);\n this.gtu[5] = np * (212378941 / 319334400);\n\n var Z = Object(_common_gatg__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(this.cbg, this.lat0);\n this.Zb = -this.Qn * (Z + Object(_common_clens__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(this.gtu, 2 * Z));\n}", "function end_PSys(sX, sY, num)\n{\n // the data - lots of particles\n this.particles = [];\n for (var i=0; i < num; i++) \n {\n this.particles.push(new end_Particle(sX, sY));\n }\n \n // function defining what to do each frame\n this.run = function() \n {\n for (var i=0; i < this.particles.length; i++) \n {\n //update each particle per frame\n this.particles[i].updateP();\n this.particles[i].renderP();\n }\n }\n}", "function fill_hyst(){\n var cor = 100;\n dens_chart = [];\n for (var i = 0; i < cor; i++) {\n dens_chart[i] = 0;\n }\n for(i = 0; i < y.length; i++){\n var addr = Math.floor( cor*(y[i]-min_y)/(max_y-min_y) );\n if (0 <= addr)\n dens_chart[addr]+=cor/ y.length/(max_y-min_y);\n }\n dist_chart[0] = 0;\n for (i = 0; i < cor; i++) {\n dist_chart[i+1] = dist_chart[i] + dens_chart[i]*(max_y-min_y)/cor;\n }\n}", "function draw(){//the main loop in a p5.js sketch\r\n\tbackground(51);\r\n\r\n\tfill(255);\r\n\tnoStroke();\r\n\r\n\ttext(eqString, pad, 2*(waveHeight+pad), width - pad*2, 100);\r\n\t\r\n\tnoFill();\r\n\tstroke(255);\r\n\trect(pad/2, pad/2, width-pad, 2*waveHeight +pad);\r\n\r\n\tbeginShape(); //this begins the shape of the sinusoidal wave at the top of the sketch\r\n\tfor(let i = 0; i<xDetail; i++){\r\n\t\txPos = map(i, 0, xDetail, pad, width-pad);\r\n\r\n\t\tvertex(xPos, (-1)*sumWaves(wave,(i*xScale)) + waveHeight + pad);\r\n\t}\r\n\tendShape();\r\n\r\n\t\r\n\ttranslate(100+pad/2, 300-pad/2);\r\n\tfill(100);\r\n\trect(-100, -100, 2*100, 2*100);\r\n\tpoint(0,0);\r\n\tnoFill();\r\n\r\n\r\n\r\n\t\r\n\txWavePoints = [];//the array of the points in the polar graph (x-axis)\r\n\tyWavePoints = [];//the array of the points in the polar graph (y-axis)\r\n\r\n\tbeginShape();//begins the polar curve shape\r\n\tfor(let ang = 0; ang<xDetail*rotations; ang++){\r\n\t\t[xPos, yPos] = polar_to_cart(sumWaves(wave,(ang*xScale)), ang*xScale*currF*fDelta);\r\n\t\tvertex(xPos, yPos);\r\n\t\txWavePoints.push(xPos/rotations);\r\n\t\tyWavePoints.push(yPos/rotations);\r\n\t}\r\n\tendShape();\r\n\r\n\t//this is the \"centre of mass\", so to speak, of the polar graph\r\n\tnoStroke();\r\n\tfill(0,0,0);\r\n\tellipse(4*sumArr(xWavePoints)/xWavePoints.length, 4*sumArr(yWavePoints)/yWavePoints.length, 4);\r\n\tnoFill();\r\n\tstroke(255);\r\n\r\n\tcurrF = currF+1;//increment the currF\r\n\tif(currF*fDelta>fRange){\r\n\t\tcurrF = 0;\r\n\t}\r\n\r\n\tySpectrum[currF] = (sumArr(yWavePoints)/spectrumScale);\r\n\txSpectrum[currF] = (sumArr(xWavePoints)/spectrumScale);\r\n\r\n\r\n\tresetMatrix();\r\n\r\n\ttranslate(200 + pad, 300+pad);\r\n\r\n\t//showing the y-axis component of the spectrum\r\n\r\n\tstroke(255, 200, 200);\r\n\tbeginShape();\r\n\tfor(i=0; i<ySpectrum.length; i++){\r\n\t\txPos = map(i, 0, totalFreqs, 0, 300-2*pad);\r\n\t\tvertex(xPos, (-1)*(ySpectrum[i]));\r\n\t}\r\n\tendShape();\r\n\r\n\r\n\t//showing the x-axis component of the spectrum\r\n\r\n\t// stroke(200, 255, 200);\r\n\t// beginShape();\r\n\t// for(i=0; i<xSpectrum.length; i++){\r\n\t// \txPos = map(i, 0, totalFreqs, 0, 300-2*pad);\r\n\t// \tvertex(xPos, (-1)*xSpectrum[i]);\r\n\t// }\r\n\t// endShape();\r\n\r\n}", "function setup() {\n createCanvas(windowWidth, windowHeight);\n a = 200;\n b = 300;\n xSpeed = random(3,8);\n ySpeed = random(3,8);\n}" ]
[ "0.64494294", "0.63659894", "0.62416935", "0.6105618", "0.60917175", "0.60842156", "0.6002999", "0.6001506", "0.6000426", "0.59567475", "0.5905112", "0.59018993", "0.5877671", "0.58366585", "0.5824098", "0.5822342", "0.5808477", "0.5807973", "0.5806658", "0.57956123", "0.57918364", "0.57888454", "0.57538563", "0.5738476", "0.57239205", "0.5718144", "0.5716043", "0.5709135", "0.57080334", "0.57068235", "0.56976616", "0.56899863", "0.5688053", "0.5683629", "0.56818014", "0.5668251", "0.56582814", "0.56535923", "0.56419", "0.56200635", "0.56066376", "0.56010276", "0.55918837", "0.558781", "0.5584679", "0.55830836", "0.55828786", "0.5579316", "0.55777276", "0.5577413", "0.5577413", "0.55742717", "0.55598235", "0.5554049", "0.5542184", "0.55369246", "0.55348474", "0.5524256", "0.55220354", "0.5519875", "0.5516556", "0.55073375", "0.55045635", "0.5495155", "0.5494812", "0.54819715", "0.5480077", "0.54743224", "0.5472087", "0.5470772", "0.5456615", "0.54524755", "0.54483634", "0.54447705", "0.5439591", "0.5437088", "0.5433805", "0.54284376", "0.5428268", "0.5419009", "0.54159516", "0.54093784", "0.5400713", "0.5393977", "0.5387068", "0.5384378", "0.5382472", "0.53804904", "0.537922", "0.53773886", "0.5368904", "0.5365456", "0.5363489", "0.5363147", "0.5362681", "0.5362681", "0.5360105", "0.5354314", "0.5351677", "0.5350562" ]
0.7679951
0
======================== ========== draw() =======================================
function draw() { translate(width/2, height/2) dispSig() myDFT(sig) print('Xmag= ' + Xmag) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {}", "function draw() {}", "draw() { }", "draw() { }", "draw() { }", "Draw(){\n\t\tthis.context.beginPath();\n\t\tthis.context.fillRect(this.posX, this.posY, this.width, this.height);\n\t\tthis.context.closePath();\n }", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "draw() {\n noStroke();\n if (this.color) {\n fill(this.color.x, this.color.y, this.color.z);\n } else {\n fill(0);\n }\n rect(this.pos.x, this.pos.y, this.w, this.h);\n }", "draw() {\n }", "draw(){\n this.ctx.strokeStyle = this.getStrokeColor();\n this.ctx.lineWidth = 2;\n this.ctx.beginPath()\n this.ctx.moveTo(this.prevx, this.prevy);\n this.ctx.lineTo(this.x, this.y)\n this.ctx.stroke()\n this.ctx.fill();\n }", "draw() {\n\t\t\tc.beginPath();\n\t\t\tc.fillStyle = this.color;\n\t\t\tc.fillRect(\n\t\t\t this.x - width / 2,\n\t\t\t this.y - height / 2,\n\t\t\t\twidth,\n\t\t\t\theight\n\t\t\t);\n\t\t\tc.closePath();\n\t\t }", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "draw() {\n\t\tnoStroke();\n\t\tfill(\"rgba(255, 255, 255, 0.1)\");\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "draw() {\n\n }", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.rect(this.position.x - width/2, this.position.y - width/2, width, width);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function draw() {\r\n \r\n}", "draw() {\n\t\tnoStroke();\n\t\tfill('rgba(255,255,255,0.5)');\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "function draw() {\n \n}", "function draw() {\n \n}", "draw(context) {\n //TO-DO\n }", "paint() {\r\n graphics.fillStyle = \"#ff1a1a\";\r\n graphics.beginPath();\r\n graphics.moveTo(this.x, this.y + this.h / 2);\r\n graphics.lineTo(this.x + this.w / 2, this.y - this.h / 2);\r\n graphics.lineTo(this.x - this.w / 2, this.y - this.h / 2);\r\n graphics.closePath();\r\n graphics.fill();\r\n }", "function draw(){\r\n ctx.fillStyle = '#70c5ce';\r\n ctx.fillRect(0, 0, cWidth, cHeight);\r\n bg.draw();\r\n pipes.draw();\r\n fg.draw();\r\n kca.draw();\r\n bird.draw();\r\n getReady.draw();\r\n gameOver.draw();\r\n score.draw();\r\n \r\n\r\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.moveTo(this.position.x - width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x + width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x, this.position.y - width/2);\n\t\tinfo.context.closePath();\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "_draw() {\n\n }", "draw(ctx){\n ctx.save();\n ctx.fillStyle = \"green\";\n ctx.fillRect(this.x-this.width/2,this.y-this.height/2,this.width,this.height);\n ctx.restore();\n }", "draw() { \r\n // Make sure the canvas has been prepared\r\n if (!this._setup) {\r\n this.prepare();\r\n }\r\n \r\n // Get the drawing context\r\n let ctx = this._canvas.getContext(\"2d\");\r\n \r\n // Clear the canvas by displaying only the background color\r\n ctx.fillStyle = this._background;\r\n ctx.fillRect(0, 0, this._width, this._height);\r\n \r\n // Loop through all of the shapes, asking them to draw theirselves\r\n // on the drawing context\r\n this._shapes.forEach(s => s.draw(ctx));\r\n }", "function draw() {\n\tctx.beginPath();\n\tctx.strokeStyle = 'white';\n\tctx.lineWidth = 15;\n\tctx.lineJoin = 'round';\n\tctx.moveTo(prevX, prevY);\n\tctx.lineTo(currX, currY);\n\tctx.closePath();\n\tctx.stroke();\n}", "function draw() {\n \n\n \n}", "function draw() {\n\tstrokeWeight(5);\n\tstroke(0);\n\tline(0,0,cw,0);\n\tline(cw,0,cw,ch);\n\tline(0,ch,cw,ch);\n\tline(0,ch,0,0);\n\tif(mouseIsPressed){\n\t\tif(mouseButton == LEFT){\n\t\tlastX = mouseX;\n\t\tlastY = mouseY;\n\t\tdrawLine(startX,startY,lastX,lastY, clr, drawThickness);\n\t\tstartX = mouseX;\n\t\tstartY = mouseY;\n\t\t}else if(mouseButton == RIGHT){\n\t\t\tlastX = mouseX;\n\t\t\tlastY = mouseY;\n\t\t\tdrawLine(startX,startY,lastX,lastY, bgcolour, rubThickness);\n\t\t\tstartX = mouseX;\n\t\t\tstartY = mouseY;\t\n\t\t}\n\t}else{\n\t\tstartX = mouseX;\n\t\tstartY = mouseY;\n\t}\n}", "function draw()\n{\n \n}", "draw(){\n }", "draw() {\n if (this.isAlive) {\n fill(color(200, 0, 200));\n } else {\n fill(color(240));\n }\n noStroke();\n rect(this.column * this.size + 1, this.row * this.size + 1, this.size - 1, this.size - 1);\n }", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "draw() {\n this.checkContext();\n this.setRendered();\n if (this.unbeamable) return;\n\n if (!this.postFormatted) {\n this.postFormat();\n }\n\n this.drawStems();\n this.applyStyle();\n this.drawBeamLines();\n this.restoreStyle();\n }", "draw(){\n\t\t\n\t\tlet height = this.height; //100\n\t\tlet width = this.width; //100\n\t\t\n\t\tlet ctx = this.ctx;\n\t\t//save last frame\n\t\tlet lastFrame = ctx.getImageData(0, 0, width, height);\n\t\t//clear canvas\n\t\tctx.clearRect(0, 0, width, height);\n\t\t//now, move frame 1 pixel to the left\n\t\tctx.putImageData(lastFrame, -1, 0);\n\t\t\n\t\t//then, draw the lines\n\t\tfor(var line of this.lines){\n\t\t\t\n\t\t\t\n\t\t\tlet range = line.maxValue - line.minValue;\n\t\t\tlet value = line.value;\n\t\t\t\n\t\t\t//Multiply line's value by the ratio between height and range, to get effective range the same but zero at the top\n\t\t\tvalue *= 1 * height / range;\n\t\t\t\n\t\t\t//Now, zero the value by adding the difference between minValue and 0\n\t\t\tvalue -= line.minValue * height / range;\n\t\t\t\n\t\t\t//Now, invert by subtracting from height\n\t\t\tvalue = height - value;\n\t\t\t\n\t\t\tctx.beginPath();\n\t\t\tctx.strokeStyle = line.color;\n\t\t\tctx.moveTo(width - 2, value);\n\t\t\tctx.lineTo(width, value);\n\t\t\tctx.stroke();\n\t\t}\n\t}", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "function draw(){\t\n\trequestAnimationFrame(draw); //allows for maximum use of the hardwares potential\n}", "function draw() {\n background(0);\n strokeWeight(1);\n\n if (drawArr) {\n for (let i = 0; i < width; ++i) {\n const col = drawMark[i];\n if (col) {\n stroke(col.r, col.g, col.b);\n } else {\n stroke(150);\n }\n line(i + 1, height, i + 1, height - drawArr[i]);\n }\n }\n}", "draw(){\n let shapes = this.shapeList.iterator();\n push();\n while(!shapes.isEmpty()){\n shapes.currItem().draw();\n shapes.next();\n }\n pop();\n\n this.drawText();\n }", "draw() {\n\n this.drawInteractionArea();\n\n //somewhat depreciated - we only really draw the curve interaction but this isnt hurting anyone\n if(lineInteraction)\n this.drawLine();\n else\n this.drawCurve();\n\n this.drawWatch(); \n\n }", "drawLine(){\n for (var index in this.draw){\n this.draw[index] = this.fracToPixel(this.draw[index])\n }\n canvas.beginPath();\n canvas.moveTo(this.draw[\"rightX\"],this.draw[\"rightY\"]);\n canvas.lineTo(this.draw[\"leftX\"],this.draw[\"leftY\"]);\n canvas.stroke();\n }", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function draw() {\n\t\tfor (var i = 0; i < loop.graphics.length; i++) {\n\t\t\tloop.graphics[i](graphics, 0.0);\n\t\t}\n\t}", "render(ctx, width, height) {\n ctx.beginPath();\n ctx.rect(0, 0, width, height);\n ctx.closePath();\n ctx.lineWidth = 2; //since this line is on the border, only 1px actually gets drawn\n ctx.strokeStyle = \"#ffffff\";\n ctx.stroke();\n\n this.guiManager.render(ctx, width, height);\n }", "draw() {\n ctx.beginPath();\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2, false);\n ctx.fillStyle = this.color;\n ctx.fill();\n }", "function draw() {\n\n\t\t\t\t// キャンバスの描画をクリア\n\t\t\t\tcontext.clearRect(0, 0, width, height);\n\n\t\t\t\t//波を描画\n\t\t\t\tdrawWave('rgba(7, 126, 195, 0.30)', 1, 3, 0);\n\n\t\t\t\t// Update the time and draw again\n\t\t\t\tdraw.seconds = draw.seconds + .009;\n\t\t\t\tdraw.t = draw.seconds * Math.PI;\n\t\t\t\tsetTimeout(draw, 20);\n\t\t\t}", "function draw()\n{\n}", "function draw() {\n count += .1;\n requestAnimationFrame( draw );\n render();\n }", "draw() {\n let anchorWidth = -this.width * this.anchor.x;\n let anchorHeight = -this.height * this.anchor.y;\n\n this.context.save();\n this.context.translate(this.x, this.y);\n\n if (this.rotation) {\n this.context.rotate(this.rotation);\n }\n\n if (this.image) {\n this.context.drawImage(\n this.image,\n 0, 0, this.image.width, this.image.height,\n anchorWidth, anchorHeight, this.width, this.height\n );\n }\n else if (this.currentAnimation) {\n this.currentAnimation.render({\n x: anchorWidth,\n y: anchorHeight,\n width: this.width,\n height: this.height,\n context: this.context\n });\n }\n else {\n this.context.fillStyle = this.color;\n this.context.fillRect(anchorWidth, anchorHeight, this.width, this.height);\n }\n\n this.context.restore();\n }", "paint() {\r\n graphics.fillStyle = \"#1aff1a\";\r\n graphics.fillRect(this.x - this.w / 2, this.y - this.h, this.w, this.h);\r\n }", "draw(display, ratio) {\n //check if we are already resized (prevents infinite growth/shrinkage)\n if(this.selected && !display || !this.selected && display) {\n this.resize();\n } \n\n ctx.beginPath();\n ctx.fillStyle = this.colour;\n ctx.fillRect(this.x, this.y, this.width, this.height); //draw the background of the graph\n // ctx.fillStyle = \"white\";\n // ctx.fillRect(this.x + this.padding, this.y + this.padding, this.width - this.padding * 2, this.height - this.padding * 2);\n\n this.drawPoints(this.width);\n\n //if the display flag is set - we should draw the selection\n if(display)\n this.drawSelection(ratio);\n }", "function draw() {\n ctx.fillStyle = \"#70c5ce\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n cloud.draw();\n pipes.draw();\n ball.draw();\n ground.draw();\n bird.draw();\n getReady.draw();\n gameOver.draw();\n score.draw();\n}", "function renderCanvas()\n {\n if (drawing)\n {\n context.moveTo(lastPos.x, lastPos.y);\n context.lineTo(mousePos.x, mousePos.y);\n context.stroke();\n lastPos = mousePos;\n }\n }", "draw() {\n ctx.beginPath();\n ctx.fillStyle = \"white\";\n ctx.arc(this.x, this.y, this.size, 0, Math.PI * 2);\n ctx.fill();\n }", "draw(){\n push();\n\n beginShape();\n texture(this.texture);\n textureWrap(MIRROR);\n //draw as a rectangle, divide by 2 for width and height\n vertex(this.getX() - (this.w/2.0), this.getY() - (this.h/2.0),CENTER,TOP_EDGE); //bottom right, CCW, Need UV coordinates for texture mapping\n vertex(this.getX() + (this.w/2.0), this.getY() - (this.h/2.0),RIGHT_EDGE,TOP_EDGE); //for some reason this starts on bottom right?\n vertex(this.getX() + (this.w/2.0), this.getY() + (this.h/2.0),RIGHT_EDGE,CENTER);\n vertex(this.getX() - (this.w/2.0), this.getY() + (this.h/2.0),CENTER,CENTER);\n\n endShape(CLOSE);\n\n pop();\n }", "draw() {\n if (this.isFilled) {\n this.fill();\n } else {\n this.outline();\n }\n }", "function draw()\n{\n\trequestAnimationFrame(draw);\n\tg_canvas.clearRect(0, 0, g_canvasWidth, g_canvasHeight);\n\tfor (let renderable of g_renderables)\n\t{\n\t\trenderable.render();\n\t}\n}", "function render() {\n\tctx.beginPath();\n\tctx.fillRect(-width, -height, 2*width, 2*height);\n\tctx.beginPath();\n\tdraw(document.getElementById('num').value, -10, -50, 10, -50);\n}", "function draw() {\n\n\t\t\t\t// キャンバスの描画をクリア\n\t\t\t\tcontext.clearRect(0, 0, width, height);\n\n\t\t\t\t//波を描画\n\t\t\t\tdrawWave('rgba(7, 126, 195, 0.30)', 1, 3, 0);\n\n\t\t\t\t// Update the time and draw again\n\t\t\t\tdraw.seconds = draw.seconds + .009;\n\t\t\t\tdraw.t = draw.seconds * Math.PI;\n\t\t\t\tsetTimeout(draw, 30);\n\t\t\t}", "function draw() {\n\n //Aqui se esta borrando y repintando toda la pantalla\n ctx.fillRect(0, 0, WIDTH, HEIGHT);\n ctx.save();\n ctx.fillStyle = \"#fff\";\n\n //Aqui van mis draws\t\t \n miRectangulo.draw();\n\n\n ctx.restore();\n}", "draw() {\n\t\tinfo.context.beginPath();\n\t\tinfo.context.arc(this.position.x, this.position.y, 30, 0, 2 * Math.PI);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "draw(context) {\n context.fillStyle = '#414048';\n context.beginPath();\n for (let i = 0; i < this.length; ++i) {\n context.fillRect(this.units[i].x, this.units[i].y, this.size, this.size);\n }\n context.closePath();\n }", "draw() {\n\t\tthis.newPosition()\n\t\tthis.hoverCalc()\n\n\n\t\t// this.drawWaves()\n\n\t\tthis.applyCircleStyle()\n\n\n\t\tthis.ly.circle( this.x, this.y, 2 * this.r * this.scale )\n\n\t\tthis.applyTextStyle()\n\t\tthis.ly.text( this.label, this.x, this.y )\n\n\n\n\t}", "function renderCanvas() {\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n }", "draw() {\n context2d.fillStyle = 'black';\n context2d.fillRect(0, 0, this.width, this.height);\n\n this.currentScene.draw();\n\n this.gameManager.drawHUD();\n }", "draw() {\n if (this._selected) {\n this.selectedDraw();\n }\n if (this._hovered) {\n this.hoveredDraw();\n }\n if (!this._hovered && !this._selected) {\n this.normalDraw();\n }\n this.isHovered();\n this.isClicked();\n }", "draw() {\n this.setSize();\n this.setSizeBounds();\n this.move();\n this.coordinates = getPlaneCoordinates(this);\n this.setOut();\n }", "draw() {\r\n this.ctx.save()\r\n this.ctx.translate(this.x + (this.pSize / 2), this.y + (this.pSize / 2))\r\n this.ctx.rotate(this.angle)\r\n this.ctx.translate(-(this.x + (this.pSize / 2)), -(this.y + (this.pSize / 2)))\r\n this.ctx.drawImage(this.pl1, this.x, this.y, this.pSize, this.pSize)\r\n this.ctx.rotate(this.angle)\r\n this.ctx.restore()\r\n }", "draw() {\n // drawing curbs first\n const shades = ['#9ca297', '#b1bab0'];\n for (let i = 0; i < 2; i++) {\n ctx.fillStyle = shades[i];\n // curbs just big rects mildly translated so some shading\n if (i) {\n ctx.translate(0, 3.3);\n }\n ctx.fillRect(0, this.y - (this.linH / 3) * 1.5, init.w, inProptn(1, 7) + (this.linH / 3) * (3 - i * 1.5));\n }\n ctx.translate(0, -3.3);\n\n // road itself\n ctx.fillStyle = 'black';\n ctx.fillRect(0, this.y, init.w, inProptn(1, 7));\n\n this.markings();\n }", "function draw() {\n\t\t\t\tctx.fillStyle = \"black\";\n\t\t\t\tctx.fillRect(0,0,canvasWidth, canvasHeight);\n\t\t\t\tplayer.draw();\n\t\t\t\tcomputer.draw();\n\t\t\t\tball.draw();\n\t\t\t}", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw(ctx) {\n\t\t\n\t\tctx.beginPath();\n\t\t\n\t\tctx.fillStyle = this.fillStyle;\n\t ctx.fillRect(this.x, this.y, this.w, this.h);\n\t\t\n\t\tif (this.lineWidth && this.strokeStyle) {\n\t\t\tctx.lineWidth = this.lineWidth;\n\t\t\tctx.strokeStyle = this.strokeStyle;\n\t\t ctx.strokeRect(this.x, this.y, this.w, this.h);\n\t\t\tctx.stroke();\n\t\t}\n\n\t\tctx.closePath();\n\t}", "draw() {\r\n this.ctx.save()\r\n this.ctx.translate(this.x + (this.pSize / 2), this.y + (this.pSize / 2))\r\n this.ctx.rotate(this.angle)\r\n this.ctx.translate(-(this.x + (this.pSize / 2)), -(this.y + (this.pSize / 2)))\r\n this.ctx.drawImage(this.pl2, this.x, this.y, this.pSize, this.pSize)\r\n this.ctx.rotate(this.angle)\r\n this.ctx.restore()\r\n }", "function draw() {\r\n\r\n // draw game background\r\n display.fill('white');\r\n\r\n // draw game map\r\n drawMap();\r\n\r\n // draw potential tower if player is dragging a tower\r\n if (controller.dragging && controller.isMouseInCanvas()) {\r\n drawNewTower();\r\n };\r\n\r\n // display buffer\r\n display.draw(); \r\n}", "function draw() {\n\t// Redraw the background color\n\tbackground(17, 17, 17, 150)\n\t\n\t// loop through the streams array and render all streams\n\tstreams.forEach(function(stream) {\n\t\tstream.render()\n\t})\n}", "function renderCanvas() {\n if (drawing) {\n ctx.beginPath();\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.closePath();\n ctx.stroke();\n\n lastPos = mousePos;\n }\n}" ]
[ "0.83454597", "0.83454597", "0.80180675", "0.80180675", "0.80180675", "0.7879257", "0.78359646", "0.78359646", "0.78359646", "0.78359646", "0.77732784", "0.77507496", "0.77258193", "0.7713859", "0.7688569", "0.7684257", "0.7600444", "0.7577968", "0.7570521", "0.7551823", "0.7514683", "0.7486493", "0.7473463", "0.7464848", "0.74621093", "0.7457723", "0.7457723", "0.7457723", "0.7457723", "0.7457723", "0.7457086", "0.74569017", "0.7437657", "0.74178237", "0.74177873", "0.7404499", "0.74010366", "0.73828584", "0.73740923", "0.73687416", "0.73683256", "0.73683256", "0.73683256", "0.73683256", "0.73683256", "0.73683256", "0.73683256", "0.73683256", "0.73683256", "0.73683256", "0.73683256", "0.7356144", "0.7348622", "0.7346177", "0.7346177", "0.7328416", "0.73248166", "0.7323896", "0.7312332", "0.73061776", "0.7275164", "0.72737366", "0.72737366", "0.72737366", "0.72737366", "0.7271995", "0.7257755", "0.72568756", "0.7236625", "0.7234384", "0.7232323", "0.7229235", "0.7221338", "0.7212308", "0.72103536", "0.7202964", "0.7198714", "0.7195758", "0.7192701", "0.7188291", "0.7186021", "0.7183816", "0.71743566", "0.7172852", "0.7171592", "0.71689063", "0.71672827", "0.7165787", "0.71655095", "0.7161396", "0.7156259", "0.71518874", "0.7150912", "0.7149967", "0.7149967", "0.7149967", "0.71478367", "0.7144538", "0.7136265", "0.713574", "0.71343774" ]
0.0
-1
end of function draw() =================================================
function dispSig() { mY = (mouseY - (height / 2)) if (mY < -358) { mY = -358 } //restrict height within graph if (mY > -82) { mY = -82 } // restrict height within graph //print('mY='+mY) mx = mouseX - width / 2; for (i = 0; i < N; i++) { xx[i] = xs + i * 30 // hori spacing ellipse(xx[i], ys, 5) line(xx[i], ys, xx[i], ys - 140) //vert lines up line(xx[i], ys, xx[i], ys + 140) //vert lines down line(xs, ys - 20 * i, xs + N * 26, ys - 20 * i) //horiz lines up line(xs, ys + 20 * i, xs + N * 26, ys + 20 * i) //horiz lines dn }; //end of for loop for plotting small circles for (i = 0; i < N; i++) { dx = abs(xx[i] - mx) if (dx < eps) { ellipse(xx[i], ys, 10); push() strokeWeight(9); //did the trick! stroke(backgnd) line(xx[i], ys, xx[i], pmY[i]) //signal bar pop() push() stroke(foregnd) strokeWeight(4) line(xx[i], ys, xx[i], mY) //signal bar pop() pmY[i] = mY; // y decreses upwords ! sig[i] = -(mY - ys); }; // end of if block }; //end of for loop }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function draw() {}", "function draw() {}", "draw() { }", "draw() { }", "draw() { }", "draw() {}", "draw() {}", "draw() {}", "draw() {}", "function draw() {\n \n}", "function draw(){\n\t\t// Needed to comply with Tool Delegate design pattern\n\t}", "function draw() {\r\n \r\n}", "draw() {\n }", "function draw() {\n \n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n}", "function draw() {\n \n\n \n}", "function draw()\n{\n \n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "function draw() {\n\n}", "draw() {\n\n }", "draw(){\n this.ctx.strokeStyle = this.getStrokeColor();\n this.ctx.lineWidth = 2;\n this.ctx.beginPath()\n this.ctx.moveTo(this.prevx, this.prevy);\n this.ctx.lineTo(this.x, this.y)\n this.ctx.stroke()\n this.ctx.fill();\n }", "function draw(){\r\n ctx.fillStyle = '#70c5ce';\r\n ctx.fillRect(0, 0, cWidth, cHeight);\r\n bg.draw();\r\n pipes.draw();\r\n fg.draw();\r\n kca.draw();\r\n bird.draw();\r\n getReady.draw();\r\n gameOver.draw();\r\n score.draw();\r\n \r\n\r\n}", "function draw()\n{\n}", "_draw() {\n\n }", "draw(){\n }", "function draw() {\n\n\n\n}", "draw() {\n\t\t\tc.beginPath();\n\t\t\tc.fillStyle = this.color;\n\t\t\tc.fillRect(\n\t\t\t this.x - width / 2,\n\t\t\t this.y - height / 2,\n\t\t\t\twidth,\n\t\t\t\theight\n\t\t\t);\n\t\t\tc.closePath();\n\t\t }", "function draw(){\t\n\trequestAnimationFrame(draw); //allows for maximum use of the hardwares potential\n}", "function draw() {\n Gravity();\n Animation();\n FrameBorder(); \n FrameBorderCleaner();\n Controls();\n Interaction();\n}", "draw() {\n noStroke();\n if (this.color) {\n fill(this.color.x, this.color.y, this.color.z);\n } else {\n fill(0);\n }\n rect(this.pos.x, this.pos.y, this.w, this.h);\n }", "Draw(){\n\t\tthis.context.beginPath();\n\t\tthis.context.fillRect(this.posX, this.posY, this.width, this.height);\n\t\tthis.context.closePath();\n }", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.rect(this.position.x - width/2, this.position.y - width/2, width, width);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "draw() {\n if (this.isAlive) {\n fill(color(200, 0, 200));\n } else {\n fill(color(240));\n }\n noStroke();\n rect(this.column * this.size + 1, this.row * this.size + 1, this.size - 1, this.size - 1);\n }", "function draw() {\n console.log(label);\n eventCounter();\n if (label === eventLabel) {\n background(backgroundColors[1]);\n dropCircle();\n } else if (label !== eventLabel) {\n background(backgroundColors[0]);\n isFriend = false;\n } else if (isFriend === true) {\n background(backgroundColors[2]);\n } else {\n background(backgroundColors[0]);\n }\n drawText();\n //drawCamera();\n //drawRectangle();\n Engine.update(engine);\n for (let circle of circles) {\n circle.show();\n }\n for (let ground of grounds) {\n ground.show();\n }\n drawCredit();\n}", "draw(ctx){\n ctx.save();\n ctx.fillStyle = \"green\";\n ctx.fillRect(this.x-this.width/2,this.y-this.height/2,this.width,this.height);\n ctx.restore();\n }", "function draw() {\n ctx.fillStyle = \"#70c5ce\";\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n cloud.draw();\n pipes.draw();\n ball.draw();\n ground.draw();\n bird.draw();\n getReady.draw();\n gameOver.draw();\n score.draw();\n}", "draw () { //change name to generate?? also need to redo\n return null;\n }", "draw(context) {\n //TO-DO\n }", "draw() {\n\t\tthis.newPosition()\n\t\tthis.hoverCalc()\n\n\n\t\t// this.drawWaves()\n\n\t\tthis.applyCircleStyle()\n\n\n\t\tthis.ly.circle( this.x, this.y, 2 * this.r * this.scale )\n\n\t\tthis.applyTextStyle()\n\t\tthis.ly.text( this.label, this.x, this.y )\n\n\n\n\t}", "function draw(\n\n) {}", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.moveTo(this.position.x - width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x + width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x, this.position.y - width/2);\n\t\tinfo.context.closePath();\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "draw() {\n\t\tnoStroke();\n\t\tfill(\"rgba(255, 255, 255, 0.1)\");\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "paint() {\r\n graphics.fillStyle = \"#ff1a1a\";\r\n graphics.beginPath();\r\n graphics.moveTo(this.x, this.y + this.h / 2);\r\n graphics.lineTo(this.x + this.w / 2, this.y - this.h / 2);\r\n graphics.lineTo(this.x - this.w / 2, this.y - this.h / 2);\r\n graphics.closePath();\r\n graphics.fill();\r\n }", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "draw() {\n rect(this.x1, this.y1, this.Width, this.Height);\n }", "function draw() {\n\tstrokeWeight(5);\n\tstroke(0);\n\tline(0,0,cw,0);\n\tline(cw,0,cw,ch);\n\tline(0,ch,cw,ch);\n\tline(0,ch,0,0);\n\tif(mouseIsPressed){\n\t\tif(mouseButton == LEFT){\n\t\tlastX = mouseX;\n\t\tlastY = mouseY;\n\t\tdrawLine(startX,startY,lastX,lastY, clr, drawThickness);\n\t\tstartX = mouseX;\n\t\tstartY = mouseY;\n\t\t}else if(mouseButton == RIGHT){\n\t\t\tlastX = mouseX;\n\t\t\tlastY = mouseY;\n\t\t\tdrawLine(startX,startY,lastX,lastY, bgcolour, rubThickness);\n\t\t\tstartX = mouseX;\n\t\t\tstartY = mouseY;\t\n\t\t}\n\t}else{\n\t\tstartX = mouseX;\n\t\tstartY = mouseY;\n\t}\n}", "draw(){\n\t\t\n\t\tlet height = this.height; //100\n\t\tlet width = this.width; //100\n\t\t\n\t\tlet ctx = this.ctx;\n\t\t//save last frame\n\t\tlet lastFrame = ctx.getImageData(0, 0, width, height);\n\t\t//clear canvas\n\t\tctx.clearRect(0, 0, width, height);\n\t\t//now, move frame 1 pixel to the left\n\t\tctx.putImageData(lastFrame, -1, 0);\n\t\t\n\t\t//then, draw the lines\n\t\tfor(var line of this.lines){\n\t\t\t\n\t\t\t\n\t\t\tlet range = line.maxValue - line.minValue;\n\t\t\tlet value = line.value;\n\t\t\t\n\t\t\t//Multiply line's value by the ratio between height and range, to get effective range the same but zero at the top\n\t\t\tvalue *= 1 * height / range;\n\t\t\t\n\t\t\t//Now, zero the value by adding the difference between minValue and 0\n\t\t\tvalue -= line.minValue * height / range;\n\t\t\t\n\t\t\t//Now, invert by subtracting from height\n\t\t\tvalue = height - value;\n\t\t\t\n\t\t\tctx.beginPath();\n\t\t\tctx.strokeStyle = line.color;\n\t\t\tctx.moveTo(width - 2, value);\n\t\t\tctx.lineTo(width, value);\n\t\t\tctx.stroke();\n\t\t}\n\t}", "function draw() {\n\t\tfor (var i = 0; i < loop.graphics.length; i++) {\n\t\t\tloop.graphics[i](graphics, 0.0);\n\t\t}\n\t}", "draw() {\n // drawing curbs first\n const shades = ['#9ca297', '#b1bab0'];\n for (let i = 0; i < 2; i++) {\n ctx.fillStyle = shades[i];\n // curbs just big rects mildly translated so some shading\n if (i) {\n ctx.translate(0, 3.3);\n }\n ctx.fillRect(0, this.y - (this.linH / 3) * 1.5, init.w, inProptn(1, 7) + (this.linH / 3) * (3 - i * 1.5));\n }\n ctx.translate(0, -3.3);\n\n // road itself\n ctx.fillStyle = 'black';\n ctx.fillRect(0, this.y, init.w, inProptn(1, 7));\n\n this.markings();\n }", "function draw() {\n\t\t\t\tctx.fillStyle = \"black\";\n\t\t\t\tctx.fillRect(0,0,canvasWidth, canvasHeight);\n\t\t\t\tplayer.draw();\n\t\t\t\tcomputer.draw();\n\t\t\t\tball.draw();\n\t\t\t}", "function draw() {\n drawText();\n}", "draw() {\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n // display problem\n this.drawProblem()\n // display input field\n if (this.input) {\n this.input._value = ''\n }\n \n this.drawInputField()\n\n // draw attacks\n this.attacks.draw(this.ctx, this.attackIndex)\n\n // draw player data\n this.player.drawPlayerData(this.ctx)\n // draw computer data\n this.computer.drawComputerData(this.ctx)\n \n }", "function draw() {\n\n //Aqui se esta borrando y repintando toda la pantalla\n ctx.fillRect(0, 0, WIDTH, HEIGHT);\n ctx.save();\n ctx.fillStyle = \"#fff\";\n\n //Aqui van mis draws\t\t \n miRectangulo.draw();\n\n\n ctx.restore();\n}", "function draw() {\n\n\t\t\t\t// キャンバスの描画をクリア\n\t\t\t\tcontext.clearRect(0, 0, width, height);\n\n\t\t\t\t//波を描画\n\t\t\t\tdrawWave('rgba(7, 126, 195, 0.30)', 1, 3, 0);\n\n\t\t\t\t// Update the time and draw again\n\t\t\t\tdraw.seconds = draw.seconds + .009;\n\t\t\t\tdraw.t = draw.seconds * Math.PI;\n\t\t\t\tsetTimeout(draw, 20);\n\t\t\t}", "draw() {\n\t\tnoStroke();\n\t\tfill('rgba(255,255,255,0.5)');\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "function draw() {\n\tctx.beginPath();\n\tctx.strokeStyle = 'white';\n\tctx.lineWidth = 15;\n\tctx.lineJoin = 'round';\n\tctx.moveTo(prevX, prevY);\n\tctx.lineTo(currX, currY);\n\tctx.closePath();\n\tctx.stroke();\n}", "function draw() {\n\tbackground(30);\n\t// this is a local variable with scope limited to setup()\n\t// I will use it for the ratio of width to height\n\tvar localVar = w/h;\n\n\t// for loops will \"iterate\" until a condition is met\n\t// useful for drawing x and y axes\n\tfor (var i = 0; i < w; i+=Math.round(50*localVar)) {\n\t\tfor (var j = 0; j < h; j+= 50) {\n\t\t\tfill(i%255, j%200, globalVar%255);\n\t\t\tstrokeWeight(globalVar%20);\n\t\t\tif (i >= w/2) {\n\t\t\t\trect(i, j, 25, 25);\n\t\t\t} else if (j >= h/2) {\n\t\t\t\tfill(i%255, globalVar%255, j%255);\n\t\t\t\tellipse(i, j, 25, 25);\n\t\t\t} else {\n\t\t\t\tfill(globalVar%255, i%255, j%255);\n\t\t\t\ttriangle(i, j, i+25, j, i, j+25);\n\t\t\t}\n\t\t\t// counts endlessly\n\t\t\tglobalVar = globalVar + 0.01;\n\t\t}\n\t}\n\n}", "function draw() {\r\n\tdrawTimer();\r\n\t//drawGratii();\r\n}", "draw(){\n push();\n\n beginShape();\n texture(this.texture);\n textureWrap(MIRROR);\n //draw as a rectangle, divide by 2 for width and height\n vertex(this.getX() - (this.w/2.0), this.getY() - (this.h/2.0),CENTER,TOP_EDGE); //bottom right, CCW, Need UV coordinates for texture mapping\n vertex(this.getX() + (this.w/2.0), this.getY() - (this.h/2.0),RIGHT_EDGE,TOP_EDGE); //for some reason this starts on bottom right?\n vertex(this.getX() + (this.w/2.0), this.getY() + (this.h/2.0),RIGHT_EDGE,CENTER);\n vertex(this.getX() - (this.w/2.0), this.getY() + (this.h/2.0),CENTER,CENTER);\n\n endShape(CLOSE);\n\n pop();\n }", "function Draw() {\n}", "function draw() {\n\n\t\t\t\t// キャンバスの描画をクリア\n\t\t\t\tcontext.clearRect(0, 0, width, height);\n\n\t\t\t\t//波を描画\n\t\t\t\tdrawWave('rgba(7, 126, 195, 0.30)', 1, 3, 0);\n\n\t\t\t\t// Update the time and draw again\n\t\t\t\tdraw.seconds = draw.seconds + .009;\n\t\t\t\tdraw.t = draw.seconds * Math.PI;\n\t\t\t\tsetTimeout(draw, 30);\n\t\t\t}", "function renderCanvas() {\n if (drawing) {\n ctx.moveTo(lastPos.x, lastPos.y);\n ctx.lineTo(mousePos.x, mousePos.y);\n ctx.stroke();\n lastPos = mousePos;\n }\n }", "function draw() {\n background(0);\n\n // draws title\n drawTitle();\n\n // draws the replay button\n clickButton.draw();\n\n // update new random panel\n checkRunTime();\n\n //draw board\n drawBoard();\n\n //draw tally\n drawTally();\n}", "function draw(){\n\tbackground ('lightblue');\n\n\t// draw characters\n\timage(jak, JakX, JakY);\n\timage(daxter, DaxterX, DaxterY);\n\n\t\t// narration\n\ttextSize(30);\n\ttextAlign(CENTER, CENTER);\n\ttext(story, width/4, 20, width/2);\n}", "draw() {\n\n this.drawInteractionArea();\n\n //somewhat depreciated - we only really draw the curve interaction but this isnt hurting anyone\n if(lineInteraction)\n this.drawLine();\n else\n this.drawCurve();\n\n this.drawWatch(); \n\n }", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "function renderCanvas() {\n\t\tif (drawing) {\n\t\t\tctx.moveTo(lastPos.x, lastPos.y);\n\t\t\tctx.lineTo(mousePos.x, mousePos.y);\n\t\t\tctx.stroke();\n\t\t\tlastPos = mousePos;\n\t\t}\n\t}", "draw() {\n this.setSize();\n this.setSizeBounds();\n this.move();\n this.coordinates = getPlaneCoordinates(this);\n this.setOut();\n }", "function draw() {\n topWall.draw();\n ball.draw();\n paddle.draw();\n playerIndexDigit.draw();\n playerBallIndexDigit.draw();\n\n // draw the currently act\n for (var i = 0; i < 112; i++) {\n playerBricks[activePlayer][playerLevel[activePlayer]][i].draw();\n }\n\n playerScoreDigits[0][0].draw();\n playerScoreDigits[0][1].draw();\n playerScoreDigits[0][2].draw();\n playerScoreDigits[0][3].draw();\n\n playerScoreDigits[1][0].draw();\n playerScoreDigits[1][1].draw();\n playerScoreDigits[1][2].draw();\n playerScoreDigits[1][3].draw();\n\n leftWall.draw();\n rightWall.draw();\n }", "paint() {\r\n graphics.fillStyle = \"#1aff1a\";\r\n graphics.fillRect(this.x - this.w / 2, this.y - this.h, this.w, this.h);\r\n }", "function draw() {\n ctx.fillRect(0, 0, WIDTH, HEIGHT);\n\n ctx.save();\n ctx.fillStyle = \"#fff\";\n\n ball.draw();\n player.draw();\n ai.draw();\n\n\n //The net down the centre of the screeen\n var w = 4;\n var x = (WIDTH - w) * 0.5;\n var y = 0;\n var step = HEIGHT / 50; //the step, the higher the number the more dots in the net\n while (y < HEIGHT) {\n ctx.fillRect(x, y + step * 0.25, w, step * 0.5);\n y += step;\n }\n\n ctx.restore();\n}", "draw(ctx){\n ctx.save()\n ctx.beginPath()\n ctx.strokeStyle = this.strokeColor\n ctx.lineWidth = this.strokeWidth\n\n const MAX_HEAD = 80\n let new_y = (this.pesanteur) ? window.innerHeight - this.height - MAX_HEAD : this.y\n ctx.rect(this.x, new_y, this.width, this.height)\n\n ctx.fillStyle = this.fillColor\n\n ctx.closePath()\n ctx.fill()\n ctx.stroke()\n ctx.restore() \n \n\n }", "draw(){\n fill(this.color);\n if(this.winner){\n if(this.winner_toggle % 3 == 0){\n fill('YELLOW');\n }\n this.winner_toggle += 1;\n }\n stroke(this.color);\n rect(this.r*CELL_SIZE, this.c*CELL_SIZE, \n CELL_SIZE, CELL_SIZE);\n }", "display(){\n noStroke();\n fill(this.color);\n this.shape(this.x, this.y, this.size, this.size);\n for(var i=0; i<this.history.length; i++){\n var pos = this.history[i];\n this.shape(pos.x, pos.y, 8, 8);\n }\n }", "draw() {\n\n // only display the dirt if it is visible... \n if (this.visible){\n\n ctxDATA.fillStyle = this.color; \n ctxDATA.fillRect(this.x, this.y, this.w, this.h);\n \n // end of visibility check \n }\n\n // end of the draw method for the Dirt \n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "draw() {\n this.loop(DrawableArray.drawFunction);\n }", "function renderCanvas()\n {\n if (drawing)\n {\n context.moveTo(lastPos.x, lastPos.y);\n context.lineTo(mousePos.x, mousePos.y);\n context.stroke();\n lastPos = mousePos;\n }\n }", "doDraw() {\n console.log(\"big game over\");\n draw_context.fillStyle = \"#000F\";\n draw_context.fillRect(0,0, canvas_element.width,canvas_element.height);\n draw_context.lineWidth = 20;\n draw_context.lineJoin = \"round\";\n draw_context.textAlign = \"center\";\n draw_context.font = \"80px Lemon\";\n draw_context.strokeStyle = \"#fff\";\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n draw_context.lineWidth = 10;\n draw_context.strokeStyle = \"#000\";\n draw_context.strokeText(this.text, canvas_element.width/2, this.vertical);\n \n draw_context.fillStyle = this.grad1;\n draw_context.fillText(this.text, canvas_element.width/2, this.vertical);\n }", "draw() {\n\n spiel.ctx.beginPath();\n spiel.ctx.fillStyle = \"ghostwhite\";\n spiel.ctx.fillRect(this.posX, this.posY, this.height, this.width);\n\n spiel.ctx.closePath();\n }", "function updateDraw(){\r\n //ToDo\r\n }", "function render() {\n\tctx.beginPath();\n\tctx.fillRect(-width, -height, 2*width, 2*height);\n\tctx.beginPath();\n\tdraw(document.getElementById('num').value, -10, -50, 10, -50);\n}", "function draw() {\n count += .1;\n requestAnimationFrame( draw );\n render();\n }", "function draw() {\n\t// ctx.clearRect(0, 0, canvas.width, canvas.height); // Clearing the canvas before each frame \n ctx.beginPath();\n ctx.rect(x, y, 10, 10);\n ctx.fillStyle = \"red\";\n ctx.fill();\n ctx.closePath();\n x += 1; // adding from here\n y += -1;\n}", "draw() {\r\n this.ctx.save()\r\n this.ctx.translate(this.x + (this.pSize / 2), this.y + (this.pSize / 2))\r\n this.ctx.rotate(this.angle)\r\n this.ctx.translate(-(this.x + (this.pSize / 2)), -(this.y + (this.pSize / 2)))\r\n this.ctx.drawImage(this.pl1, this.x, this.y, this.pSize, this.pSize)\r\n this.ctx.rotate(this.angle)\r\n this.ctx.restore()\r\n }" ]
[ "0.85384756", "0.85384756", "0.81735563", "0.81735563", "0.81735563", "0.7963708", "0.7963708", "0.7963708", "0.7963708", "0.79450506", "0.7942093", "0.7939449", "0.785113", "0.7849154", "0.7826705", "0.7826705", "0.7826705", "0.7826705", "0.7826705", "0.775753", "0.7747478", "0.77363807", "0.77363807", "0.77363807", "0.77363807", "0.77363807", "0.77363807", "0.77363807", "0.77363807", "0.77363807", "0.77363807", "0.77363807", "0.7684237", "0.7645476", "0.7635017", "0.76172084", "0.75951594", "0.7548532", "0.7532663", "0.7505073", "0.7496267", "0.7479703", "0.7467756", "0.74677086", "0.7380487", "0.7376627", "0.7366283", "0.73646677", "0.7359813", "0.7359534", "0.73398435", "0.7338849", "0.73356336", "0.7323582", "0.73167795", "0.7314376", "0.7302429", "0.7302429", "0.7280989", "0.72794604", "0.7267482", "0.7235814", "0.72293615", "0.72124344", "0.7198525", "0.71953934", "0.71950436", "0.7194781", "0.71801174", "0.71684575", "0.71663964", "0.7165867", "0.71602196", "0.7152421", "0.7141914", "0.713852", "0.7137454", "0.71305496", "0.7129911", "0.7129911", "0.7129911", "0.7129911", "0.7119331", "0.7118113", "0.71174484", "0.71173495", "0.71152264", "0.7109909", "0.71059906", "0.70998836", "0.7099228", "0.7099228", "0.7099228", "0.7095732", "0.7093955", "0.7092519", "0.7088744", "0.7087557", "0.70873356", "0.7083615", "0.70761055" ]
0.0
-1
end of function dispSig()
function initDFT() { for (i = 0; i < N; i++) { Xcos[i] = 0; Xsin[i] = 0; Xmag[i] = 0; }; // end of for loop }//end of function initDFT()
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function Disp() {\r\n}", "function showSignature() {\r\n print(\"Showing signature\");\r\n window.sigCtl.GetSignature(onGetSignature);\r\n function onGetSignature(sigCtlV, sigObjV, status) {\r\n if (window.sdkPtr.ResponseStatus.OK == status) {\r\n var outputFlags = window.sdkPtr.RBFlags.RenderOutputPicture | window.sdkPtr.RBFlags.RenderColor24BPP;\r\n var sigObj = sigObjV;\r\n sigObj.RenderBitmap(SigCaptX_Globals_1.BITMAP_IMAGEFORMAT, sigcaptx_1.HTMLTags.imageBox.clientWidth, sigcaptx_1.HTMLTags.imageBox.clientHeight, SigCaptX_Globals_1.BITMAP_INKWIDTH, SigCaptX_Globals_1.BITMAP_INKCOLOR, SigCaptX_Globals_1.BITMAP_BACKGROUNDCOLOR, outputFlags, SigCaptX_Globals_1.BITMAP_PADDING_X, SigCaptX_Globals_1.BITMAP_PADDING_Y, onRenderBitmap);\r\n }\r\n else {\r\n print(\"Error retrieving signature\");\r\n }\r\n }\r\n function onRenderBitmap(sigObjV, bmpObj, status) {\r\n if (callbackStatusOK(\"Signature Render Bitmap\", status)) {\r\n if (null == sigcaptx_1.HTMLTags.imageBox.firstChild) {\r\n sigcaptx_1.HTMLTags.imageBox.appendChild(bmpObj.image);\r\n }\r\n else {\r\n sigcaptx_1.HTMLTags.imageBox.replaceChild(bmpObj.image, sigcaptx_1.HTMLTags.imageBox.firstChild);\r\n }\r\n if (sigcaptx_1.HTMLTags.chkSigText.checked) {\r\n sigObjV.GetSigText(onGetSigText);\r\n }\r\n else {\r\n SigCaptX_WizSessionCtrl_1.WizardEventController.stop();\r\n }\r\n }\r\n }\r\n // Displays the SigText string in the text box on the HTML document\r\n function onGetSigText(sigObjV, text, status) {\r\n if (callbackStatusOK(\"Signature Render Bitmap\", status)) {\r\n print(\"Sig text successfully obtained: \" + text);\r\n // At this point you can send the contents of \"text\" to the server \r\n // and then validate it at the server end\r\n print(\"Stopping script\");\r\n SigCaptX_WizSessionCtrl_1.WizardEventController.stop();\r\n }\r\n }\r\n }", "function dispSig() {\n mY = (mouseY - (height / 2))\n if (mY < -358) {\n mY = -358\n } //restrict height within graph\n if (mY > -82) {\n mY = -82\n } // restrict height within graph\n //print('mY='+mY)\n mx = mouseX - width / 2;\n for (i = 0; i < N; i++) {\n xx[i] = xs + i * 30 // hori spacing\n ellipse(xx[i], ys, 5)\n line(xx[i], ys, xx[i], ys - 140) //vert lines up\n line(xx[i], ys, xx[i], ys + 140) //vert lines down\n\n line(xs, ys - 20 * i, xs + N * 26, ys - 20 * i) //horiz lines up\n line(xs, ys + 20 * i, xs + N * 26, ys + 20 * i) //horiz lines dn\n }; //end of for loop for plotting small circles\n for (i = 0; i < N; i++) {\n dx = abs(xx[i] - mx)\n\n if (dx < eps) {\n\n ellipse(xx[i], ys, 10);\n push()\n strokeWeight(9); //did the trick!\n stroke(backgnd)\n line(xx[i], ys, xx[i], pmY[i]) //signal bar\n pop()\n push()\n stroke(foregnd)\n strokeWeight(4)\n line(xx[i], ys, xx[i], mY) //signal bar\n pop()\n pmY[i] = mY; // y decreses upwords !\n sig[i] = -(mY - ys);\n }; // end of if block\n }; //end of for loop\n\n}", "function draw() {\n\n translate(width/2, height/2)\n \n dispSig()\n myDFT(sig)\n print('Xmag= ' + Xmag)\n}", "function FreeSym() {\r\n}", "inform() { }", "function Signal() { }", "function onGetSigText(sigObjV, text, status) {\r\n if (callbackStatusOK(\"Signature Render Bitmap\", status)) {\r\n print(\"Sig text successfully obtained: \" + text);\r\n // At this point you can send the contents of \"text\" to the server \r\n // and then validate it at the server end\r\n print(\"Stopping script\");\r\n SigCaptX_WizSessionCtrl_1.WizardEventController.stop();\r\n }\r\n }", "function HandleSigInt()\n{\n console.log(''); // (for linefeed after CTRL-C)\n Log('Exiting on SIGINT');\n Cleanup();\n // exit after giving time to log last message\n setTimeout(function() { process.exit(); }, 10);\n}", "function cust_exitFrame(tlref){\n \n}", "function Handle() {}", "function Close_Instruction() {\r\n}", "exitEncoding_decl(ctx) {\n\t}", "exitFpdef(ctx) {\n\t}", "function disp(){ \n console.log('This must be printed after addition'); \n }", "function deWndwRsizHandler() {\n nvBrClpsHid();\n}", "function nullFunc_dddd(x) { err(\"Invalid function pointer called with signature 'dddd'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)\"); err(\"Build with ASSERTIONS=2 for more info.\");abort(x) }", "function mostrarSig() {\n if(preguntas.length == 0){\n window.location = \"/\";\n }\n quiz.fadeOut(function() {\n $('#cuest').remove();\n if(indicePreg < preguntas.length) {\n var sigPreg = crearElemenPreg(indicePreg);\n quiz.append(sigPreg).fadeIn(); \n if(indicePreg === 0) {\n $('#next').show();\n }\n }else {\n var scoreElem = mensajefin();\n quiz.append(scoreElem).fadeIn();\n $('#next').hide();\n $('#start').show();\n $('#enc-sig').show();\n }\n });\n}", "function Xh(){}", "function kIPC(vm, uri, method, args, onok, onerr, timeout) {\n \n var rq = {\n v: 1, // protocol version\n id: __jn_stacks.newId()+(new Date().getTime())+\"\", // dunno why at init time the ID counter is not enough and can interfere with something else :\\\n uri: uri,\n terminal_id: \"~\", // always 'myself' for local requests - remote set at hubConnection\n/*\n object_type: vm.TypeURI, // TODO DOC decide on these names! mb. caller_type, caller_uri, etc.?\n object_security: vm.SecurityURI,\n object_uri: vm.uri, // named request\n*/\n caller_type: vm.TypeURI, // TODO DOC decide on these names! mb. caller_type, caller_uri, etc.?\n caller_security: vm.SecurityURI,\n caller_uri: vm.uri, // named request\n\n method: method,\n args: args,\n \n timeout: parseInt((timeout || MAX_RQ_TIME)) // timeout to drop\n };\n \n //var TIMEOUT_OK = {v: false};\n \n var afterSign = function () {\n if (vm.security.validateResponse) {\n var myonok = function (rs) {\n // validate response, if appropriate\n // TODO: these are currently unusable for in-stack execution; need to set SecurityError instead\n // maybe do not validate response here??\n \n var cbo = function (vr) {\n if(vr) {\n //TIMEOUT_OK.v = true;\n onok(rs); \n } else {\n onerr({id: rq.id, status: \"EPERM\", result: \"response validation failed\"}); // this can actually be parsed as permission error and raise SecurityError..\n }\n };\n \n var cbe = function (vr) {\n onerr({id: rq.id, status: \"EEXCP\", result: \"validateResponse failed with exception: \"+vr});\n };\n \n vm.execf_thread(vm.security.validateResponse, [rq], cbo, cbe, undefined, vm.security); \n };\n } else {\n //var myonok = function (rs) { TIMEOUT_OK.v = true; onok(rs); };\n var myonok = onok;\n }\n\n var lURI = uri.split(\"/\");\n if(lURI[0] == \"\") { // means this is root HUB request\n if(vm.DEBUG) vm.ErrorConsole.log(\"in kIPC... request for HUB\");\n\n // DOC if no onerror and only onok: call onok always -> as a standard kernel programming practice\n // TODO: introduce timeout to requests in case the request gets never response\n \n hubConnection.send(rq); \n if(uri.indexOf(\",\") > -1) {\n onok({id: rq.id, status: \"OK\", result: null});\n } else {\n __eos_requests[rq.id] = {request: rq, onok: myonok, onerror: onerr}; \n }\n } else { // TODO: URI caching\n try { // TODO get rid of this.. later\n // cache\n if(__eos_objects[uri]) var dest = __eos_objects[uri];\n else var dest = vm.getChild(lURI); // should never fail...\n } catch (e) {\n onerr({id: rq.id, status: \"EEXCP\", result: \"FAILED TO EXECUTE GETCHILD: \"+e+\" Line:\"+e.lineNumber+\" File:\"+e.fileName});\n return;\n }\n if(dest == null) {\n \n onerr({id: rq.id, status: \"EEXCP\", result: \"object not found by URI\"});\n return;\n }\n if(typeof(dest)==\"string\") { // means we're redirect \n if(vm.DEBUG) vm.ErrorConsole.log(\"in kIPC... again kIPC!\");\n // TODO optimize this! this will run signRequest at least twice; and pollute heap\n kIPC(vm, dest, method, args, onok, onerr); // we're taking advantage of the 'GIL' in js engine\n } else { // means it is a VM instance, so execute the request\n try {\n dest.execIPC(rq, myonok, onerr); // XXX parse results?? if YES -> change wakeObject!! \n } catch (e) {\n if(window.console) console.log(\"in kIPC - execIPC error:: \" + e);\n }\n }\n }\n \n if(typeof(timeout) == \"number\") {\n var tmf = function () {\n //if(TIMEOUT_OK.v) return;\n onerr({id: rq.id, status: \"EEXCP\", result: \"TIMEOUT\"});\n //hubConnection.abort(rq.id); // fail silently?? or do not abort??\n };\n setTimeout(tmf, timeout); // document that timeout is milliseconds\n }\n \n };\n\n if (vm.security.signRequest) {\n // do somehow validate request\n var onSok = function (res){\n if(res === true) { // XXX DOC the signRequest should modify the rq object itself and it should return true\n afterSign();\n } else {\n onerr({id: rq.id, status: \"EPERM\", result: (res ? res : \"signRequest refused to sign request\")});\n }\n };\n \n var onSerr = function (exc) {\n onerr({id: rq.id, status: \"EEXCP\", result: \"signRequest failed with exception: \"+exc});\n };\n vm.execf_thread(vm.security.signRequest, [rq], onSok, onSerr, undefined, vm.security); \n } else {\n afterSign();\n }\n\n}", "exitA104(ctx) {\n\t}", "function StackSym() {\r\n}", "function call_Batman() {\n console.log(\"Show signal\");\n}", "static get DS_HIDDEN() { return 0; }", "function simbl() {\n symbol = confirm(\"do you want to include symbol case option\\n ok = yes cancel = no\");\n return symbol; \n}", "function platinumHandler () {\n return;\n}", "function FP_RMSGB_PRIVATE_Submit(QueuedObject)\n//#else\n//# static function FP_RMSGB_PRIVATE_Submit ( QueuedObject )\n//#endif \n{\n var thisObject = QueuedObject.thisObject;\n var strEvent = QueuedObject.strEvent;\n \n if ((strEvent == \"CONFIRMED\") || (QueuedObject.flaguSignalCanceled)) VF_SY506_PRIVATE_HandleEvent(thisObject, strEvent);\n}", "function h$stg_sig_install(sigNo, actionCode, sigSet_d, sigSet_o) {\n // XXX dummy implementation\n return 0;\n}", "function sc_EOF() {\n}", "static handleOutput(evt){\n // response info includes response event object and output string \n IpcResponder.respond(GHCI_PROCESS.responseEvt, \"ghci\", {str: evt.str});\n }", "static final private public function m104() {}", "function SPmyFunction(){\r\ndebugger\r\n\t$('#SPcloseid').text(\"Submit\");\r\n\t}", "function SigV4Utils() { }", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "_FBPReady(){super._FBPReady();//this._FBPTraceWires()\n}", "function bnSigNum() {\n\tif(this.s < 0) return -1;\n\telse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\n\telse return 1;\n\t}", "function terminate() {\n\tt.murder(eventHandlers.cb);\n}", "enterFpdef(ctx) {\n\t}", "function nullFunc_dd(x) { err(\"Invalid function pointer called with signature 'dd'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)\"); err(\"Build with ASSERTIONS=2 for more info.\");abort(x); }", "function nullFunc_ii(x) { err(\"Invalid function pointer called with signature 'ii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)\"); err(\"Build with ASSERTIONS=2 for more info.\");abort(x); }", "function evHandler() {\r\n if (argv.debug)\r\n console.log(`exifProcessing ${exifProcessing} `); // eslint-disable-line no-console\r\n\r\n\r\n if (exifProcessing <= 0 && statProcessing <= 0) {\r\n exif.end();\r\n //console.log(\"TheRGC\", TheRGC);\r\n //console.log(\"TheRGC length\", TheRGC.length);\r\n runBatchGC();\r\n }\r\n}", "function endSub()\n{\n if (novel.callStack.length != 0)\n {\n novel.frame = novel.callStack.pop();\n }\n}", "function faildTerm(e) {\n\n}", "function gen_op_exit_tb()\n{\n gen_opc_ptr.push({func:op_exit_tb});\n}", "function instructionHandler(event)\n\t\t{\n\t\t\tg.instruct();\n\t\t\thideButtons(this);\n\t\t}", "handle() {}", "_disposeDisplay(object) {}", "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "function bnSigNum() {\nif(this.s < 0) return -1;\nelse if(this.t <= 0 || (this.t == 1 && this.data[0] <= 0)) return 0;\nelse return 1;\n}", "function printSims()\r\n{\r\n\ttry\r\n\t{\r\n\r\n\t}\r\n\tcatch(e)\r\n\t{\r\n\t\terrorHandler('printSims', e);\r\n\t}\r\n}", "exitA14(ctx) {\n\t}", "function nullFunc_ii(x) { err(\"Invalid function pointer called with signature 'ii'. Perhaps this is an invalid value (e.g. caused by calling a virtual method on a NULL pointer)? Or calling a function with an incorrect type, which will fail? (it is worth building your source files with -Werror (warnings are errors), as warnings can indicate undefined behavior which can cause this)\"); err(\"Build with ASSERTIONS=2 for more info.\");abort(x) }", "ret() {\r\n return 0x00EE;\r\n }", "function ux_hideMsg() {\n _hideErrMsg();\n}", "exitA46(ctx) {\n\t}", "function bnSigNum() {\r\n\t if (this.s < 0) return -1;\r\n\t else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\r\n\t else return 1;\r\n\t}", "function bnSigNum() {\r\n\t if (this.s < 0) return -1;\r\n\t else if (this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\r\n\t else return 1;\r\n\t}", "function _hidden() {}", "onCodePathEnd() {\n funcInfo = funcInfo.upper;\n }", "function adbpEndSlateClick() {\n\ttry {\n\t\ttrackMetrics({ \n\t\t\ttype: \"endslate-click\", \n\t\t\tdata: {}\n\t\t}); \n\t} catch(e){}\n}", "function hideStuff() {\n\thideInv();\n}", "exitA27(ctx) {\n\t}", "function gi(t,e){0}", "function n(e,t,n){i(this,\"ssfi\",n||arguments.callee),i(this,\"object\",e),i(this,\"message\",t)}", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "__fbpReady(){super.__fbpReady();//this._FBPTraceWires()\n}", "function priv () {\n\t\t\t\n\t\t}", "function bnSigNum() {\n\tif(this.s < 0) return -1;\n\telse if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n\telse return 1;\n }", "function bnSigNum() {\n\t if(this.s < 0) return -1;\n\t else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n\t else return 1;\n\t }", "function bnSigNum() {\n\t if(this.s < 0) return -1;\n\t else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n\t else return 1;\n\t }", "exitA54(ctx) {\n\t}", "function signDisplayNoneBadFunctionChangeThis() {\n store.dispatch({\n type: \"SHOW_SIGN\",\n payload: {\n display: \"none\"\n }\n });\n }", "exitA85(ctx) {\n\t}", "exitA86(ctx) {\n\t}", "function DispCls()// Probably gonna use the 'CE' button to call this function\n{\n DispString = \"\";\n DispUpdate(\"0\");\n}", "function __consolePrintHandle__(msg){\n print(msg);\n}", "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}", "function i(t, e) {\n 0;\n }", "exitA96(ctx) {\n\t}", "exitA16(ctx) {\n\t}", "function DK_DoFrame(){ /*DKLog(\"DK_ClearEvents(): not available for \"+DK_GetBrowser()+\"\\n\", DKWARN);*/ }", "function printc() {\r\n this.print(String.fromCharCode(this.stack.pop()));\r\n}", "function signature(text)\n { \n var sig = 0, len = text.length\n if(len > magic)\n len = magic\n for(var tdx = 0; tdx < len; ++tdx) \n {\n sig <<= 8\n sig += char(text, tdx)\n }\n return sig\n }", "function displayHelperProblem(prob) {\n\tloc = document.getElementById(\"helperTV\");\n\tdisplayProblem(prob,loc); //\n\tMathJax.Hub.Queue([\"Typeset\",MathJax.Hub]);\n}", "function EndForm()\n\t{\n\t\t// Write out the <div> that will house the submission applet now\n\t\t// if NS4 support is required.\n\t\tif (this.ns4support && !__submitDivOutput) {\n\t\t\tdocument.writeln('<div id=\"editize_submit_div\" style=\"position: absolute;\"></div>');\n\t\t\t__submitDivOutput = true;\n\t\t}\n\n\t\tvar editizeForm = __getObj(this.name).form;\n\t\tfor (var i = 0; i < editizeForm.elements.length; i++)\n\t\t{\n\t\t\tif (editizeForm.elements[i].type == \"submit\" &&\n\t\t\t\teditizeForm.elements[i].onclick != __submitButtonEditize)\n\t\t\t{\n\t\t\t\teditizeForm.elements[i].editizeOnclick =\n\t\t\t\t\teditizeForm.elements[i].onclick != null ?\n\t\t\t\t\teditizeForm.elements[i].onclick : null;\n\t\t\t\teditizeForm.elements[i].onclick = __submitButtonEditize;\n\t\t\t}\n\t\t}\n\t}", "function Answer() {\r\n // var val = 0;\r\n pressed = pressed.replace(\"x\", \"*\");\r\n pressed = eval(pressed) + \"\";\r\n refreshDisplay();\r\n }", "function display()\n{\n\n}", "function req(j){\n $('#reqspace').hide();\n reqerror[j]=0;\n reqdisp=\"\";\n errordisappear(id[j]);\n $('#reqspace').text(reqdisp);\n \n }", "function _0x407e48(_0x18187c, _0x27f1e8) {\n 0x0;\n }", "function bnSigNum() {\n\t if(this.s < 0) return -1;\n\t else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;\n\t else return 1;\n\t}", "exitA48(ctx) {\n\t}", "exitA95(ctx) {\n\t}", "async lavaPacketSignatureBurned(packetData,env){\n\n\n var params = lavaUtils.getLavaParamsFromData(packetData.from,packetData.to,packetData.walletAddress,packetData.tokenAddress,packetData.tokenAmount,packetData.relayerReward,packetData.expires,packetData.nonce)\n\n var msgParams = {data: params}\n\n var msgHash = ethSigUtil.typedSignatureHash(msgParams.data)\n\n\n console.log('sig was burned?' , msgHash )\n\n var burnedStatus = 0;\n\n try{\n burnedStatus = await ContractInterface.getWalletContract(this.web3,env).methods.signatureBurnStatus(msgHash).call()\n //var burnedStatus= 0;\n console.log('sig was burned: ',burnedStatus )\n }catch(e)\n {\n console.error(e)\n }\n\n return (burnedStatus != 0);\n\n\n }", "exitA79(ctx) {\n\t}", "exitA127(ctx) {\n\t}", "function Help() {\n}" ]
[ "0.61839", "0.5971244", "0.5869338", "0.5776047", "0.57388234", "0.5496641", "0.53882456", "0.535788", "0.53080934", "0.5279114", "0.52421707", "0.51038384", "0.5100492", "0.50479966", "0.49850985", "0.49465784", "0.49396953", "0.49311787", "0.49122626", "0.49115998", "0.4891984", "0.48658523", "0.48518652", "0.48288593", "0.48222357", "0.48151428", "0.4804512", "0.47980478", "0.47922087", "0.47847542", "0.47824928", "0.47704658", "0.4769058", "0.4755253", "0.4755253", "0.47489214", "0.47486272", "0.4742122", "0.47402245", "0.47366202", "0.47354642", "0.47277075", "0.47170076", "0.4715184", "0.47102082", "0.4709278", "0.47065446", "0.47038418", "0.47038418", "0.47038418", "0.47038418", "0.47038418", "0.47038418", "0.47038418", "0.4702196", "0.46846333", "0.46843964", "0.46816203", "0.4672318", "0.46702656", "0.4668893", "0.4668893", "0.4666123", "0.4652852", "0.4652468", "0.46498957", "0.46436587", "0.4638773", "0.4637018", "0.46361825", "0.46361825", "0.46321112", "0.46258235", "0.46212843", "0.46212843", "0.4619717", "0.46196687", "0.46162054", "0.461485", "0.46067056", "0.4604796", "0.460443", "0.45972204", "0.4597016", "0.45968947", "0.45893514", "0.45861396", "0.4579669", "0.45789018", "0.4577004", "0.45764697", "0.45749426", "0.45709243", "0.45670763", "0.45657802", "0.45632935", "0.45556545", "0.45548", "0.45509845", "0.45476207", "0.45461044" ]
0.0
-1
Gives a score on quality of match
function rateUser(userData, matchData, callback) { const userRoles = userData.roles || []; const userSkills = userData.skills || []; const matchRoles = matchData.roles || []; const matchSkills = matchData.skills || []; var rating = 0; // find matched roles async.forEachOf(userRoles, (role, index, next) => { // increase rating if match if (matchRoles.includes(role)) rating++; next(); }, err => { if(err) return callback(null); // find matched skills async.forEachOf(userSkills, (skill, index, next) => { // increase rating if match if (matchSkills.includes(skill)) rating++; next(); }, err => { if(err) return callback(null); else return callback(rating); }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function matchQuality (text, query) {\n const terms = tokenize(query)\n const termsLength = terms.map(term => term.length).reduce((x, y) => x + y, 0)\n\n const quality = termsLength / text.length\n // Add bonus points if the query matches text at the very start.\n const bonus = startsWith(text, terms[0]) ? 1 : 0\n\n return quality + bonus\n}", "function match(known_value, search_term) {\r\n\t// reset a few important variables to zero\r\n\traw_spedis_score = 0; spedis_score = 0; lev_score = 1;\r\n\tsxscore1 = \"\"; sxscore2 = \"\"; sxmatch = 0; matchscore = 0;\r\n\t// check if they exactly match, in which case skip the calculations!\r\n\tif (known_value == search_term) {\r\n\t\t matchscore = 100;\r\n\t} else {\r\n\t\traw_spedis_score = spedis(known_value, search_term);\r\n\t\tspedis_score = (-0.01*raw_spedis_score*raw_spedis_score)-(1.05*raw_spedis_score)+100\r\n\t\tlev_score = levenshtein2(known_value, search_term) * 100;\r\n\t\tsxscore1 = soundex(known_value);\r\n\t\tsxscore2 = soundex(search_term);\r\n\r\n\t\t// combine the raw soundex scores into a matching criteria\r\n\t\t// this system was developed by the author and applies an additive, non-exclusive percentage matching system\r\n\t\tif (sxscore1.charAt(0) == sxscore2.charAt(0)) { sxmatch = sxmatch + 40; };\r\n\t\tif (sxscore1.charAt(1) == sxscore2.charAt(1)) { sxmatch = sxmatch + 25; };\r\n\t\tif (sxscore1.charAt(2) == sxscore2.charAt(2)) { sxmatch = sxmatch + 10; };\r\n\t\tif (sxscore1.charAt(3) == sxscore2.charAt(3)) {\r\n\t\t\tif (sxscore1.length == 4 && sxscore2.length == 4) {\r\n\t\t\t\tif (sxmatch != 0) { sxmatch = sxmatch + 25; };\r\n\t\t\t} else {\r\n\t\t\t\tif (sxmatch != 0) { sxmatch = sxmatch + 10; };\r\n\t\t\t};\r\n\t\t};\r\n\t\tif (Math.min(sxscore1.length,sxscore2.length) > 4) {\r\n\t\t\tfor (n=4;n<=Math.min(sxscore1.length,sxscore2.length)-1;n++) {\r\n\t\t\t\tif (sxscore1.charAt(n) == sxscore2.charAt(n)) { sxmatch = sxmatch + (15/(Math.max(sxscore1.length,sxscore2.length)-4)); };\r\n\t\t\t};\r\n\t\t};\r\n\r\n\t\t// pull all the scores together\r\n\t\t// if they do not meet even a basic criteria, set the match to zero\r\n\t\tif (spedis_score < 20 || lev_score < 45) { matchscore = 0; } else {\r\n\t\t\tmatchscore = (((spedis_score + lev_score)/2) - 10) + (10 * (sxmatch/100));\r\n\t\t};\r\n\t};\r\n\treturn matchscore;\r\n}", "function calculate_score() {\n var answer = get_answer();\n var guess = get_guess();\n var diff = compare_arrays(answer, guess)\n return Math.floor(((((255 * 3) - diff) / (255 * 3)) * 100))\n}", "function scoreSolution(solution) {\n\n}", "matchPriority() {\n let priority = 1;\n\n if (this.match) {\n priority -= 0.1;\n }\n\n return priority;\n }", "function calculateAccuracy(){\n return Math.round( (cardMatches / matchAttempts) * 100 );\n}", "score() {\n var scores = [];\n var state = [];\n\n var guess = this._mapRenderers(data => {\n if (!data.ref) {\n return null;\n }\n\n if (data.ref.getSerializedState) {\n state.push(data.ref.getSerializedState());\n }\n\n scores.push(data.ref.score());\n return data.ref.getUserInput();\n });\n\n var combinedScore = scores.reduce(Util$l.combineScores);\n return Util$l.keScoreFromPerseusScore(combinedScore, guess, state);\n }", "function score(option) {\n return (option.boost || 0) * 100 + (option.apply ? 10 : 0) + (option.info ? 5 : 0) +\n (option.type ? 1 : 0);\n}", "function getHighestRecoScore(result) {\n\n var bestMatchScore = 0;\n var bestRecoItemNumber = -1;\n\n for (var i = 0; i < result.voiceClip.recos.length; i++) {\n var score = result.voiceClip.recos[i].matchScore\n if (score > bestMatchScore) {\n bestRecoItemNumber = i;\n bestMatchScore = score;\n }\n }\n\n return bestMatchScore;\n}", "function outputResults(score) {\n\n\n}", "function findBestMatch() {\n bestMatch = songMatches[0];\n for (let i = 1; i < songMatches.length; ++i) {\n if ( songMatches[i].popularity > bestMatch.popularity ) {\n bestMatch = songMatches[i];\n }\n }\n}", "function calculateMatchResult(gameId){\n\n}", "function score() {\n\treturn `Human: ${playerPoints} Computer: ${computerPoints}`;\n}", "get scoring () {\n\t\treturn this._scoring;\n\t}", "function getScore() {\n\t\tif (this.value == 'N') { //None\n\t\t\treturn 0.85;\n\t\t} else { //Required\n\t\t\treturn 0.62;\n\t\t}\n\t}", "function calculateScore() {\n\tscore = winCount * 100 + loseCount * -50 + (coveredTileCount * 2) + (100 - time) + (50 - moves) * 2 + (bonus * 15);\n}", "function score(data) {\r\n return data[0]*0.1 + data[2]*0.01 + data[3]*0.11 + data[1]*0.1 + data[4]*0.2 + data[5]*0.1 + data[6]*0.2 + data[7]*0.01 + data[8]*0.01;\r\n}", "function Matchup (quality)\n{\n\tthis.Quality = quality;\n\tthis.ScenarioQuality = null;\n\tthis.Scenarios = [];\n}", "function scoreCheck() {\n for (var i=0; i<mediaInfo.length; i++) {\n mediaInfo[i][9] = getScore(mediaInfo[i][7], mediaInfo[i][8]);\n }\n}", "function scoreAnswers(){}", "function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length,\n proximity = Math.abs(loc - x);\n\n if (!Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy;\n }\n return accuracy + (proximity / Match_Distance);\n }", "get quality() {}", "getScore() { \n return sb3.computeBoolObjScore(this.reqs);\n }", "evaluate() {\n let highest = 0.0;\n let index = 0;\n for (let i = 0; i < this.population.length; i++) {\n if (this.population[i].fitness > highest) {\n index = i;\n highest = this.population[i].fitness;\n }\n }\n\n this.best = this.population[index].getPhrase();\n if (highest === this.perfectScore) {\n this.finished = true;\n }\n }", "function calculateScore(match) {\n let score = 0;\n // cross line\n if (match[\"Start\"][\"Cross Line\"] == \"1\") {\n score += 3;\n } else if (match[\"Start\"][\"Cross Line\"] == \"2\") {\n score += 6;\n }\n let climb_score = 0;\n // platform\n if (match[\"Endgame\"][\"Platform\"] == \"level 1\") {\n climb_score += 3;\n } else if (match[\"Endgame\"][\"Platform\"] == \"level 2\") {\n climb_score += 6;\n } else if (match[\"Endgame\"][\"Platform\"] == \"level 3\") {\n climb_score += 12;\n }\n if (match[\"Endgame\"][\"Assistance\"] == \"received\") {\n climb_score = 0;\n } else if (match[\"Endgame\"][\"Assistance\"] == \"gave 1\") {\n climb_score *= 2;\n } else if (match[\"Endgame\"][\"Assistance\"] == \"gave 2\") {\n climb_score *= 3;\n }\n score += climb_score;\n // hatch\n let hatch_vals = [\"Hatch Ship\", \"Hatch Low\", \"Hatch Mid\", \"Hatch High\"];\n for (let i in hatch_vals) {\n score += (parseInt(match[\"Teleop\"][hatch_vals[i]]) * 2);\n\n }\n // cargo\n let cargo_vals = [\"Cargo Ship\", \"Cargo Low\", \"Cargo Mid\", \"Cargo High\"];\n for (let i in cargo_vals) {\n score += (parseInt(match[\"Teleop\"][cargo_vals[i]]) * 3);\n }\n return score;\n}", "function match_bitapScore_(e, x) {\n var accuracy = e / pattern.length,\n proximity = Math.abs(loc - x)\n\n if (!Match_Distance) {\n // Dodge divide by zero error.\n return proximity ? 1.0 : accuracy\n }\n return accuracy + proximity / Match_Distance\n }", "function yourScore() {\n return fname + ' scored ' + (mid + final);\n }", "function qualityMetrics() {\n let auto = [];\n let manual = [];\n for (let entry of texts) {\n (entry.automaticSpeed ? auto : manual).push(entry);\n }\n auto.sort((entry) => entry.score);\n manual.sort((entry) => entry.score);\n\n /**\n * @param {Entry[]} group\n */\n const stats = (group) => {\n const scores = group.map((entry) => entry.score);\n return {\n scores: scores.reduce((object, score, i) => {\n const firstWord = group[i].text.split(/\\s+/)[0];\n object[firstWord] = score;\n return object;\n }, {}),\n min: scores[0],\n max: scores[scores.length - 1],\n mean: scores.reduce((a, b) => a + b) / scores.length,\n expectedYesRatio:\n group.filter((entry) => entry.expectedAnswer === \"yes\").length /\n group.length,\n longestWords: group.map(\n (entry) =>\n entry.text.split(/\\s+/).sort((a, b) => b.length - a.length)[0]\n ),\n };\n };\n\n return {\n auto: stats(auto),\n manual: stats(manual),\n };\n}", "function calculateScoreTries(board) {\n\t\tif (board == \"boardEasy\" && openedPairs < 10) {\n\t\t\tscore += 20;\n\t\t} else if (board == \"boardEasy\" && openedPairs < 15) {\n\t\t\tscore += 10;\t\t\n\t\t} else if (board == \"boardNormal\" && openedPairs < 15) {\n\t\t\tscore += 40;\t\t\n\t\t} else if (board == \"boardNormal\" && openedPairs < 20) {\n\t\t\tscore += 20;\t\t\n\t\t} else if (board == \"boardAdvanced\" && openedPairs < 20) {\n\t\t\tscore += 50;\t\t\n\t\t} else if (board == \"boardAdvanced\" && openedPairs < 25) {\n\t\t\tscore += 30;\t\t\n\t\t} else if (board == \"boardDifficult\" && openedPairs < 30) {\n\t\t\tscore += 60;\t\t\n\t\t} else if (board == \"boardDifficult\" && openedPairs < 40) {\n\t\t\tscore += 40;\t\t\n\t\t}\n\t}", "function updateScore(time) {\n score = Math.floor((matches * matches / (time + 1) / (misses + 1)) * 10000);\n $('#score').text('Score: ' + score);\n return score;\n }", "function getScore() { // Calculating rounded scores based off of dimension\n if (size < 50) { // Checking less than 50\n var lessThan = Math.round(10 - 0.1 * size);\n score = score + lessThan; // Updating score\n } else { // Checking more than 50\n var moreThan = Math.round(10 - 0.09 * size);\n score = score + moreThan; // Updating score\n }\n }", "function simpleScore() {\n return simpleScrabbleScorer(userWord);\n}", "function getScore(p1, p2) {\r\n if (p1 === p2) {\r\n return 0;\r\n } else if (p1 === 0) {\r\n if (p2 === 1) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else if (p1 === 1) {\r\n if (p2 === 2) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n } else if (p1 === 2) {\r\n if (p2 === 0) {\r\n return 0;\r\n } else {\r\n return 1;\r\n }\r\n }\r\n}", "function getScore(str1,str2,v1,v2,v3){\n\t\t\t\t\t\t\tvar r = 0;\n\t\t\t\t\t\t\tstr1 = str1.toUpperCase();\n\t\t\t\t\t\t\tstr2 = str2.toUpperCase();\n\t\t\t\t\t\t\tif(str1.indexOf(str2)==0) r += (v1||3);\n\t\t\t\t\t\t\tif(str1.indexOf(str2)>0) r += (v2||1);\n\t\t\t\t\t\t\tif(str1==str2) r += (v3||4);\n\t\t\t\t\t\t\treturn r;\n\t\t\t\t\t\t}", "function calcScore(correct, length) {\n return correct / length * 100; \n}", "function getScore(){\n return score\n}", "function Score() { }", "function k538(matches) { return 250 / Math.pow(matches + 5, .4); }", "function getHumanReadableScore(score) {\r\n if (score > 0) { \r\n return Math.round(score/antiscale);\r\n }\r\n return 10000;\r\n}", "function best_matches() {\n var matched_counter = identicalCards(computerStack.cards);\n var num_sets = Object.keys(matched_counter).length;\n\n myarray = _.pairs(matched_counter);\n\n function Comparator(a, b) {\n if (a[1] < b[1]) return 1;\n if (a[1] > b[1]) return -1;\n return 0;\n }\n myarray = myarray.sort(Comparator);\n keys_array = new Array();\n values_array = new Array();\n for (i = 0; i < myarray.length; i++) {\n if (myarray[i][0] != '\"W\"') { // no wilds\n trimmed_string = myarray[i][0].replace(/\"/g, \"\");\n keys_array.push(trimmed_string);\n values_array.push(myarray[i][1]);\n }\n // now count the wilds\n else {\n var num_wilds = myarray[i][1];\n }\n }\n\n var best_nums = new Array();\n var num_with_largest_matches = keys_array[0];\n var num_with_next_largest_matches = keys_array[1];\n\n // Now we evaluate to see if we have a phase with just our cards! Two sets of 3.\n if (values_array[0] > 2 && values_array[1] > 2) {\n console.log(\"Computer has a phase!\");\n best_nums.push(\"True\");\n best_nums.push(num_with_largest_matches); // We know we can make a phase with this\n best_nums.push(num_with_next_largest_matches);\n }\n\n // Now we evaluate to see if we have a phase if we use our wilds.\n // This particular if statement checks to see if the highest match amount is 3 or more\n // And that there's 1 card that matches it, with another card that has 2 or more\n else if (num_wilds > 0) {\n\n if (values_array[0] + values_array[1] + num_wilds > 5) {\n console.log(\"We have a phase with a wild!\");\n best_nums.push(\"Wilds\");\n best_nums.push(\"W\");\n best_nums.push(num_with_largest_matches);\n best_nums.push(num_with_next_largest_matches);\n\n\n } else {\n console.log(\"There were wilds but no matches.\")\n best_nums.push(\"False\");\n best_nums.push(num_with_largest_matches);\n best_nums.push(num_with_next_largest_matches);\n }\n\n } else {\n console.log(\"No matches.\");\n best_nums.push(\"False\");\n best_nums.push(num_with_largest_matches);\n best_nums.push(num_with_next_largest_matches);\n }\n return best_nums;\n }", "function getScoreApertif( site , url){\n scorePos = site.search('rating-points') + 12;\n score = site[scorePos+3] + site[scorePos+4];\n if(checkValue(score[0])){\n insertScore('ap', score , url , 'https://static.gfx.no/images/main/aperitif.png')\n }\n else {\n noScoreFound();\n }\n\n}", "function heuristic(state) {\n var score = 0;\n for(var idx = 0; idx < patterns.length; idx++) {\n if(match_pattern(state, patterns[idx].pattern, 'red')) {\n score = score + patterns[idx].score;\n }\n if(match_pattern(state, patterns[idx].pattern, 'yellow')) {\n score = score - patterns[idx].score;\n }\n }\n return score;\n}", "score(args) {\n\n }", "function getScore(records) {\n const DEFAULT_SCORE = 0;\n const MAGIC_PARAMETER = 10;\n if (!records.length) {\n return DEFAULT_SCORE;\n }\n const x = sd(records);\n return (1 - (x / (x + MAGIC_PARAMETER))) * 100;\n}", "function getScore() {\n /*\n * (# of req. pages viewed + # of correctly answered req. questions) / \n * (total req. pages + total req. questions)\n */\n\n var totalRequired = pages.required + questions.required;\n\n // User scores 100% if there are no requirements...\n if( totalRequired === 0 ) {\n return 1;\n } \n\n return Math.min(( pages.viewed.required + questions.answered.required ) / totalRequired, 1);\n }", "function score(sequence1, sequence2, scoringMatrix)\r\n{\r\n\tvar score = 0;\r\n\tvar nucleotideIndex1; //indeks w macierzy podobienstwa nukleotydu z pierwszej sekwencji\r\n\tvar nucleotideIndex2; //indeks w macierzy podobienstwa nukleotydu z drugiej sekwencji\r\n\tfor(i = 0; i < sequence1.length; i++)\r\n\t{\r\n\t\tnucleotideIndex1 = getNucletideIndex(sequence1[i]);\r\n\t\tnucleotideIndex2 = getNucletideIndex(sequence2[i]);\r\n\t\tscore = score + parseInt(scoringMatrix[nucleotideIndex1][nucleotideIndex2]);\r\n\t}\r\n\treturn score;\r\n}", "function scoreQ10a() {\n console.log(\"q10a answer: \" + q10a)\n}", "function bonusScore () {\n // Currently, we have two kinds of bonus: Match and Phrase\n var bonus = 0;\n\n // TODO: Yeah, I know we can fail faster here, but it's 3 in the morning\n var firstWord = formWord(state.words[0]);\n var secondWord = formWord(state.words[1]);\n\n // Check for a Match Bonus, where both words are the same\n if (firstWord.toUpperCase() === secondWord.toUpperCase()) {\n bonus += 2 * getWordValue(state.words[0].toUpperCase());\n }\n\n // Check for a Phrase Bonus\n var phrase = firstWord.toLowerCase() + \" \" + secondWord.toLowerCase();\n if (bonusPhrases[phrase]) {\n bonus += config.phraseBonus;\n }\n console.log(\"The phrase bonus result is: \" + bonus);\n return bonus;\n}", "function scoreQ9() {\n console.log(\"q9a answer: \" + q9a)\n console.log(\"q9b answer: \" + q9b)\n \n return 0; \n}", "function calculateScore(objResult) {\n let result = 0\n for (let item in objResult) {\n result += Number(objResult[item])\n }\n return result * 100 / (Object.keys(objResult).length * 5)\n}", "function getScore(str1,str2,v1,v2,v3){\n\t\tvar r = 0;\n\t\tstr1 = str1.toUpperCase();\n\t\tstr2 = str2.toUpperCase();\n\t\tif(str1.indexOf(str2)==0) r += (v1||3);\n\t\tif(str1.indexOf(str2)>0) r += (v2||1);\n\t\tif(str1==str2) r += (v3||4);\n\t\treturn r;\n\t}", "function getScore() {\n\treturn parseFloat((Math.abs(error) / ramp * 100).toPrecision(4));\n}", "function compareByRelevance(o1, o2) {\n var result = 0;\n\n if (Math.abs(0.5 - o1.percentage) > Math.abs(0.5 - o2.percentage)) {\n result = -1; // A trait with 1% is more interesting than one with 60%.\n }\n\n if (Math.abs(0.5 - o1.percentage) < Math.abs(0.5 - o2.percentage)) {\n result = 1;\n }\n\n return result;\n}", "function determineWinner(matches) {\n // loop through each map\n for (let i=0; i<matches.length; i++) {\n // find each player and return points\n let playerOneStrength= locateStrength(matches[i].playerOne)/totalGames;\n let playerTwoStrength= locateStrength(matches[i].playerTwo)/totalGames;\n let relativeStrengthDifferential = (playerOneStrength - playerTwoStrength)/2;\n let playerOneResult = (Math.random()*100);\n // give win to winner of game\n if (playerOneResult + relativeStrengthDifferential >= 50) {\n locateAndAdd(matches[i].playerOne) //\n } else \n locateAndAdd(matches[i].playerTwo)\n }\n}", "GetBestScore() {\n\t\treturn this.SearchController.bestScore\n\t}", "function compare(userChoice){\r\n let robotChoice = roboChoice();\r\n let score;\r\n\r\n if(userChoice == robotChoice){\r\n score = 2;\r\n }\r\n else if(userChoice == \"rock\" && robotChoice == \"scissors\"){\r\n score = 1;\r\n }\r\n else if(userChoice == \"scissors\" && robotChoice == \"rock\"){\r\n score = 0;\r\n }\r\n else if(userChoice == \"paper\" && robotChoice == \"rock\"){\r\n score = 1;\r\n }\r\n else if(userChoice == \"rock\" && robotChoice == \"paper\"){\r\n score = 0;\r\n }\r\n else if(userChoice == \"paper\" && robotChoice == \"scissors\"){\r\n score = 0;\r\n }\r\n else if(userChoice == \"scissors\" && robotChoice == \"paper\"){\r\n score = 1;\r\n }\r\n else{\r\n score = 2;\r\n } \r\n\r\n return score;\r\n\r\n}", "function winChance(score1, score2) {\n return 1/(1+Math.pow(10,((score2-score1)/400.0)))\n}", "function updateScore(result) {\n\tif (result === 'won') {\n\t\t++totalWins;\n\t} else if (result === 'lose') {\n\t\t++totalLost;\n\t} else {\n\t\t++totalDraw;\n\t}\n\n\t++totalMatches;\n\n\tupdateBoard(totalMatches, totalWins, totalLost, totalDraw);\n}", "score(inputs, output) {\n var d = Math.abs(inputs[0] - inputs[1]);\n d = Math.abs(d - output) + 0.1;\n return 1 / d;\n }", "static async getMatchScore(tournamentId, round, match) {\n const url = ENDPOINTS.MATCH_SCORE_ENDPOINT;\n const parameters = {\n tournamentId: tournamentId,\n round: round,\n match: match\n };\n\n try {\n const matchScore = await HTTPRequestHandler.get(url, parameters);\n return {\n score: matchScore.score,\n number: match,\n round: round\n }\n } catch (error) {\n console.log('getTeam error', error.toString());\n }\n }", "function getScoreStatus() {\n if (correctAnswers >= passingScore) {\n return \"passed\";\n }\n return \"failed\";\n}", "function mappingDesirableScore(offered_course, pi) {\n let score = Random.fraction() * 100 | 0;\n // return score;\n return 0;\n}", "calculateScoreOld() {\n let cardValues = this.cards.map(({ value }) => value).sort((a, b) => b - a);\n return cardValues.reduce((acc, val) => {\n return val === 1 && acc + val < 8 ? acc + val + 10 : acc + val;\n }, 0);\n }", "function CalculateScore(score, homeworkCount) {\n let submittedHW = homeworkCount / this.presentations.length;\n let result = score * 3 + submittedHW;\n }", "getAnswerScore(fastestFingerChoices) {\n var score = 0;\n\n for (let i = 0; i < fastestFingerChoices.length; i++) {\n if (this.shuffledChoices[fastestFingerChoices[i]] == this.orderedChoices[i]) {\n score++;\n }\n }\n\n return score;\n }", "function getScore(correct, missed, noAnswer){\n let x = (correct / (correct + missed + noAnswer)) * 100;\n return x;\n }", "function mapQuality(qualClassName) {\r\n\tswitch (qualClassName) {\r\n\t\tcase 'very high': return (8);\r\n\t\tcase 'high': return (7);\r\n\t\tcase 'med': return (6);\r\n\t\tcase 'low': return (5);\r\n\t\tcase 'very low': return (4);\r\n\t\tcase 'corrupted': return (3);\r\n\t\tcase 'eyecancer': return (2);\r\n\t\tcase 'unknown': return (1);\r\n\t\t}\r\n\treturn (1);\r\n}", "function jobAwesomenessScore(jobAttrs) {\n /**\n * @param {Object} jobAttrs - Qualities of a job tested for awesomeness\n * @return {number} 0 score for offer without good qualities and +1 for every\n * met quality\n */\n const { paidVacation = 0, hammocksInOffice = false, freeLunch = false } = jobAttrs;\n const minPaidVacation = 30;\n\n let score = 0;\n\n // Calc the score here...\n\n return score;\n}", "function score({route, pickUp}) {\n return (pickUp ? 0.5 : 0) - route.length;\n }", "function getMatchResult(pobj) {\n return (pobj['stats']['win'] ? 'Win' : 'Lose');\n}", "function calculeScores() {\n var width = canvas.width / ratio;\n var height = canvas.height / ratio;\n pigs.forEach((p) => {\n if ((birdX + birdWidth - tolerance > p.centerX - p.radius) && (birdX + tolerance < p.centerX + p.radius)) {\n if ((birdY + birdHeight - tolerance > p.centerY - p.radius) && (birdY + tolerance < p.centerY + p.radius)) {\n scoreSound.play();\n score += 2;\n p.centerX = canvas.width / ratio;\n p.centerY = Math.floor(Math.random() * (height - flowHeight - flowHeight + 1) + flowHeight);\n }\n }\n })\n}", "checkCorrectness(answer) {\n var playerAnswer = answer.toLowerCase().replace(\", \", \" ja \").replace(\" & \", \" ja \")\n var latinName = this.props.game.currentImage.bone.nameLatin.toLowerCase().replace(\" & \", \" ja \")\n return 100 * StringSimilarity.compareTwoStrings(playerAnswer, latinName); // calculate similarity \n //return 100 * StringSimilarity.compareTwoStrings(this.props.game.currentImage.bone.nameLatin.toLowerCase(), this.state.value.toLowerCase()); // calculate similarity \n }", "set quality(value) {}", "function hatchTest(team) {\n // data about the team's scores\n let team_scores = calculateScores(team);\n // median number of hatches per match\n let hatch_avg = roundto100th(jStat.median(team_scores[1]));\n return hatch_avg;\n}", "function compareAudienceScores(){\n\t\t\tif (audiencescorem1>audiencescorem2){\n\t\t\t\taudiencewinner = \"<p>According to the audience, the winner is <span class='movietitleoutput'>\" + simplem1tempURI +\"</span>.</p>\";\n\t\t\t\taudiencewinnerposter = posterm1;\n\t\t\t}\n\t\t\telse if (audiencescorem2>audiencescorem1){\n\t\t\t\taudiencewinner = \"<p>According to the audience, the winner is <span class='movietitleoutput'>\" + simplem2tempURI +\"</span>.</p>\";\n\t\t\t\taudiencewinnerposter = posterm2;\n\t\t\t}\n\t\t\telse {\n\t\t\t\taudiencewinner = \"<p>The audience liked both movies the same! WHOA.</p>\"\n\t\t\t}\n\t}", "function calculateMatch(newFriend) {\n var matches = [];\n for (i = 0; i < friendData.length; i++) {\n matches.push(\n {\n name: friendData[i].name,\n score: compareScores(newFriend.scores, friendData[i].scores),\n photo: friendData[i].photo,\n }\n );\n }\n\n // Look at score attribute and sort\n matches.sort(function (a, b) {\n return (a.score - b.score)\n });\n\n // Return the closest match\n return matches[0];\n}", "function scrabbleScore() {\n console.log(`Currently using : ${scoringAlgorithms[2].name}`);\n\tconsole.log(`The score for your word, ${userWord}, is ${oldScrabbleScoreTotal(userWord)}!`);\n}", "function scoreQ10b() {\n console.log(\"q10b answer: \" + q10b)\n\n}", "function exactMatchs(p) {\n let oldScore = parseInt(document.getElementById('matchs').innerText);\n if (p === 10) {\n document.getElementById('matchs').innerText = oldScore + 1;\n }\n}", "function compatibilityTest(scores) {\n\tvar match = {};\n\tvar matchIndex = 0;\n\tvar sum = 0;\n\tfor (var i=0; i<friends.length; i++) {\n\t\tvar tempSum = 0;\n\n\t\t// Get the diff between each score for a given friend and the new friend\n\t\t// Add them up together\n\t\tfor (var j=0; j<friends[i].answers.length; j++) {\n\t\t\tvar friendScore = parseInt(scores[j]);\n\t\t\tvar matchScore = parseInt(friends[i].answers[j]);\n\t\t\tif (matchScore > friendScore) {\n\t\t\t\ttempSum += (matchScore - friendScore);\n\t\t\t} else {\n\t\t\t\ttempSum += (friendScore - matchScore);\n\t\t\t}\n\t\t}\n\n\t\tif (tempSum == 0) {\n\t\t\t//Exact Match\n\t\t\tmatchIndex = i;\n\t\t\tbreak;\n\t\t}\n\n\t\tif (sum == 0 || sum > tempSum) {\n\t\t\t//Best match so far\n\t\t\tsum = tempSum;\n\t\t\tmatchIndex = i;\n\t\t}\n\t}\n\n\t// Let us send the name and photo of the friend that best matched\n\tmatch.name = friends[matchIndex].name;\n\tmatch.photo = friends[matchIndex].photo;\n\treturn match;\n}", "function rating(voyage, history) {\n const vpf = voyageProfitFactor(voyage, history);\n const vr = voyageRisk(voyage);\n const chr = captainHistoryRisk(voyage, history);\n if (vpf * 3 > vr + chr * 2) return \"A\";\n else return \"B\";\n}", "function CalGoalsPerMatch(playerInstance)\r\n{\r\n \r\n// Object with goals per match formula\r\n\r\nformulaObj = {\r\n\r\n// goals / (losses + wins + draws);\r\n formula:playerInstance.stats[0].value / (playerInstance.stats[1].value + playerInstance.stats[2].value + playerInstance.stats[3].value)\r\n\r\n}\r\n\r\nresult = formulaObj.formula.toFixed(2); ; // fixing the integer length of the double to three integers\r\n\r\nreturn result // returning the new result \r\n \r\n}", "function calculateScore(groupedHeroes, comics) {\n const correctOrder = HEROES.filter((hero) => hero.comics === comics).sort(\n (a, b) =>\n a.rank < b.rank ? -1 : 1\n\n )\n\n\n return groupedHeroes ? groupedHeroes.reduce((score, { name, rank }, index) => {\n const maxPoint = getMaxPoints()\n const heroIndex = correctOrder.findIndex((hero) => hero.rank === rank && hero.name === name)\n const penalty = heroIndex >= 0 ? Math.abs(index - heroIndex) : maxPoint\n return score + (maxPoint - penalty)\n }, 0) : null\n}", "function playMatch( results ) {\n //Create the teams\n var teams = [\n [players[0].rating, players[1].rating, players[2].rating, players[3].rating, players[4].rating],\n [players[5].rating, players[6].rating, players[7].rating]\n ];\n //Get the new ratings using the results\n var newRatings = trueSkill.update( teams, results );\n console.log( \"new ratings\", newRatings );\n ////Update the player's rating\n //for ( var i = 0; i < teams.length; i++ ) {\n // players[i * 5].rating = newRatings[i][0];\n // players[(i * 5) + 1].rating = newRatings[i][1];\n // players[(i * 5) + 2].rating = newRatings[i][2];\n // players[(i * 5) + 3].rating = newRatings[i][3];\n // players[(i * 5) + 4].rating = newRatings[i][4];\n //}\n //console.log( \"players\", players );\n}", "function computeScore (type, el) {\n let tmp = el.querySelector('.prt-supporter-summon');\n const name = tmp.childNodes[2].nodeValue.trim();\n tmp = el.querySelector('.prt-supporter-name');\n const isFriend = tmp.classList.contains('ico-friend') ? 0 : 1;\n\n const fn = SCORE_TABLE[type][name];\n if (!fn) {\n return 0 + isFriend;\n }\n\n let rank = 0;\n if (el.querySelector('.bless-rank1-style')) {\n rank = 1;\n } else if (el.querySelector('.bless-rank2-style')) {\n rank = 2;\n } else if (el.querySelector('.bless-rank3-style')) {\n rank = 3;\n }\n\n return fn[rank] + isFriend;\n}", "function compareResultScores(result1, result2) {\n return result2.score - result1.score;\n}", "function getBestMatch(subject) {\n\tvar bestScore = 100.0\n\tvar matchName = \"\"\n\tvar returnString = \"\"\n\tvar allMeasurements = Object.keys(Measurements)\n\tvar allSubjects = []\n\tfor (firstIndex = 0; firstIndex < allMeasurements.length; firstIndex++) {\n\t\tvar measurement = allMeasurements[firstIndex]\n\t\tallSubjects[firstIndex] = exportArray(Measurements[measurement])\n\t}\n\tfor (secondIndex = 0; secondIndex < allSubjects.length; secondIndex++) {\n\t\tvar score = compareWithSubject(subject, allSubjects[secondIndex])\n\t\tif (score < bestScore) {\n\t\t\tbestScore = score\n\t\t\tmatchName = allMeasurements[secondIndex]\n\t\t}\n\t}\t\n\treturn matchName\n}", "calculateScore () {\n this.allCorrectAnswers = {};\n this.allSelectedAnswers = readFromCache('selectedAnswers');\n this.quizData.map((qA) => {\n const correctAnswers = [];\n for (const [key, value] of Object.entries(qA.correct_answers)) {\n if (value == 'true') {\n const correctAnswer = helpers.splitter(key, '_', 2);\n correctAnswers.push(correctAnswer);\n }\n }\n this.allCorrectAnswers[qA.id] = correctAnswers;\n });\n for (const [key, value] of Object.entries(this.allSelectedAnswers)) {\n if (value.sort().join(',') === this.allCorrectAnswers[key].sort().join(',')) {\n this.score++;\n }\n }\n this.score = this.score / Object.keys(this.allSelectedAnswers).length * 100;\n this.score = this.score.toFixed(2);\n let allScores = readFromCache('scores');\n allScores = allScores || {};\n allScores[new Date().toLocaleString()] = this.score;\n writeToCache('scores', allScores);\n }", "function getQuality()\r\n {\r\n return quality;\r\n }", "evaluate() {\n let worldrecord = -1;\n let index = 0;\n for (let i = 0; i < this.population.length; i++) {\n if (this.population[i].fitness > worldrecord) {\n index = i;\n worldrecord = this.population[i].fitness;\n }\n }\n \n this.best = this.population[index].getPhrase();\n }", "function Resume_Minify_ScoreCounter(score)\n{\n\t//create a result array\n\tvar aResult = [];\n\t//fill it up\n\taResult[0] = score.Requests_Hints;\t\t\t//Count of all hints requested\n\taResult[1] = score.Requests_Cameras; \t\t//Count of all cameras requested\n\taResult[2] = score.Actions_Correct; \t\t//count of correct actions performed with correct data\n\taResult[3] = score.Actions_BadData; \t\t//count of correct actions performed with bad data\n\taResult[4] = score.Triggers_Hints;\t\t\t//count of hints triggered\n\taResult[5] = score.Triggers_Camera;\t\t\t//count of cameras triggered\n\taResult[6] = score.Triggers_Penalty; \t\t//count of penalty triggers triggered\n\taResult[7] = score.Triggers_Error; \t\t\t//count of error triggers triggered\n\taResult[8] = score.Triggers_Info;\t\t\t//count of information triggers triggered\n\taResult[9] = score.Triggers_MouseOver;\t\t//count of mouseover triggers triggered\n\taResult[10] = score.Count_Errors; \t\t\t//count of total errors (bad datas, penalties and error triggers)\n\taResult[11] = score.bProcessed ? 1 : 0;\t\t//set to true when the main action has been done\n\taResult[12] = score.AutoPlayCamera ? 1 : 0; //set to true to indicate this is an autocamera and shouldnt be penalised\n\t//return it\n\treturn aResult;\n}", "function score({route, pickUp}) {\n return (pickUp ? 0.5 : 0) - route.length;\n }", "function cargoHatchTest(team) {\n // data about the team's scores\n let team_scores = calculateScores(team);\n // median number of hatches per match\n let hatch_avg = roundto100th(jStat.median(team_scores[1]));\n // median number of cargo per match\n let cargo_avg = roundto100th(jStat.median(team_scores[2]));\n return hatch_avg + cargo_avg;\n}", "function performScoreCalculation() {\r\n var totalScore = 0; // calculated total score\r\n var score; // score in a category\r\n var ratio; // ratio of a category within the total score\r\n $(\"[id$='_score']\").each(function() {\r\n ratio = parseFloat($(this).attr(\"data-ratio\"));\r\n score = parseFloat($(this).attr(\"data-score\"));\r\n totalScore = totalScore + (ratio * score);\r\n });\r\n return totalScore;\r\n}", "function score(workorder) {\n //return workorder.priority * timeSinceRequest(workorder.timeStamp);\n return workorder.priority;\n}", "function getRankBonus(result) {\n // set a bonus factor for Matches and Hits in the upper rankings (of Original Dataset)\n let bonus\n if (result <= topRank) {\n bonus = topBonus\n } else if (result <= mediumRank) {\n bonus = mediumBonus\n } else {\n bonus = 1\n }\n return bonus\n}", "function Score(strength) {\n this.strength = strength;\n this.points = 0;\n this.isMinimum = false;\n this.hasLower = false;\n this.hasUpper = false;\n this.hasNumber = false;\n this.hasSpecial = false;\n this.isBonus = false;\n this.percent = 0;\n this.valid = false;\n this.errors = [];\n}", "score(aMessage, aContext) {\n let score = 0;\n if (aMessage.starred) {\n score += this.NOTABILITY_STARRED;\n }\n if (aMessage.tags.length) {\n score +=\n this.NOTABILITY_TAGGED_FIRST +\n (aMessage.tags.length - 1) * this.NOTABILITY_TAGGED_ADDL;\n }\n return score;\n }", "function showMatch() {\n for (var i = 0; i < doneScoreArr.length; i++) {\n if (doneScoreArr[i] < lowestScore) {\n lowestScore = doneScoreArr[i];\n }\n }\n\n console.log(\"Lowest Score \" + lowestScore);\n\n for (var i = 0; i < doneScoreArr.length; i++) {\n if (lowestScore === doneScoreArr[i]) {\n // console.log(surveyData[i])\n bestMatch = surveyData[i];\n }\n }\n}", "getScore()\r\n\t{\r\n\t\treturn this._score;\r\n\t}", "scoreToDisplay() {\n let score = '';\n\n if (this.P1point === this.P2point && this.P1point < 3) {\n if (this.P1point === 0)\n score = 'Love';\n if (this.P1point === 1)\n score = 'Fifteen';\n if (this.P1point === 2)\n score = 'Thirty';\n score += '-All';\n }\n if (this.P1point === this.P2point && this.P1point > 2)\n score = 'Deuce';\n\n if (this.P1point > 0 && this.P2point === 0) {\n if (this.P1point === 1)\n this.P1res = 'Fifteen';\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n if (this.P1point === 3)\n this.P1res = 'Forty';\n\n this.P2res = 'Love';\n score = this.P1res + '-' + this.P2res;\n }\n if (this.P2point > 0 && this.P1point === 0) {\n if (this.P2point === 1)\n this.P2res = 'Fifteen';\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n if (this.P2point === 3)\n this.P2res = 'Forty';\n\n this.P1res = 'Love';\n score = this.P1res + '-' + this.P2res;\n }\n\n if (this.P1point > this.P2point && this.P1point < 4) {\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n if (this.P1point === 3)\n this.P1res = 'Forty';\n if (this.P2point === 1)\n this.P2res = 'Fifteen';\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n score = this.P1res + '-' + this.P2res;\n }\n if (this.P2point > this.P1point && this.P2point < 4) {\n if (this.P2point === 2)\n this.P2res = 'Thirty';\n if (this.P2point === 3)\n this.P2res = 'Forty';\n if (this.P1point === 1)\n this.P1res = 'Fifteen';\n if (this.P1point === 2)\n this.P1res = 'Thirty';\n score = this.P1res + '-' + this.P2res;\n }\n\n if (this.P1point > this.P2point && this.P2point >= 3) {\n score = 'Advantage ' + this.player1Name;\n }\n\n if (this.P2point > this.P1point && this.P1point >= 3) {\n score = 'Advantage ' + this.player2Name;\n }\n\n if (this.P1point >= 4 && this.P2point >= 0 && (this.P1point - this.P2point) >= 2) {\n score = 'Win for ' + this.player1Name;\n }\n if (this.P2point >= 4 && this.P1point >= 0 && (this.P2point - this.P1point) >= 2) {\n score = 'Win for ' + this.player2Name;\n }\n return score;\n }" ]
[ "0.7092915", "0.6878535", "0.658132", "0.6563475", "0.6543055", "0.65254724", "0.6443714", "0.6440338", "0.64390355", "0.636438", "0.63287157", "0.62749505", "0.6272122", "0.62667716", "0.6263273", "0.6245607", "0.62451166", "0.6234905", "0.6227321", "0.6214549", "0.617666", "0.6159211", "0.6143049", "0.61304533", "0.612738", "0.6121527", "0.6120848", "0.61067444", "0.6102421", "0.6101684", "0.60976243", "0.6091724", "0.609034", "0.60869336", "0.60747623", "0.60710967", "0.60659534", "0.60609853", "0.60571265", "0.6051231", "0.60427994", "0.60414803", "0.60398483", "0.6035282", "0.6032547", "0.60138226", "0.59896886", "0.598478", "0.59784263", "0.5976048", "0.5966648", "0.59541017", "0.59455496", "0.59287566", "0.59197426", "0.5918647", "0.59128934", "0.59062356", "0.58900017", "0.58850706", "0.58707815", "0.58641624", "0.58493775", "0.584819", "0.5846438", "0.5845207", "0.583002", "0.5813346", "0.5812404", "0.5812117", "0.5807688", "0.58062524", "0.58018595", "0.5789272", "0.5785098", "0.577864", "0.5778461", "0.5766761", "0.57659215", "0.57633215", "0.57615435", "0.5754464", "0.57542914", "0.57497084", "0.5730295", "0.5720019", "0.5719879", "0.57104886", "0.570883", "0.57086974", "0.5706026", "0.5705256", "0.56989664", "0.56966656", "0.56964576", "0.5688595", "0.5687776", "0.56863177", "0.5685767", "0.56769663", "0.5675688" ]
0.0
-1
Sort matches based on quality and timestamp
function sortMatches(matches, callback) { callback(matches.sort((x, y) => { // sort by rating in descending order, then by timestamp in ascending order return (y.rating - x.rating || x.ts - y.ts); })); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "sorted(matches) {\n // sort on i primary, j secondary\n return matches.sort((m1, m2) => (m1.i - m2.i) || (m1.j - m2.j));\n }", "function sortMatches(x, y) {\n // Sort two matching results, first by rankOrder, and second by rankPos.\n // Multiplier should be larger than rankPos (char idx of first match).\n var xScore = 1000 * parseInt(x.rankOrder, 10) + parseInt(x.rankPos, 10);\n var yScore = 1000 * parseInt(y.rankOrder, 10) + parseInt(y.rankPos, 10);\n if (xScore === yScore) {\n return x.name.length > y.name.length;\n } else {\n return xScore - yScore;\n }\n }", "function sort (suggestions) {\n return suggestions.slice().sort((suggestion1, suggestion2) => {\n if (suggestion1.matchQuality !== suggestion2.matchQuality) {\n return suggestion2.matchQuality - suggestion1.matchQuality\n } else {\n return categoryPriority(suggestion1.category) - categoryPriority(suggestion2.category)\n }\n })\n}", "sortFunction(input) {\n input.sort((a, b) => {\n if (a.timestamp === b.timestamp) {\n return input.indexOf(a) - input.indexOf(b);\n } else {\n return b.timestamp - a.timestamp;\n }\n });\n }", "_updateMatches() {\n let matches = [];\n let completeList = this.words.concat(this.extraWords);\n completeList.forEach((word) => {\n word.matches.forEach((match) => {\n matches.push({\n match,\n word\n });\n });\n });\n matches.sort(function (a, b) {\n return b.match.length - a.match.length;\n });\n this.matches = matches;\n }", "function sortRecords(recordA, recordB) {\n const matchTimeStamp = /^\\[(.*)\\] .*/;\n const timeStampA = recordA.match(matchTimeStamp)[1];\n const timeStampB = recordB.match(matchTimeStamp)[1];\n \n if (timeStampA < timeStampB) return -1;\n if (timeStampA > timeStampB) return 1;\n return 0;\n}", "_sortQueue() {\n this._queue.sort((a, b) => {\n if (a.priority === b.priority) {\n return b.timestamp - a.timestamp;\n } else {\n return a.priority - b.priority;\n }\n });\n // console.log(JSON.stringify(this._queue));\n }", "function sort_events(a,b) {\n if (a.recorded_at < b.recorded_at)\n return -1;\n if (a.recorded_at > b.recorded_at)\n return 1;\n return 0;\n }", "function timestampSort(a, b) {\n return (a.startTime - b.startTime);\n }", "function asorter(a, b) {\n return getTime(a.start_time) - getTime(b.start_time);\n}", "sortTwitsByDate( ) {\n this.twits.sort( (a, b) => {\n \n if (this.switchPosition == \"normal\");\n if (this.dateCompare(a,b)) {\n return 1;\n }\n if (!this.dateCompare(a,b)) {\n return -1;\n }\n if (this.switchPosition == \"reversed\"){\n if (!this.dateCompare(a,b)) {\n return 1;\n }\n if (this.dateCompare(a,b)) {\n return -1;\n }\n }\n return 0;\n });\n }", "function solve(arr) {\n var data = {};\n\n for (var i = 0; i < arr.length; i++) {\n var currLine = arr[i];\n var splited = currLine.split(/[/:-]+/g).map(function(x){return x.trim()});\n var homeTeam = splited[0];\n var awayTeam = splited[1];\n\n if (!data[homeTeam]) {\n data[homeTeam] = {};\n data[homeTeam]['goalsScored'] = Number(splited[2]);\n data[homeTeam]['goalsConceded'] = Number(splited[3]);\n data[homeTeam]['matchesPlayedWith'] = [awayTeam];\n\n } else {\n data[homeTeam].goalsScored += Number(splited[2]);\n data[homeTeam].goalsConceded += Number(splited[3]);\n if (data[homeTeam]['matchesPlayedWith'].indexOf(awayTeam)===-1){\n data[homeTeam]['matchesPlayedWith'].push(awayTeam);\n }\n }\n\n if (!data[awayTeam]) {\n data[awayTeam] = {};\n data[awayTeam]['goalsScored'] = Number(splited[3]);\n data[awayTeam]['goalsConceded'] = Number(splited[2]);\n data[awayTeam]['matchesPlayedWith'] = [homeTeam];\n\n } else {\n data[awayTeam].goalsScored += Number(splited[3]);\n data[awayTeam].goalsConceded += Number(splited[2]);\n if (data[awayTeam]['matchesPlayedWith'].indexOf(homeTeam)===-1){\n data[awayTeam]['matchesPlayedWith'].push(homeTeam);\n }\n }\n\n }\n\n for (var index in data){\n data[index]['matchesPlayedWith'].sort();\n }\n\n var result = dateSorter(data);\n\n console.log(JSON.stringify(result));\n\n function dateSorter(data){\n var keys = [];\n\n for (var key in data){\n keys.push(key);\n }\n\n keys.sort();\n\n var sorted = {};\n for (var i = 0; i < keys.length; i++) {\n sorted[keys[i]] = data[keys[i]];\n\n }\n\n return sorted;\n }\n}", "order_() {\n const lines = Array.from(document.querySelectorAll(cssSelector.TUBE_LINE));\n const sorted = lines.sort((a, b) => {\n return +b.getAttribute(\"score\") - +a.getAttribute(\"score\");\n });\n\n Array.from(this.children).forEach((child) => {\n if (!child.classList.contains(cssClass.FILTER)) {\n this.removeChild(child);\n }\n });\n\n // insert sorted lines back into DOM\n sorted.forEach((line) => this.appendChild(line));\n }", "function orderByDuration(array){\n var sortedArray =\n array.sort(function(a,b){\n //console.log(a.duration);\n if(parseInt(a.duration) < parseInt(b.duration)){\n return -1;\n } else if(parseInt(a.duration) > parseInt(b.duration)){\n return 1;\n } else {\n if(a.title.toLowerCase() < b.title.toLowerCase()){\n return -1;\n } else if(a.title.toLowerCase() > b.title.toLowerCase()){\n return 1;\n }\n // return 0;\n }\n \n // return a.duration - b.duration;\n });\n return sortedArray;\n }", "function match(title, q) {\n const ts = Array.from(title);\n const qs = Array.from(q);\n const matches = [{ next: 0, density: 0, length: 0 }];\n for (var i = 0; i < ts.length; i++) {\n var c; // Current match\n for (var j = 0; j < matches.length; j++) {\n c = matches[j]\n if (c.length === qs.length || !equalsCaseInsensitively(ts[i], qs[c.next])) {\n continue;\n }\n\n // Update the current match\n if (c.length === 0) {\n c.spans = [{start: i, end: i + 1}]\n } else {\n c.density += i - c.last;\n const lastSpan = c.spans[c.spans.length - 1]\n if (lastSpan.end === i)\n lastSpan.end = i + 1\n else\n c.spans.push({ start: i, end: i + 1 })\n }\n c.next += 1;\n c.last = i;\n c.length += 1;\n\n const p = matches[j - 1] // Previous match\n // Compare the current and previous matches\n if (j === 0 || c.length !== p.length) {\n continue\n }\n if (lt(c, p)) {\n console.debug(\"Comparing:\", \"text:\", title, \": q:\", q, \"current:\", JSON.stringify(c), \"< previous:\", JSON.stringify(matches[j - 1]))\n matches.splice(j - 1, 1);\n j--; \n } else if (p.last === i) {\n console.debug(\"Comparing:\", \"text:\", title, \": q:\", q, \"current:\", JSON.stringify(c), \">= previous:\", JSON.stringify(matches[j - 1]))\n matches.splice(j, 1);\n j--; \n }\n }\n // Ensure the last match to be a 'zero' awaiting\n if (c.length !== 0)\n matches.push({ next: 0, density: 0, length: 0 });\n }\n console.debug(\"Matching:\", \"text:\", title, \": q:\", q,\":final stacks:\", matches)\n return matches[0];\n}", "function sort_stamps(temp) {\n\t\ttemp.sort(function (a, b) {\n\t\t\tvar entryA = a.instrument + a.state;\n\t\t\tvar entryB = b.instrument + b.state;\n\t\t\tif (entryA < entryB) return -1;\n\t\t\tif (entryA > entryB) return 1;\n\t\t\treturn 0;\n\t\t});\n return temp;\n\t}", "function sortByTimestamp(a, b) {\n return a.timestamp < b.timestamp ? -1 : 1;\n}", "function sortResults(results) {\n results.sort(compareResultScores);\n}", "function compareByMatch(a,b) {\n return parseInt(a[\"info\"][\"match\"]) - parseInt(b[\"info\"][\"match\"]);\n}", "function sort(res) {\n return res.sort((r1, r2) => {\n const scoreSort = Math.sign(r2.score - r1.score);\n if (scoreSort != 0) {\n return scoreSort;\n }\n const lenSort = Math.sign(r1.word.length - r2.word.length);\n if (lenSort != 0) {\n return lenSort;\n }\n const w1 = r1.word.toUpperCase();\n const w2 = r2.word.toUpperCase();\n if (w1 < w2) {\n return -1;\n } else if (w1 > w2) {\n return 1;\n } else {\n return 0;\n }\n });\n}", "function sortListsByDate() {\r\n\t\treturn getItems().sort(function(a,b){\r\n \t\t\treturn new Date(`${a.date} ${a.time}`) - new Date(`${b.date} ${b.time}`);\r\n\t\t});\r\n\t}", "function sortMapByDate(){\n let aMap1 = sortedGames;\n aMap1.sort( compareReleaseDate );\n}", "function orderByDuration(arr){\n const time = arr.sort(function(a,b) {\n if (a.duration < b.duration) {\n return -1;\n } else if (a.duration > b.duration) {\n return 1;\n } else if (a.duration = b.duration) {\n if (a.title < b.title) {\n return -1;\n } else if (a.title > b.title) {\n return 1;\n } else {\n return 0;\n }\n }\n});\nreturn time\n}", "function orderByDuration(array){\n var newArray = turnHoursToMinutes(array);\n newArray.sort(function(a, b){\n if (a.duration === b.duration){\n return a.title.toLowerCase() - b.title.toLowerCase()\n }\n return a.duration - b.duration;\n });\n console.log(newArray)\n return newArray;\n}", "function orderByDuration(tab){\n var tab2 = tab.sort((a,b) => {\n if (a.duration > b.duration){\n return 1;\n }\n if (a.duration < b.duration){\n return -1;\n }\n\n else {\n if (a.title > b.title){\n return 1;\n }\n if (a.title < b.title){\n return -1;\n }\n return 0;\n }\n \n });\n\n return tab2;\n}", "function sortByTime(a, b) {\r\n\tvar x = a[0].substr(0, 2) + a[0].substr(3, 2) + a[0].substr(6, 2);\r\n\tvar y = b[0].substr(0, 2) + b[0].substr(3, 2) + b[0].substr(6, 2);\r\n\r\n\treturn ((x < y) ? SortDirection * (-1) : ((x > y) ? SortDirection : 0));\r\n}", "function orderByDuration(array) {\n\n let result = array.sort((movie1, movie2) => {\n if (movie1.duration < movie2.duration) {\n return -1\n } else if (movie1.duration > movie2.duration) {\n return 1\n } else { // movie1.duration === movie2.duration\n if (movie1.title > movie2.title) {\n return 1\n } else {\n return -1\n }\n }\n })\n return result\n\n}", "function testSorts()\n{\n\n\tconsole.log(\"============= original googleResults =============\");\n\tconsole.log(googleResults);\n\t\n\tconsole.log(\"==== before sort array element index name rating ====\");\n\t\n\tgoogleResults.forEach(function(element,index)\n\t{\n\t\t console.log(index + \": name: \" + element.name + \" rating: \" + element.rating);\n\n\t});\n\n\t\t// commented for testing\n\t\t//googleResults.sortByRatingAscending();\n\t\t\n\t\t// commented for testing\n\t\tgoogleResults.sortByRatingDescending();\n\t\t\n\t//===============================================================\t\n\n\tconsole.log(\"============= after sort =============\");\n\n\tgoogleResults.forEach(function(element,index)\n\t{\n\t\t console.log(index + \": name: \" + element.name + \" rating: \" + element.rating);\n\n\t});\n\t\n}//END test", "function orderByDuration(movies){\n // var newMovies = turnHoursToMinutes(movies); //Jasmine de que va???!!!\n var orderMovies = movies.sort(function(a,b){\n if (a.duration > b.duration) {\n return 1;\n }\n else if (a.duration < b.duration) {\n return -1;\n } else {\n if (a.title > b.title){\n return 1\n } else {return -1}\n }\n })\n return orderMovies;\n}", "function sortFunc(a, b) {\n var aDate = new Date(a.time);\n var bDate = new Date(b.time);\n\n if (aDate > bDate) {\n return -1;\n } else if (aDate < bDate) {\n return 1;\n } else {\n return 0;\n }\n }", "function sort_features(features){\n return features\n // all the newer dates, first\n .sort(function(a, b){ return b.attributes.acquisitionDate - a.attributes.acquisitionDate })\n}", "function sortScores() {\n\n\t\t\tstoredScores = storedScores.sort(function(score1,score2) {\n\n\t\t\t\t// If Score is tied, sort by Time Remaining...\n\t\t\t\tif (score1[1]-score2[1] == 0) {\n\t\t\t\t\treturn score2[2]-score1[2];\n\t\t\t\t}\n\t\t\t\t// ...otherwise sort by score.\n\t\t\t\telse {\n\t\t\t\t\treturn score2[1]-score1[1];\n\t\t\t\t}\n\n\t\t\t});\n\t\t\t\n\t\t}", "sortGraphics(a, b) {\n if (a.z === b.z) {\n return a.id - b.id;\n }\n return a.z - b.z;\n }", "function sortEntriesMRU(entries){\n\t// Comparison function for sort\n\tvar date_sort_desc = function (entry1, entry2) {\n\t\tvar date1 = Date.parse(entry1.dateAccessed);\n\t\tvar date2 = Date.parse(entry2.dateAccessed);\n\t\tif (date1 > date2) return -1;\n\t\tif (date1 < date2) return 1;\n\t\treturn 0;\n\t};\n console.log(\"sort mru\");\n\tentries.sort(date_sort_desc);\n}", "function sortResults() {\n results.sort(compareTwoRegions);\n}", "function sortEntries() {\n entries.sort((a, b) => (new Date(a.date).getTime() - new Date(b.date).getTime()));\n}", "function sortSongsByScores(song1, song2){\n\treturn song2.getScore() - song1.getScore();\n}", "function sortGamesByReleaseOrder() {\r\n khGames.sort(function(a,b) {\r\n // Comparator function to tell JS how to compare the items when sorting\r\n // Compare by release year, then if both the same then give bundled game priority (higher up list)\r\n var order = a.releaseOrder - b.releaseOrder;\r\n if (order == 0) {\r\n if (!b.games) {\r\n return -1;\r\n } else if (!a.games) {\r\n return 1;\r\n } else if (!a.games && !b.games) {\r\n return 0;\r\n }\r\n }\r\n return order;\r\n });\r\n return khGames;\r\n}", "function fix_video_order(list) {\n //var last_ep = null, last_part = null;\n var curr_ep, curr_part;\n for(var i = 0; i < list.length; i++) {\n //let's find this current ep str\n var matches = _ep_str_matches(list[i].title);\n if(matches != null) {\n //debug(\"matched\");\n curr_ep = matches[1];\n curr_part = matches[2];\n //look through all the episodes for the next episode, insert it next\n for(var j = 0; j < list.length; j++) {\n if(i == j) continue;\n var item = list[j];\n var matches2 = _ep_str_matches(item.title);\n if(matches2 != null && matches2[1] == curr_ep && matches2[2] - 1 == curr_part) { //subtraction cause string concatination lol\n //j should go after i\n //remove j\n Array_remove(list, j);\n if(j < i) i--; //'i' has moved back one place since we removed a row before it\n list.splice(i + 1, 0, item); //insert j at position i+1\n break;\n }\n }\n }\n }\n}", "function orderByDuration(arr){\n\n let newArray = turnHoursToMinutes(arr)\n // console.log(newArray);\n newArray.sort(function(a,b) { \n var result = a.duration - b.duration\n if(result != 0) {\n return result;\n }\n if(a.title < b.title) {\n return -1;\n }\n if(a.title > b.title) {\n return 1;\n }\n return 0\n });\n // console.log(newArray);\n return newArray;\n \n}", "sortByDate(selection = \"timed\"){\n return this.dataFromSelectionName(selection).sort((a, b) => a.date - b.date);\n }", "function sortByReleaseDateUp() {\n arrayLivros.sort((a, b) => Date.parse(a._releaseDate) - Date.parse(b._releaseDate));\n}", "function sortScore(a, b) {\n return b.score - a.score;\n }", "function sortTrackCount()\n{\n\ttracks.sort( function(a,b) { if (a.playCount < b.playCount) return -1; else return 1; } );\n\tclearTable();\n\tfillTracksTable();\n}", "function sortDescriptionObjectList(descriptionList){\n var len = descriptionList.length, min, i, j;\n\n for (i=0; i < len; i++){\n min = i;\n for (j=i+1; j < len; j++){\n if (descriptionList[j].startTime < descriptionList[min].startTime){\n min = j;\n }\n }\n if (i != min){\n var temp = descriptionList[i];\n descriptionList[i] = descriptionList[min];\n descriptionList[min] = temp;\n }\n }\n return descriptionList;\n}", "function orderByDuration(array){\n let newArray = Array.from(array);\n newArray.sort(function (a,b){\n if(a.duration === b.duration){\n return a.title > b.title;\n }\n return a.duration - b.duration;\n });\n return\n}", "function sortFunction(a, b) {\n $('#deus_loader span').text('Tri par mots clés');\n if (a.deus_keywords_similarities === b.deus_keywords_similarities) {\n if (a.note_deussearch === b.note_deussearch) {\n return 0;\n }\n if(a.note_deussearch < b.note_deussearch) {\n return 1;\n }\n if(a.note_deussearch > b.note_deussearch) {\n return -1;\n }\n }\n if(a.deus_keywords_similarities < b.deus_keywords_similarities) {\n return 1;\n }\n if(a.deus_keywords_similarities > b.deus_keywords_similarities) {\n return -1;\n }\n }", "function matchSearch (jiraResults,keyWordsList){\n\n var inSummaryWeight = 80;\n var inDescriptionWeight = 20;\n\n var jiraItemList = jiraResults.issues;\n var matchRateList = [];\n\n jiraItemList.forEach(function(jiraTicket, jiraTicketIndex){\n\n var matchRate = 0;\n var inSummary = 0;\n var inDescription = 0;\n\n keyWordsList.forEach(function(keyword,keyWordIndex){\n\n // Search key words in summary and description\n if(jiraTicket.fields.summary != null)\n inSummary = jiraTicket.fields.summary.split(keyword).length == 1 ? 0 : 1;\n\n if(jiraTicket.fields.description != null)\n inDescription = jiraTicket.fields.description.split(keyword).length == 1 ? 0 : 1;\n\n matchRate = matchRate + inSummary * 80 + inDescription * 20;\n\n });\n\n matchRateList[jiraTicketIndex] = [jiraTicketIndex, matchRate];\n\n });\n // Re-order the rate list according rate by decrease order.\n matchRateList = matchRateList.sort(function(x,y){\n return y[1] - x[1]; // Decrease order\n });\n\n var sortedJiraItemList = [];\n\n // Get top 10 match rate jira tickets\n var j = matchRateList.length > 10 ? 10 : matchRateList.length;\n for (var i =0; i < j; i++) {\n // Get jira iteam list indexes for top 10 match rate\n var jiraIteamListIndex = matchRateList[i][0];\n sortedJiraItemList[i] = jiraItemList[jiraIteamListIndex];\n }\n\n return sortedJiraItemList;\n}", "function sortByRating(results) {\r\n\r\n\t\t// JavaScript - array.sort(compareFunction)\r\n\t\tresults.sort(function(a, b) {\r\n\t\t\t// a and b will here be two objects from the array thus a.rating and b.rating will be compared for sort\r\n\r\n\t\t\t// if they are equal, return 0 (no sorting)\r\n\t\t\tif (a.rating == b.rating) { return 0; }\r\n\t\t\tif (a.rating < b.rating) {\r\n\t\t\t\t// if a comes before b, return 1\r\n\t\t\t\treturn 1;\r\n\t\t\t} else {\r\n\t\t\t\t// if b comes before a, return -1\r\n\t\t\t\treturn -1;\r\n\t\t\t}\r\n\t\t});\r\n\t}", "function compare (a, b) {\r\n if (a.timeStamp > b.timeStamp) {\r\n return -1;\r\n }\r\n if (a.timeStamp < b.timeStamp) {\r\n return 1;\r\n }\r\n\r\n return 0;\r\n }", "function qa(a,b){// earlier start time goes first\n// tie? longer-duration goes first\nreturn a.start-b.start||b.end-b.start-(a.end-a.start)||(a.event.title||\"\").localeCompare(b.event.title)}", "function orderByDuration(array) {\n let newArray = array.map(function (element) {\n return turnHoursToMinutes(element);\n })\n return newArray.sort((a, b) => {\n if (a.duration > b.duration) {\n return 1;\n } else if (a.duration < b.duration) {\n return -1;\n } else {\n if (a.title > b.title) {\n return 1;\n } else {\n return -1;\n }\n }\n });\n}", "function sortTrackName()\n{\n\ttracks.sort( function(a,b) { if (a.name < b.name) \nreturn -1; else return 1; } );\n\tclearTable();\n\tfillTracksTable();\n}", "function compare(a,b) {\n if (a.timestamp < b.timestamp)\n return -1;\n if (a.timestamp > b.timestamp)\n return 1;\n return 0;\n}", "function orderByDuration(array){\n var ordenado = array.sort(function(a,b) {\n if(a.duration - b.duration === 0){\n //misma duracion => hay que ordenarlo alfabeticamente segun titulo\n return a.title > b.title;\n }else{\n return a.duration - b.duration;\n }\n \n});\n return ordenado; \n}", "function sortGamesByChronologicalOrder() {\r\n khGames.sort(function(a,b) {\r\n // Comparator function to tell JS how to compare the items when sorting\r\n // This comparator inlcudes cases where the key doesn't exist\r\n // a < b = -1, a > b = 1, a==b = 0\r\n if (!a.chronologicalOrder) {\r\n return -1;\r\n } else if (!b.chronologicalOrder) {\r\n return 1;\r\n } else if (!a.chronologicalOrder && !b.chronologicalOrder) {\r\n return 0;\r\n }\r\n return a.chronologicalOrder - b.chronologicalOrder;\r\n }); \r\n return khGames;\r\n}", "function songSort(a,b)\n{\n for(var i=0; i<songSort.stack.length; i++)\n {\n var va = a[songSort.stack[i]];\n var vb = b[songSort.stack[i]];\n if((songSort.stack[i] == \"year\") || (songSort.stack[i] == \"track\"))\n {\n va |= 0;\n vb |= 0;\n }\n if(va != vb) return (va > vb) ? 1 : -1;\n }\n return 1;\n}", "function orderByDuration(movies){\n // var newMovies= {...movies};\n movies.sort(function (a,b){\n var order=a.duration>b.duration ;\n return (order==0?(a.title>b.title):order);\n })\n return movies;\n}", "function sortMatInfo()\n{\n for(var i=0; i<matInfo.length-1; i++) {//only need to go to second to last element\n var indexOfCurrentSmallest = i;\n for(var j=i; j<matInfo.length; j++) {\n if(compare(matInfo[j].endtag,matInfo[indexOfCurrentSmallest].endtag) == -1) {\n indexOfCurrentSmallest = j;\n }\n }\n //swap i and indexOfCurrentSmallest\n var temp = matInfo[i];\n matInfo[i] = matInfo[indexOfCurrentSmallest];\n matInfo[indexOfCurrentSmallest] = temp;\n }\n}", "function orderByDuration(moviesArr) {\n\n const finalArray = moviesArr.sort((a, b) => {\n\n if (a.duration < b.duration) {\n return -1;\n } else if (a.duration > b.duration) {\n return 1;\n } else if (a.duration === b.duration) {\n if (a.title < b.title) {\n return -1;\n } else if (a.title > b.title) {\n return 1;\n } else {\n return 0;\n }\n } \n })\n console.log(finalArray)\n return finalArray;\n}", "function markSorted(globals, params, q) {\n animToQueue(q, '#' + globals.cards[params].num,\n {top:'0px'}, \"sort\", globals, params);\n}", "function sortMostUrgetFirst(a, b) {\n a.frames = a.frames.sort(sortMostRecentFirst);\n b.frames = b.frames.sort(sortMostRecentFirst);\n let aFrame = a.frames[0]; // most recent frame is not at 0\n let bFrame = b.frames[0];\n let aOngoing = aFrame.until === undefined;\n let bOngoing = bFrame.until === undefined;\n if (aOngoing != bOngoing)\n return aOngoing ? -1 : 1;\n let aLevel = aFrame.level;\n let bLevel = bFrame.level;\n if (aLevel != bLevel)\n return aLevel === 'red' ? -1 : 1;\n return bFrame.since - aFrame.since; // start with most recent item\n }", "function orderByDuration (movies){\n var moviesMinutes = movies.map(function(m){\n var hora = m.duration.slice(0,1);\n var min = m.duration.slice(3,5);\n var horaNum = parseInt(hora*60);\n var minNum = parseInt(min);\n if (horaNum == 0) m.duration = minNum;\n m.duration = horaNum + minNum;\n \n return m\n });\n \n var orden = movies.sort(function(a,b){\n if (a.duration>b.duration) return 1;\n if (a.duration<b.duration) return -1;\n if (a.duration === b.duration) return 0;\n });\n console.log(orden);\n }", "function compare(a, b) {\n if (a.timeStamp > b.timeStamp) {\n return -1;\n }\n if (a.timeStamp < b.timeStamp) {\n return 1;\n }\n\n return 0;\n }", "function compare(a, b) {\n if (a.timeStamp > b.timeStamp) {\n return -1;\n }\n if (a.timeStamp < b.timeStamp) {\n return 1;\n }\n\n return 0;\n }", "function sortPlaylist() {\n playlistArr = Object.entries(livePlaylist);\n\n if (playlistArr.length > 2) {\n var sorted = false;\n while (!sorted) {\n sorted = true;\n for (var i = 1; i < playlistArr.length - 1; i++) {\n if ((playlistArr[i][1].upvote < playlistArr[i + 1][1].upvote)) {\n sorted = false;\n var temp = playlistArr[i];\n playlistArr[i] = playlistArr[i + 1];\n playlistArr[i + 1] = temp;\n // })\n }\n // playlistArr[i][1].index = i;\n }\n }\n }\n return playlistArr;\n}", "function sortByScore()\n {\n newsItems.sort(function(a,b) {return a.points<b.points});\n console.log(newsItems);\n\n addNewsListItems();\n\n }", "function compare(a, b) {\n\t if (a.timeStamp > b.timeStamp) {\n\t return -1;\n\t }\n\n\t if (a.timeStamp < b.timeStamp) {\n\t return 1;\n\t }\n\n\t return 0;\n\t }", "function compare(a, b) {\n\t if (a.timeStamp > b.timeStamp) {\n\t return -1;\n\t }\n\n\t if (a.timeStamp < b.timeStamp) {\n\t return 1;\n\t }\n\n\t return 0;\n\t }", "function sortEntriesMRU(entries){\n\t// Comparison function for sort\n\tvar date_sort_desc = function (entry1, entry2) {\n\t\tvar date1 = entry1.dateAccessed;\n\t\tvar date2 = entry2.dateAccessed;\n\t\tif (date1 > date2) return -1;\n\t\tif (date1 < date2) return 1;\n\t\treturn 0;\n\t};\n\n\tentries.sort(date_sort_desc);\t\n}", "compare(a, b) {\r\n const timestampA = a.timestamp;\r\n const timestampB = b.timestamp;\r\n let comparison = 0;\r\n if (timestampA > timestampB) {\r\n comparison = 1;\r\n } else if (timestampA < timestampB) {\r\n comparison = -1;\r\n }\r\n return comparison*-1;\r\n }", "async function TopologicalSort(){}", "function sortMapByScore(){\n let aMap1 = sortedGames.sort();\n aMap1.sort( compareScore );\n}", "function sort(){\n var toSort = S('#sched-list').children;\n toSort = Array.prototype.slice.call(toSort, 0);\n\n toSort.sort(function(a, b) {\n var a_ord = +a.id.split('e')[1]; //id tags of the schedule items are timeINT the INT = the numeric time\n var b_ord = +b.id.split('e')[1]; //splitting at 'e' and getting the element at index 1 gives use the numeric time\n\n return (a_ord > b_ord) ? 1 : -1;\n });\n\n var parent = S('#sched-list');\n parent.innerHTML = \"\";\n\n for(var i = 0, l = toSort.length; i < l; i++) {\n parent.appendChild(toSort[i]);\n }\n }", "function snapshotTimeCompare(a, b) {\n\t\tif (a.snapshot_time_ms < b.snapshot_time_ms)\n\t\t\treturn -1;\n\t\tif (a.snapshot_time_ms > b.snapshot_time_ms)\n\t\t\treturn 1;\n\t\treturn 0;\n\t}", "function orderByDuration(arrayOfMovies){\n let arrayToUse = [...arrayOfMovies];\n if(typeof arrayOfMovies[0].duration === \"string\"){\n arrayToUse = turnHoursToMinutes(arrayToUse);\n }\n arrayToUse.sort((a,b)=>{\n if(a.duration < b.duration){\n return -1;\n } else if (b.duration < a.duration){\n return 1;\n } else { // this else only happens if they have the same duration \n if(a.title < b.title){\n return -1;\n } else if (b.title < a.title){\n return 1;\n }\n }\n return 0;\n });\n return arrayToUse;\n}", "function sort(results){\r\n var swap=0;\r\n var view = new Array();\r\n for(var i=0; i<results.length; i++){\r\n view.push(data[results[i]].views);\r\n }\r\n for(var i=results.length-1; i>0; i--){\r\n for(var j=0; j<i; j++){\r\n if(view[j]<view[j+1]){\r\n var temp = results[j];\r\n results[j] = results[j+1];\r\n results[j+1] = temp;\r\n temp = view[j];\r\n view[j] = view[j+1];\r\n view[j+1]=temp;\r\n swap = 1; \r\n }\r\n }\r\n if(swap == 0){break;}\r\n } \r\n}", "function sortTime(i) {\n // 1. set time to each card\n let arrayCardTime = [];\n let timeCardElem = document.querySelectorAll('#row-main-' + i + ' .time-card'); // select a time card element\n timeCardElem.forEach(timeCard => {\n let cardElem = timeCard.parentElement; // get parent card element\n let cardTime = timeCard.textContent.replace(/\\s+/g, '').toUpperCase(); // get time from each card\n // current card time format: 9:30-10:30AM\n let ampm = cardTime.slice(-2); // parsing AM / PM\n let currentTime = cardTime.split('-')[0]; // split the card time e.g 9:30\n let hour24Time = convertTime12to24(currentTime + ' ' + ampm);\n hour24Time = parseInt(hour24Time.replace(':', ''), 10);\n // 2. assign card into arrays\n arrayCardTime.push({ card: cardElem, time: hour24Time });\n })\n\n // 3. sorting according to time \n arrayCardTime.sort((a, b) => (a.time > b.time) ? 1 : -1)\n // 4. use insert before / after to implement \n let row1Elem = document.querySelector('#row-main-' + i);\n row1Elem.innerHTML = '' // clear out the row-1 inner html\n for (let i = 0; i < arrayCardTime.length; i++) { // insert the card one by one from arrayCardTime\n row1Elem.appendChild(arrayCardTime[i].card);\n }\n}", "compare (a, b){\n if (a.time > b.time){\n return -1;\n }\n if (a.time < b.time){\n return 1;\n }\n return 0;\n }", "_prepareMatches(matchesWithLength, matches, matchesLength) {\n function isSubTerm(currentIndex) {\n const currentElem = matchesWithLength[currentIndex];\n const nextElem = matchesWithLength[currentIndex + 1];\n\n // Check for cases like \"TAMEd TAME\".\n if (\n currentIndex < matchesWithLength.length - 1 &&\n currentElem.match === nextElem.match\n ) {\n currentElem.skipped = true;\n return true;\n }\n\n // Check for cases like \"thIS IS\".\n for (let i = currentIndex - 1; i >= 0; i--) {\n const prevElem = matchesWithLength[i];\n if (prevElem.skipped) {\n continue;\n }\n if (prevElem.match + prevElem.matchLength < currentElem.match) {\n break;\n }\n if (\n prevElem.match + prevElem.matchLength >=\n currentElem.match + currentElem.matchLength\n ) {\n currentElem.skipped = true;\n return true;\n }\n }\n return false;\n }\n\n // Sort the array of `{ match: <match>, matchLength: <matchLength> }`\n // objects on increasing index first and on the length otherwise.\n matchesWithLength.sort(function (a, b) {\n return a.match === b.match\n ? a.matchLength - b.matchLength\n : a.match - b.match;\n });\n for (let i = 0, len = matchesWithLength.length; i < len; i++) {\n if (isSubTerm(i)) {\n continue;\n }\n matches.push(matchesWithLength[i].match);\n matchesLength.push(matchesWithLength[i].matchLength);\n }\n }", "function orderByDuration(arr) {\n return arr.sort(function(a, b) {\n if (a.duration > b.duration) {\n return 1;\n } else if (a.duration < b.duration) {\n return -1;\n } else {\n return a.title.localeCompare(b.title);\n }\n });\n}", "sortDataByUrgentDateTime(data, deadlineHourDifference) {\n\n // function for add hours in Date() object\n Date.prototype.addHours = function (h) {\n this.setTime(this.getTime() + (h * 60 * 60 * 1000));\n return this;\n }\n\n var allActivities = data; // all activities\n var urgent = [];\n var notUrgent = [];\n var total = [];\n\n // endTime == time right now + 12hours(which is, 'deadlineHourFromCurrentTime')\n var endTime = new Date().addHours(deadlineHourDifference);\n\n for (var i in allActivities) {\n\n switch(allActivities[i].status) {\n case 1:\n this.state.doingMatch.push(allActivities[i]);\n break;\n case 2:\n this.state.finishedMatch.push(allActivities[i]);\n break;\n case 3:\n this.state.doingActivity.push(allActivities[i]);\n break;\n case 4:\n this.state.finishedActivity.push(allActivities[i]);\n break;\n default:\n this.state.cancledActivity.push(allActivities[i]);\n break;\n }\n\n var deadline = new Date(allActivities[i].deadline); // deadline of activity\n\n // difference between 'deadline' and '12 hours from right now' in hours\n var diff = (deadline - endTime) / (60 * 60 * 1000); // divide by milliseconds, since it is expressed as hours\n\n if (diff <= 12 && diff >= 0 && allActivities[i].status == 1) {\n allActivities[i]['isUrgent'] = 1;\n urgent.push(allActivities[i]);\n } else {\n allActivities[i]['isUrgent'] = 0;\n notUrgent.push(allActivities[i]);\n }\n }\n\n // sorted as urgent activities first, then not-urgent activities later\n for (var i = 0; i < urgent.length; i++) total.push(urgent[i]);\n for (var i = 0; i < notUrgent.length; i++) total.push(notUrgent[i]);\n\n this.setState({ data: total });\n this.setList(this.state.filterStatus, this.state.search);\n }", "function sortByTime(a, b) {\n let comparison = 0;\n if (a.time >= b.time) {\n comparison = 1;\n } else if (a.time <= b.time) {\n comparison = -1;\n }\n return comparison;\n}", "function orderByDuration(movies){\n\n let moviesOrder = movies.sort(function(a,b) {\n if (a.duration > b.duration) return 1\n if (a.duration === b.duration) {\n if (a.title > b.title) return 1\n if (a.title < b.title) return -1 \n }\n if (a.duration < b.duration) return -1\n }) \n return moviesOrder\n}", "sort(sort){\n\t\tthis.output3 = [];\n\t\t//order by date\n\t\tif(sort == 'dateCreated'){\n\t\t\tthis.output3 = this.output2.sort(function(a, b) {\n\t\t\t\treturn new Date(a.dateCreated) - new Date(b.dateCreated);\n\t\t\t});\n\t\t//order by id\n\t\t}else if(sort == 'id'){\n\t\t\tthis.output3 = this.output2.sort(function(a, b) {\n\t\t\t\treturn a.id - b.id;\n\t\t\t});\n\t\t//order by issueId\n\t\t}else if(sort == 'issueId'){\n\t\t\tthis.output3 = this.output2.sort(function(a, b) {\n\t\t\t\treturn a.issueId - b.issueId;\n\t\t\t});\n\t\t//order by high priority then low priority\n\t\t}else if(sort == 'highPriority'){\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.highPriority == 'TRUE'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.highPriority == 'FALSE'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t//order by high-med-low severity\n\t\t}else if(sort == 'severity'){\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.severity == 'HIGH'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.severity == 'MEDIUM'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.severity == 'LOW'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t//order by status, to do-in progress-in review-in test-in demo-done\n\t\t}else if(sort == 'status'){\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.status == 'TO DO'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.status == 'IN PROGRESS'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.status == 'IN REVIEW'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.status == 'IN TEST'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.status == 'IN DEMO'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tif(bug.status == 'DONE'){\n\t\t\t\t\tthis.output3.push(bug);\n\t\t\t\t}\n\t\t\t});\n\t\t//if no sort field is selected/passed in to method, leave array of bugs as it is\n\t\t}else{\n\t\t\tthis.output2.forEach((bug) => {\n\t\t\t\tthis.output3.push(bug);\n\t\t\t});\n\t\t}\n\t\t//emit signal for listeners\n\t\tthis.emit(\"DATA_FINISHED\");\n\t}", "sort() {\n // Calculate the fitness of all the solutions.\n // We must do this for all because any could have experienced\n // a mutation that could change its fitness score.\n const fitnessSnapshot = this.solutions.map(solution => this.calculateFitness(solution));\n \n this.solutions.sort((a,b) => {\n const indexA = this.solutions.indexOf(a);\n const indexB = this.solutions.indexOf(b);\n const fitA = fitnessSnapshot[indexA];\n const fitB = fitnessSnapshot[indexB];\n \n if (fitA < fitB) { \n return -1;\n } else if (fitA > fitB) {\n return 1;\n } else {\n return 0;\n }\n });\n }", "function orderByDuration(arr) {\n if (arr.length === 1) {\n return arr;\n }\n let resultArray = turnHoursToMinutes(arr);\n resultArray.sort((a, b) => {\n if (Number(a.duration) > Number(b.duration)) {\n return 1;\n }\n if (Number(a.duration) < Number(b.duration)) {\n return -1\n } \n else if (Number(a.duration) = Number(b.duration)) {\n if (a.title > b.title) {\n return 1;\n }\n if (a.title < b.title) {\n return -1;\n }\n }\n return 0;\n })\n return resultArray;\n}", "function twpro_sortJobs(){\r\n\t\tif (TWPro.twpro_failure) return;\r\n\t\tvar sortby = TWPro.twpro_jobsort, twpro_jobValues = TWPro.twpro_jobValues;\r\n\t\tvar sortfunc = function(twpro_a, twpro_b){\r\n\t\t\tvar twpro_a_str = twpro_a.name,\r\n\t\t\t\ttwpro_b_str = twpro_b.name;\r\n\t\t\tif(sortby == 'name'){\r\n\t\t\t\treturn twpro_a_str.localeCompare(twpro_b_str);\r\n\t\t\t}\r\n\t\t\tif(sortby == 'comb'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].jobrank == twpro_jobValues[twpro_b.shortName].jobrank) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].jobrank - twpro_jobValues[twpro_a.shortName].jobrank);\r\n\t\t\t}\r\n\t\t\tif(sortby == 'erfahrung'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].experience == twpro_jobValues[twpro_b.shortName].experience) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].experience - twpro_jobValues[twpro_a.shortName].experience);\r\n\t\t\t} if(sortby == 'lohn'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].wages == twpro_jobValues[twpro_b.shortName].wages) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].wages - twpro_jobValues[twpro_a.shortName].wages);\r\n\t\t\t} if(sortby == 'glueck'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].luckvaluemax == twpro_jobValues[twpro_b.shortName].luckvaluemax) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName].luckvaluemax - twpro_jobValues[twpro_a.shortName].luckvaluemax);\r\n\t\t\t} if(sortby == 'gefahr'){\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName].danger == twpro_jobValues[twpro_b.shortName].danger) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_a.shortName].danger - twpro_jobValues[twpro_b.shortName].danger);\r\n\t\t\t} else {\r\n\t\t\t\treturn (twpro_jobValues[twpro_a.shortName][sortby] == twpro_jobValues[twpro_b.shortName][sortby]) ? twpro_a_str.localeCompare(twpro_b_str) : (twpro_jobValues[twpro_b.shortName][sortby] - twpro_jobValues[twpro_a.shortName][sortby]);\r\n\t\t\t}\r\n\t\t}\r\n\t\tTWPro.twpro_jobs.sort(sortfunc);\r\n\t\t//if(sortby == 'danger') TWPro.twpro_jobs.reverse();\r\n\t}", "sortTwitsByText( ) {\n this.twits.sort( (a, b) => {\n \n if (this.switchPosition == \"normal\");\n if (a.text > b.text) {\n return 1;\n }\n if (a.text < b.text) {\n return -1;\n }\n if (this.switchPosition == \"reversed\"){\n if (a.text < b.text) {\n return 1;\n }\n if (a.text > b.text) {\n return -1;\n }\n }\n return 0;\n });\n }", "function properSort(a, b) {\n if (a.times > b.times) {\n return -1;\n }\n if (b.times > a.times) {\n return 1;\n }\n return 0;\n }", "sortData(data) {\n return data.sort((a, b) => {\n let aa = typeof a.date === \"string\" ? Date.parse(a.date) : a.date,\n bb = typeof b.date === \"string\" ? Date.parse(b.date) : b.date;\n return this.latest ? bb - aa : aa - bb;\n });\n }", "function orderByDuration(arr) {\n let orderMovie = [];\n orderMovie = [...arr];\n orderMovie.sort((a, b) => {\n if (a.duration > b.duration) {\n return 1;\n } else if (a.duration < b.duration) {\n return -1;\n } else {\n let k = a.title;\n let j = b.title;\n let comp = 0;\n return (k).localeCompare(j);\n }\n })\n return orderMovie;\n}", "function order(){\n\n var keys = getKeys( PEERS ),\n\n times = {};\n\n times[ PLAYER.time ] = PLAYER.id;\n\n for ( var i = 0, l = keys.length; i < l; i++ ) times[ PEERS[ keys[i] ].time ] = keys[i];\n\n var list = getKeys( times ).sort( rank ).map( function ( key ) { return times[key]; }),\n\n user;\n\n if ( list.length !== keys.length + 1 ) {\n\n var msg = 'Precision time conflict';\n\n WATCH.emit('error', { msg: msg, line: 340 });\n\n throw new Error( msg );\n }\n\n DATA.length = 0;\n\n for ( i = 0, l = list.length; i < l; i++ ) {\n\n user = PEERS[ list[i] ] || PLAYER;\n\n user.pos = DATA.push( user.data ) - 1;\n }\n\n function rank ( curr, next ) { return curr - next; }\n }", "function orderByDuration(movieList) {\n let sorted = movieList.slice().sort(function(a, b) {\n if (a.duration === b.duration) {\n //if duration same, order alpahbetically by title\n return a.title.localeCompare(b.title);\n } else {\n return a.duration - b.duration; //ascending order\n }\n });\n return sorted;\n}", "function reducePrecision(matches) {\n function toPrecision(number, precision) {\n var power = Math.pow(10, precision);\n return Math.round(number * power) / power;\n }\n\n for (var i = 0; i < matches.length; i++) {\n matches[i].distance = toPrecision(matches[i].distance, 5);\n matches[i].segment.properties.bearing = toPrecision(matches[i].segment.properties.bearing, 1);\n }\n return matches;\n}", "function orderByDuration(array){\n return array.sort(function(durationA,durationB){\n return durationA-durationB;\n if (durationA===durationB){\n return movies.title.sort();\n }\n });\n}", "function cmp(column, data, index) {\n\tvar {fields: [field], xzoom, sortVisible} = column,\n\t\tpos = parsePos(field),\n\t\tappliedZoom = sortVisible && xzoom ? xzoom : {start: -Infinity, end: Infinity},\n\t\trefGene = _.getIn(data, ['refGene']),\n\t\tflip = !pos && refGene && _.getIn(_.values(refGene), [0, 'strand']) === '-',\n\t\tsamples = _.getIn(index, ['bySample']);\n\n\treturn samples ?\n\t\t(s1, s2) => cmpSamples(appliedZoom, samples, flip, s1, s2) :\n\t\t() => 0;\n}", "function orderByDuration(movieArray) {\n\n return movieArray.sort((a, b) => {\n if (a.duration > b.duration) { return 1 }\n\n else if (a.duration < b.duration) { return -1 }\n else { if (a.title < b.title) { return -1 } }\n })\n\n}", "function sortTimes(dateTimes) {\n\t\tdateTimes.sort(function(a, b) {\n\t\t\tif(a.start < b.start) {\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif(a.start > b.start) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\treturn 0;\n\t\t})\n\t}", "function compare(a, b) {\n if (a['timestamp'] < b['timestamp'])\n return -1\n if (a['timestamp'] > b['timestamp'])\n return 1;\n return 0;\n}" ]
[ "0.69574136", "0.66316885", "0.6457013", "0.63573706", "0.60483915", "0.6035465", "0.57600826", "0.571879", "0.5708793", "0.5631702", "0.5618308", "0.56176496", "0.56160194", "0.5583195", "0.55749035", "0.55486107", "0.5534604", "0.5517065", "0.5511828", "0.5500277", "0.5496782", "0.5471369", "0.5471199", "0.5442636", "0.54300207", "0.54223216", "0.5421004", "0.5404861", "0.5391295", "0.5391243", "0.5380694", "0.537915", "0.53763103", "0.53756505", "0.5371961", "0.5364213", "0.53590375", "0.53486246", "0.53467447", "0.5341885", "0.5339924", "0.53298664", "0.5327562", "0.53257644", "0.531923", "0.53109384", "0.5298544", "0.5295913", "0.5286312", "0.5278556", "0.527346", "0.52658546", "0.5260944", "0.52574724", "0.5256989", "0.5249415", "0.5245402", "0.5241168", "0.52396196", "0.5236361", "0.52339524", "0.52299297", "0.5228024", "0.52178574", "0.52178574", "0.52148336", "0.5214084", "0.5211985", "0.5211985", "0.5207945", "0.5207352", "0.52009356", "0.5196333", "0.51926607", "0.51920235", "0.51906836", "0.51866084", "0.51814264", "0.5175538", "0.5174522", "0.5173354", "0.51701325", "0.5168514", "0.516498", "0.5154805", "0.5148131", "0.5143827", "0.5142739", "0.5136446", "0.5133962", "0.51332265", "0.51293343", "0.5128896", "0.5123595", "0.5120414", "0.51181895", "0.5113666", "0.5112577", "0.5109915", "0.51098126" ]
0.7520447
0
Complements the application of 'pred`
function complement(pred) { return function(/* arguments */) { return !pred.apply(null, _.toArray(arguments)); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function filter(pred) {\n return function(xs) {\n return Z.filter (pred, xs);\n };\n }", "function filter(pred) {\n return function(rf) { // <- buildArray for example, but also the function in map on line 82\n return function(result, item) {\n if(pred(item))\n return rf(result, item)\n else\n return result\n }\n }\n}", "function complement(pred) { return function(x) { return !(pred (x)); }; }", "function PredPrediction(pred, alt) {\n\tthis.alt = alt;\n\tthis.pred = pred;\n\treturn this;\n}", "function PredPrediction(pred, alt) {\n\tthis.alt = alt;\n\tthis.pred = pred;\n\treturn this;\n}", "function Array$prototype$filter(pred) {\n return this.filter (function(x) { return pred (x); });\n }", "function filterWithReduce(arr, pred) {\n\tarr.reduce()\n}", "function filter(pred, m) {\n // Fast path for arrays.\n if (Array.isArray(m)) return m.filter(function(x) { return pred(x); });\n var M = m.constructor;\n return reduce(function(m, x) { return pred(x) ? concat(m, of(M, x)) : m; },\n empty(M),\n m);\n }", "function tagBy(pred) {\n return ifElse (pred) (Right) (Left);\n }", "function filter(pred, xs){\n if (is_empty_list(xs)) {\n return xs;\n } else {\n if (pred(head(xs))) {\n return pair(head(xs), filter(pred, tail(xs)));\n } else {\n return filter(pred, tail(xs));\n }\n }\n}", "function restrict(table, pred) {\n return _.reduce(table, function(newTable, obj) {\n if (fns.truthy(pred(obj)))\n return newTable;\n else\n return _.without(newTable, obj);\n }, table);\n}", "function filterM(pred, m) {\n var M = m.constructor;\n var z = zero(M);\n return chain(function(x) { return pred(x) ? of(M, x) : z; }, m);\n }", "function partitionOn(pred, items) {\n var f = items.filter(v => !pred(v));\n var t = items.filter(v => pred(v));\n items.splice(0); items.push(...f); items.push(...t);\n return f.length;\n }", "function partitionOn(pred, items) {\n var arrTrue=[], arrFalse=[], ret;\n \n for(i=0;i<items.length;i++){\n if(pred(items[i])){\n arrTrue.push(items[i]);\n }else{\n arrFalse.push(items[i]);\n }\n }\n \n for(i=0;i<arrFalse.length;i++){\n items[i] = arrFalse[i];\n }\n ret = i;\n for(j=0;j<arrTrue.length;j++){\n items[i++] = arrTrue[j];\n }\n \n return ret;\n}", "function Object$prototype$filter(pred) {\n var result = {};\n forEachKey (this, function(k) {\n if (pred (this[k])) result[k] = this[k];\n });\n return result;\n }", "function loss(pred, labels){\n return pred.sub(labels).square().mean();\n }", "function filterInPlace(arr, pred) {\n var idx = 0;\n for (var ii = 0; ii < arr.length; ++ii) {\n if (pred(arr[ii])) {\n arr[idx] = arr[ii];\n ++idx;\n }\n }\n arr.length = idx;\n //arr.slice(0, idx);\n}", "function Nothing$prototype$filter(pred) {\n return this;\n }", "function unless(pred) {\n return ifElse (pred) (I);\n }", "function remove_copy_if(first, last, output, pred) {\r\n for (; !first.equals(last); first = first.next()) {\r\n if (pred(first.value))\r\n continue;\r\n output.value = first.value;\r\n output = output.next();\r\n }\r\n return output;\r\n}", "function dropWhile(pred) {\n return function(xs) {\n var idx = 0;\n while (idx < xs.length && pred (xs[idx])) idx += 1;\n return xs.slice (idx);\n };\n }", "function filter(pred, xs) {\r\n var res = [], i = 0, l = xs.length, isStr = xs.charAt;\r\n for(; i < l; ++i)\r\n if(pred(isStr ? xs.charAt(i) : xs[i]))\r\n res.push(xs[i]);\r\n return isStr ? res.join(\"\") : res;\r\n}", "function predict(xs){\n //y = mx + b\n return xs.mul(m).add(b);\n }", "function predict() {\n classifier.predict(gotResults);\n}", "function loss(pred, labels) {\n return pred.sub(labels).square().mean(); //mean squared error\n }", "function copy_if(first, last, output, pred) {\r\n for (; !first.equals(last); first = first.next()) {\r\n if (!pred(first.value))\r\n continue;\r\n output.value = first.value;\r\n output = output.next();\r\n }\r\n return output;\r\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n }", "function all(pred, foldable) {\n // Fast path for arrays.\n if (Array.isArray (foldable)) return foldable.every (unary (pred));\n return reduce (function(b, x) { return b && pred (x); }, true, foldable);\n }", "function takeWhile(pred) {\n return function(xs) {\n var idx = 0;\n while (idx < xs.length && pred (xs[idx])) idx += 1;\n return xs.slice (0, idx);\n };\n }", "function handleWhile(_pred) {\n var pred = JSON.parse(JSON.stringify(_pred));\n var _convertedCondition = convertValueToInputVars(pred.condition, false, true);\n var _result = convertValueToInputVars(pred.condition, true, true);\n\n pred.condition = _convertedCondition;\n pred.result = _result || true;\n\n symbolize.push(pred);\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n }", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n }", "function partitionOn(pred, items) {\r\n let arr_even = items.filter( item => pred(item));\r\n let arr_odd = items.filter( item => !pred(item));\r\n \r\n items.splice(0);\r\n \r\n arr_odd.forEach( item => items.push(item));\r\n arr_even.forEach( item => items.push(item));\r\n \r\n return arr_odd.length;\r\n}", "function ifElse(pred) {\n return function(f) {\n return function(g) {\n return function(x) {\n return (pred (x) ? f : g) (x);\n };\n };\n };\n }", "function handleElse(_pred) {\n blockExit();\n var pred = JSON.parse(JSON.stringify(_pred));\n\n var _result = getPreviousIfResult(pred);\n\n pred.result = pred.result === undefined ? _result : pred.result && _result;\n return pred;\n}", "function _evaluate(predicate) {\n return options.negate ? !predicate : predicate;\n }", "function find(pred) {\n return function(xs) {\n return Z.reduce (\n function(m, x) {\n return m.isJust ? m : pred (x) ? Just (x) : Nothing;\n },\n Nothing,\n xs\n );\n };\n }", "function partition_copy(first, last, output_true, output_false, pred) {\r\n for (; !first.equals(last); first = first.next())\r\n if (pred(first.value)) {\r\n output_true.value = first.value;\r\n output_true = output_true.next();\r\n }\r\n else {\r\n output_false.value = first.value;\r\n output_false = output_false.next();\r\n }\r\n return new Pair_1.Pair(output_true, output_false);\r\n}", "function replace_copy_if(first, last, result, pred, new_val) {\r\n for (; !first.equals(last); first = first.next()) {\r\n if (pred(first.value))\r\n result.value = new_val;\r\n else\r\n result.value = first.value;\r\n result = result.next();\r\n }\r\n return result;\r\n}", "function partitionOn(pred, items) {\n\tvar left = [];\n\tvar right = [];\n\tfor (var i in items){\n\t\tif (pred(items[i])){\n\t\t\tright.push(items[i]);\n\t\t}else{\n\t\t\tleft.push(items[i]);\n\t\t}\n\t}\t\n\tfunction forEach(element){\t\t\n\t\titems.shift()\n\t\titems.push(element);\n\t}\n\tleft.forEach(forEach);\n\tright.forEach(forEach);\t\n\treturn left.length;\n}", "function none(pred, foldable) {\n return !(any (pred, foldable));\n }", "function remove_if(first, last, pred) {\r\n var ret = first;\r\n while (!first.equals(last)) {\r\n if (!pred(first.value)) {\r\n ret.value = first.value;\r\n ret = ret.next();\r\n }\r\n first = first.next();\r\n }\r\n return ret;\r\n}", "function RandomWalkKernel(pred)\n{\n\tthis.pred = pred\n\tthis.proposalsMade = 0\n\tthis.proposalsAccepted = 0\n}", "function handleAssignmentExp(pred) {\n var _convertedValue = convertValueToInputVars(pred.value, true, false);\n var _result = parseInt(convertValueToInputVars(pred.value, true, true));\n\n if (isInput(pred.name)) {\n pred.value = _result;\n symbolize.push(pred);\n }\n\n if (isInputArray(pred.name)) {\n setInputArrayValue(pred.name, _result);\n symbolize.push(pred);\n } else {\n _convertedValue = removeZeros(_convertedValue);\n var_table[pred.name] = { value: _convertedValue, result: _result };\n }\n}", "function partitionOn(pred, items) {\n var evenItems = items.filter(pred);\n var oddItems = items.filter(function getOdd(index) {\n return !pred(index);\n });\n\n //items=[];// -- Not working\n items.length = 0;\n items.push.apply(items, oddItems.concat(evenItems));\n return items.indexOf(evenItems[0]);\n}", "applyPreEmph(curSample, prevSample) {\n\t\treturn curSample - this.preEmphasisFilterFactor * prevSample;\n\t}", "function cond_(pred, result, error) {\n return pred ? (0, _succeed.succeed)(result()) : core.fail(error());\n}", "function when(pred) {\n return C (ifElse (pred)) (I);\n }", "function handleReturnStatement(_pred) {\n var pred = JSON.parse(JSON.stringify(_pred));\n var _convertedValue = convertValueToInputVars(pred.value, false, false);\n\n _convertedValue = removeZeros(_convertedValue);\n\n pred.value = _convertedValue;\n symbolize.push(pred);\n\n blockExit();\n}", "function dropUntil(pred) {\n return self => dropUntil_(self, pred);\n}", "function any(pred, foldable) {\n // Fast path for arrays.\n if (Array.isArray (foldable)) return foldable.some (unary (pred));\n return reduce (function(b, x) { return b || pred (x); }, false, foldable);\n }", "function ml_z_pred(z1) {\n return ml_z_normalize(bigInt(z1).prev());\n}", "function RandomWalkKernel(pred)\n{\n this.pred = pred\n\tthis.proposalsMade = 0\n\tthis.proposalsAccepted = 0\n}", "constructor(type, value, pred) {\n this.type = type;\n this.value = value;\n this.pred = pred;\n }", "function processArray(a) {\n\t\tvar p = composePredicatesWith(preds, and);\n\t\treturn a.reduce(function(acc, current){\n\t\t\treturn acc && p(current);\n\t\t}, true);\n\t}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function all(array, pred) {\n for (var idx = 0, len = array.length; idx < len; idx++) {\n if (!pred(array[idx])) {\n return false;\n }\n }\n return true;\n}", "function Predicate () {}", "function handlePreds(pred) {\n if (pred.type == 'function declaration') {\n symbolize.push(pred);\n _isGlobal = false;\n }\n else if (pred.type == 'variable declaration') {\n handleVarDecleration(pred);\n }\n else handlePreds2(pred);\n}", "function loss(pred, label) {\n // MSE - Mean Squared Error\n // MSE = (pred - y)^2\n return pred.sub(label).square().mean();\n}", "function Predicate() {}", "function Predicate() {}", "function Predicate() {}", "function some(arr, pred){\n for(var i = 0; i < arr.length; i++){\n\tif(pred(arr[i]))\n\t return true;\n }\n\treturn false;\n}", "function sc_anyPred(proc, l) {\n return sc_any(proc, l) !== false;\n}", "function every1(arr, pred) {\n for (let el of arr) {\n if (!pred(el)) return false;\n }\n return true;\n}", "on(model) {\n\t\treturn this.filter.reduce( (acc, m, key) => {\n\t\t\t\tfor (let [, predFn] of this.filter) {\n\t\t\t\t\tif (!predFn(m)) {\n\t\t\t\t\t\treturn acc;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tacc.push(m);\n\n\t\t\t\treturn acc;\n\t\t\t}, []);\n\t}", "static ecm(yPredicion, yReal) {\n let suma = 0;\n for (let i = 0; i < yPredicion.length; i++) {\n suma = (yPredicion[i] - yReal[i]) ** 2;\n }\n return suma / yPredicion.length;\n }", "function predict() {\n regressor.predict(gotResults);\n}", "predict(features = {}) {\n const scores = {};\n for (const feature in features) {\n const classes = weights[feature];\n const value = features[feature];\n if (classes && value) {\n for (const label in classes) {\n scores[label] = (scores[label] || 0) + classes[label] * value;\n }\n }\n }\n\n let bestScore = -Infinity;\n let prediction = \"\";\n for (const label in scores) {\n const score = scores[label];\n if (score > bestScore) {\n bestScore = score;\n prediction = label;\n }\n }\n\n return prediction;\n }", "static updateFalsePredictionUser(author, pred, wager, callback) {\n\n const userUpdate = {\n $inc: {\n reservedCoins: -wager.coins,\n lostCoins: wager.coins\n },\n $push: {\n messages: {\n message: \"Your wager \" + pred.text +\" has not come true.\",\n dismissed: false,\n seen: false,\n type: \"false\",\n _id: Mongodb.ObjectId()\n }\n }\n }\n const userFindParam = {\n username: author\n }\n MongoModels.db.collection('users').findOneAndUpdate(userFindParam, userUpdate, (err, user) => {\n if (err) {\n return callback(err);\n }\n callback(pred)\n });\n\n }", "function Predicate(){}", "function preProcessor_onlyIntent(value)\n{\n\tvar initial = value\n\n\tif (\"input\" in value)\n\t{\n\t\tif (value.input.sentences.length > 1)\n\t\t{\n\t\t\tconsole.vlog(process.pid + \"DEBUG: the train instance is filtered due to multiple sentences \"+initial.output)\n\t\t\treturn undefined\n\t\t}\n\n\t\t// clean all the attr and values stuff from the sentence\n\t\t// every fe... clean by itself\n\t\t//\tvalue.input.sentences = getRule(value.input.sentences[0]).cleaned\n\t\tvalue.input.sentences = value.input.sentences[0]\n\t}\n\n\tif (\"output\" in value)\n\t{\n\t\tvalue.output = _.map(value.output, Hierarchy.splitPartEquallyIntent);\n\t\tvalue.output = _.unique(_.flatten(value.output))\n\n\t\tif (value.output.length > 1)\n\t\t\t{\n\t\t\tconsole.log(process.pid + \"DEBUG: the train instance is filtered \"+initial.output)\n\t\t\treturn undefined\n\t\t}\n\t\telse\n\t\t\treturn value\n\t}\n\telse\n\t\treturn value\n\n\n\n\t/*var initial = value\n\t\n\tif (_.isObject(value))\n\t{\n\t\t// it's from test and it's object\n\t\tif (\"text\" in value)\n\t\t{\t\n\t\t\tconsole.log(\"its test\")\n\t\t\tvar sentence = rules.generatesentence({'input':value.text, 'found': rules.findData(value.text)})['generated']\n\t\t\tsentence = sentence.replace(/<VALUE>/g,'').replace(/<ATTRIBUTE>/g,'').replace(/NIS/,'').replace(/nis/,'').replace(/track/,'').replace(/USD/,'').trim()\n\t\t\tvalue.text = sentence\n\t\t\treturn value\t\n\t\t}\n\n\t\t// it's from train\n\t\tif (\"input\" in value)\n\t\t{\n\t\t\tvalue.output = _.map(value.output, Hierarchy.splitPartEquallyIntent);\n\t\t\tvalue.output = _.unique(_.flatten(value.output))\n\t\t\tif (value.output.length > 1)\n\t\t\t{\n\t\t\t\tconsole.log(process.pid + \"DEBUG: the train instance is filtered \"+initial.output)\n\t\t\t\treturn undefined\n\t\t\t}\n\n\t\t\t// text in input\n\t\t\tif (_.isObject(value.input))\n\t\t\t\t{\n\t\t\t\t\tvar sentence = rules.generatesentence({'input':value.input.text, 'found': rules.findData(value.input.text)})['generated']\n\t\t\t\t\tsentence = sentence.replace(/<VALUE>/g,'').replace(/<ATTRIBUTE>/g,'').replace(/NIS/,'').replace(/nis/,'').replace(/track/,'').replace(/USD/,'').trim()\n\t\t\t\t\tvalue.input.text = sentence\n\n\t\t\t\t\treturn value\t\n\t\t\t\t}\n\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tvar sentence = rules.generatesentence({'input':value.input, 'found': rules.findData(value.input)})['generated']\n\t\t\t\t\tsentence = sentence.replace(/<VALUE>/g,'').replace(/<ATTRIBUTE>/g,'').replace(/NIS/,'').replace(/nis/,'').replace(/track/,'').replace(/USD/,'').trim()\n\t\t\t\t\tvalue.input = sentence\n\n\t\t\t\t\treturn value\t\n\t\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t// it's just string from test\n\t\tsentence_clean = rules.generatesentence({'input':value, 'found': rules.findData(value)})['generated']\n\t\tsentence_clean = sentence_clean.replace(/<VALUE>/g,'').replace(/<ATTRIBUTE>/g,'').replace(/NIS/,'').replace(/nis/,'').replace(/track/,'').replace(/USD/,'').trim()\n\t\treturn sentence_clean\n\t}\n*/\n}", "function sc_everyPred(proc, l) {\n var tmp = sc_every(proc, l);\n if (tmp !== false) return true;\n return false;\n}", "function getPreviousIfResult(pred) {\n var _hasTrue = false;\n var _prevIfs = 0;\n for (var i = symbolize.length - 1; i >= 0; i--) {\n _prevIfs = isNestedIf(symbolize[i], _prevIfs);\n _hasTrue = checkPrevSymbol(symbolize[i], pred);\n if (stopPrevRun(_hasTrue, _prevIfs))\n break;\n\n if (symbolize[i].type == 'if statement') {\n _prevIfs--;\n if (_prevIfs == -1)\n break;\n else\n _hasTrue = false;\n }\n }\n return !_hasTrue;\n}", "function _predicateWrap(predPicker) {\n return function(preds /* , args */) {\n var predIterator = function() {\n var args = arguments;\n return predPicker(function(predicate) {\n return predicate.apply(null, args);\n }, preds);\n };\n return arguments.length > 1 ?\n // Call function immediately if given arguments\n predIterator.apply(null, _slice(arguments, 1)) :\n // Return a function which will call the predicates with the provided arguments\n arity(max(pluck('length', preds)), predIterator);\n };\n }", "predict(x1, x2) {\n const sum = this.b0 + x1 * this.b1 + x2 * this.b2;\n const exp = Math.exp(sum);\n return 1 / (1 + exp);\n }", "function unify(s, senv, d, denv, f) {\r\n if (typeof(trace) != 'undefined') document.writeln('UNIFY\\n' + JSON.stringify(s) + '\\nWITH\\n' + JSON.stringify(d) + '\\n');\r\n //If source predicate is a variable\r\n if (isVar(s.pred)) {\r\n //evaluate it in the environment\r\n var sval = evaluate(s, senv);\r\n //if it did evaluate, unify with the value\r\n if (sval != null) return unify(sval, senv, d, denv, f);\r\n //otherwise assume match\r\n else return true;\r\n }\r\n //If the desination predicate is a variable\r\n else if (isVar(d.pred)) {\r\n //evalaute it in the environment\r\n var dval = evaluate(d, denv);\r\n //if it did evaluate, unify with the value\r\n if (dval != null) return unify(s, senv, dval, denv, f);\r\n //otherwise\r\n else {\r\n //if we have the override flag, update the destination predicate with its value from source\r\n //note: currently unused\r\n if (f != null) denv[d.pred] = evaluate(s, senv);\r\n return true;\r\n }\r\n }\r\n //otherwise, check for matching predicates\r\n else if (s.pred == d.pred && s.args.length == d.args.length) {\r\n //they match, check each argument and make sure they also unify, fail out if not\r\n for (var i = 0; i < s.args.length; i++) \r\n\t\tif (!unify(s.args[i], senv, d.args[i], denv, f)) \r\n\t\t\treturn false;\r\n //everything matched! These statements unify and denv is updated.\r\n return true;\r\n }\r\n //otherwise we fail unification\r\n else {\r\n if (typeof(trace) != 'undefined') document.writeln('FAILED TO UNIFY\\n' + JSON.stringify(s) + '\\nWITH\\n' + JSON.stringify(d) + '\\n');\r\n return false;\r\n }\r\n}", "function imagePrediction(error, result)\r\n{\r\n if (error)\r\n {\r\n console.error(error);\r\n }\r\n else\r\n {\r\n prediction = result;\r\n //calls itself because we want to constantly check what the image is.\r\n classifier.classify(imagePrediction);\r\n }\r\n}", "function dropWhile(pred, foldable) {\n var take = false;\n return filter(function(x) { return take = take || !pred(x); }, foldable);\n }", "function replace_if(first, last, pred, new_val) {\r\n for (var it = first; !it.equals(last); it = it.next())\r\n if (pred(it.value) === true)\r\n it.value = new_val;\r\n}", "function loss(prediction, labels) {\r\n // Having a good error function is key for training a machine learning model\r\n const error = prediction.sub(labels).square().mean();\r\n return error;\r\n}", "predict(x) {\n return this.b0 + x * this.b1\n }", "function evaluateThunks(original){\n for(attr in original){\n if(original.hasOwnProperty(attr) && typeof original[attr] != 'undefined'){\n if(original[attr].constructor == Array || typeof original[attr] == 'object'){\n original[attr] = evaluateThunks(original[attr]);\n }else if(typeof original[attr] == 'function' && original[attr].length == 0){\n original[attr] = original[attr]();\n }\n }\n }\n return original;\n}", "function find_if_not(first, last, pred) {\r\n return find_if(first, last, function (elem) { return !pred(elem); });\r\n}", "function composePredicatesWithWrapped(preds, glue) {\n\tglue = glue || andWrapped;\n\n\tif (preds.length < 2) {\n\t\t// need at least two arguments for and, or, glue etc\n\t\treturn valueParser(preds[0]);\n\t}\n\n\treturn preds.reduce(function(acc, current) {\n\t\tvar c = valueParser(current);\n\t\treturn function(x) { \n\t\t\t// wrapping the values allows the boolean short-circuiting\n\t\t\t// to keep undefined values from being evaluated\n\t\t\tvar wrapped_acc = function() { return acc(x); } \n\t\t\tvar wrapped_c = function() { return c(x); }\t\n\n\t\t\treturn glue(wrapped_acc, wrapped_c); \n\t\t}; \n\t});\n}", "function none_of(first, last, pred) {\r\n return !any_of(first, last, pred);\r\n}", "function C(e,t,a){for(\n // At any point we are certain `to` satisfies `pred`, don't know\n // whether `from` does.\n var n=t>a?-1:1;;){if(t==a)return t;var r=(t+a)/2,f=n<0?Math.ceil(r):Math.floor(r);if(f==t)return e(f)?t:a;e(f)?a=f:t=f+n}}", "loss(y, y_pred, len) {\n\t\tconst outputLoss = tf.tidy(() => {\n\t\t\tconst yTensor = tf.tensor(y);\n\t\t\tconst y_predTensor = tf.tensor(y_pred);\n\t\t\tconst compute =\n\t\t\t\t(1 / (2 * len)) *\n\t\t\t\ttf.sum(tf.pow(tf.sub(y_predTensor, yTensor), 2)).dataSync()[0];\n\t\t\treturn compute;\n\t\t});\n\t\treturn outputLoss;\n\t}", "function reduceFilter(fn) {\n return function (mapped, x) {\n if (fn(x)) {\n mapped.push(x);\n }\n return mapped;\n };\n}", "predict(input=[]) {\r\n\t\tconst input_layer = input;\r\n\t\t//multiplica a entrada com o peso e soma os resultados\r\n\t\t// e mapeia esse retorno passando pela função de ativação\r\n\t\tconst hidden_layer = \r\n\t\tthis.math.multiply(input_layer, this.synapse0).map(v => this.activation(v, false));\r\n\t\t//multiplica o resultado com outro peso e passa novamente pela função de ativação\r\n\t\tconst output_layer =\r\n\t\tthis.math.multiply(hidden_layer, this.synapse1).map(v => this.activation(v, false));\r\n\t\treturn output_layer;\r\n\t}", "function Predicate() { }", "function Predicate() { }", "update(features = {}, label = \"\", guess = perceptron.predict(features)) {\n if (label !== guess) {\n for (const feature in features) {\n if (!weights[feature]) {\n weights[feature] = {};\n }\n\n if (!accumulatedWeights[feature]) {\n accumulatedWeights[feature] = {};\n }\n\n const value = features[feature];\n const classes = weights[feature];\n const accumulatedClasses = accumulatedWeights[feature];\n const { [label]: weight = 0 } = classes;\n const { [label]: [total, timestamp] = [0, 0] } = accumulatedClasses;\n classes[label] = weight + value;\n accumulatedClasses[label] = [total + weight * (i - timestamp), i];\n if (guess) {\n const { [guess]: weight = 0 } = classes;\n const { [guess]: [total, timestamp] = [0, 0] } = accumulatedClasses;\n classes[guess] = weight - value;\n accumulatedClasses[guess] = [total + weight * (i - timestamp), i];\n }\n }\n }\n\n i += 1;\n return perceptron;\n }", "get prediction() {\n\t\treturn this.__prediction;\n\t}", "function predict(x) {\n const xs = tf.tensor1d(x); \n // y = mx + b\n const ys = xs.mul(m).add(b);\n return ys;\n }", "function evaluate(t, env) {\r\n //If the predicate is a variable\r\n if (isVar(t.pred)) {\r\n //look up the variable in environment\r\n var a = env[t.pred];\r\n //if the variable has a value, re-evaluate with the predicate variable replaced\r\n if (a != null) return evaluate(a, env);\r\n //otherwise fail\r\n else return null;\r\n }\r\n //The predicate is not a variable and there are no parameters to it, so we are done, return the value\r\n else if (t.args.length == 0) return t;\r\n //the predicate is not a variable but there are some parameter terms. Evalaute each.\r\n else {\r\n //Placeholder for evaluated arguments\r\n var n = [];\r\n //loop over arguments\r\n for (var i = 0; i < t.args.length; i++) {\r\n //evaluate this argument\r\n var a = evaluate(t.args[i], env);\r\n if (a != null) n.push(a); //we were able to evaluate, so include the value of the argument\r\n else n.push({pred:t.args[i].pred, args:[]}); //we were not able to evaluate, so leave it as a variable predicate\r\n }\r\n //return the term with variables all replaced\r\n return {pred:t.pred, args:n};\r\n }\r\n //never reach here\r\n}", "function fprop(a,p){return a.filter(function(x){return x[p]})}" ]
[ "0.6705718", "0.65874404", "0.65270615", "0.6463311", "0.6463311", "0.61922604", "0.58999133", "0.5811592", "0.5677635", "0.5664593", "0.5558659", "0.5535481", "0.5527944", "0.5503125", "0.546129", "0.54492134", "0.54168695", "0.53777325", "0.5288122", "0.5233991", "0.52029365", "0.5177703", "0.5165758", "0.5133905", "0.5085846", "0.5073748", "0.5029813", "0.50144047", "0.50069386", "0.5002632", "0.4997759", "0.4997759", "0.4959106", "0.49539033", "0.49412072", "0.4926335", "0.49227202", "0.4899851", "0.4897489", "0.48920515", "0.48831508", "0.4883039", "0.48723736", "0.4862341", "0.48612285", "0.48395815", "0.48312107", "0.48294586", "0.48188192", "0.4815291", "0.48144227", "0.481316", "0.481089", "0.48091015", "0.4801683", "0.4785353", "0.4785353", "0.4785353", "0.4785353", "0.47554892", "0.47421503", "0.4735465", "0.4714572", "0.4714572", "0.4714572", "0.4704", "0.47015965", "0.46909454", "0.46884874", "0.4674057", "0.46687835", "0.4625053", "0.4603049", "0.46007073", "0.459206", "0.45666507", "0.45519945", "0.45415625", "0.45278716", "0.44854063", "0.44846433", "0.44823426", "0.44812217", "0.44774297", "0.44736934", "0.44659433", "0.44603816", "0.4459002", "0.44503114", "0.44456944", "0.44384196", "0.44274992", "0.44127154", "0.4407406", "0.4407406", "0.440424", "0.43958566", "0.43853635", "0.43793818", "0.43735695" ]
0.6928306
0
Draw Piece Offset allows us to move the piece
function drawMatrix(matrix, offset) { matrix.forEach((row, y) => { row.forEach((value, x) => { if (value !== 0) { context.fillStyle = colors[value]; context.fillRect(x + offset.x, y + offset.y, 1, 1); } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rePosition(){\r\n piece.pos.y = 0; // this and next line puts the next piece at the top centered\r\n piece.pos.x = ( (arena[0].length / 2) | 0) - ( (piece.matrix[0].length / 2) | 0);\r\n }", "function drawPiece(context, piece, pos, maxHeight){\n var drawX, drawY;\n context.fillStyle = piece.color;\n for(var y = 0;y < piece.shape.length;y++){\n for(var x = 0;x < piece.shape[y].length;x++){\n if(piece.shape[y][x] != 0){\n // console.log(\"p1.shape[\" + i + \"][\" + j + \"]=\" + piece.shape[i][j]);\n drawX = (x + pos.x)*UNIT_SIZE;\n drawY = (maxHeight - 1 - (y + pos.y))*UNIT_SIZE;\n context.fillRect(drawX, drawY, UNIT_SIZE, UNIT_SIZE);\n context.strokeRect(drawX, drawY, UNIT_SIZE, UNIT_SIZE);\n }\n }\n }\n}", "drawPiece(piece){\n let context = this.canvas.getContext(\"2d\");\n let shiftX = this.cell_w * piece.pos.x;\n let shiftY = this.cell_h * piece.pos.y;\n let imageObj = undefined;\n\n context.save();\n context.lineWidth = \"2\";\n context.strokeStyle = \"black\";\n context.beginPath();\n context.rect(shiftX + 5, shiftY + 5, this.cell_w - 10, this.cell_h - 10);\n context.stroke();\n context.closePath();\n\n let rank = piece.rank;\n let scale = 0.7;\n let imageW = 64 * 0.7, imageH = 64 * 0.7;\n let ssx = (64 - imageW)/ 2, ssy = (64 - imageW)/ 2 - 2;\n let colorW= \"\", colorB = \"\"\n\n if (piece.team == 1){\n colorB = \"black\"\n colorW = \"white\"\n imageObj = this.game.imageObjs.get(IMAGE_PATH[0]);\n }else if (piece.team == 2){\n colorB = \"white\"\n colorW = \"black\"\n imageObj = this.game.imageObjs.get(IMAGE_PATH[1]);\n }\n context.fillStyle= colorB;\n context.fill();\n context.stroke();\n\n\n if (!piece.isHide){\n context.drawImage(imageObj, piece.rank * this.cell_w, 0, this.cell_w, this.cell_h, shiftX + ssx, shiftY + ssy, imageW, imageH)\n context.font=\"10px Verdana\";\n context.fillStyle= colorW;\n rank = rank == 0 ? \"B\" : (rank == \"11\" ? \"F\" : rank);\n context.fillText(\"RANK \" + rank, shiftX + ssx + 2, shiftY + ssy + 45);\n }\n context.restore();\n }", "_drawPiece(piece, origin, squareWidth) {\n\t\tlet center = {\n\t\t\tx: origin.x + Math.floor(squareWidth / 2),\n\t\t\ty: origin.y + Math.floor(squareWidth / 2)\n\t\t}\n\t\tthis._ctx.fillStyle = 'black';\n\t\tif (piece.type === 'p') { // pawns\n\t\t\tlet rad = Math.floor(squareWidth / 4);\n\t\t\tthis._ctx.beginPath();\n\t\t\tthis._ctx.arc(center.x, center.y, rad, 0, Math.PI * 2);\n\t\t\tif (piece.color === 'b') {\n\t\t\t\tthis._ctx.fill();\n\t\t\t} else {\n\t\t\t\tthis._ctx.lineWidth = this._lineWidth;\n\t\t\t\tthis._ctx.stroke();\n\t\t\t}\n\t\t} else if (piece.type === 'n') { // knights\n\t\t\tthis._ctx.beginPath();\n\t\t\t// left ear\n\t\t\tthis._ctx.moveTo(\n\t\t\t\tcenter.x - (squareWidth / 4),\n\t\t\t\tcenter.y - (squareWidth / 3)\n\t\t\t);\n\t\t\t// central crevice\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x, center.y - (squareWidth / 6)\n\t\t\t)\n\t\t\t// right ear\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x + (squareWidth / 4),\n\t\t\t\tcenter.y - (squareWidth / 3)\n\t\t\t);\n\t\t\t// right eye\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x + (squareWidth / 4),\n\t\t\t\tcenter.y,\n\t\t\t);\n\t\t\t// right mouth\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x + (squareWidth / 8),\n\t\t\t\tcenter.y + (squareWidth / 3)\n\t\t\t);\n\t\t\t// left mouth\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x - (squareWidth / 8),\n\t\t\t\tcenter.y + (squareWidth / 3)\n\t\t\t);\n\t\t\t// left eye\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x - (squareWidth / 4),\n\t\t\t\tcenter.y,\n\t\t\t);\n\t\t\tif (piece.color === 'b') {\n\t\t\t\tthis._ctx.fill();\n\t\t\t} else {\n\t\t\t\tthis._ctx.lineWidth = this._lineWidth;\n\t\t\t\tthis._ctx.closePath();\n\t\t\t\tthis._ctx.stroke();\n\t\t\t}\n\t\t} else if (piece.type === 'r') { // rooks\n\t\t\tlet length = squareWidth / 3;\n\t\t\tlet height = length * 2;\n\t\t\tif (piece.color === 'b') {\n\t\t\t\tthis._ctx.fillRect(\n\t\t\t\t\tcenter.x - (length / 2),\n\t\t\t\t\tcenter.y - (height / 2),\n\t\t\t\t\tlength,\n\t\t\t\t\theight\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tthis._ctx.lineWidth = this._lineWidth;\n\t\t\t\tthis._ctx.strokeRect(\n\t\t\t\t\tcenter.x - (length / 2),\n\t\t\t\t\tcenter.y - (height / 2),\n\t\t\t\t\tlength,\n\t\t\t\t\theight\n\t\t\t\t);\n\t\t\t}\n\t\t} else if (piece.type === 'b') { // bishops\n\t\t\tthis._ctx.beginPath();\n\t\t\tthis._ctx.moveTo(\n\t\t\t\tcenter.x,\n\t\t\t\tcenter.y - (squareWidth / 3)\n\t\t\t);\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x + (squareWidth / 4),\n\t\t\t\tcenter.y + (squareWidth / 3)\n\t\t\t);\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x - (squareWidth / 4),\n\t\t\t\tcenter.y + (squareWidth / 3)\n\t\t\t);\n\t\t\tif (piece.color === 'b') {\n\t\t\t\tthis._ctx.fill();\n\t\t\t} else {\n\t\t\t\tthis._ctx.lineWidth = this._lineWidth;\n\t\t\t\tthis._ctx.closePath();\n\t\t\t\tthis._ctx.stroke();\n\t\t\t}\n\t\t} else if (piece.type === 'k') { // kings\n\t\t\tthis._ctx.beginPath();\n\t\t\t// left spike\n\t\t\tthis._ctx.moveTo(\n\t\t\t\tcenter.x - (squareWidth / 3),\n\t\t\t\tcenter.y - (squareWidth / 3),\n\t\t\t);\n\t\t\t// central crevice\n\t\t\tthis._ctx.lineTo(center.x, center.y);\n\t\t\t// right spike\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x + (squareWidth / 3),\n\t\t\t\tcenter.y - (squareWidth / 3),\n\t\t\t);\n\t\t\t// right base\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x + (squareWidth / 3),\n\t\t\t\tcenter.y + (squareWidth / 3)\n\t\t\t);\n\t\t\t// left base\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x - (squareWidth / 3),\n\t\t\t\tcenter.y + (squareWidth / 3)\n\t\t\t);\n\t\t\tif (this._model.turn == piece.color) {\n\t\t\t\tthis._ctx.strokeStyle = 'red';\n\t\t\t\tthis._ctx.fillStyle = 'red';\n\t\t\t}\n\t\t\tif (piece.color === 'b') {\n\t\t\t\tthis._ctx.fill();\n\t\t\t} else {\n\t\t\t\tthis._ctx.lineWidth = this._lineWidth;\n\t\t\t\tthis._ctx.closePath();\n\t\t\t\tthis._ctx.stroke();\n\t\t\t}\n\t\t\t// jewel\n\t\t\tthis._ctx.beginPath();\n\t\t\tthis._ctx.arc(\n\t\t\t\tcenter.x,\n\t\t\t\tcenter.y - (squareWidth / 4),\n\t\t\t\tMath.floor(squareWidth / 8),\n\t\t\t\t0,\n\t\t\t\tMath.PI * 2\n\t\t\t);\n\t\t\tif (piece.color === 'b') {\n\t\t\t\tthis._ctx.fill();\n\t\t\t} else {\n\t\t\t\tthis._ctx.lineWidth = this._lineWidth;\n\t\t\t\tthis._ctx.stroke();\n\t\t\t}\n\t\t\tthis._ctx.strokeStyle = 'black';\n\t\t\tthis._ctx.fillStyle = 'black';\n\t\t} else if (piece.type === 'q') { // queens\n\t\t\tthis._ctx.beginPath();\n\t\t\t// left spike\n\t\t\tthis._ctx.moveTo(\n\t\t\t\tcenter.x - (squareWidth / 3),\n\t\t\t\tcenter.y - (squareWidth / 8),\n\t\t\t);\n\t\t\t// left crevice\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x - (squareWidth / 6),\n\t\t\t\tcenter.y\n\t\t\t);\n\t\t\t// central spike\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x,\n\t\t\t\tcenter.y - (squareWidth / 3),\n\t\t\t);\n\t\t\t// right crevice\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x + (squareWidth / 6),\n\t\t\t\tcenter.y\n\t\t\t);\n\t\t\t// right spike\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x + (squareWidth / 3),\n\t\t\t\tcenter.y - (squareWidth / 8)\n\t\t\t);\n\t\t\t// right base\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x + (squareWidth / 4),\n\t\t\t\tcenter.y + (squareWidth / 3)\n\t\t\t);\n\t\t\t// left base\n\t\t\tthis._ctx.lineTo(\n\t\t\t\tcenter.x - (squareWidth / 4),\n\t\t\t\tcenter.y + (squareWidth / 3)\n\t\t\t)\n\t\t\tif (piece.color === 'b') {\n\t\t\t\tthis._ctx.fill();\n\t\t\t} else {\n\t\t\t\tthis._ctx.lineWidth = this._lineWidth;\n\t\t\t\tthis._ctx.closePath();\n\t\t\t\tthis._ctx.stroke();\n\t\t\t}\n\t\t} else {\n\t\t\tthrow Error(`No drawing handler for piece of type: ${piece.type}`)\n\t\t}\n\n\t}", "function drawPieceBoard(pieceBoard) {\n for(var i = 0; i < 3; i++)\n for(var j = 0;j < 7; j++)\n drawPixelNext( j, i, pieceBoard[i][j]);\n}", "doDraw(offset) {\n let pp = [this.pos[0] - 16 - offset, this.pos[1] - 32];\n if ((this.life_time % 16) < 8) {\n drawImage(Graphics[\"spell1\"], pp);\n } else {\n drawImage(Graphics[\"spell2\"], pp);\n }\n // draw_context.fillStyle = \"#f007\"\n // draw_context.fillRect(hb_rect(this, 0),hb_rect(this, 1),this.width,this.height)\n }", "doDraw(offset) {\n super.doDraw(offset);\n let pp = [this.pos[0] - 64 - offset, this.pos[1] - 128];\n let image = \"gobbo-\";\n if (this.dir == 1){\n image+=\"r\";\n } else {\n image+=\"l\";\n }\n drawImage(Graphics[image], pp);\n \n }", "moveTo(row, col, piece) {\r\n this.fillAt(piece.row, piece.col, null);\r\n this.fillAt(row, col, piece);\r\n }", "placePiece(x,y,piece) {\n\n }", "function drawPiece(i,j,x,y,piece) {\n\tvar newImg;\n\tvar pieceSet;\n\tswitch (piece.charAt(0)) {\n\t\tcase 'b':\n\t\t\tpieceSet = pieces.black;\n\t\t\tbreak;\n\t\tcase 'w':\n\t\t\tpieceSet = pieces.white;\n\t\t\tbreak;\n\t}\n\tswitch(piece.charAt(1)) {\n\t\tcase 'b':\n\t\t\tnewImg = pieceSet.bishop;\n\t\t\tbreak;\n\t\tcase 'h':\n\t\t\tnewImg = pieceSet.knight;\n\t\t\tbreak;\n\t\tcase 'k':\n\t\t\tnewImg = pieceSet.king;\n\t\t\tbreak;\n\t\tcase 'p':\n\t\t\tnewImg = pieceSet.pawn;\n\t\t\tbreak;\n\t\tcase 'q':\n\t\t\tnewImg = pieceSet.queen;\n\t\t\tbreak;\n\t\tcase 'r':\n\t\t\tnewImg = pieceSet.rook;\n\t\t\tbreak;\n\t}\n\tif (piece != 'ee') {\n\t\tif (newImg.width > newImg.height) {\n\t\t\tnewImg.divisor = newImg.width/tileSize;\n\t\t} else if (newImg.width < newImg.height) {\n\t\t\tnewImg.divisor = newImg.height/tileSize;\n\t\t}\n\t\tvar width = newImg.width/newImg.divisor;\n\t\tvar height = newImg.height/newImg.divisor;\n\t\tvar xOff = Math.floor(tileSize/2) - Math.floor(width/2);\n\t\tvar yOff = Math.floor(tileSize/2) - Math.floor(height/2);\n\t\tvar newImg = new Kinetic.Image({\n\t\t\timage: newImg,\n\t\t\tx:x + xOff,\n\t\t\ty:y + yOff,\n\t\t\theight:height,\n\t\t\twidth:width,\n\t\t\tid: String(i) + String(j)\n\t\t});\n\t\tpieceLayer.add(newImg);\n\t}\n}", "doDraw(offset) {\n super.doDraw(offset);\n let pp = [this.pos[0] - 64 - offset, this.pos[1] - 128];\n let image = \"chad-\";\n if (this.stance == 0){\n image+=\"n\";\n } else {\n image+=\"d\";\n }\n if (this.dir == 1){\n image+=\"r\";\n } else {\n image+=\"l\";\n }\n drawImage(Graphics[image], pp);\n\n for (let i=0; i < this.health; i+=1) { // hud\n drawImage(Graphics[\"health\"], [8, 8 + i*32]);\n }\n }", "function drawPiece() {\n var block = piece.pieceName;\n for(var i = 0; i < block.length; i++)\n for(var j = 0; j < block.length; j++)\n if( block[i][j] == 1)\n drawPixel( piece.xPos +j, piece.yPos+i, piece.colour);\n}", "function drawBoard(){\n\tfor (var i = 0; i < n - 1; i++) {\n\t\tvar pos = pieceSize * (i + 1);\n\t\tctx.beginPath();\n\t\tctx.moveTo(pos, 0);\n\t\tctx.lineTo(pos, length);\n\t\tctx.moveTo(0, pos);\n\t\tctx.lineTo(length, pos);\n\t\tctx.stroke();\n\t\tctx.closePath();\n\t}\n}", "function drawNext(){\n prepareNextPiece();\n\n if(matrixNext.type === 'L' || matrixNext.type === 'I'){\n var copy = rotateLeft(matrixNext.matrix);\n drawNextPiece(copy, {x:2.5, y: 0.5});\n }\n else{\n //show the current piece\n drawNextPiece(matrixNext.matrix, {x: 3, y: 0.9});\n }\n}", "function basicDrawing(x, y, tool){tool.drawPixel(x, y);}", "function drawPlayer(){\n\t//draw hard drop position\n\tplayer.shape.forEach((row,y)=>{\n\t\trow.forEach((value,x)=>{\n\t\t\tif(player.shape[y][x] != 0){\n\t\t\t\tcontext.lineWidth = 3;\n\t\t\t\tcontext.strokeStyle = 'white';\n\t\t\t\tcontext.strokeRect(25*(x+player.hPos.X)+4,25*(y+player.hPos.Y)+4,16,16);\n\t\t\t}\n\t\t});\n\t});\n\t\n\t//draw player piece\n\tplayer.shape.forEach((row,y) =>{\n\t\trow.forEach((value, x) =>{\n\t\t\tif(player.shape[y][x] != 0){\n\t\t\t\tswitch(player.shape[y][x]){//tioszlj\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\tfillPiece(context,player.pos.X+x,player.pos.Y+y,'mediumpurple','purple');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\tfillPiece(context,player.pos.X+x,player.pos.Y+y,'darkcyan','cyan');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\tfillPiece(context,player.pos.X+x,player.pos.Y+y,'goldenrod','gold');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\tfillPiece(context,player.pos.X+x,player.pos.Y+y,'green','lawngreen');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 5:\n\t\t\t\t\t\tfillPiece(context,player.pos.X+x,player.pos.Y+y,'darkred','red');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 6:\n\t\t\t\t\t\tfillPiece(context,player.pos.X+x,player.pos.Y+y,'darkorange','orange');\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 7:\t\t\t\n\t\t\t\t\t\tfillPiece(context,player.pos.X+x,player.pos.Y+y,'darkblue','blue');\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t});\n\t});\t\n}", "doDraw(offset) {\n super.doDraw(offset);\n let pp = [this.pos[0] - 64 - offset, this.pos[1] - 256];\n let image = \"wizard-\";\n if (this.dir == 1){\n image+=\"r\";\n } else {\n image+=\"l\";\n }\n drawImage(Graphics[image], pp);\n if (this.spell != undefined) {\n this.spell.doDraw(offset);\n }\n // draw_window.\n for (let i=0; i < this.health; i+=1) { // hud\n drawImage(Graphics[\"wizard_health\"], [canvas_element.width-40, 8 + i*32]);\n }\n \n }", "function surface_offset(x, y)\n{\n\t//post('plinko offset', x, y, '\\n');\n\ts_offset = [x, y];\n}", "_drawCharacter() {\n this.flappy.style.top = `${this.charY}px`;\n }", "function point_offset(i) {\n return 4*i;\n }", "function updateOffset() {\n canvasBounding = canvas.getBoundingClientRect();\n offsetX = canvasBounding.left;\n offsetY = canvasBounding.top;\n}", "set_drawing_position() {\n push()\n translate(this.module_x, this.module_y)\n }", "function drawPieces(state) {\r\n // state.printBoardText();\r\n for(let col = 0; col < state.board_size; col++) {\r\n for(let row = 0; row < state.board_size; row++) {\r\n let player = state.board[state.getIndex(row, col)];\r\n if(player != 0) {\r\n drawCircle(row, col, player);\r\n }\r\n }\r\n }\r\n hover_coord = null;\r\n //updateScores();\r\n }", "placePieceAt(y , x , row , col, boardArr) {\n var piece = game.addSprite(game.startingX + x*game.squareSize*3 + col*game.squareSize, game.startingY + y * game.squareSize*3 + row*game.squareSize, 'O');\n \n game.board[y][x][row][col] = \"o\"\n game.previousPiece = \"o\";\n }", "function drawPiece(type, posX, posY, rot){\n if(type < 1 || type > 7)\n return;//Invalid type\n rot = rot % 4; //No matter how high rotation gets, it can't exceed 4\n ctx.beginPath();\n let rasterX = horizPad;\n let rasterY = padding;\n for(let i = 0; i < posX; ++i){\n rasterX += squareSize;\n }\n for(let i = 0; i < posY; ++i){\n rasterY += squareSize;\n }\n\n ctx.moveTo(rasterX, rasterY);\n\n ctx.fillStyle = 'pink';\n ctx.arc(rasterX,rasterY,3,0,6.28318,false);\n ctx.fill();\n\n\n switch(type){\n \n case 1://L\n //Draw piece\n ctx.fillStyle = 'green';\n switch(rot){\n case 0:\n ctx.lineTo(rasterX + squareSize*3, rasterY);\n rasterX += squareSize*3;\n ctx.lineTo(rasterX, rasterY+squareSize*2);\n rasterY += squareSize*2;\n ctx.lineTo(rasterX - squareSize, rasterY);\n rasterX -= squareSize;\n ctx.lineTo(rasterX, rasterY-squareSize);\n rasterY -= squareSize;\n ctx.lineTo(rasterX - squareSize * 2, rasterY);\n rasterX -= squareSize * 2;\n ctx.lineTo(rasterX, rasterY - squareSize);\n rasterY -= squareSize;\n ctx.fill();\n \n \n //Check collision\n if(board[posX+2][posY + 2] != 0 || \n board[posX+1][posY + 1] != 0 ||\n board[posX+1][posY] != 0 ||\n posY + 1 > height){\n //Piece has landed\n board[posY][posX] = 1;\n board[posY][posX+1] = 1;\n board[posY][posX+2] = 1;\n board[posY+1][posX+2] = 1;\n return true;\n } else return false;\n case 1:\n rasterX += squareSize;\n rasterY += squareSize;\n ctx.moveTo(rasterX, rasterY);\n rasterX += squareSize;\n ctx.lineTo(rasterX, rasterY);\n rasterY -= squareSize * 2;\n ctx.lineTo(rasterX, rasterY);\n rasterX += squareSize;\n ctx.lineTo(rasterX, rasterY);\n rasterY += squareSize * 3;\n ctx.lineTo(rasterX, rasterY);\n rasterX -= squareSize * 2;\n ctx.lineTo(rasterX, rasterY);\n rasterY -= squareSize;\n ctx.lineTo(rasterX, rasterY);\n ctx.fill()\n\n //Check collision\n if(board[posX+2][posY+1] != 0 ||\n board[posX+2][posY+2] != 0 ||\n posY + 2 > height){\n board[posY+1][posX+1] = 1;\n board[posY+1][posX+2] = 1;\n board[posY][posX+2] = 1;\n board[posY-1][posX+2] = 1;\n return true;\n }else return false;\n case 2:\n ctx.moveTo(rasterX, rasterY);\n rasterY += squareSize * 2;\n ctx.lineTo(rasterX, rasterY);\n rasterX += squareSize * 3;\n ctx.lineTo(rasterX, rasterY);\n rasterY -= squareSize;\n ctx.lineTo(rasterX, rasterY);\n rasterX -= squareSize * 2;\n ctx.lineTo(rasterX, rasterY);\n rasterY -= squareSize;\n ctx.lineTo(rasterX, rasterY);\n rasterX -= squareSize;\n ctx.lineTo(rasterX, rasterY);\n ctx.fill();\n\n\n //Check collison\n if(board[posY+2][posX] != 0 ||\n board[posY+2][posX+1] != 0 ||\n board[posY+2][posX+2] != 0 ||\n posY + 1 > height){\n board[posY][posX] = 1;\n board[posY+1][posX] = 1;\n board[posY+1][posX+1] = 1;\n board[posY+1][posX+2] = 1;\n return true;\n }else return false;\n case 3:\n rasterX += squareSize;\n ctx.moveTo(rasterX, rasterY);\n rasterX += squareSize * 2;\n ctx.lineTo(rasterX, rasterY);\n rasterY += squareSize;\n ctx.lineTo(rasterX, rasterY);\n rasterX -= squareSize;\n ctx.lineTo(rasterX, rasterY);\n rasterY += squareSize * 2;\n ctx.lineTo(rasterX, rasterY);\n rasterX -= squareSize;\n ctx.lineTo(rasterX, rasterY);\n rasterY -= squareSize * 3;\n ctx.lineTo(rasterX, rasterY);\n ctx.fill();\n \n \n //Check collision\n if(board[posY+3][posX+1] != 0 ||\n board[posY+1][posX+2] != 0||\n posY + 2 > height)\n {\n board[posY][posX+1] = 1;\n board[posY][posX+2] = 1;\n board[posY+1][posX+1] = 1;\n board[posY+2][posX+1] = 1;\n }else return false;\n }\n \n\n break;\n case 2://J\n ctx.fillStyle = 'blue';\n break;\n case 3://T\n ctx.fillStyle = 'red';\n break;\n case 4://S\n ctx.fillStyle = 'pink';\n break;\n case 5://Z\n ctx.fillStyle = 'yellow';\n break;\n case 6://I\n ctx.fillStyle = 'purple';\n break;\n case 7://O\n ctx.fillStyle = 'aqua';\n break;\n }\n \n}", "function paintCurrentMove() {\n\t\t\tvar m;\n\n\t\t\tstoneContext.fillStyle = \"red\";\n\t\t\tstoneContext.beginPath();\n\t\t\tm = goMap.getCurrentMove();\n\t\t\tstoneContext.arc(SPACE * (m.x + 1), SPACE * (m.y + 1), SPACE_DIVIDE_FOUR, 0, PI_MUL_TWO, true);\n\t\t\tstoneContext.fill();\n\t\t\tstoneContext.closePath();\n\t\t}", "function movePiece(color){\r\n\r\n\t//variable to hold piece to be moved\r\n\tvar whoseTurn = whitePiece;\r\n\r\n\t//sets the correct piece and offset based on the color passed\r\n\tif(color == \"white\"){\r\n\t\twhoseTurn = whitePiece;\r\n\t\toffsetX = .2;\r\n\t\toffsetZ = -.2;\r\n\t}\r\n\r\n\tif(color == \"yellow\"){\r\n\t\twhoseTurn = yellowPiece;\r\n\t\toffsetX = .2;\r\n\t\toffsetZ = 0.0;\r\n\t}\r\n\r\n\tif(color == \"orange\"){\r\n\t\twhoseTurn = orangePiece;\r\n\t\toffsetX = .2;\r\n\t\toffsetZ = .2;\r\n\t}\r\n\r\n\tif(color == \"green\"){\r\n\t\twhoseTurn = greenPiece;\r\n\t\toffsetX = 0.0;\r\n\t\toffsetZ = -.2;\r\n\t}\r\n\r\n\tif(color == \"purple\"){\r\n\t\twhoseTurn = purplePiece;\r\n\t\toffsetX = -.2;\r\n\t\toffsetZ = .2;\r\n\t}\r\n\r\n\tif(color == \"red\"){\r\n\t\twhoseTurn = redPiece;\r\n\t\toffsetX = -.2;\r\n\t\toffsetZ = 0.0;\r\n\t}\r\n\r\n\tif(color == \"black\"){\r\n\t\twhoseTurn = blackPiece;\r\n\t\toffsetX = -.2;\r\n\t\toffsetZ = -.2;\r\n\t}\r\n\r\n\tif(color == \"blue\"){\r\n\t\twhoseTurn = bluePiece;\r\n\t\toffsetX = 0.0;\r\n\t\toffsetZ = .2;\r\n\t}\r\n\r\n\r\n\t//moves the selected piece to the center of the region determined by the dice roll then offsets it based on the offset\r\n\t//assigned above\r\n\tif(turnValue == 2 || turnValue == 3){\r\n\t\twhoseTurn.position.set(twoThreeCenterX+offsetX,pieceVisible,twoThreeCenterZ+offsetZ);\r\n\t}\r\n\r\n\tif(turnValue == 4 || turnValue == 5){\r\n\t\twhoseTurn.position.set(fourFiveCenterX+offsetX,pieceVisible,fourFiveCenterZ+offsetZ);\r\n\t}\r\n\r\n\tif(turnValue == 6){\r\n\t\twhoseTurn.position.set(sixCenterX+offsetX,pieceVisible,sixCenterZ+offsetZ);\r\n\t}\r\n\r\n\tif(turnValue == 7){\r\n\t\t//S17\r\n\t\twhoseTurn.position.set(sevenCenterX+offsetX,pieceVisible,sevenCenterZ+offsetZ);\r\n\t}\r\n\r\n\tif(turnValue == 8){\r\n\t\twhoseTurn.position.set(eightCenterX+offsetX,pieceVisible,eightCenterZ+offsetZ);\r\n\t}\r\n\r\n\tif(turnValue == 9 || turnValue == 10){\r\n\t\twhoseTurn.position.set(nineTenCenterX+offsetX,pieceVisible,nineTenCenterZ+offsetZ);\r\n\t}\r\n\r\n\tif(turnValue == 11 || turnValue == 12){\r\n\t\twhoseTurn.position.set(elevenTwelveCenterX+offsetX,pieceVisible,elevenTwelveCenterZ+offsetZ);\r\n\t}\r\n\r\n\r\n}", "draw(ctx){\n saveMatrix();\n ctx.save();\n translate(0,0);\n\n if (this.extended) {\n this.dockPointsReq.forEach((value) => {\n value.draw(ctx);\n });\n this.dockPointsDev.forEach((value) => {\n value.draw(ctx);\n });\n }\n\n ctx.strokeRect(this.x,this.y+this.margin_top,this.width,this.height);\n restoreMatrix();\n ctx.restore();\n }", "drawChar(offset, value) {\n const screenX = (offset % 64) * 8 * this.scale + this.padding;\n const screenY = Math.floor(offset / 64) * 24 * this.scale + this.padding;\n this.context.fillStyle = this.getBackgroundColor();\n if (this.isExpandedCharacters()) {\n if (offset % 2 === 0) {\n this.context.fillRect(screenX, screenY, 16 * this.scale, 24 * this.scale);\n this.context.drawImage(this.glyphs[value], 0, 0, this.glyphWidth * 2, 24, screenX, screenY, 16 * this.scale, 24 * this.scale);\n }\n }\n else {\n this.context.fillRect(screenX, screenY, 8 * this.scale, 24 * this.scale);\n this.context.drawImage(this.glyphs[value], 0, 0, this.glyphWidth, 24, screenX, screenY, 8 * this.scale, 24 * this.scale);\n }\n }", "function movePiece(x, y, nx, ny) {\r\n var bxy = board[x][y];\r\n var ele = document.getElementById(\"piece\" + String(Number(bxy[0]) * 16 + Number(bxy[1])));\r\n ele.onclick = function () {\r\n control(nx, ny);\r\n }\r\n ele.style = pos(nx, ny);\r\n}", "function drawFixation() {\n let ctx = document.getElementById('canvas').getContext('2d');\n ctx.lineWidth = prms.fixWidth;\n ctx.moveTo(-prms.fixSize, 0);\n ctx.lineTo( prms.fixSize, 0);\n ctx.stroke(); \n ctx.moveTo(0, -prms.fixSize);\n ctx.lineTo(0, prms.fixSize);\n ctx.stroke(); \n}", "draw() {\n this.setSize();\n this.setSizeBounds();\n this.move();\n this.coordinates = getPlaneCoordinates(this);\n this.setOut();\n }", "draw() {\n if (this.eraser) {\n this.erase();\n }\n ctx.fillStyle = '#1A1D22';\n\n for (let i = 0; i < 2; i++) {\n this.pS[i].style.top = `${this.pos.sT}px`;\n this.pS[i].style.left = `${this.pos.x[i] - (this.pS[i].clientWidth / 1.98) - this.anisign}px`;\n\n ctx.fillRect(this.pos.x[i] - this.anisign, this.pos.sT, this.pos.w, this.pos.h);\n this.eraser[i].push(this.pos.x[i] - this.anisign - 3, this.pos.sT - 3, this.pos.w + 5, this.pos.h + 5);\n }\n }", "function drawNextPiece() {\n clearPieceBoard();\n var block = nextPiece.pieceName;\n for(var i = 0; i < block.length; i++)\n for(var j = 0; j < block.length; j++)\n if( block[i][j] == 1)\n drawPixelNext( 1+j, i, nextPiece.colour);\n}", "drawLine(){\n for (var index in this.draw){\n this.draw[index] = this.fracToPixel(this.draw[index])\n }\n canvas.beginPath();\n canvas.moveTo(this.draw[\"rightX\"],this.draw[\"rightY\"]);\n canvas.lineTo(this.draw[\"leftX\"],this.draw[\"leftY\"]);\n canvas.stroke();\n }", "function redrawHolePos(player) {\n c.beginPath();\n c.arc(player.lastPos[0].x, player.lastPos[0].y, player.\n radius + 0.1, 0, Math.PI * 2, false);\n c.fillStyle = \"black\";\n c.fill();\n}", "function piece_movements (name) {\n piece = new Piece ({piece: chess_pieces [name]});\n\n piece . draw ();\n\n make_credits_line (name);\n}", "function drawOnDeck() {\n\t\tclearDeck()\n\t\tvar onDeckCanvas = document.getElementsByClassName(\"tetron-next-piece\")[0]\n\t\tvar ctx = onDeckCanvas.getContext(\"2d\");\n\t\tpieceOnDeck.draw(ctx, 2)\n\n\t}", "addPiece(piece) {\n if (this.piece != null)\n throw 'addPiece but piece already exists';\n this.piece = piece;\n this.piece.generateView(this.getTileElement());\n }", "move(from, to, silent) {\n // Carry out the move in the normal way\n super.move(from, to, silent);\n\n // Get the from and to square HTML elements\n let $from = $(`.square-${from}`);\n let $to = $(`.square-${to}`);\n\n // We need to know where the board is on the screen to offset our drawing\n // on the canvas\n let boardX = $('#board').offset().left;\n let boardY = $('#board').offset().top;\n\n // We also need to offset the drawing to the centre of the square\n let offset = $(SQUARE).width() / 2;\n\n // Calculate the from (x1,y1) and to (x2,y2) positions in pixels\n let x1 = $from.offset().left - boardX + offset; // - $from.parent().offset().left;\n let y1 = $from.offset().top - boardY + offset; // - $from.parent().offset().top;\n let x2 = $to.offset().left - boardX + offset; // - $from.parent().offset().left;\n let y2 = $to.offset().top - boardY + offset; // - $from.parent().offset().top;\n\n // Draw a line between the two locations using scribble\n stroke(0, 150);\n strokeWeight(2);\n this.scribble.scribbleLine(x1, y1, x2, y2);\n }", "function drawFixation() {\n 'use strict';\n let ctx = document.getElementById('canvas').getContext('2d');\n ctx.lineWidth = prms.fixWidth;\n ctx.moveTo(-prms.fixSize, 0);\n ctx.lineTo(prms.fixSize, 0);\n ctx.stroke();\n ctx.moveTo(0, -prms.fixSize);\n ctx.lineTo(0, prms.fixSize);\n ctx.stroke();\n\n // ctx.font = '30px monospace';\n // ctx.textAlign = 'center';\n // ctx.textBaseline = 'middle';\n // ctx.fillStyle = 'black';\n // ctx.fillText('Gesamtpunkte: ' + prms.cPoints, 0, -300);\n}", "function drawStep(x,y,symbol){\n\n // Give new values\n width(5)\n\n // For random player\n if (symbol == \"r\" || symbol == \"R\") {\n rcheck = Math.random()\n if (rcheck>=0.5){\n symbol=\"X\"\n }\n else{\n symbol=\"O\"\n }\n }\n\n // Does this if needs to draw X\n if (symbol==\"X\" || symbol==\"x\") {\n x_coordinates.push([x,y])\n myX = -cs/2+x*(squareSize)-(squareSize)+(squareSize/5)\n myY = cs/2-(y*squareSize)+(squareSize/5)\n goto(myX,myY)\n color(\"blue\")\n right(45)\n forward((4.24*squareSize)/5)\n goto(myX+(squareSize*3/5),myY)\n left(90)\n forward((4.24*squareSize)/5)\n right(45)\n\n\n let arrToCheck = [x,y]\n for (let i = 0; i < free_coordinates.length; i++) {\n if (arraysEqual(free_coordinates[i],arrToCheck)) {\n free_coordinates.splice(i,1)\n break\n }\n }\n }\n\n // Does this if needs to draw O\n if(symbol==\"O\" || symbol==\"o\" || symbol==\"0\"){\n o_coordinates.push([x,y])\n myX = -cs/2+x*(squareSize)-(squareSize)+(squareSize/2)\n myY = cs/2-(y*squareSize)+(squareSize/2)\n radius = squareSize*3/10\n goto(myX,myY+radius)\n right(90)\n color(\"red\")\n for (let r = 0; r < 100; r++) {\n forward(squareSize/55.5)\n right(360/100)\n }\n left(90)\n\n let arrToCheck = [x,y]\n for (let i = 0; i < free_coordinates.length; i++) {\n if (arraysEqual(free_coordinates[i],arrToCheck)) {\n free_coordinates.splice(i,1)\n break\n }\n }\n }\n\n // Back default options\n goto(1000,1000)\n color(\"black\")\n width(2)\n}", "draw () {\n this.dotCircle.remove()\n this.dotCircle = this.getDotCircle(this.point, this.thickness, this.color)\n\n this.dotToLine.removeSegments()\n this.dotToLine.add(this.point, this.iPoint)\n\n this.fillingDotToLine.removeSegments()\n this.fillingDotToLine.add(this.point)\n\n const point = this.dotToLine.getLocationAt(this.dotToLine.length * this.fillingProgress)\n this.fillingDotToLine.add(point)\n }", "function cardDrawActionPointsAttribute(card, font, fontColor, fontSize, isPlayerCard){\n \n if(isPlayerCard){\n var cardMoves = playerCards[card.id].remMoves;\n }else{\n var cardMoves = mobCards[card.id].remMoves;\n }\n \n var actionPoints = new PIXI.Text(cardMoves);\n \n //BOTTOM LEFT\n actionPoints.position.x = botLeftAttributeSlotXOffset - getXOffsetFromCenterForText(cardMoves, cardAttributeFontCharSize);\n actionPoints.position.y = botLeftAttributeSlotYOffset - cardAttributeFontCharSize;\n \n actionPoints.setStyle({font:\"\"+fontSize+\"px \"+font, fill:fontColor});\n \n card.addChildAt(actionPoints, 2);\n \n }", "function movePiece(mouseX, mouseY) {\n piece.x = mouseX - piece.w/2;\n if (piece.x <= 0)\n piece.x = 0;\n if (piece.x >= canvasWidth - piece.w)\n piece.x = canvasWidth - piece.w;\n }", "function piece_path (name) {\n let piece = chess_pieces [name];\n\n let board = new Spiral;\n\n board . draw_path ({piece: piece});\n}", "translate (offset) {\n this.position = this.tempPosition.plus(offset);\n }", "function buildPiece(piece){\n\n const tmpPce = document.createElement('div');\n tmpPce.classList = \"allPiece \" + piece.color + \"Piece\";\n if(piece.color == 'light'){tmpPce.style.cursor=\"pointer\"}\n tmpPce.id = piece.tileLocation + 'Piece';\n\n if(!anotherMove){\n tmpPce.addEventListener('click', function(){movePiece(piece);})\n\n }\n else{\n tmpPce.style.boxShadow=\"3px 3px 2px black\";\n }\n if(piece.crowned){\n tmpPce.innerHTML = \"&#9813\";\n }\n for(var i = 0; i < boardArr.length; i++){\n if((boardArr[i].tileLocation == piece.tileLocation) && piece.color == 'light'){\n boardArr[i].currPieceLight = 1;\n }\n else if((boardArr[i].tileLocation == piece.tileLocation) && piece.color == 'dark'){\n boardArr[i].currPieceLight = -1;\n }\n }\n document.getElementById(piece.tileLocation+'Tile').appendChild(tmpPce);\n\n}", "display() {\n fill(0, 0, 0, 30)\n noStroke()\n ellipse(this.position.x, this.position.y, 4, 4)\n }", "function move(piece){\r\n\tif (isMoveable(piece)){\r\n\t\tvar switchTop = emptyPiece[0] + \"px\";\r\n\t\tvar switchLeft = emptyPiece[1] + \"px\";\r\n\t\tvar styleTop = piece.style.top;\r\n\t\tvar styleLeft = piece.style.left;\r\n\t\tpiece.style.top = switchTop;\r\n\t\tpiece.style.left = switchLeft;\r\n\t\temptyPiece[0] = parseInt(styleTop);\r\n\t\temptyPiece[1] = parseInt(styleLeft);\r\n\t}\r\n}", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.moveTo(this.position.x - width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x + width/2, this.position.y + width/2);\n\t\tinfo.context.lineTo(this.position.x, this.position.y - width/2);\n\t\tinfo.context.closePath();\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function draw(i, o) {\n with(context) {\n x = i % grid * size, y = ~~(i / grid) * size, c = size / 2, d = size / 3, e = d * 2, lineWidth = 4;\n bn(); // beginPath\n o ? a(x + c, y + c, d / 2, 0, Math.PI * 2, !1) // draw o\n :\n (mT(x + d, y + d), lT(x + e, y + e), mT(x + d, y + e), lT(x + e, y + d)); // draw x\n stroke();\n board[i] = o || 1;\n }\n }", "function drawXY(x, y, ch) {\n if (y >= 0 && x >= 0 && x < viewPort[0] && y < viewPort[1]) {\n var offset = y * (viewPort[0] + 1) + x; \n t = t.substr(0, offset) + ch + t.substr(offset +1);\n }\n }", "function getOffset(piece, type){\n if(type === 'left'){\n return parseInt(piece.style.left);\n }\n else if(type === 'top'){\n return parseInt(piece.style.top);\n }\n\n}", "function updateGraphics() {\r\n //put currentPiece on board\r\n for (const coord of currentPiece.coords) {\r\n board[coord[0]][coord[1]] = currentPiece.color;\r\n }\r\n //draw board\r\n for (let i = 4; i < 24; i++) {\r\n for (let j = 0; j < 10; j++) {\r\n //gets colors from the board array\r\n document.querySelector('#r'+ (i-4) + 'c' + j).style.backgroundColor = board[i][j];\r\n }\r\n }\r\n //draw next\r\n for (let i = 0; i < 4; i++) {\r\n for (let j = 0; j < 4; j++) {\r\n //clears next display\r\n document.querySelector('#nr'+ i + 'c' + j).style.backgroundColor = \"#ffffff\"\r\n //draws piece in that cell if that piece goes there\r\n if (nextPiece.coords.some(x => x[0] === i && x[1] - 3 === j)) {\r\n document.querySelector('#nr'+ i + 'c' + j).style.backgroundColor = nextPiece.color;\r\n }\r\n }\r\n }\r\n //draw held\r\n if (heldPiece !== null) {\r\n for (let i = 0; i < 4; i++) {\r\n for (let j = 0; j < 4; j++) {\r\n //clears held display\r\n document.querySelector('#hr'+ i + 'c' + j).style.backgroundColor = \"#ffffff\"\r\n //draws piece in that cell if that piece goes there\r\n if (heldPiece.coords.some(x => x[0] === i && x[1] - 3 === j)) {\r\n document.querySelector('#hr'+ i + 'c' + j).style.backgroundColor = heldPiece.color;\r\n }\r\n }\r\n }\r\n }\r\n}", "draw() {\n\t\tlet width = 30;\n\n\t\tinfo.context.beginPath();\n\t\tinfo.context.rect(this.position.x - width/2, this.position.y - width/2, width, width);\n\t\tinfo.context.fillStyle = this.color;\n\t\tinfo.context.fill();\n\t}", "function drawTile(i,j,x,y,piece) {\n\tdrawBGTile(i,j,x,y);\n\tdrawPiece(i,j,x,y,piece);\n\tdrawFGTile(i,j,x,y,piece);\n}", "debug( draw, steps=10, inc_dxdy=false, inc_dxdy2=false ){\r\n let prev = new Vec3();\r\n let pos = new Vec3();\r\n let dev = new Vec3();\r\n let t;\r\n\r\n // Draw First Point\r\n this.at( 0, prev );\r\n draw.pnt( prev, \"yellow\", 0.05, 1 );\r\n\r\n for( let i=1; i <= steps; i++ ){\r\n t = i / steps;\r\n\r\n //------------------------------------\r\n // Draw Step\r\n this.at( t, pos );\r\n draw\r\n .ln( prev, pos, \"yellow\" )\r\n .pnt( pos, \"yellow\", 0.05, 1 );\r\n\r\n //------------------------------------\r\n // Draw Forward Direction\r\n if( inc_dxdy ){\r\n this.at( t, null, dev );\r\n draw.ln( pos, dev.norm().scale( 0.4 ).add( pos ), \"white\" );\r\n }\r\n\r\n //------------------------------------\r\n // Draw Forward Direction\r\n if( inc_dxdy2 ){\r\n this.at( t, null, null, dev );\r\n draw.ln( pos, dev.norm().scale( 0.4 ).add( pos ), \"cyan\" );\r\n }\r\n\r\n //------------------------------------\r\n prev.copy( pos );\r\n }\r\n }", "function draw(event) {\n if (isDrawing) {\n ctx.strokeStyle = `hsl(${hue}, 100%, 50%)`;\n ctx.beginPath();\n // start from\n ctx.moveTo(lastX, lastY);\n // go to\n ctx.lineTo(event.offsetX, event.offsetY);\n ctx.stroke();\n [lastX, lastY] = [event.offsetX, event.offsetY];\n groove();\n } // else do nothing\n}", "panel() {\n\n if (this.$p.cursor.grid_id !== this.layout.id) {\n return\n }\n\n let lbl = this.$p.cursor.y$.toFixed(this.layout.prec)\n this.ctx.fillStyle = this.$p.colors.colorPanel\n\n let panwidth = this.layout.sb + 1\n\n let x = - 0.5\n let y = this.$p.cursor.y - PANHEIGHT * 0.5 - 0.5\n let a = 5 //* 0.5\n this.ctx.fillRect(x - 0.5, y, panwidth, PANHEIGHT)\n this.ctx.fillStyle = this.$p.colors.colorTextHL\n this.ctx.textAlign = 'left'\n this.ctx.fillText(lbl, a, y + 16)\n\n }", "function trackPieceMove(event) {\n event.preventDefault();\n mouseMoved = true;\n if (activePiece) {\n\n let [moveX, moveY] = getPos(event.clientX + offset[0], event.clientY + offset[1], chessboard, activePiece);\n activePiece.style.left = moveX * 100 + '%';\n activePiece.style.top = moveY * 100 + '%';\n }\n }", "function movePiece(piece, moveBy) {\n currentSpace = 2;\n targetSpace = currentSpace + moveBy;\n piece = document.getElementById(piece);\n piece.remove()\n targetSpace = document.querySelector(`#space${targetSpace} .container`);\n targetSpace.appendChild(piece);\n} //figure out how to get your current piece location and modify thos function so it moves.", "function movePiece(oldPosition, newPosition){\n currentState2D[newPosition[1]][newPosition[0]] = currentState2D[oldPosition[1]][oldPosition[0]] \n currentState2D[oldPosition[1]][oldPosition[0]] = 0 \n drawPieces() ; \n}", "function drawBoard() {\n // vertical lines\n for (let x = 0; x <= BOARD_WIDTH; x += CELL_SIZE) {\n context.moveTo(0.5 + x + OFFSET, OFFSET);\n context.lineTo(0.5 + x + OFFSET, BOARD_HEIGHT + OFFSET);\n }\n\n // horizontal lines\n for (let y = 0; y <= BOARD_HEIGHT; y += CELL_SIZE) {\n context.moveTo(OFFSET, 0.5 + y + OFFSET);\n context.lineTo(BOARD_WIDTH + OFFSET, 0.5 + y + OFFSET);\n }\n\n context.strokeStyle = \"black\";\n context.stroke();\n}", "function redraw() {\n\n\t\tcanvas.clearRect(0,0,BOARD_SIZE * SQUARE_SIZE, BOARD_SIZE * SQUARE_SIZE);\n\t\tfor (var i = 0; i < visible_pieces.length; i++) {\n\t\t\tvisible_pieces[i].draw();\n\t\t}\n\t}", "draw() {\n this.setSize();\n this.setSizeBounds();\n this.move();\n this.coordinates = getPlaneCoordinates(this);\n this.gridCoordinates = getGridCoordinates(this);\n }", "function draw(event) {\n\tcanvas = document.getElementById(\"mycanvas\"),\n\tcontext = canvas.getContext(\"2d\");\n\tcontext.fillRect(event.pageX-offset, event.pageY-offset, 5, 5);\n }", "display() {\n for (let i = 0; i < this.pieces.length; i++) {\n let x_cord = this.pieces[i][0];\n let y_cord = this.pieces[i][1];\n let curr_piece = this.gameboard[x_cord][y_cord];\n imageMode(CORNER);\n if (!(curr_piece === null)) {\n image(curr_piece.srcImg, curr_piece.x, curr_piece.y)\n }\n }\n }", "function drawPowerup() {\n //console.log(powerupX, powerupY);\n graphics.drawImage(greenshield, powerupX, powerupY, 60, 60);\n }", "redraw() {\n if (this._isShutDown) return;\n this._hoverCoords = [-1, -1];\n let totMov = this._gameState.totalMoves;\n let maxSum = 0; for (let i = 0; i < 6; i++) maxSum += totMov - i > 0 ? totMov - i : 0;\n let maxMaxSum = totMov * (totMov + 1) / 2;\n let [hexSize, xD, yD] = [this._hexSize, this._xD, this._yD];\n let [con, scale, board, fieldVals] = [this._context, this._scale, this._gameState.board, this._gameState.fieldVals];\n let [width, height] = [board[0].length, board.length];\n let [xO, yO] = [this._origin[0] - (width - 1) * xD * scale, this._origin[1] + (height - 1) * (hexSize + yD) * scale / 2];\n\n con.clearRect(0, 0, window.innerWidth, window.innerHeight);\n\n con.save();\n con.translate(xO, yO);\n con.scale(scale, scale);\n con.font = Math.round(hexSize / 2) + 'px Arial';\n con.textAlign = 'center';\n con.textBaseline = 'middle';\n con.lineWidth = 10;\n for (let y = 0; y < height; y++) {\n let by = height - y - 1;\n for (let x = 0; x < width; x++) {\n if (!isNaN(board[by][x])) {\n let xp = x * (2 * xD) + (Math.abs(y) % 2 ? xD : 0);\n let yp = - y * (hexSize + yD);\n let actx = xO + xp * scale;\n let acty = yO + yp * scale;\n\n con.beginPath();\n con.moveTo(xp - xD, yp - hexSize / 2);\n con.lineTo(xp - xD, yp + hexSize / 2);\n con.lineTo(xp, yp + hexSize / 2 + yD);\n con.lineTo(xp + xD, yp + hexSize / 2);\n con.lineTo(xp + xD, yp - hexSize / 2);\n con.lineTo(xp, yp - hexSize / 2 - yD);\n con.lineTo(xp - xD, yp - hexSize / 2);\n con.closePath();\n\n let dx = actx - this._lastMouseCoords[0]; let dy = acty - this._lastMouseCoords[1];\n if (board[by][x] == 0 && Math.sqrt(dx * dx + dy * dy) < scale * xD) {\n this._hoverCoords = [x, y];\n con.fillStyle = 'rgba(218, 205, 155, 1)';\n con.fill();\n } else if (board[by][x] == 0) {\n con.fillStyle = 'rgba(228, 246, 238, 1)';\n con.fill();\n } else if (board[by][x] < 0) { // player 2\n con.fillStyle = 'rgba(193, 74, 64, 1)';\n con.fill();\n } else if (board[by][x] > 0) { // player 1\n con.fillStyle = 'rgba(72, 180, 145, 1)';\n con.fill();\n }\n\n if (board[by][x] == 0) {\n if (by < this._cMoveOpts.length && x < this._cMoveOpts[by].length) {\n if (this._cMoveOpts[by][x] == 0) {\n con.fillStyle = 'rgba(36, 63, 65, 1)';\n con.fillText('D', xp, yp);\n } else if (this._cMoveOpts[by][x] == 1) {\n con.fillStyle = 'rgba(193, 74, 64, 1)';\n con.fillText('P2', xp, yp);\n } else if (this._cMoveOpts[by][x] == -1) {\n con.fillStyle = 'rgba(72, 180, 145, 1)';\n con.fillText('P1', xp, yp);\n } else if (this._cMoveOpts[by][x] >= 2 && this._cMoveOpts[by][x] <= 4) {\n let val = this._cMoveOpts[by][x] - 3;\n if (Math.abs(val) < 0.1) {\n con.fillStyle = 'rgba(36, 63, 65, 0.5)';\n con.fillText(Math.round(val * 100) / 100, xp, yp);\n } else if (val > 0) {\n con.fillStyle = `rgba(193, 74, 64, ${0.1 + val * 0.9})`;\n con.fillText(Math.round(val * 100) / 100, xp, yp);\n } else if (val < 0) {\n con.fillStyle = `rgba(72, 180, 145, ${0.1 - val * 0.9})`;\n con.fillText(Math.round(val * 100) / 100, xp, yp);\n }\n }\n } else if (fieldVals[by][x] != 0) {\n let importance = Math.abs(fieldVals[by][x]) / maxSum;\n importance = 0.1 + (1 - (importance - 1) * (importance - 1)) * 0.9;\n if (fieldVals[by][x] < 0) // good for player 1\n con.fillStyle = `rgba(72, 180, 145, ${importance})`;\n else if (fieldVals[by][x] > 0) // good for player 2\n con.fillStyle = `rgba(193, 74, 64, ${importance})`;\n con.fillText(fieldVals[by][x], xp, yp);\n }\n } else {\n let importance = Math.abs(board[by][x]) / totMov;\n importance = 0.1 + importance * 0.9;\n con.fillStyle = `rgba(255, 255, 255, ${importance})`;\n con.fillText(board[by][x], xp, yp);\n }\n }\n }\n }\n\n for (let y = 0; y < height; y++) {\n let by = height - y - 1;\n for (let x = 0; x < width; x++) {\n if (!isNaN(board[by][x])) {\n let xp = x * (2 * xD) + (Math.abs(y) % 2 ? xD : 0);\n let yp = - y * (hexSize + yD);\n\n con.strokeStyle = 'rgba(36, 63, 65, 1)';\n con.beginPath();\n con.moveTo(xp - xD, yp - hexSize / 2);\n con.lineTo(xp - xD, yp + hexSize / 2);\n con.lineTo(xp, yp + hexSize / 2 + yD);\n con.lineTo(xp + xD, yp + hexSize / 2);\n con.lineTo(xp + xD, yp - hexSize / 2);\n con.lineTo(xp, yp - hexSize / 2 - yD);\n con.lineTo(xp - xD, yp - hexSize / 2);\n con.closePath();\n con.stroke();\n }\n }\n }\n\n let winner = this._gameState.checkWinner();\n con.font = Math.round(hexSize / 2) + 'px Merriweather';\n let texty = - (height - 1) * (hexSize + yD) / 2;\n let texty1 = hexSize + yD;\n let texty2 = - height * (hexSize + yD);\n let textx = (width - 1) * xD;\n con.fillStyle = 'rgba(36, 63, 65, 1)';\n con.fillText(`Current sum: ${this._gameState.sum}${!isNaN(winner) && winner == 0 ? ', game ended in draw' : ''}`, textx, texty1);\n con.fillText(this._gameState.name, textx, texty2);\n\n let p1width = con.measureText('Player 1').width;\n let p2width = con.measureText('Player 2').width;\n con.fillStyle = 'rgba(72, 180, 145, 1)';\n con.fillText('Player 1', - xD * 2 - p1width / 2, texty);\n if (isNaN(winner) && !(this._gameState.currentMove % 2)) con.fillRect(- xD * 2 - p1width, texty + hexSize * 0.25, p1width, 4);\n con.fillStyle = 'rgba(193, 74, 64, 1)';\n con.fillText('Player 2', (textx + xD) * 2 + p2width / 2, texty);\n if (isNaN(winner) && this._gameState.currentMove % 2) con.fillRect((textx + xD) * 2, texty + hexSize * 0.25, p2width, 4);\n if (this._gameState.sum != 0) {\n let importance = Math.abs(this._gameState.sum) / maxMaxSum;\n importance = 0.1 + (1 + (importance - 1) * (importance - 1) * (importance - 1)) * 0.9;\n let text = 'seems to win!';\n if (!isNaN(winner)) { text = 'won!'; importance = 1; }\n let twidth = con.measureText(text).width;\n if (this._gameState.sum < 0) {\n con.fillStyle = `rgba(72, 180, 145, ${importance})`;\n con.fillText(text, - xD * 2 - twidth / 2, texty + hexSize * 0.66);\n } else if (this._gameState.sum > 0) {\n con.fillStyle = `rgba(193, 74, 64, ${importance})`;\n con.fillText(text, (textx + xD) * 2 + twidth / 2, texty + hexSize * 0.66);\n }\n }\n\n con.restore();\n }", "updateDrawLine(pointer, x, y) {\n if (!this.isSelecting) {\n return\n }\n\n var tw = (this.tileWidth * this.firstLetter.worldScale.x) / 2\n var th = (this.tileHeight * this.firstLetter.worldScale.y) / 2\n\n this.drawLine.clear()\n this.drawLine.lineStyle(\n this.drawLineThickness,\n this.drawLineColor,\n this.drawLineAlpha\n )\n this.drawLine.moveTo(\n this.firstLetter.worldPosition.x + tw,\n this.firstLetter.worldPosition.y + th\n )\n this.drawLine.lineTo(x, y)\n }", "function updateGraphics(p, m) {\n let ctx = document.getElementById(\"board\").getContext(\"2d\");\n let src = document.getElementById(\"images\");\n let sc = getPieceSrc(p.color + p.name);\n\n if (ROTATION) {\n ctx.clearRect(m[0].alf * SQ_SIZE, (7 - m[0].num) * SQ_SIZE, SQ_SIZE, SQ_SIZE);\n } else {\n ctx.clearRect(m[0].alf * SQ_SIZE, m[0].num * SQ_SIZE, SQ_SIZE, SQ_SIZE);\n }\n\n if (ROTATION) {\n ctx.drawImage(src, sc.x, sc.y, 1000 / 3, 1000 / 3, m[1].alf * SQ_SIZE, (7 - m[1].num) * SQ_SIZE, SQ_SIZE, SQ_SIZE);\n } else {\n ctx.drawImage(src, sc.x, sc.y, 1000 / 3, 1000 / 3, m[1].alf * SQ_SIZE, m[1].num * SQ_SIZE, SQ_SIZE, SQ_SIZE);\n }\n\n}", "draw() {\n\t\tnoStroke();\n\t\tfill('rgba(255,255,255,0.5)');\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "function DrawCharacter()\n{\n\tvar color=0xFFFFFF;\n\tvar size=2;\n\te.lineStyle(size, color);\n\te.beginFill(color);\n\te.drawCircle(mapOrigin.x, mapOrigin.y, 2);\n\te.endFill();\n}", "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}", "function drawPointer() {\n var centerX = (zeroX+squareSize/2) + Pointer.x*squareSize;\n var centerY = (zeroY+squareSize/2) + Pointer.y*squareSize;\n \n if(Pointer.dir == \"up\") {\n drawTri(centerX - triSize/2, centerY + triSize/2, Pointer.dir);\n } else if(Pointer.dir == \"right\") {\n drawTri(centerX - triSize/2, centerY - triSize/2, Pointer.dir);\n } else if(Pointer.dir == \"down\") {\n drawTri(centerX + triSize/2, centerY - triSize/2, Pointer.dir);\n } else if(Pointer.dir == \"left\") {\n drawTri(centerX + triSize/2, centerY + triSize/2, Pointer.dir);\n }\n penUp();\n}", "function draw(id){\n\tvar canvas = document.getElementById(id);\n\tif (canvas.getContext){\n\t\tvar ctx = canvas.getContext('2d');\n\t\tvar origx = 0;\n\t\tvar origy = 0;\n\t\tvar posx = 0;\n\t\tvar posy = 0;\n\t\tvar imgWidth = puzzles[id].imgWidth;\n\t\tvar imgHeight = puzzles[id].imgHeight;\n\t\tvar pieceWidth = puzzles[id].pieceWidth;\n\t\tvar pieceHeight = puzzles[id].pieceHeight;\n\t\tvar xdiv = puzzles[id].xdiv;\n\t\tvar ydiv = puzzles[id].ydiv;\n\t\tvar img = puzzles[id].img;\n\t\tif(!jQuery('#'+id).hasClass('canvas-loaded')){\n\t\t\tjQuery('#'+id).addClass('canvas-loaded');\n\t\t\timg.onload = function(){\n\t\t\t\tctx.fillStyle = \"rgb(0,0,0)\";\n\t\t\t\tctx.fillRect (0, 0, imgWidth, imgHeight);\n\t\t\t\t//drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight)\n\t\t\t\tfor (var posx=0; posx<xdiv; posx++){\n\t\t\t\t\tfor (var posy=0; posy<ydiv; posy++){\n\t\t\t\t\t\tvar index = xdiv*posy + posx;\n\t\t\t\t\t\tif(puzzles[id].board[index] != -1){\n\t\t\t\t\t\t\torigx = puzzles[id].board[index] % xdiv;\n\t\t\t\t\t\t\torigy = Math.floor(puzzles[id].board[index] / xdiv);\n\t\t\t\t\t\t\tif(dragging && index == currentPos){\n\t\t\t\t\t\t\t\tctx.drawImage(img, \n\t\t\t\t\t\t\t\t\tpieceWidth*origx, pieceHeight*origy, \n\t\t\t\t\t\t\t\t\tpieceWidth, pieceHeight, \n\t\t\t\t\t\t\t\t\tpieceWidth*posx + deltaX, pieceHeight*posy + deltaY, \n\t\t\t\t\t\t\t\t\tpieceWidth, pieceHeight);\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\tctx.drawImage(img, \n\t\t\t\t\t\t\t\t\tpieceWidth*origx, pieceHeight*origy, \n\t\t\t\t\t\t\t\t\tpieceWidth, pieceHeight, \n\t\t\t\t\t\t\t\t\tpieceWidth*posx, pieceHeight*posy, \n\t\t\t\t\t\t\t\t\tpieceWidth, pieceHeight);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t};\n\t\t}else{\n\t\t\tctx.fillStyle = \"rgb(0,0,0)\";\n\t\t\tctx.fillRect (0, 0, imgWidth, imgHeight);\n\t\t\t//drawImage(image, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight)\n\t\t\tfor (var posx=0; posx<xdiv; posx++){\n\t\t\t\tfor (var posy=0; posy<ydiv; posy++){\n\t\t\t\t\tvar index = xdiv*posy + posx;\n\t\t\t\t\tif(puzzles[id].board[index] != -1){\n\t\t\t\t\t\torigx = puzzles[id].board[index] % xdiv;\n\t\t\t\t\t\torigy = Math.floor(puzzles[id].board[index] / xdiv);\n\t\t\t\t\t\tif(dragging && index == currentPos){\n\t\t\t\t\t\t\tctx.drawImage(img, \n\t\t\t\t\t\t\t\tpieceWidth*origx, pieceHeight*origy, \n\t\t\t\t\t\t\t\tpieceWidth, pieceHeight, \n\t\t\t\t\t\t\t\tpieceWidth*posx + deltaX, pieceHeight*posy + deltaY, \n\t\t\t\t\t\t\t\tpieceWidth, pieceHeight);\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\tctx.drawImage(img, \n\t\t\t\t\t\t\t\tpieceWidth*origx, pieceHeight*origy, \n\t\t\t\t\t\t\t\tpieceWidth, pieceHeight, \n\t\t\t\t\t\t\t\tpieceWidth*posx, pieceHeight*posy, \n\t\t\t\t\t\t\t\tpieceWidth, pieceHeight);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}else{\n\t\t//alert('Your browser does not support canvas');\n\t}\n}", "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}", "draw(){\n this.ctx.strokeStyle = this.getStrokeColor();\n this.ctx.lineWidth = 2;\n this.ctx.beginPath()\n this.ctx.moveTo(this.prevx, this.prevy);\n this.ctx.lineTo(this.x, this.y)\n this.ctx.stroke()\n this.ctx.fill();\n }", "function move_piece (name) {\n let piece = chess_pieces [name];\n let spiral_args = piece . spiral_args || {};\n let spiral = new Spiral (spiral_args);\n\n spiral . draw ({with_values: 1});\n\n spiral . place_piece (piece, {});\n spiral . hide_value (1);\n\n let moves = piece . run_list;\n\n let manual_steps = piece . manual_moves || 0;\n\n for (let i = 1; i <= manual_steps; i ++) {\n nav . add_todo (function () {\n spiral . move_piece ({\n move_list: moves,\n start: i,\n end: i,\n callback: function (args) {\n $('#move-number') . html (args . move);\n }\n });\n });\n }\n\n //\n // We're using a trick here. We first delete the existing chess\n // piece, then replace it with another. This way, the animation\n // runs more smoothly; that is, it won't do the first steps all\n // at once.\n //\n nav . add_todo (function () {\n SVG ('#chess-piece') . css ({display: 'none'});\n SVG ('#chess-piece') . id ('bogus');\n spiral . place_piece (piece, {value: moves [manual_steps]});\n spiral . move_piece ({\n move_list: moves,\n start: manual_steps + 1,\n callback: function (args) {\n $('#move-number') . html (args . move);\n }\n });\n });\n}", "draw() {\r\n this.ctx.save()\r\n this.ctx.translate(this.x + (this.pSize / 2), this.y + (this.pSize / 2))\r\n this.ctx.rotate(this.angle)\r\n this.ctx.translate(-(this.x + (this.pSize / 2)), -(this.y + (this.pSize / 2)))\r\n this.ctx.drawImage(this.pl1, this.x, this.y, this.pSize, this.pSize)\r\n this.ctx.rotate(this.angle)\r\n this.ctx.restore()\r\n }", "drawPoint(p) {\n if (this.connectWithPrev) {\n p.line(\n 0,\n 0,\n this.prevPos.x - this.pos.x,\n this.prevPos.y - this.pos.y\n );\n } else {\n p.point(0, 0);\n }\n }", "function draw(){\n\n //Schachbrettmuster\n context.fillStyle = \"#694a00\";\n context.fillRect(0, 0, canvasSize, canvasSize);\n context.fillStyle = \"#9e8400\";\n for(i = 0;i<4;i++){\n for(j = 0;j<4;j++){\n context.fillRect(tileSize*j*2, tileSize*2*i, tileSize, tileSize);\n }\n for(j = 0;j<4;j++){\n context.fillRect(tileSize*(2*i+1), tileSize*(1+j*2), tileSize, tileSize);\n }\n }\n\n //Figuren zeichnen\n fillStyle = \"#000000\";\n numOfPieces = Pieces.length;\n for(i = 0;i<numOfPieces;i++){\n context.fillRect(Pieces[i].x, Pieces[i].y, tileSize-10, tileSize-10);\n }\n\n }", "drawPoint(point) {\n // Clipping what's visible on screen\n if (point.x >= 0 && point.y >= 0 && point.x < this.workingWidth\n && point.y < this.workingHeight) {\n // Drawing a yellow point\n this.putPixel(point.x, point.y, new BABYLON.Color4(1, 1, 0, 1));\n }\n }", "function draw() {\n\n for ( var x = 0; x < COLS; ++x ) {\n for ( var y = 0; y < ROWS; ++y ) {\n if ( tetrisBoard[ y ][ x ] ) {\n ctx.strokeStyle = 'black';\n ctx.lineWidth = \"4\";\n ctx.fillStyle = colors[ tetrisBoard[ y ][ x ] - 1 ];\n ctx.fillRect( BLOCK_W * x, BLOCK_H * y, BLOCK_W - 1 , BLOCK_H - 1 );\n ctx.strokeRect( BLOCK_W * x, BLOCK_H * y, BLOCK_W - 1 , BLOCK_H - 1 );\n }\n else {\n ctx.strokeStyle = 'black';\n ctx.lineWidth = \"0.8\";\n ctx.fillStyle = 'white';\n ctx.fillRect( BLOCK_W * x+1, BLOCK_H * y+1, BLOCK_W - 1 , BLOCK_H - 1 );\n ctx.strokeRect( BLOCK_W * x, BLOCK_H * y, BLOCK_W - 1 , BLOCK_H - 1 );\n }\n }\n }\n\n ctx.strokeStyle = 'black';\n for ( var y = 0; y < pieceSize; ++y ) {\n for ( var x = 0; x < pieceSize; ++x ) {\n if ( shape[ y ][ x ] ) {\n ctx.fillStyle = colors[ shape[ y ][ x ] - 1 ];\n ctx.lineWidth = \"4\";\n ctx.fillRect( BLOCK_W * (x+currX) , BLOCK_H * (y+currY) , BLOCK_W - 1 , BLOCK_H - 1 );\n ctx.strokeRect( BLOCK_W * (x+currX) , BLOCK_H * (y+currY) , BLOCK_W - 1 , BLOCK_H - 1 );\n }\n }\n }\n}", "function draw() {\n background(0); // Set the background to black\n\n \n var prev = 0;\n\n\n fill(102);\n ellipse(width/2, height/2, 15, 15);\n\n line(width/2, height/2, mouseX, mouseY);\n var normXDiff = 2 * mouseX/width - 1;\n var normYDiff = 2 * mouseY/height - 1;\n\n\n // we obtain values from -1 to 1\n // transX += normXDiff * width/10;\n\n if (move) {\n zoom += normXDiff * speed;\n posY += normYDiff * speed / zoom;\n }\n\n posY = max(posY, 0);\n posY = min(posY, 1);\n\n zoom = max(0.7, zoom);\n\n for (var i = 0; i < p_s.length; i++) {\n var p = p_s[i];\n var size = p * height;\n\n var y = prev * height;\n\n y *= zoom;\n\n if (zoom >= 1) {\n y -= posY * height * (zoom-1);\n } else\n y -= 0.5 * height * (zoom-1);\n size *= zoom;\n fill(102);\n var x = width-size;\n rect(x, y, size, size);\n prev += p;\n }\n}", "function piece(type,color,p){\n\n\tthis.color = color + \"Piece\";\n\n\tvar pieceCode = \"&#98\" + type;\n\n\tvar p = $(\"<span>\").attr({class: \"piece\", id: pieceCode, pos: p}).html(pieceCode)\n\t.draggable({\n\t\tgrid: [80,80], revert:\"invalid\",\n\t\tdrag: function(event, ui){\n\t\t\tcurrentPiece = $(this)[0];\n\t\t}\n\t});\n\t$(p).addClass(this.color);\n\n\treturn p;\n\n}", "function draw(delta) {\n\t\n\t// clear the canvas\n\tcontext.setTransform(1, 0, 0, 1, 0, 0)\n\tcontext.clearRect(0, 0, canvas.width, canvas.height)\n\n\t// center the canvas\t\n\tcontext.translate(canvas.width / 2, canvas.height / 2)\n\n\tcontext.fillStyle = '#ffd500'\n\tcontext.strokeStyle = context.fillStyle\n\n\tconst l = 80\n\tconst h = l * Math.sqrt(3) / 2\n\n\tconst pos = ([i, j]) => [h * i, i % 2 ? l * (j + 0.5) : l * j]\n\n\tfor (let i = -6; i <= 7; i++) {\n\t\tfor (let j = -10; j <= (i % 2 ? 9 : 10); j++) {\n\t\t\tconst [y, x] = pos([i, j])\n\n\t\t\tconst n = Date.now() / 1000\n\t\t\t// const r = 3 * (Math.sin(x + n) + Math.cos(y + 2 * n) + 2)\n\t\t\tconst r = 4\n\n\t\t\tcontext.save()\n\t\t\tcontext.translate(x, y)\n\n\t\t\tfor (let a = 0; a < 6; a++) {\n\t\t\t\tconst t = Math.PI / 3 * a\n\n\t\t\t\t// position of this 'pixel'\n\t\t\t\tconst sx = (x + Math.cos(t + Math.PI/6) * 2/3*h) / l / 4\n\t\t\t\tconst sy = (y + Math.sin(t + Math.PI/6) * 2/3*h) / l / 4\t\n\n\t\t\t\tconst wx = Math.sin(n * 0.4) + Math.cos(n * 0.5)\n\t\t\t\tconst wy = 0.6 * Math.sin(n * 0.11) + Math.cos(n * 0.34)\n\t\t\t\tconst w = Math.sin(3*Math.pow((sx-wx)*(sx-wx)+(sy-wy)*(sy-wy), 0.8) + 0.03*n)\n\n\t\t\t\tcontext.save()\n\t\t\t\tcontext.rotate(t)\n\t\t\t\tcontext.beginPath()\n\t\t\t\tcontext.moveTo(0, 0)\n\t\t\t\tcontext.lineTo(l, 0)\n\t\t\t\tcontext.lineTo(l/2, h/3 * Math.cos(w))\n\t\t\t\tcontext.closePath()\n\t\t\t\t//context.fillStyle = context.strokeStyle = a%2 ?\n\t\t\t\t//\t'#ffd500' : '#ff9500'\n\t\t\t\tcontext.fill()\n\t\t\t\t//context.stroke()\n\t\t\t\tcontext.restore()\n\t\t\t}\n\n\t\t\tcontext.restore()\n\t\t}\n\t}\n\n}", "doDraw(offset) {\n if (this.stab_box != undefined) {\n let p = [hb_rect(this.stab_box,0) - offset, hb_rect(this.stab_box,1)];\n if (this.stab_box.dir == 1) {\n drawImage(Graphics[\"hit-r\"], p);\n }\n else {\n drawImage(Graphics[\"hit-l\"], p);\n }\n // draw_window.fillRect(p[0],p[1], this.stab_box.width,this.stab_box.height)\n }\n // draw_window.fillRect(hb_rect(this, 0),hb_rect(this, 1), this.width,this.height)\n }", "draw() {\n\t\tnoStroke();\n\t\tfill(\"rgba(255, 255, 255, 0.1)\");\n\t\tcircle(this.pos.x, this.pos.y, this.size);\n\t}", "function drawPlayer(x, y, wid, hei, color) {\r\n y == 0 ? (y = 1) : (y = y);\r\n x = x / 1.5;\r\n ctx.save();\r\n ctx.fillStyle = color;\r\n ctx.fillRect(x, y, wid, hei);\r\n ctx.restore();\r\n }", "function drawBank(bank, sideOffset = 0) {\n //sideOffset = sideOffset == 'undefined'? 0 :sideOffset;\n if (bank.length > 1) {\n ctx.strokeStyle = \"#000000\";\n ctx.beginPath();\n\n restoreFirstPoint = null;\n if (bank[0].x == 0) {\n // handle start of island\n restoreFirstPoint = bank[0];\n var offset = unit * .5;\n //if (bank[1].x < unit * 2) offset = unit * .01;\n bank.splice(0, 1, { x: restoreFirstPoint.x, y: restoreFirstPoint.y - offset * slope })\n bank.splice(1, 0, { x: restoreFirstPoint.x + offset, y: restoreFirstPoint.y - offset * slope })\n }\n restoreLastPoint = null;\n if (bank[bank.length - 1].x == 0) {\n // handle end of island\n restoreLastPoint = bank.pop();\n var offset = unit * .5;\n //offset = (bank[bank.length - 2].x < unit * 2) offset = unit * .01;\n bank.push({ x: restoreLastPoint.x + offset, y: restoreLastPoint.y + offset * slope });\n bank.push({ x: restoreLastPoint.x, y: restoreLastPoint.y + offset * slope });\n }\n ctx.moveTo(-sideOffset, Math.max(bank[0].y, canvas.height - scroll + sideOffset));\n ctx.lineTo(bank[0].x, bank[0].y);\n\n if (bank.length > 2) {\n for (i = 0; i < bank.length - 2; ++i) {\n var a = bank[i];\n var b = bank[i + 1];\n var c = bank[i + 2];\n // fake elevation\n //if ((a.x == b.x && c.x > b.x) || (a.x < b.x && b.x == c.x)) { a.y -= fakeElevation; b.y -= fakeElevation; c.y -= fakeElevation; }\n var ab = subVec(b, a);\n var cb = subVec(b, c);\n var abAbs = absVec(ab);\n var cbAbs = absVec(cb);\n var n1 = normalizeVec(ab);\n var n2 = normalizeVec(cb);\n var offset = Math.min(abAbs / 2, cbAbs / 2, unit * .5);\n var p1 = addVec(a, mulVec(n1, abAbs - offset));\n var p2 = addVec(c, mulVec(n2, cbAbs - offset));\n\n ctx.lineTo(p1.x, p1.y);\n ctx.quadraticCurveTo(b.x, b.y, p2.x, p2.y);\n //ctx.lineTo(p1.x, p1.y);\n //ctx.lineTo(p2.x, p2.y);\n }\n // ctx.lineTo(bank[i].x, bank[i].y);\n }\n ctx.lineTo(bank[bank.length - 1].x, bank[bank.length - 1].y);\n ctx.lineTo(-sideOffset, Math.max(bank[bank.length - 1].y, -scroll - sideOffset));\n\n ctx.closePath();\n ctx.fill();\n if (restoreFirstPoint) {\n bank.shift();\n bank.splice(0, 1, restoreFirstPoint);\n }\n if (restoreLastPoint) {\n bank.pop();\n bank.pop();\n bank.push(restoreLastPoint);\n }\n }\n\n}", "show() {\n push();\n noStroke();\n fill(120, 180, 255, 150);\n\n translate(this.position.x, this.position.y);\n\n if (this.crashed) {\n fill(255, 0, 0);\n\n circle(0, 0, 12);\n\n pop();\n return;\n }\n\n circle(0, 0, 14);\n pop();\n }", "function drawMiniBoardAtPosition(x, y){\n \tvar c = document.getElementById(\"canvas_1\");\n \tvar ctx = c.getContext(\"2d\");\n\n \tvar starting_corner = 25;\n \tvar ending_corner = 475;\n \tvar bigboard_width = 150;\n \tvar smallboard_width = 50;\n \tvar smallboard_offset = 10;\n \tctx.strokeStyle=\"#000000\"; //all black\n ctx.lineWidth = 1;\n //Draw the first smaller board in the upper, left corner\n ctx.moveTo(starting_corner + smallboard_width + (x * bigboard_width), \n starting_corner + smallboard_offset + (y * bigboard_width));\n ctx.lineTo(starting_corner + smallboard_width + (x * bigboard_width), \n starting_corner + 3 * smallboard_width - smallboard_offset + (y * bigboard_width));\n ctx.stroke();\n ctx.moveTo(starting_corner + 2 * smallboard_width + (x * bigboard_width), \n starting_corner + smallboard_offset + (y * bigboard_width));\n ctx.lineTo(starting_corner + 2 * smallboard_width + (x * bigboard_width), \n starting_corner + 3 * smallboard_width - smallboard_offset + (y * bigboard_width));\n ctx.stroke();\n ctx.moveTo(starting_corner + smallboard_offset + (x * bigboard_width), \n starting_corner + smallboard_width + (y * bigboard_width));\n ctx.lineTo(starting_corner + 3 * smallboard_width - smallboard_offset + (x * bigboard_width), \n starting_corner + smallboard_width + (y * bigboard_width));\n ctx.stroke();\n ctx.moveTo(starting_corner + smallboard_offset + (x * bigboard_width), \n starting_corner + 2 * smallboard_width + (y * bigboard_width));\n ctx.lineTo(starting_corner + 3 * smallboard_width - smallboard_offset + (x * bigboard_width), \n starting_corner + 2 * smallboard_width + (y * bigboard_width));\n ctx.stroke();\n\t }", "show() {\n fill(255);\n noStroke();\n let sx = map(this.x/this.z, 0, 1, 0, width);\n let sy = map(this.y/this.z, 0, 1, 0, height);\n let r = map(this.z, 0, width, 8, 0);\n //ellipse(sx, sy, r, r);\n stroke(255);\n let px = map(this.x/this.pz, 0, 1, 0, width);\n let py = map(this.y/this.pz, 0, 1, 0, height);\n line(px,py, sx, sy);\n this.pz = this.z;\n }", "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}", "function placePiece(piece, x, y) {\n // class string\n var cl = \"piece\";\n // white or black\n if (piece[0] == \"w\") {\n cl += \" white\";\n } else {\n cl += \" black\";\n }\n // piece type\n switch(piece[1]) {\n case \"r\":\n cl += \" rook\";\n break;\n case \"n\":\n cl += \" knight\";\n break;\n case \"b\":\n cl += \" bishop\";\n break;\n case \"q\":\n cl += \" queen\";\n break;\n case \"k\":\n cl += \" king\";\n break;\n case \"p\":\n cl += \" pawn\";\n break;\n }\n // add piece to board\n $(\"#\" + x + y).append('<img class=\"' + cl + '\" id=\"' + piece +\n '\" src=\"chess/' + piece[0] + piece[1] + '.png\">');\n}", "function draw() {\n\t// pinta o fundo de cinza\n\tbackground(240);\n\n\tposicao = posicao.add(velocidade);\n\n\tellipse(posicao.x, posicao.y, 50);\n}", "draw() {\r\n this.ctx.save()\r\n this.ctx.translate(this.x + (this.pSize / 2), this.y + (this.pSize / 2))\r\n this.ctx.rotate(this.angle)\r\n this.ctx.translate(-(this.x + (this.pSize / 2)), -(this.y + (this.pSize / 2)))\r\n this.ctx.drawImage(this.pl2, this.x, this.y, this.pSize, this.pSize)\r\n this.ctx.rotate(this.angle)\r\n this.ctx.restore()\r\n }", "function draw() {\n ellipseMode(CENTER);\n drawTrack(h1Pat, whatY(1));\n drawTrack(h2Pat, whatY(2));\n drawTrack(snPat, whatY(3));\n drawTrack(shPat, whatY(4));\n drawTrack(k1Pat, whatY(5));\n drawTrack(k2Pat, whatY(6));\n getTrackCenters();\n}", "makeAMove(whereX, whereY) {\n let lastX = this.whereWasPieceRaisedFromX;\n let lastY = this.whereWasPieceRaisedFromY;\n\n // call the model to do the change and reply with the move's notation\n let moveNotation = this.GameData.movePiece(\n lastX,\n lastY,\n whereX,\n whereY,\n this.removePieceEvent\n );\n this.GameView.addMoveToList(moveNotation); // update the view with the notation\n // update the view with the piece in the new location\n this.GameView.putPieceOnBoard(\n whereX,\n whereY,\n this.GameData.getPieceAt(whereX, whereY).getClassName()\n );\n this.goNextMove(); // next player\n }" ]
[ "0.6511581", "0.65115803", "0.64742166", "0.6404337", "0.62690616", "0.6197641", "0.6186632", "0.61701274", "0.6094864", "0.60929704", "0.60718167", "0.6066706", "0.6045832", "0.6033441", "0.6007734", "0.5976015", "0.59749305", "0.59620893", "0.5957712", "0.5938316", "0.590064", "0.58932", "0.5889348", "0.58874667", "0.5885135", "0.5872186", "0.5869761", "0.58578616", "0.5851123", "0.5819358", "0.5802698", "0.5799596", "0.57939196", "0.5785478", "0.57809234", "0.57689124", "0.57660604", "0.5764825", "0.576016", "0.57519567", "0.5750283", "0.57473576", "0.57375354", "0.5727682", "0.5721218", "0.570963", "0.57039154", "0.57016164", "0.5699003", "0.56625545", "0.5658431", "0.5635413", "0.56345314", "0.56294245", "0.56241876", "0.5623144", "0.56205654", "0.561721", "0.55975443", "0.559736", "0.55970806", "0.5595751", "0.55876833", "0.5580005", "0.5576962", "0.5571842", "0.5544948", "0.554402", "0.5541057", "0.5536576", "0.5515143", "0.55148715", "0.55137944", "0.55089945", "0.5507771", "0.55076206", "0.5504465", "0.5495208", "0.5492597", "0.549055", "0.54896045", "0.548868", "0.548435", "0.54783475", "0.5477304", "0.5475953", "0.5472486", "0.54700553", "0.5467502", "0.5466778", "0.54667014", "0.5463852", "0.5458641", "0.5458562", "0.5456745", "0.5455059", "0.5453867", "0.5453696", "0.54480207", "0.5446173", "0.54461527" ]
0.0
-1
Copy values from player into arena
function merge(arena, player) { player.matrix.forEach((row, y) => { row.forEach((value, x) => { if (value !== 0) { arena[y + player.pos.y][x + player.pos.x] = value; } }); }); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function merge(arena, player) { //merge function puts the last position of the piece on the arena, so that we maintain the status of the pieces that have been played previously\n player.matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if (value !== 0) {\n arena[y + player.pos.y][x + player.pos.x] = value;\n }\n });\n });\n}", "function merge(arena, player) {\n player.matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if (value !== 0) {\n arena[y + player.pos.y][x + player.pos.x] = value;\n }\n });\n });\n}", "function merge(arena, player) {\n player.matrix.forEach((row, y) => {\n row.forEach((val, x) => {\n if(val !== 0) {\n arena[y + player.pos.y][x + player.pos.x] = val;\n }\n });\n });\n}", "function merge(arena, player) {\n player.matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if(value !== 0) {\n arena[y + player.pos.y][x + player.pos.x] = value;\n }\n });\n });\n}", "function merge(arena, player) {\n player.matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if(value !== 0) {\n arena[y+player.pos.y][x+player.pos.x] = value;\n }\n });\n });\n}", "function merge(arena, player){\n player.matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if(value !== 0){\n arena[y + player.pos.y][x + player.pos.x] = value;\n }\n });\n });\n}", "function merge(player) {\n player.matrix.forEach((row, y) => {\n row.forEach((value, x) => {\n if (value !== 0) {\n player.arena[y + player.pos.y][x + player.pos.x] = value;\n }\n });\n });\n}", "function createInitialArena(humanPlayers, AIs) {\n if (humanPlayers + AIs > 4){\n console.log(\"More than 4 players WTH!!!\");\n }\n \n \n var player1 = new Player({cx: 40*1, cy: 40*1, width: 36, height: 36,\n keyUp: 'W'.charCodeAt(0), \n keyDown: 'S'.charCodeAt(0), \n keyLeft: 'A'.charCodeAt(0), \n keyRight: 'D'.charCodeAt(0),\n keyPutBomb: ' '.charCodeAt(0),\n commandObject: keys\n });\n \n var player2 = new Player({cx: 40*13, cy: 40*1, width: 36, height: 36,\n keyUp: 'I'.charCodeAt(0), \n keyDown: 'K'.charCodeAt(0), \n keyLeft: 'J'.charCodeAt(0), \n keyRight: 'L'.charCodeAt(0),\n keyPutBomb: 'O'.charCodeAt(0),\n commandObject: keys \n });\n \n var player3 = new Player({cx: 40*1, cy: 40*13, width: 36, height: 36,\n keyUp: 38, // up arrow\n keyDown: 40, // down arrow\n keyLeft: 37, // left arrow\n keyRight: 39, // right arrow\n keyPutBomb: 13, // enter\n commandObject: keys \n });\n \n var player4 = new Player({cx: 40*13, cy: 40*13, width: 36, height: 36,\n keyUp: 38, // up arrow\n keyDown: 40, // down arrow\n keyLeft: 37, // left arrow\n keyRight: 39, // right arrow\n keyPutBomb: 13, // enter\n commandObject: keys \n });\n \n \n \n \n // Create AI players and command objects\n g_aiCommands.ai1 = {};\n var aiPlayer1 = new Player({cx: 40*1, cy: 40*1, width: 36, height: 36,\n keyUp: consts.CONTROLS.UP, keyDown: consts.CONTROLS.DOWN, \n keyLeft: consts.CONTROLS.LEFT, keyRight: consts.CONTROLS.RIGHT,\n keyPutBomb: consts.CONTROLS.PUT_BOMB,\n commandObject: g_aiCommands.ai1\n });\n \n g_aiCommands.ai2 = {};\n var aiPlayer2 = new Player({cx: 40*13, cy: 40*1, width: 36, height: 36,\n keyUp: consts.CONTROLS.UP, keyDown: consts.CONTROLS.DOWN, \n keyLeft: consts.CONTROLS.LEFT, keyRight: consts.CONTROLS.RIGHT,\n keyPutBomb: consts.CONTROLS.PUT_BOMB,\n commandObject: g_aiCommands.ai2\n });\n \n g_aiCommands.ai3 = {};\n var aiPlayer3 = new Player({cx: 40*1, cy: 40*13, width: 36, height: 36,\n keyUp: consts.CONTROLS.UP, keyDown: consts.CONTROLS.DOWN, \n keyLeft: consts.CONTROLS.LEFT, keyRight: consts.CONTROLS.RIGHT,\n keyPutBomb: consts.CONTROLS.PUT_BOMB,\n commandObject: g_aiCommands.ai3\n });\n \n g_aiCommands.ai4 = {};\n var aiPlayer4 = new Player({cx: 40*13, cy: 40*13, width: 36, height: 36,\n keyUp: consts.CONTROLS.UP, keyDown: consts.CONTROLS.DOWN, \n keyLeft: consts.CONTROLS.LEFT, keyRight: consts.CONTROLS.RIGHT,\n keyPutBomb: consts.CONTROLS.PUT_BOMB,\n commandObject: g_aiCommands.ai4\n });\n \n var players = []; //\n var ai1added = false;\n var ai2added = false;\n var ai3added = false;\n var ai4added = false;\n \n // Fill in slots 1, 4, 2 and 3 in that order\n // Determine slot 1\n if(humanPlayers > 0){\n players.push(player1);\n humanPlayers--;\n }else if(AIs > 0 ){\n players.push(aiPlayer1);\n AIs--;\n ai1added = true;\n }\n \n // Determine slot 4\n if(humanPlayers > 0){\n players.push(player4);\n humanPlayers--;\n }else if(AIs > 0 ){\n players.push(aiPlayer4);\n AIs--;\n ai4added = true;\n }\n \n // Determine slot 2\n if(humanPlayers > 0){\n players.push(player2);\n humanPlayers--;\n }else if(AIs > 0 ){\n players.push(aiPlayer2);\n AIs--;\n ai2added = true;\n }\n \n // Determine slot 3\n if(humanPlayers > 0){\n players.push(player3);\n humanPlayers--;\n }else if(AIs > 0 ){\n players.push(aiPlayer3);\n AIs--;\n ai3added = true;\n }\n \n \n // Initialize arena\n var arena = new Arena(players);\n \n // create Ais for ai players\n var p1Ai = new AI(arena, aiPlayer1, g_aiCommands.ai1);\n var p2Ai = new AI(arena, aiPlayer2, g_aiCommands.ai2);\n var p3Ai = new AI(arena, aiPlayer3, g_aiCommands.ai3);\n var p4Ai = new AI(arena, aiPlayer4, g_aiCommands.ai4);\n \n // add AIs to the entity manager\n if(ai1added){\n entityManager.addAi(p1Ai);\n }\n if(ai2added){\n entityManager.addAi(p2Ai);\n }\n if(ai3added){\n entityManager.addAi(p3Ai);\n }\n if(ai4added){\n entityManager.addAi(p4Ai);\n }\n \n // Set the newly created arena as the default arena\n entityManager.setDefaultArena(arena);\n \n}", "assign(){\n index = this.index; \n PlayerIndex = this.playerIndex;\n block = this.block;\n turn = this.turn;\n }", "function arenaUpdate() {\n\tarena.currentTime = (new Date()).getTime();\n\tarena.numOfConnections = Object.keys(io.sockets.sockets).length;\n\t//console.log(\"Connections: \" + Object.keys(io.sockets.sockets).length);\n\t\n\t// Handle created non-player objects.\n\tarena.missiles.forEach(function(missile, index) {\n\t\tmissile.position.x += Math.cos(missile.heading) * (missile.speed / arena.frameRate);\n\t\tmissile.position.y += Math.sin(missile.heading) * (missile.speed / arena.frameRate);\n\t\tmissile.distanceSqr = distanceSqr(missile.startPoint, missile.position);\n\n\t\t// If missle goes out of arena it is gone no explosion. (yet)\n\t\tif (missile.position.x < 0 || missile.position.x > arena.size.x ||\n\t\t\tmissile.position.y < 0 || missile.position.y > arena.size.y\n\t\t) { arena.missiles.splice(index, 1); }\n\t\t\n\t\tif (missile.distanceSqr > (missile.range * missile.range)) {\n\t\t\t// Handle explosion, and then remove missle from list.\n\t\t\tfor(var socketId in arena.users) {\n\t\t\t\tif (arena.users[socketId].type != \"robot\") continue; // Skip over arenaViewers.\n\t\t\t\tif (arena.users[socketId].robot.dead) continue;\n\t\t\t\tvar dist_M2R_Sqr = distanceSqr(arena.users[socketId].robot.position, missile.position);\n\t\t\t\t\n\t\t\t\tif (dist_M2R_Sqr <= 2500) {\n\t\t\t\t\tarena.users[socketId].robot.damage += ((2500 - dist_M2R_Sqr) / 250);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (arena.users[socketId].robot.damage >= 100) {\n\t\t\t\t\tif (!arena.scoreBoard[(arena.users[socketId].robot.name)]) {\n\t\t\t\t\t\tarena.scoreBoard[(arena.users[socketId].robot.name)] = {};\n\t\t\t\t\t\tarena.scoreBoard[(arena.users[socketId].robot.name)].kills = 0;\n\t\t\t\t\t\tarena.scoreBoard[(arena.users[socketId].robot.name)].deaths = 0;\n\t\t\t\t\t}\n\t\t\t\t\tarena.scoreBoard[arena.users[socketId].robot.name].kills++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tarena.missiles.splice(index, 1);\n\t\t}\n\t});\n\t\n\tvar userIndex = -1;\n\tfor(var socketId in arena.users) {\n\t\tuserIndex++;\n\t\tarena.users[socketId].index = userIndex;\n\t\t\n\t\tif (arena.currentTime - arena.users[socketId].ping > 60000) {\n\t\t\tuserDisconnet(socketId, \"forced_disconnect\");\n\t\t\tcontinue;\n\t\t}\n\t\tif (typeof arena.users[socketId].type == \"undefined\") { continue; }\n\t\t\n\t\tswitch (arena.users[socketId].type) {\n\t\t\tcase \"arenaViewer\":\n\t\t\t\t// Only arenaViewers should be allowed some of this detailed information.\n\t\t\t\tliveArena.to(socketId).emit(\"users\", arena);\n\t\t\t\tbreak;\n\t\t\tcase \"robot\":\n\t\t\t\tarena.users[socketId].robot.arenaCurrentTime = (new Date()).getTime();\n\t\t\t\tarena.users[socketId].robot.robotIndex = userIndex;\n\t\t\t\t\n\t\t\t\tif (!arena.users[socketId].robot.dead) {\n\t\t\t\t\tif (arena.users[socketId].robot.damage >= 100) {\n\t\t\t\t\t\tarena.users[socketId].robot.damage = 100;\n\t\t\t\t\t\tarena.users[socketId].robot.dead = true;\n\t\t\t\t\t\tif (!arena.scoreBoard[(arena.users[socketId].robot.name)]) {\n\t\t\t\t\t\t\tarena.scoreBoard[(arena.users[socketId].robot.name)] = {};\n\t\t\t\t\t\t\tarena.scoreBoard[(arena.users[socketId].robot.name)].kills = 0;\n\t\t\t\t\t\t\tarena.scoreBoard[(arena.users[socketId].robot.name)].deaths = 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tarena.scoreBoard[(arena.users[socketId].robot.name)].deaths++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tarena.users[socketId].robot.damage -= 0.005;\n\t\t\t\t\t\tif (arena.users[socketId].robot.damage < 0) arena.users[socketId].robot.damage = 0;\n\t\t\t\t\t}\n\t\t\t\t\tarena.users[socketId].robot.position.x += Math.cos(arena.users[socketId].robot.heading) * (arena.users[socketId].robot.speed / arena.frameRate);\n\t\t\t\t\tarena.users[socketId].robot.position.y += Math.sin(arena.users[socketId].robot.heading) * (arena.users[socketId].robot.speed / arena.frameRate);\n\t\t\t\t\tif (arena.users[socketId].robot.position.x < 0) { arena.users[socketId].robot.position.x = 0; arena.users[socketId].robot.speed = 0; }\n\t\t\t\t\tif (arena.users[socketId].robot.position.x > arena.size.x) { arena.users[socketId].robot.position.x = arena.size.x; arena.users[socketId].robot.speed = 0; }\n\t\t\t\t\tif (arena.users[socketId].robot.position.y < 0) { arena.users[socketId].robot.position.y = 0; arena.users[socketId].robot.speed = 0; }\n\t\t\t\t\tif (arena.users[socketId].robot.position.y > arena.size.y) { arena.users[socketId].robot.position.y = arena.size.y; arena.users[socketId].robot.speed = 0; }\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tliveArena.to(socketId).emit(\"robotStatus\", arena.users[socketId].robot);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t}\n\t}\n}", "function merge(arena, piece){\r\n piece.matrix.forEach((row, y) =>{\r\n row.forEach((value, x) => {\r\n if(value !== 0){\r\n arena[y + piece.pos.y][x+ piece.pos.x] = value;\r\n }\r\n });\r\n });\r\n }", "function playerSetup() {\n playerName = playerStats.name;\n playerHealth = playerStats.health;\n playerMaxHealth = playerStats.maxhealth;\n playerEndurance = playerStats.endurance;\n playerAttack = playerStats.attack;\n playerDefense = playerStats.defense;\n playerAcornCoin = playerStats.acorncoin;\n playerMushroomCoin = playerStats.mushroomcoin;\n playerBearclawCoin = playerStats.bearclawcoin;\n leafCoin = playerStats.leafcoin;\n}", "copyState(state){\n\n var remotePlayers = state.players;\n\n // remove old players\n for(var i in this.players){\n if(!remotePlayers.hasOwnProperty(i)){\n delete this.players[i];\n }\n }\n\n // Update and add any new players \n for(var i in remotePlayers){\n var remotePlayer = remotePlayers[i];\n \n if(!this.players.hasOwnProperty(remotePlayer.id)){\n console.log('copying unknown player');\n this.players[remotePlayer.id] = new Player();\n }\n \n var localPlayer = this.players[remotePlayer.id];\n \n \n localPlayer.state = remotePlayer;\n }\n\n\n\n var remoteMap = state.map;\n this.map.state = remoteMap;\n\n \n }", "function placePlayer() {\n player.position = {\n row: Math.floor(board.length / 2),\n column: Math.floor(board[0].length / 2),\n };\n getPlayerPosition().push(player);\n}", "set(p, gb, p1p, p2p) {\n this._phase = p;\n // clone this._board\n for (let x = 0; x < 6; x++) {\n for (let y = 0; y < 6; y++) {\n this._board[x][y] = gb[x][y];\n }\n }\n // clone player pieces\n for (let i = 0; i < 6; i++) {\n this._player_1_pieces[i] = p1p[i];\n this._player_2_pieces[i] = p2p[i];\n }\n }", "function createArena() { // creates the arena randomly\r\n arena = new Array(arenaY);\r\n for (i = 0; i < arena.length; i++) { // creates large 2d array without needing to write the entire thing out\r\n arena[i] = new Array(arenaX);\r\n }\r\n jumpDistance = Math.round(jump * 2 *(maxVel / 10)) + maxVel + 2;\r\n y = arenaY / 3 * 2;\r\n yChange = 0;\r\n xChange = 0;\r\n for (x = 0; x < arenaX; x += xChange - 1) {\r\n for (i = 0; i < maxVel; i++) {\r\n arena[y][x + i] = 1;\r\n } \r\n yChange = Math.floor(Math.floor(Math.random() * jumpDistance) / arenaUnit);\r\n xChange = jumpDistance - yChange - Math.floor(Math.random() * (jumpDistance - yChange))\r\n while (xChange < maxVel + 1) {\r\n xChange++;\r\n }\r\n while ((xChange > maxVel + 1) && (xChange < maxVel + 5)) {\r\n xChange++;\r\n }\r\n y -= yChange;\r\n } \r\n }", "function setupPlayer() {\n playerX = 4 * width / 5;\n playerY = height / 2;\n playerHealth = playerMaxHealth;\n playerStamina = playerMaxStamina;\n}", "setArena(arena)\n {\n this.arena = arena;\n }", "constructor(player) {\n this.board = [[ '', '', ''], [ '', '', ''], [ '', '', '']];\n this.gameOver = false;\n this.player = player;\n this.spaces = 9;\n this.map = {\n 0: [0, 0],\n 1: [1, 0],\n 2: [2, 0],\n 3: [0, 1],\n 4: [1, 1],\n 5: [2, 1],\n 6: [0, 2],\n 7: [1, 2],\n 8: [2, 2]\n }\n }", "placePlayers() {\n this.players.forEach((player) => {\n player.initPlayer(this.map);\n this.map.addPlayerToCell(player);\n });\n }", "function placeBets(player)\n{\n if(player.active===true)\n {\n player.money = player.money-15;\n dealer.money = dealer.money+15;\n }\n return player;\n}", "function generate_player_data(player_id) {\n\tvar cards = genShuffledDeck();\n\tvar i;\n\tvar pile = [];\n\tvar home = [];\n\tvar zones = [[],[],[],[]];\n\t\n/*\tfor (i=0; i<52; i++)\n\t\tif (cards[i] % 13 == 0) {\n\t\t\tvar t = cards[i];\n\t\t\tcards[i] = cards[3];\n\t\t\tcards[3] = t;\n\t\t\tbreak;\n\t\t}\n*/\n\n\tfor (i=0;i<13;i++) pile[i] = cards.pop();\n\tfor (i=0;i<35;i++) home[i] = cards.pop();\n\tfor (i=0;i<4;i++) zones[i][0] = cards.pop();\n\tvar player = {\n\t\tid: player_id,\n\t\tscore: 0,\n\t\tstandby: false,\n\t\trequested_end: false,\n\t\tpile: pile,\n\t\thome: home,\n\t\tcut: 32,//Player can see home[cut](top) to home[bot](bottom)\n\t\tbot: 34,\n\t\tzones: zones,\n\n\t\tget_overview: function(){\n\t\t\treturn {\n\t\t\t\tname: map_id_to_name[this.id],\n\t\t\t\tscore: this.score,\n\t\t\t\trequested_end: this.requested_end,\n\t\t\t\tpile: this.pile[this.pile.length-1],\n\t\t\t\tpile_count: this.pile.length,\n\t\t\t\thome_count: this.cut,\n\t\t\t\thomeside: this.home.slice(this.cut, this.bot+1).reverse(),\n\t\t\t\tzones: this.zones,\n\t\t\t};\n\t\t},\n\t\thomenext: function(){\n\t\t\tthis.bot = this.cut-1;\n\t\t\tif (this.cut == 0)\n\t\t\t\tthis.cut = this.home.length;\n\t\t\telse {\n\t\t\t\tthis.cut -= 3;\n\t\t\t\tif (this.cut < 0) this.cut = 0;\n\t\t\t}\n\t\t},\n\t\tmove: function(srcz, srcf, dstz){\n\t\t\tvar srccard = this.get_card_value(srcz, srcf);\n\t\t\tvar dstcard = this.zones[dstz][this.zones[dstz].length-1];\n\t\t\tconsole.log('move '+srccard+' to '+dstcard);\n\t\t\tif (dstcard >= 0 && dstcard <=51) {\n\t\t\t\tif ((srccard+1+39-dstcard)%26 != 0 || srccard % 13 == 12) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (srcz < 4) {\n\t\t\t\tthis.zones[dstz] = this.zones[dstz].concat(this.zones[srcz].splice(srcf, this.zones[srcz].length-srcf));\n\t\t\t}\n\t\t\telse if (srcz == 4) {\n\t\t\t\tthis.zones[dstz] = this.zones[dstz].concat(this.home.splice(this.cut, 1));\n\t\t\t\tif (this.bot > this.cut) this.bot -= 1;\n\t\t\t}\n\t\t\telse if (srcz == 5) {\n\t\t\t\tthis.zones[dstz].push(this.pile.pop());\n\t\t\t\tthis.score += 2;\n\t\t\t}\n\t\t\treturn true;\n\t\t},\n\t\tget_card_value: function(z, f){\n\t\t\tif (z < 4)\n\t\t\t\treturn this.zones[z][f];\n\t\t\telse if (z == 4)\n\t\t\t\treturn this.home[this.cut];\n\t\t\telse if (z == 5)\n\t\t\t\treturn this.pile[this.pile.length-1];\n\t\t},\n\t\tabandon: function(z){\n\t\t\tif (z < 4) {\n\t\t\t\tif (this.zones[z].length > 0) {\n\t\t\t\t\tthis.zones[z].pop();\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (z == 4) {\n\t\t\t\tif (this.cut < home.length && this.cut >= 0) {\n\t\t\t\t\tthis.home.splice(this.cut, 1);\n\t\t\t\t\tif (this.bot > this.cut) this.bot -= 1;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse if (z == 5) {\n\t\t\t\tif (this.pile.length > 0) {\n\t\t\t\t\tthis.pile.pop();\n\t\t\t\t\tthis.score += 2;\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tconsole.error('Abandoning a nonexistent card!');\n\t\t\t}\n\t\t},\n\t};\n\treturn player;\n}", "function setProfilePlayerDataFromValues(){\n \tgameData.data.player.profile.name = $(\"#name\").val();\n \tgameData.data.player.profile.surname = $(\"#surname\").val();\n \tgameData.data.player.profile.sex = $(\"#sex\").val();\n \tgameData.data.player.profile.age = $(\"#age\").val(); \n \tgameData.data.player.profile.mobile = $(\"#mobile\").val();\n \tgameData.data.synch.profile = CORE.getCurrentTime();\n \tgameData.saveLocal();\n \t\n \tgameData.pushProfile();\n \tCORE.LOG.addInfo(\"PROFILE_PAGE:setProfilePlayerDataFromValues\");\n }", "function updateBoard(){\n draw(levelMap);\n\n /*\n levelMap[player.getCurrentPosition().y][player.getCurrentPosition().x] = 1;\n levelMap[enemy.getCurrentPosition().y][enemy.getCurrentPosition().x] = 2;\n\n if(player.getCurrentPosition().y == levelMap.length - 1) player.setGoalReached(true);\n if(enemy.getCurrentPosition().y == 0) enemy.setGoalReached(true);\n\n draw(levelMap);\n\n //Clean the cells where the player was standed\n levelMap[player.getCurrentPosition().y][player.getCurrentPosition().x] = 0;\n levelMap[enemy.getCurrentPosition().y][enemy.getCurrentPosition().x] = 0;\n\n //Read the x and y positions of player and enemy to put them in the board\n if(!player.getGoalReached()){\n player.setCurrentPosition(player.getCurrentPosition().x,player.getCurrentPosition().y+1);\n }\n\n if(!enemy.getGoalReached()){\n enemy.setCurrentPosition(enemy.getCurrentPosition().x,enemy.getCurrentPosition().y-1);\n }\n */\n}", "function arena_sweep() {\n let row_count = 1;\n outer: for(let y = arena.length - 1; y >= 0; y--) {\n for (let x = 0; x < arena[y].length; x++) {\n if (arena[y][x] === 0) {\n continue outer;\n }\n }\n const row = arena.splice(y, 1)[0].fill(0);\n arena.unshift(row);\n ++y;\n player.score += row_count * 10;\n row_count *= 2;\n }\n}", "populate({ playerData }) {\n\n if (playerData) {\n\n Object.assign(this, playerData);\n\n }\n\n }", "function setupPlayer() {\n playerX = 4 * width / 5;\n playerY = height / 2;\n playerHealth = playerMaxHealth;\n}", "function setupPlayer() {\n playerX = 4 * width / 5;\n playerY = height / 2;\n playerHealth = playerMaxHealth;\n}", "function setupPlayer() {\n playerX = 4 * width / 5;\n playerY = height / 2;\n playerHealth = playerMaxHealth;\n}", "function setupPlayer() {\n playerX = (4*width/5);\n playerY = (height/2);\n playerHealth = playerMaxHealth;\n}", "function set_player_loc(x, y) {\n player['x'] = x;\n player['newx'] = x;\n player['y'] = y;\n player['newy'] = y\n}", "function updatePlayers(listOfPlayers) {\n allPlayers = listOfPlayers;\n}", "function setupPlayer() {\n playerX = 4*width/5;\n playerY = height/2;\n playerHealth = playerMaxHealth;\n}", "startGame() {\n this.playerOne = new Player(p1Name, true);\n this.playerTwo = new Player(p2Name, false);\n this.masterBoardArray = this.playerOne.boardArray.concat(this.playerTwo.boardArray);\n this.render();\n }", "function resetPlayers() {\n this.playerStates = [];\n const usedPositions = [];\n for (const player of SNAKE_GAME_CONFIG.playerDefs) {\n let randomPosition = getUnoccupiedPosition.call(this);\n this.playerStates.push({\n direction: null,\n score: 0,\n length: SNAKE_GAME_CONFIG.startLength,\n positions: [randomPosition],\n alive: true\n });\n }\n}", "function arenaSweep() {\n let rowCount = 1;\n \n //Check for the empty spaces in the blocks\n //in general\n outer: for(let y = arena.length - 1; y > 0; --y) {\n for(let x = 0; x < arena[y].length; ++x) {\n \n //Checking if the row is fully populated\n if(arena[y][x] === 0) {\n continue outer;\n }\n }\n \n //Creating the empty row\n const row = arena.splice(y, 1)[0].fill(0);\n arena.unshift(row);\n ++y;\n \n //Counting score\n player.score += rowCount * 10;\n rowCount *= 2;\n }\n}", "static randomizePlayers() {\n let arr = shuffle([1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2])\n for (const index in arr) {\n let ter = Territory.find(parseInt(index) + 1)\n ter.player_id = arr[index]\n }\n }", "setPlayersData (data) {\n console.log('SETTING PLAYER DATA')\n console.log('')\n var i = 0\n THIS.playerList = []\n for (var i = 0; i < data.players.length; i++) {\n var player = data.players[i]\n var p = new Player(i, player.name, i)\n p.reinforcements = data.players[i].reinforcements\n p.tokens.tok1 = data.players[i].tokens.tok1\n p.tokens.tok2 = data.players[i].tokens.tok2\n p.tokens.tok3 = data.players[i].tokens.tok3\n p.tokens.tok4 = data.players[i].tokens.tok4\n console.log('player is set :')\n console.log(p)\n THIS.playerList.push(p)\n if (localStorage.login === data.players[i].name) {\n THIS.view.localNbTokenTypeJoker = data.players[i].tokens.tok1\n THIS.view.localNbTokenTypeOne = data.players[i].tokens.tok2\n THIS.view.localNbTokenTypeTwo = data.players[i].tokens.tok3\n THIS.view.localNbTokenTypeThree = data.players[i].tokens.tok4\n }\n }\n console.log('this playerlist is set')\n console.log(THIS.playerList)\n\n // The player list is copyied to the view\n THIS.view.players = THIS.playerList\n }", "function make_map(stage){\r\n stage.addPlayer(new Player(stage,images.naked_player ,Math.floor(stage.width/2), Math.floor(stage.height/2),player_width,player_height));\r\n stage.addItem(new Gun(stage,images.machine_gun,40,40,100,100,'gun'));\r\n stage.addItem(new Gun(stage,images.pistol,80,80,2300,2200,'gun'));\r\n stage.addItem(new Ammo(stage,images.ammo,20,20,2200,2200,'ammo'));\r\n stage.addItem(new Item(stage,images.health_pack,20,20,2300,2300,'health'));\r\n\r\n var canvw = stage.width;\r\n var canvl = stage.height;\r\n for (var i = 0; i<30; i++){\r\n x = randint(canvw);\r\n y = randint(canvl);\r\n stage.addItem(new Gun(stage,images.pistol,80,80,x,y,'gun'));\r\n\r\n }\r\n for (var i = 0; i<trees.length; i++){\r\n stage.addHittable(new hittableObject(stage,'sprites/tree.png',100,100,trees[i][0],trees[i][1],true));\r\n }\r\n\r\n for (var i = 0; i<rocks.length; i++){\r\n stage.addHittable(new hittableObject(stage,'sprites/rock.png',70,70,rocks[i][0],rocks[i][1],false));\r\n }\r\n for (var i = 0; i<npcs.length; i++){\r\n stage.addEnemy(new NPC_Enemies(stage, images.gun_player ,npcs[i][0], npcs[i][1],player_width,player_height));\r\n }\r\n var game_house = new house(stage,images.house_outside,1000,1000,4000,0);\r\n stage.type.house = game_house;\r\n \r\n\r\n\r\n}", "insertPlayerPos(blankGrid, playerPos) {\n blankGrid[playerPos[0]][playerPos[1]] = 'X'\n return blankGrid;\n }", "choosePlayer() {\n player.sprite = document.formular.player.value;\n player.moves = true;\n }", "function newPlayer(player) {\r\n var homeRow;\r\n var goalRow;\r\n if (player === 0) {\r\n homeRow = 8;\r\n goalRow = 0;\r\n\r\n }\r\n if (player === 1) {\r\n homeRow = 0;\r\n goalRow = 8;\r\n }\r\n return {\r\n i: 4,\r\n j: homeRow,\r\n walls: 10,\r\n score: 8,\r\n goalRow: goalRow\r\n };\r\n }", "function insert_stats(src_player, dest_player, callback) {\n dest_player[\"mins\"] = src_player.overallPlayerDashboard[0].min;\n dest_player[\"fg_pct\"] = src_player.overallPlayerDashboard[0].fgPct;\n dest_player[\"ft_pct\"] = src_player.overallPlayerDashboard[0].ftPct;\n dest_player[\"fga\"] = src_player.overallPlayerDashboard[0].fga;\n dest_player[\"fta\"] = src_player.overallPlayerDashboard[0].fta;\n dest_player[\"threes_pg\"] = src_player.overallPlayerDashboard[0].fG3M;\n dest_player[\"rebs\"] = src_player.overallPlayerDashboard[0].reb;\n dest_player[\"asts\"] = src_player.overallPlayerDashboard[0].ast;\n dest_player[\"stls\"] = src_player.overallPlayerDashboard[0].stl;\n dest_player[\"blks\"] = src_player.overallPlayerDashboard[0].blk;\n dest_player[\"tovs\"] = src_player.overallPlayerDashboard[0].tov;\n dest_player[\"pts\"] = src_player.overallPlayerDashboard[0].pts;\n return callback(dest_player);\n}", "function place_player()\n{\n\tvar col;\n\tvar row;\n\t\n\tswitch(player_number)\n\t{\n\t\tcase 0:\n\t\t\tif(is_two_player_game)\n\t\t\t{\n\t\t\t\tcol = 27;\n\t\t\t\trow = 20;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcol = 27;\n\t\t\t\trow = 19;\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\tif(is_two_player_game)\n\t\t\t{\n\t\t\t\tcol = 29;\n\t\t\t\trow = 20;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tcol = 29;\n\t\t\t\trow = 21;\n\t\t\t}\n\t\t\t\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcol = 29;\n\t\t\trow = 19;\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tcol = 27;\n\t\t\trow = 21;\n\t\t\tbreak;\n\t}\n\t\n\tvar player_text = Crafty.e(\"2D, DOM, Text\")\n\t\t.attr({x: col * 16, y: row * 16 - 15, w: 75})\n\t\t.textColor('#FFFFFF')\n\t\t.text(list_of_users[player_number]);\n\t\t\n\tplayer = Crafty.e('PlayerCharacter').at(col, row).attach(player_text);\n}", "function moveAllPlayers() {\n for (const player of this.playerStates) {\n if (player.direction && player.alive) {\n const oldPositions = player.positions.slice();\n player.positions[0] = {\n x: player.positions[0].x + player.direction.x,\n y: player.positions[0].y + player.direction.y\n };\n\n if (player.positions[0].x < 0) {\n player.positions[0].x += SNAKE_GAME_CONFIG.gridSize.width;\n }\n if (player.positions[0].x >= SNAKE_GAME_CONFIG.gridSize.width) {\n player.positions[0].x -= SNAKE_GAME_CONFIG.gridSize.width;\n }\n if (player.positions[0].y < 0) {\n player.positions[0].y += SNAKE_GAME_CONFIG.gridSize.height;\n }\n if (player.positions[0].y >= SNAKE_GAME_CONFIG.gridSize.height) {\n player.positions[0].y -= SNAKE_GAME_CONFIG.gridSize.height;\n }\n\n for (let i = 1; i < player.positions.length; i++) {\n player.positions[i] = oldPositions[i - 1];\n }\n if (player.positions.length < player.length) {\n player.positions.push(oldPositions[oldPositions.length - 1]);\n }\n }\n }\n}", "function reset(player) {\n const pieces = 'TJLOSZI';\n player.matrix = createPiece(pieces[pieces.length * Math.random() | 0]);\n player.pos.y = 0;\n player.pos.x = (player.arena[0].length / 2 | 0) - (player.matrix[0].length / 2 | 0);\n\n //when game ends\n if (collide(player)) {\n player.arena.forEach(row => row.fill(0));\n }\n}", "getUpdatedPlayerData(player) {\n\n let playerData = {\n id: player.id,\n name: player.name,\n isDead: player.isDead,\n deathAnimationTime: player.deathAnimationTime,\n isStunt: player.isStunt,\n color: player.color,\n bombs: player.bombs,\n canKickBombs: player.canKickBomb,\n canThrowBomb: player.canThrowBomb,\n bombRange: player.bombRange / 50,\n speed: player.speed / 5,\n xPos: player.xPos,\n yPos: player.yPos\n\n }\n return playerData;\n\n }", "function arenaSweep() {\n var rowcount = 1;\n outer: for(var y = arena.length - 1; y > 0; y--){\n for(var x = 0; x < arena[y].length; x++){\n if(arena[y][x] === 0) {\n continue outer;\n }\n }\n\n const row = arena.splice(y, 1)[0].fill(0);\n arena.unshift(row);\n y++;\n\n player.score += rowcount*10;\n rowcount *= 2;\n }\n\n if(rowcount > 1) {\n clear.play();\n }\n}", "function player_reset() {\n const pieces = 'ILJOTSZ';\n player.matrix = create_piece(pieces[pieces.length * Math.random() | 0]);\n player.pos.y = 0;\n player.pos.x = (arena[0].length / 2 | 0) - (player.matrix[0].length / 2 | 0);\n if (collide(arena, player)) {\n arena.forEach(row => row.fill(0));\n player.score = 0;\n update_score();\n }\n}", "function initPlayers(scene) {\n for (let id in gameState.coords) {\n if (id != PLAYER_ID) {\n if (!(id in players)) { //new player\n const coords = gameState.coords[id];\n cursors[id] = {right: false, left: false, up: false, down: false};\n positions[id] = {x: coords.x, y: coords.y};\n players[id] = scene.physics.add.sprite(coords.x, coords.y, 'hemadi', 'walk_down_2.png');\n players[id].anims.play('walk_down');\n scene.physics.add.collider(players[id], collideLayer);\n }\n }\n }\n}", "start(playerOneName, playerTwoName) {\n this.players.push(new Player(playerOneName));\n this.players.push(new Player(playerTwoName));\n let d = new Deck();\n d.createDeck();\n d.shuffleDeck(); \n this.players[0].playerCards = d.cards.splice(0, 2);\n this.players[1].playerCards = d.cards.splice(0, 2);\n this.cardsInMiddle = d;\n this.players[0].playerChips = 2;\n this.players[1].playerChips = 2;\n }", "function assignPokemonStats(stats, player) {\n // console.log(stats)\n stats.forEach(function(statObject) {\n switch(statObject.stat.name){\n case \"hp\":\n if (player === \"me\") { \n yourPokemonHP = statObject.base_stat\n } else {\n randomPokemonHP = statObject.base_stat;\n };\n break;\n case \"attack\":\n if (player === \"me\") {\n yourAttack = statObject.base_stat;\n } else {\n randomPokemonAttack = statObject.base_stat;\n }\n break;\n case \"defense\":\n if (player === \"me\") {\n yourDefense = statObject.base_stat;\n } else {\n randomPokemonDefense = statObject.base_stat; \n }\n break;\n }\n })\n // console.log(`This is your HP: ${yourPokemonHP}. This is your attack: ${yourAttack}.\n // This is your defense: ${yourDefense}. This is random HP: ${randomPokemonHP}. \n // This is random attack: ${randomPokemonAttack}.\n // This is random defense: ${randomPokemonDefense}.`) \n }", "setPlayers() {\n\n GameElements.players[0].xPos = 50;\n GameElements.players[0].yPos = 50;\n GameElements.players[0].position = 17;\n GameElements.players[0].state = Player.STATES.PLAYING;\n GameElements.players[0].color = Player.COLORS.WHITE;\n\n if (REQUIRED_PLAYERS > 1) {\n GameElements.players[1].xPos = 650;\n GameElements.players[1].yPos = 50;\n GameElements.players[1].position = 29;\n GameElements.players[1].state = Player.STATES.PLAYING;\n GameElements.players[1].color = Player.COLORS.BLACK;\n }\n if (REQUIRED_PLAYERS > 2) {\n GameElements.players[2].xPos = 50;\n GameElements.players[2].yPos = 550;\n GameElements.players[2].position = 167;\n GameElements.players[2].state = Player.STATES.PLAYING;\n GameElements.players[2].color = Player.COLORS.BLUE;\n }\n if (REQUIRED_PLAYERS > 3) {\n GameElements.players[3].xPos = 650;\n GameElements.players[3].yPos = 550;\n GameElements.players[3].position = 179;\n GameElements.players[3].state = Player.STATES.PLAYING;\n GameElements.players[3].color = Player.COLORS.YELLOW;\n }\n\n }", "function players() {\n return Object.assign({}, homeTeam().players, awayTeam().players);\n}", "playerMove(id, player) {\n DATA.boardCells[id] = player;\n VIEW.placeMark(id, player);\n let winner = this.checkWin(DATA.boardCells, player);\n if (winner) this.gameOver(winner);\n }", "function resizePlayer(){\n\n for(id in board.player_dic){\n\n board.player_dic[id].r = board.player_r;\n }\n\n}", "function startAI(){\n\tapp.playerTwo.move = function(){\n\t\tif (this.position.y > app.ball.position.y \n\t\t\t&& this.position.y > this.size.height / 2){\n\t\t\tthis.position.y -= 4;\n\t\t}\n\t\tif (this.position.y < app.ball.position.y\n\t\t\t&& this.position.y < app.canvas.height - (this.size.height / 2)){\n\t\t\tthis.position.y += 4;\n\t\t}\n\t}\n}", "function enterBossRoom1(player, startSide) {\n player.room = 16;\n if (startSide == 0) { // left\n player.x = 50;\n player.y = roomHeight / 2 - 50;\n } else if (startSide == 1) { // right\n player.x = roomWidth - player.width - 50;\n player.y = roomHeight / 2 - 50;\n } else if (startSide == 2) { // up\n player.x = roomWidth / 2 - 50;\n player.y = 50;\n } else { // down\n player.x = roomWidth / 2 - 50;\n player.y = roomHeight - player.height - 50;\n }\n\t\n\tif (secondsLeft >= 0)\n\t\tsecondsLeft = -10;\n\t\n\t// Restore all health to players\n\tfor (let i in PLAYER_LIST) {\n\t\tPLAYER_LIST[i].health = PLAYER_LIST[i].healthCapacity;\n\t}\n\t\n\tio.emit(\"enterSlimeKing\", 0);\n\t\n\t/*\n\tnow = new Date();\n let time = (now.getHours() + \":\" + now.getMinutes() + \":\" + now.getSeconds());\n log_file[time] = (player.id + \" entered Boss Room 1\");\n\t*/\n}", "function randomlyAssign() {\n var roles = _.cloneDeep(gameState.roles);\n _.each(gameState.playerNames, function(playerName) {\n var role = roles.splice(_.random(roles.length - 1), 1)[0];\n\n var player = {\n alive: true,\n name: playerName,\n role: role,\n inCult: role.name === 'Cult Leader'\n };\n\n // Add the player to the game with their role\n $ctrl.players.push(player);\n });\n showRole();\n gameState.setProperty('players', $ctrl.players);\n }", "function SarahTransferAmandaToRoom() {\n\tSarahAmandaLeaveRoom();\n\tCharacterRelease(Amanda);\n\tif ((InventoryGet(Amanda, \"ItemPelvis\") != null) && (InventoryGet(Amanda, \"ItemPelvis\").Asset.Name == \"StraponPanties\")) InventoryRemove(Amanda, \"ItemPelvis\");\n\tInventoryWear(Amanda, \"CollegeOutfit1\", \"Cloth\");\n\tInventoryWear(Amanda, \"CollegeSkirt\", \"ClothLower\");\n\tInventoryWear(Amanda, \"Socks4\", \"Socks\", \"#AAAAAA\");\n\tInventoryWear(Amanda, \"Shoes1\", \"Shoes\", \"#222222\");\n\tInventoryWear(Amanda, \"Bra1\", \"Bra\", \"#bbbbbb\");\n\tInventoryWear(Amanda, \"Panties1\", \"Panties\", \"#bbbbbb\");\n\tInventoryAdd(Player, \"StraponPanties\", \"ItemPelvis\");\n\tCommonSetScreen(\"Room\", \"Private\");\n\tPrivateAddCharacter(Amanda, null, true);\n\tvar C = PrivateCharacter[PrivateCharacter.length - 1];\n\tC.Trait = [];\n\tNPCTraitSet(C, \"Peaceful\", 70);\n\tNPCTraitSet(C, \"Wise\", 90);\n\tNPCTraitSet(C, \"Serious\", 30);\n\tNPCTraitSet(C, \"Polite\", 50);\n\tC.Love = 20;\n\tif (Amanda.Owner == Player.Name) {\n\t\tNPCEventAdd(C, \"NPCCollaring\", CurrentTime);\n\t\tInventoryWear(C, \"SlaveCollar\", \"ItemNeck\");\n\t\tC.Owner = Player.Name;\n\t\tC.Love = 100;\n\t}\n\tif (Player.Lover == \"NPC-Amanda\") {\n\t\tNPCEventAdd(C, \"Girlfriend\", CurrentTime);\n\t\tC.Lover = Player.Name;\n\t\tC.Love = 100;\n\t}\n\tif (Player.Owner == \"NPC-Amanda\") {\n\t\tNPCEventAdd(C, \"PlayerCollaring\", CurrentTime);\n\t\tNPCEventAdd(C, \"LastGift\", CurrentTime);\n\t\tC.Love = 100;\n\t}\n\tif (LogQuery(\"AmandaSarahLovers\", \"NPC-AmandaSarah\")) C.Lover = \"NPC-Sarah\";\n\tNPCTraitDialog(C);\n\tServerPrivateCharacterSync();\n}", "async _addPlayer() {\n this.arena.player = await new Player({\n playerProps: this.config.playerProps,\n container: this.stage.container(),\n layer: this.layer,\n onScreenUpdate: this._onScreen.bind(this),\n commands: this.commands,\n }).init()\n\n for (let children in this.arena.player.sprite.getChildren()) {\n let child = this.arena.player.sprite[children];\n\n if (child.top || child.middle || child.lower) {\n for (let headgear in child) {\n this.layer.add(child[headgear]);\n }\n } else {\n this.layer.add(child);\n }\n\n }\n\n this._updateFrame();\n this.arena.player.sprite.start();\n }", "function placePlayer(player){\n\nlet row = randomRowColumnNumber(9);\nlet col = randomRowColumnNumber(9);\nlet gridItem = $(`[data-col=\"${col}\"][data-row=\"${row}\"]`);\nif( gridItem.hasClass('full') ) {\n \n return placePlayer(player);\n}\n\ngridItem.addClass('full').addClass(player.playerType);\nplayer.playerPos.row = row;\nplayer.playerPos.col = col;\n\n\n}", "function init_player_1(){\n p_color = 0; // determines the color of the unit hp bars\n fx = f;\n\n // generate units for the civilization\n // generate a settler\n /*unit_type = values_units.units[0].type;\n civ_units[p_color][f] = new unit_struct(-1,-1, values_units.units[0].type, values_units.units[0].move, values_units.units[0].move, values_units.units[0].health, values_units.units[0].strength, f, player[p_color].civ_Name, values_units.units[0].production, values_units.units[0].class, values_units.units[0].bonus_damage);*/\n var unit_num = 0;\n unit_type = values_units.units[unit_num].type;\n civ_units[p_color][f] = new unit_struct(-1,-1, values_units.units[unit_num].type, values_units.units[unit_num].move, values_units.units[unit_num].move, values_units.units[unit_num].health, values_units.units[unit_num].strength, f, player[p_color].civ_Name, values_units.units[unit_num].production, values_units.units[unit_num].class, values_units.units[unit_num].bonus_damage);\n\n civ_units[p_color][f].unit_X_coord = x; // do these even do anything???\n civ_units[p_color][f].unit_Y_coord = y;\n\n // generate a warrior\n f++;\n fx = f;\n /*unit_type = values_units.units[1].type;\n civ_units[p_color][f] = new unit_struct(-1,-1, values_units.units[1].type, values_units.units[1].move, values_units.units[1].move, values_units.units[1].health, values_units.units[1].strength, f, player[p_color].civ_Name, values_units.units[1].production, values_units.units[1].class, values_units.units[1].bonus_damage);*/\n var unit_num = 1;\n unit_type = values_units.units[unit_num].type;\n civ_units[p_color][f] = new unit_struct(-1,-1, values_units.units[unit_num].type, values_units.units[unit_num].move, values_units.units[unit_num].move, values_units.units[unit_num].health, values_units.units[unit_num].strength, f, player[p_color].civ_Name, values_units.units[unit_num].production, values_units.units[unit_num].class, values_units.units[unit_num].bonus_damage);\n\n civ_units[p_color][f].unit_X_coord = x;\n civ_units[p_color][f].unit_Y_coord = y;\n}", "function playerReset() {\n const pieces = 'ILJOTSZ';\n player.matrix = createPiece(pieces[pieces.length * Math.random() | 0]);\n player.pos.y = 0;\n player.pos.x = (arena[0].length / 2 | 0) - (player.matrix[0].length / 2 |0);\n \n //If the block element hits the upper wall\n //game is over and the arena is cleared\n if(colide(arena, player)) {\n arena.forEach(row => row.fill(0));\n player.score = 0;\n updateScore();\n }\n}", "setupTeamPositions() {\n\n\t\t// pick appropriate home regions\n\n\t\tlet regions;\n\n\t\tif ( this.color === TEAM.RED ) {\n\n\t\t\tif ( this.stateMachine.in( TEAM_STATES.DEFENDING ) ) {\n\n\t\t\t\tregions = _redDefendingRegions;\n\n\t\t\t} else {\n\n\t\t\t\tregions = _redAttackingRegions;\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\tif ( this.stateMachine.in( TEAM_STATES.DEFENDING ) ) {\n\n\t\t\t\tregions = _blueDefendingRegions;\n\n\t\t\t} else {\n\n\t\t\t\tregions = _blueAttackingRegions;\n\n\t\t\t}\n\n\t\t}\n\n\t\t// set new home regions\n\n\t\tconst players = this.children;\n\n\t\tfor ( let i = 0, l = players.length; i < l; i ++ ) {\n\n\t\t\tconst player = players[ i ];\n\t\t\tconst regionId = regions[ i ];\n\n\t\t\tplayer.homeRegionId = regionId;\n\n\t\t}\n\n\t}", "newGame() {\n this.initMap();\n this.addMapEnvironnement();\n this.addMapPattern();\n this.addMapItems(4);\n this.players.forEach((player) => {\n this.addPlayer(player[0], player[1])\n });\n this.placePlayers(); \n this.interface.displayPlayersStatus(this.players);\n this.initializePlayerControlEvents(); \n this.roundManager(); \n }", "function colide(arena, player) {\n const[m, o] = [player.matrix, player.pos];\n for(let y = 0; y < m.length; ++y) {\n for(let x = 0; x < m[y].length; ++x) {\n if(m[y][x] !== 0 && (arena[y + o.y] && arena[y + o.y][x + o.x]) !== 0) {\n return true;\n }\n }\n }\n return false;\n}", "function movePlayer() {\n screenWarping(\"player\");\n playerX += playerVX;\n playerY += playerVY;\n}", "function Player(astarcell) {\n this.cell = astarcell;\n this.cell.player = this;\n this.cell.obstacle = false;\n this.cell.update();\n}", "function initAllVars () {\r\n // ARENA\r\n game.arena.Element.style.backgroundPositionY = game.arena.y + 'px';\r\n game.arena.Element.style.width = game.arena.width + 'px';\r\n\r\n //ROCKET\r\n game.rocket.Element.style.left = game.rocket.x + 'px';\r\n game.rocket.Element.style.top = game.rocket.y + 'px';\r\n game.rocket.Element.style.width = game.rocket.width + 'px';\r\n\r\n //BULLET\r\n game.bullet.Element.style.left = game.bullet.x + 'px';\r\n game.bullet.Element.style.top = game.bullet.y + 'px';\r\n game.bullet.Element.style.width = game.bullet.width + 'px';\r\n game.bullet.Element.style.height = game.bullet.width + 'px';\r\n\r\n // ENEMY\r\n createEnemies();\r\n renderEnemies();\r\n console.log(game.enemy.list);\r\n}", "function PongArena() {\n var _shape = new createjs.Shape();\n _shape.graphics.beginRadialGradientFill([\"#AAA\", \"#FFF\"], [0, 1], 0, 0, 0, 0, 0, 300).drawPolyStar(0, 0, 300, 6, 0, -90)\n .beginStroke(\"black\").drawPolyStar(0, 0, 300, 6, 0, -90);\n _shape.x = 300;\n _shape.y = 300;\n var _boundingPoints;\n\n /**\n * returns true if a point (vector) is inside the game arena\n */\n this.isPointInside = function (p) {\n return Geometry.isPointInsidePolygon(p, _boundingPoints);\n };\n\n /**\n * returns an array of vectors with each vector being a point of\n * the polygon forming the arena\n */\n this.getBoundingPoints = function () {\n _boundingPoints = _shape.graphics._instructions.map(function (a) {\n return a.params;\n }).filter(function (a) {\n return a.length > 0;\n }).slice(1, 7).map(function (a) {\n return $V(a).add($V([300, 300]));\n });\n return _boundingPoints;\n };\n\n this.shape = _shape;\n }", "function teleport(AIMap)\n {\n var i, j;\n do\n {\n i = randomintAtoB(1,GRIDSIZE-2);\n j = randomintAtoB(1,GRIDSIZE-2);\n }\n while ( occupied(i,j) && GRID[i][j] != GRID_BLANK); \t // search for empty square\n\n //set old i and j to null\n AIMap['oldI'] = null;\n AIMap['oldJ'] = null;\n\n //set new position\n AIMap['i'] = i;\n AIMap['j'] = j;\n\n }", "finishedCombat (tSource, tDest, attackerLoss, defenderLoss) {\n /* show combat results ? */\n console.log(\n 'Combat results: attacking territory ' +\n tSource +\n 'lost ' +\n attackerLoss +\n ' units, defending territory ' +\n tDest +\n 'lost ' +\n defenderLoss +\n ' units.'\n )\n\n var tmpSource = tSource\n var tmpDest = tDest\n\n /* were are getting IDs from server, getting name strings of countries */\n tSource = THIS.getCountryNameById(tSource)\n tDest = THIS.getCountryNameById(tDest)\n\n var cSource = getContinentOf(tSource)\n var cDest = getContinentOf(tDest)\n\n /* Unhighlight the belligerents */\n GameWindow.unhighlightTerritory()\n\n /* apply losses */\n THIS.map[cSource][tSource].soldiers -= attackerLoss\n THIS.map[cDest][tDest].soldiers -= defenderLoss\n /* displaying loss(es) on map (using country IDs) */\n GameWindow.updateCountrySoldiersNumber(tmpSource)\n GameWindow.updateCountrySoldiersNumber(tmpDest)\n // Rest\n console.log('attackUnits = ' + THIS.attackUnits)\n var restAttack = THIS.attackUnits - attackerLoss\n console.log('restattack = ' + restAttack)\n\n var attackingPlayer = THIS.getPlayerById(THIS.map[cSource][tSource].player)\n var defendingPlayer = THIS.getPlayerById(THIS.map[cDest][tDest].player)\n\n var myPlayer = THIS.getMyPlayer()\n\n console.log(attackingPlayer)\n console.log(defendingPlayer)\n console.log(myPlayer)\n\n GameWindow.addServerMessage(\n 'LOSSES',\n attackingPlayer.displayName +\n ' lost ' +\n attackerLoss +\n ' units <br>' +\n defendingPlayer.displayName +\n ' lost ' +\n defenderLoss +\n ' units'\n )\n\n var dead = false\n /* if there are no more units on the territory */\n if (THIS.map[cDest][tDest].soldiers <= 0) {\n // is dead : replace dest soldiers by attackers soldiers\n dead = true\n\n if (attackingPlayer.id == myPlayer.id) {\n // We attacked\n GameWindow.addServerMessage('COMBAT', 'You conquered ' + tDest + ' !')\n } else if (defendingPlayer.id == myPlayer.id) {\n GameWindow.addServerMessage('COMBAT', 'You lost ' + tDest + \" :'(\")\n } else {\n GameWindow.addServerMessage(\n 'COMBAT',\n defendingPlayer.displayName + ' lost ' + tDest\n )\n }\n\n THIS.view.players[THIS.map[cDest][tDest].player].nbTerritories--\n\n /* updating local player territories number (NW UI) */\n if (localStorage.getItem('myId') == THIS.map[cDest][tDest].player) {\n THIS.view.localTerritories--\n }\n\n THIS.map[cDest][tDest].player = THIS.map[cSource][tSource].player\n THIS.map[cDest][tDest].soldiers = restAttack\n THIS.map[cSource][tSource].soldiers -= THIS.attackUnits\n\n console.log('Attacker territory after conquer : ')\n console.log(tSource)\n console.log(THIS.map[cSource][tSource].soldiers)\n console.log('Territory ' + tDest + ' is conquered by the attacker')\n\n /* change the color of a territory during the pre-phase */\n GameWindow.setCountryColor(\n SupportedColors[THIS.map[cSource][tSource].player],\n tmpDest\n )\n /* puts the soldier icon with the number area */\n GameWindow.updateSoldierColor(\n SupportedColors[THIS.map[cSource][tSource].player],\n tDest\n )\n THIS.view.players[THIS.map[cSource][tSource].player].nbTerritories++\n\n /* updating local player territories number (NW UI) */\n if (localStorage.getItem('myId') == THIS.map[cSource][tSource].player) {\n THIS.view.localTerritories++\n }\n\n GameWindow.updateCountrySoldiersNumber(tmpDest)\n GameWindow.updateCountrySoldiersNumber(tmpSource)\n } else {\n GameWindow.updateCountrySoldiersNumber(tmpDest)\n }\n\n // updating the ratio bar\n for (var i = 0; i < THIS.totalPlayers; i++) {\n GameWindow.updateRatioBar(i, THIS.playerList[i].nbTerritories)\n }\n\n if (!dead) {\n this.beginAttackPhase()\n } else {\n // Player can move soldiers\n if (attackingPlayer.id == myPlayer.id) {\n THIS.lastFortify.tSource = tSource\n THIS.lastFortify.tDest = tDest\n GameWindow.fortifyAfterConquering(tSource, tDest)\n }\n }\n }", "function setPlayerPosition(x,y){\n playerPosition={x,y};\n}", "saveBoard()\n {\n game.endingBoard = []\n game.world.forEach(function(item)\n {\n game.endingBoard.push(item)\n });\n }", "function reset() {\n allEnemies = [];\n player = null;\n allEnemies = [new Enemy(60), new Enemy(140), new Enemy(230)];\n player = new Player(200, 400);\n playerYValues = [];\n\n }", "set players(value) {\n this._players = value;\n }", "function positionUpdater(player, oldY, oldX) {\n mapArrays[player.y + oldY][player.x + oldX].playerHere = false;\n mapArrays[player.y][player.x].playerHere = true;\n}", "prepAndStartNewGame() {\n this.resetPlayers(Player.TOWN);\n this.assignRoles(this.options.numMafia, this.options.numCops, this.options.numDoctors);\n this.updateRoleCounts();\n this.gameState = MAFIA_TIME;\n }", "function startEvaluation(){\n //console.log('population: ' + neat.population.length)\n highestScore = 0;\n\n //for(var genome in neat.population){\n for(var v=0;v<neat.population.length;v++){\n genome = neat.population[v];\n if(!players[v]){\n //console.log('didnt exist')\n players.push()\n players[v] = new Player(genome, v);\n } else {\n //console.log('existed')\n var oldPos = players[v].getPos()\n var oldScore = players[v].getScore()\n //console.log(oldScore, oldPos)\n players.splice(v,1)\n players[v] = new Player(genome, v);\n\n //fix NaN's\n oldPos.x = isNaN(oldPos.x) ? 0 : oldPos.x\n oldPos.y = isNaN(oldPos.y) ? 0 : oldPos.y\n oldPos.ax = isNaN(oldPos.ax) ? 0 : oldPos.ax\n oldPos.ay = isNaN(oldPos.ay) ? 0 : oldPos.ay\n oldPos.vx = isNaN(oldPos.vx) ? 0 : oldPos.vx\n oldPos.vy = isNaN(oldPos.vy) ? 0 : oldPos.vy\n\n\n players[v].setPos(oldPos)\n players[v].setScore(oldScore * .5)\n }\n }\n\n walker.reset();\n}", "function setAttack() {\n $(\"#fight-outcome\").empty();\n\n arenaObj.enemy.health -= arenaObj.ally.attack;\n arenaObj.enemy.stats();\n\n killCharacter();\n\n $(\"#fight-outcome\").empty();\n\n arenaObj.ally.health -= arenaObj.enemy.counter;\n arenaObj.ally.stats();\n\n killCharacter();\n\n console.log(\"Your enemy HP is \" + arenaObj.enemy.health \n + \" and your HP is \" + arenaObj.ally.health);\n}", "function syncPlayer() {\n\t\t$scope.players = $scope.room.game.players;\n\t\t$scope.room.game.players.forEach(function(player, ind) {\n\t\t\tif (player.user.name === $routeParams['user']) {\n\t\t\t\t$scope.player = player;\n\t\t\t}\n\t\t});\n\t}", "function getPositions(){\n this.PlayerMove = playerOption;\n this.ComputerMove = [Math.floor(Math.random() * whoWonTheBattle.length)];\n getFinalPosition();\n }", "function testBoard() {\n let board = new Board();\n let index = board.coordToIndex(0, 0);\n board.playerBoard[index].value = 'HIT';\n board.prettyPrint(board.playerBoard);\n}", "toGame() {\n return {\n player_names: this.p_name,\n player_SIDs: this.p_sid,\n }\n }", "collectWinnings( otherPlayer ) {\n this.hand = this.hand.concat( this.currentCards, otherPlayer.currentCards )\n this.currentCards = []\n otherPlayer.currentCards = []\n }", "function moveTracker() {\n moveTrack.push({\n \"x\" : x , \n \"y\" : y , \n \"loc\": player.loc\n })\n }", "function characterValues() {\n\t\t\tremainingOpponents = 3;\n\t\t\t$.each(playerCharacters, function (index) {\n\t\t\t\tplayerCharacters[index].characterHealthPoints = Math.round(Math.random()*100)+25;\n\t\t\t\tplayerCharacters[index].characterAttackPower = Math.round(Math.random()*20)+5;\n\t\t\t\tplayerCharacters[index].characterBaseAttackPower = playerCharacters[index].characterAttackPower;\n\t\t\t\tplayerCharacters[index].characterCounterAttackPower = Math.round(Math.random()*20)+5;\n\t\t\t\tplayerCharacters[index].characterStatus = '';\n\t\t\t});\n\t\t\t$.each(computerCharacters, function (index) {\n\t\t\t\tcomputerCharacters[index].characterHealthPoints = Math.round(Math.random()*100)+25;\n\t\t\t\tcomputerCharacters[index].characterAttackPower = Math.round(Math.random()*20)+5;\n\t\t\t\tcomputerCharacters[index].characterBaseAttackPower = playerCharacters[index].characterAttackPower;\n\t\t\t\tcomputerCharacters[index].characterCounterAttackPower = Math.round(Math.random()*20)+5;\n\t\t\t\tcomputerCharacters[index].characterStatus = '';\n\t\t\t});\n\t\t\tselectPlayer();\t\t\t\n\t\t}", "function Update()\n{\n\tloadingBlockPart++;\n\tif(loadingBlockPart > 12){\n\t\tloadingBlockPart = 0;\n\t}\n\t\n\tif (playerList.length>0){\n\tfor (p in playerList)\n\t\t{\n\t\t\tif(!(Time.timeSinceLevelLoad - p.playerAtackTime <= 30.0) && !(Time.timeSinceLevelLoad - p.playerAtackModeTime <= 30.0) && p.health < 100){\n\t\t\t\twaitTime++;\n\t\t\t\tif(waitTime > 50){\n\t\t\t\t\tGameObject.FindObjectOfType(PlayerCombat).addPlayerHealth(p.playerID);\n\t\t\t\t\twaitTime = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\t\n\tif(playerCanSpawn && playerNameArray.Count != 0){\n\t\tplayerCanSpawn = false;\n\t\tspanNewPlayer(playerNameArray[0], playerArray[0]);\n\t}\n\t\n\tif (mainScript && Network.isClient){\n\t\tif(mainScript.spawnArray.length > 0 && hasBeenSpawned == false){\n\t\t\t//if I have not been spawned yet, and I have the grid information, spawn myself.\n\t\t\t//You need the grid information since you need the spawnArray data from the mainscript in the pawnPlayer function\n\t\t\tDebug.Log(\"NOW IS THE TIME! PLAYER, I CHOOSE YOU!\");\n\t\t\tnetworkView.RPC(\"connectMyPlayer\", RPCMode.AllBuffered, PlayerPrefs.GetString(\"name\"));\n\t\t\thasBeenSpawned = true;\n\t\t\t\n\t\t\tnetworkView.RPC(\"affirmConnection\", RPCMode.Server); //HIER\n\t\t}\n\t}\t\t\n\t\t\n\t/*if (Input.GetKeyDown(\"space\"))\n\t{\n\t\tDebug.Log(\"player info: \");\n\t\tfor (playerNode in playerList)\n\t\t{\n\t\t\tDebug.Log(\"- playerName: \"+playerNode.playerName);\n\t\t\tDebug.Log(\"- nPlayer: \"+playerNode.nPlayer);\n\t\t\tDebug.Log(\"- playerID: \"+playerNode.playerID);\n\t\t\tDebug.Log(\"- hasRelic: \"+playerNode.hasRelic);\n\t\t\tDebug.Log(\"- numRelic: \"+playerNode.numRelic);\n\t\t\tDebug.Log(\"- isMole: \"+playerNode.isMole);\n\t\t\tDebug.Log(\"- health: \"+playerNode.health);\n\t\t\tDebug.Log(\"-----------------------------\");\n\t\t\t//Debug.Log(\"- playerTeam: \"+playerNode.playerTeam);\n\t\t}\n\t}*/\n\tif(Input.GetKey(\"e\")){\n\t \t/*for (player in playerList){\n\t \t\t if (player.nPlayer == localPlayer){\n\t \t\t \t//drop the relic\n\t \t\t \tGrid.GetComponent(main).dropOwnTreasure(GameObject.Find(\"Player(Clone)\").transform.position, GameObject.Find(\"Player(Clone)\").GetComponent(ThirdPersonController).myTile, getNumRelic());\n\t \t\t }\n\t \t}*/\n\t \tif (getHasRelic()) //HIER GEBLEVEN\n\t \t{\n\t\t\tmainScript.GetComponent(main).dropOwnTreasure(GameObject.Find(\"Player(Clone)\").transform.position, GameObject.Find(\"Player(Clone)\").GetComponent(ThirdPersonController).myTile, getNumRelic());\n\t\t\tsetHasRelic(false);\n\t\t\n\t\t\tDebug.Log(\"dropping key\");\n\t\t}\n\t}\n\t/*if(Input.GetKeyDown(\"6\")){\n\t\tfor (p in playerList){\n\t\t\tif (p.nPlayer == localPlayer){\n\t\t\t\tif (p.isMole){\n\t\t\t\t\tDebug.Log(\"I was a mole, not any longer!\");\n\t\t\t\t\tnetworkView.RPC(\"setIsMole\", RPCMode.AllBuffered, false, localPlayer);\n\t\t\t\t} else {\n\t\t\t\t\tDebug.Log(\"I wasn a mole, becoming one now!\");\n\t\t\t\t\tnetworkView.RPC(\"setIsMole\", RPCMode.AllBuffered, true, localPlayer);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}*/\n\t\n\tif (GameObject.FindGameObjectsWithTag(\"Player\").Length == GameObject.FindObjectOfType(NetworkLevelLoad).maxGroupSize && idHasBeenAllocatedForAll == false){\n\t\tDebug.Log(\"all players are present: \"+GameObject.FindGameObjectsWithTag(\"Player\").Length+\", allocating IDs\");\n\t\tfor (i=0; i<GameObject.FindGameObjectsWithTag(\"Player\").Length; i++){\n\t\t\tif (GameObject.FindGameObjectsWithTag(\"Player\")[i] == GameObject.Find(\"Player(Clone)\")){\n\t\t\t\tnetworkView.RPC(\"setPlayerIDFromObject\", RPCMode.AllBuffered, i, localPlayer);\n\t\t\t}\n\t\t}\n\t\tidHasBeenAllocatedForAll = true;\n\t}\n}", "function clear_enemy() {\n board.enemy = {\"north\":[], \"east\":[], \"west\":[], \"south\":[]};\n}", "function loadLevel(mapInfoFile) {\n\n mapReady = false;\n playerWon = false;\n\n setup();\n\n\n /*======CONNECT TO JSON FILE=======*/\n $.getJSON(mapInfoFile, function(data) {\n console.log(\"loading level\");\n //ARRAY OF MOVES \n playerMoves = data.playerMoves;\n\n //POSITION OF DESTINATION/FINAL PIPE\n endX = data.end.x * cellSize;\n endY = data.end.y * cellSize;\n\n //STARTING PIPE POSITION\n // startX = data.start.x * cellSize;\n // startY = data.start.y * cellSize;\n\n //INFORMATION FOR ALL DIFFERENT OBSTACLES\n obstaclesInfo = data.obstaclesInfo;\n\n //OBSTACLE POSITIONS\n for (var i = 0; i < obstaclesInfo.length; i++) {\n console.log(\"ready to work\");\n console.log(obstaclesInfo[i]);\n var coordinateX = obstaclesInfo[i].coordinates.x;\n var coordinateY = obstaclesInfo[i].coordinates.y;\n for (var j = 0; j < obstaclesInfo[i].relativeShape.length; j++) {\n var relativeX = obstaclesInfo[i].relativeShape[j].x;\n var relativeY = obstaclesInfo[i].relativeShape[j].y;\n obstaclesList.push({ x: coordinateX + relativeX, y: coordinateY + relativeY });\n }\n }\n\n //Number of pipes left\n pipesRemaining = data.pipesRemaining;\n\n //FINAL PLAYER ENDPOINT\n destinationX = data.destination.x;\n destinationY = data.destination.y;\n\n enemies = data.enemyInfo;\n\n /*=======LOAD IMAGES=======*/\n bg = loadImage(\"assets/background.png\");\n user = loadImage(\"assets/user.png\");\n endPipe = loadImage(\"assets/end.png\");\n gameOver = loadImage(\"assets/loser.png\");\n winner = loadImage(\"assets/winnerTwo.png\");\n crack = loadImage(\"assets/crack.png\");\n brrr = loadImage(\"assets/frozen.png\");\n final = loadImage(\"assets/final.png\");\n\n for (i = 0; i < obstaclesInfo.length; i++) {\n obstaclesInfo[i][\"img\"] = loadImage(obstaclesInfo[i].artwork);\n }\n\n for (i = 0; i < enemies.length; i++) {\n enemies[i][\"img\"] = loadImage(enemies[i].artwork);\n enemies[i][\"currentCoordinates\"] = enemies[i].startCoordinates;\n enemies[i][\"currentDirection\"] = Math.random();\n }\n\n //UNCOMMENT FOR BACKGROUND SOUNDTRACK\n // track.play();\n\n //SETUP 2D OBSTACLE AND PIPE ARRAYS\n for (var i = 0; i < COLUMNS; i++) {\n pipes[i] = [];\n obstacles[i] = [];\n for (var j = 0; j < ROWS; j++) {\n pipes[i][j] = \"empty\";\n obstacles[i][j] = \"empty\";\n }\n }\n\n //STORING OBSTACLES INTO OBSTACLE ARRAY\n\n for (var i = 0; i < obstaclesList.length; i++) {\n obstacles[obstaclesList[i].x][obstaclesList[i].y] = \"occupied\";\n }\n\n mapReady = true;\n\n });\n}", "function setUpGame(){\n generateShips('player')\n generateShips('ai')\n }", "function buildPlayerList(){\n playerArray.forEach(function(player){\n if (player.Team === vm.teamKey) {\n vm.currentPlayerArray.push(player);\n };\n });\n vm.currentPlayerArray.forEach(function(player){\n player.Name = player.Name.toUpperCase();\n player.lastName = player.lastName.toUpperCase();\n });\n vm.maxScore = vm.currentPlayerArray.length;\n vm.gameStarted = true;\n vm.isTimeLeft = true\n vm.displayTimer();\n }", "teleportation(currentPlayer, consequence, channel){\n currentPlayer.position = consequence.mapIndex\n channel.send(consequence.description).catch(err => {console.error(err);})\n this.utils.saveUniverse(this)\n }", "play(){\r\n form.hide()\r\n\r\n Player.getPlayerInfo()\r\n \r\n if(allPlayers !== undefined){\r\n var index = 0\r\n var x = 0\r\n var y\r\n\r\n for(var p in allPlayers){\r\n\r\n console.log(\"hello\")\r\n\r\n index = index + 1\r\n x = x + 200\r\n y = displayHeight - allPlayers[p].distance\r\n\r\n cars[index - 1].x = x\r\n cars[index - 1].y = y\r\n }\r\n }\r\n\r\n if(keyDown(UP_ARROW) && player.index !== null){\r\n player.distance = player.distance + 50\r\n player.update()\r\n }\r\n\r\n drawSprites()\r\n }", "transfer(object){\n if (object === this.encounter.playerShip) this.encounter.win();\n }", "function damangePlayer (obj) {\n // Decrement player health\n hero.health--\n \n // Set iframes on player\n hero.justHit = true\n setTimeout(iframes, 1500)\n \n // Set particle emitter to player's location\n emitParticles(hero.x + (hero.width/2), hero.y + (hero.height/2), 'hotpink', 'black', 20, 40)\n \n // push that loser\n pushObject(obj, hero, 4, 10, 100)\n}", "function start(){\n allEnemies =[];\n player = new Player(200,400);\n enemy50 = new Enemy(-100,50,Math.floor(Math.random() * 400)+ 150);\n enemy140 = new Enemy(-100,140,Math.floor(Math.random() * 400)+ 150);\n enemy220 = new Enemy(-100,220,Math.floor(Math.random() * 400)+ 150);\n\n allEnemies = [enemy50, enemy140, enemy220];\n}", "function enterBossRoom3 (player, startSide) {\n\tplayer.room = 18;\n if (startSide == 0) { // left\n player.x = 50;\n player.y = roomHeight / 2 - 50;\n } else if (startSide == 1) { // right\n player.x = roomWidth - player.width - 50;\n player.y = roomHeight / 2 - 50;\n } else if (startSide == 2) { // up\n player.x = roomWidth / 2 - 50;\n player.y = 50;\n } else { // down\n player.x = roomWidth / 2 - 50;\n player.y = roomHeight - player.height - 50;\n }\n\t\n\t// Restore all health to players\n\tfor (let i in PLAYER_LIST) {\n\t\tPLAYER_LIST[i].health = PLAYER_LIST[i].healthCapacity;\n\t}\n\t\n\tif (secondsLeft >= 0)\n\t\tsecondsLeft = -10;\n\t\n\tio.emit(\"enterHive\", 0);\n}", "async function injectPlayer(player, pos, teamId) {\n // insert more player information into the unsorted teams obj\n teamsUnsorted[teamId][pos][player.id] = player;\n // add the player to the players obj\n players[player.id] = player;\n // add the player into the playersByTeam obj\n if (!playersByTeam[teamId]) {\n playersByTeam[teamId] = {};\n }\n if (!playersByTeam[teamId][pos]) {\n playersByTeam[teamId][pos] = {};\n }\n playersByTeam[teamId][pos][player.id] = player;\n}" ]
[ "0.720134", "0.715486", "0.70767826", "0.7059706", "0.70479363", "0.7023856", "0.6843925", "0.6343385", "0.6198291", "0.6040673", "0.5898057", "0.58365566", "0.58083683", "0.5783554", "0.576863", "0.57621264", "0.5730956", "0.5677256", "0.56510913", "0.5630383", "0.5581915", "0.55308604", "0.55065507", "0.5494568", "0.54736245", "0.5448718", "0.54480094", "0.54480094", "0.54480094", "0.5440011", "0.54360145", "0.54350495", "0.5428126", "0.5401988", "0.5396902", "0.538066", "0.5357736", "0.5354118", "0.5343685", "0.5341013", "0.5340203", "0.5330997", "0.5308274", "0.530673", "0.52986", "0.5293943", "0.52912664", "0.52867246", "0.52771145", "0.52718484", "0.5267105", "0.5262115", "0.526197", "0.5259924", "0.52584136", "0.5237261", "0.52236795", "0.5217133", "0.52147144", "0.52020884", "0.5200252", "0.5186741", "0.5186372", "0.51861787", "0.5180641", "0.51785666", "0.51607656", "0.51600534", "0.51597106", "0.51593935", "0.5157288", "0.51548916", "0.51488125", "0.51481384", "0.5146593", "0.51429874", "0.51400137", "0.5138579", "0.51384586", "0.51338196", "0.51330465", "0.5126879", "0.51249516", "0.51186395", "0.51146215", "0.51114535", "0.5102445", "0.51015824", "0.5099324", "0.50957227", "0.50924283", "0.50859916", "0.5084563", "0.5084458", "0.5076591", "0.50763625", "0.50738734", "0.5072565", "0.50704765", "0.5067929" ]
0.70673656
3
Move player and prevent leaving screen
function playerMove(dir) { player.pos.x += dir; if (collide(arena, player)) { player.pos.x -= dir; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function movePlayer() {\n screenWarping(\"player\");\n playerX += playerVX;\n playerY += playerVY;\n}", "function still_player() {\n player.moving_frame.visible = false;\n player.still_frame.visible = true;\n\n }", "function movePlayer() {\n if (game.press[k.w]) {\n var top = parseInt($(\"#player\").css(\"top\"));\n $(\"#player\").css(\"top\", top - 10);\n\n /*-----Limit Position-----*/\n if (top <= 0) {\n $(\"#player\").css(\"top\", top + 10);\n } \n /*-----Limit Position-----*/ \n }\n\n if (game.press[k.s]) {\n var top = parseInt($(\"#player\").css(\"top\"));\n $(\"#player\").css(\"top\", top + 10);\n\n /*-----Limit Position-----*/\n if (top >= 437) {\n $(\"#player\").css(\"top\", top - 10);\n } \n /*-----Limit Position-----*/ \n }\n\n if (game.press[k.d]) {\n shooting();\n }\n }", "function movePlayer() {\n // top wall\n if(playerUp && player.position.y > 112) {\n player.position.y -= 2;\n }\n // bottom wall\n if(playerDown && player.position.y < 1136) {\n player.position.y += 2;\n }\n // left wall\n if(playerLeft && player.position.x > 112) {\n player.position.x -= 2;\n }\n // right wall\n if(playerRight && player.position.x < 1136) {\n player.position.x += 2;\n }\n}", "function stopPlayer() {\n if (game.level.player.prevX != game.level.player.x) {\n\n game.level.player.x = game.level.player.prevX;\n }\n if (game.level.player.prevY != game.level.player.y) {\n game.level.player.y = game.level.player.prevY;\n }\n}", "function move() {\n movingPlayer = true;\n}", "function movePlayer() {\n // Check whether the player is on a platform\n var isOnPlatform = player.isOnPlatform();\n\n // Update player position\n var displacement = new Point();\n\n // Move left or right\n if (player.motion == motionType.LEFT) {\n displacement.x = -PLAYER_X_SPEED;\n }\n if (player.motion == motionType.RIGHT) {\n displacement.x = PLAYER_X_SPEED;\n }\n\n // Fall\n if (!isOnPlatform && player.verticalSpeed <= 0) {\n displacement.y = -player.verticalSpeed;\n player.verticalSpeed -= PLAYER_Y_ACCELERATION;\n }\n\n // Jump\n if (player.verticalSpeed > 0) {\n displacement.y = -player.verticalSpeed;\n player.verticalSpeed -= PLAYER_Y_ACCELERATION;\n if (player.verticalSpeed <= 0) {\n player.verticalSpeed = 0;\n }\n }\n\n // Get the new position of the player\n var position = new Point();\n position.x = player.position.x + displacement.x;\n position.y = player.position.y + displacement.y;\n\n // Check collision with platforms and screen\n player.collidePlatform(position);\n player.collideScreen(position);\n\n // Set the location back to the player object (before update the screen)\n player.position = position;\n\n for (var i = 0; i < 3; ++i) {\n if (hasDisappearingPlatform[i]) {\n if (player.isOnDisappearingPlatform(i)) {\n if (!isOnDisappearingPlatform[i]) {\n isOnDisappearingPlatform[i] = true;\n disappearingTimeout[i] = setTimeout(\"removeDisappearingPlatform(\" + i + \")\", 500);\n }\n } else {\n if (isOnDisappearingPlatform[i]) {\n isOnDisappearingPlatform[i] = false;\n if (disappearingTimeout[i] != null) {\n clearTimeout(disappearingTimeout[i]);\n }\n }\n }\n }\n }\n}", "move() {\n // Handle movement with edge conditions\n if (upPressed) {\n if (player.y <= 0) {\n player.y += 1;\n } else {\n player.y -= player.speed;\n }\n }\n else if (downPressed) {\n if (player.y >= canvas.height) {\n player.y -= 1;\n } else {\n player.y += player.speed;\n }\n }\n if (rightPressed) {\n if (player.x >= canvas.width) {\n player.x -= 1;\n } else {\n player.x += player.speed;\n }\n }\n else if (leftPressed) {\n if (player.x <= 0) {\n player.x += 1;\n }\n else {\n player.x -= player.speed;\n }\n }\n }", "function playerMoved() {\n _hasPlayerMoved = true;\n }", "function movementControlAndLock() {\n offsetX = -player.x + width / 2;\n offsetY = -player.y + height / 2;\n\n\n //ALLOWS USER TO REACH HORIZONTAL EDGE OF SCREEN//\n if (player.x >= worldLimit.w - width / 2) {\n offsetX = -(worldLimit.w - width);\n }\n\n if (player.x <= width / 2) {\n offsetX = 0;\n }\n\n //ALLOWS USER TO REACH VERTICAL EDGE OF SCREEN//\n if (player.y >= worldLimit.h - height / 2) {\n offsetY = -(worldLimit.h - height);\n }\n\n if (player.y <= height / 2) {\n offsetY = 0;\n }\n\n}", "update() {\n // if the player touches the top of the screen...\n if (this.player.y < 0) {\n // gmae over man, restart the game\n this.scene.start(\"PlayGame\");\n }\n }", "function move() {\r\n player.x += player.dx;\r\n player.y += player.dy;\r\n\r\n //stoping at boundaries while moving\r\n\r\n //left wall\r\n if (player.x < 0) {\r\n player.x = 0;\r\n }\r\n //right wall\r\n if (player.x + player.w > canvas.width) {\r\n player.x = canvas.width - player.w;\r\n }\r\n //top wall\r\n if (player.y < 0) {\r\n player.y = 0;\r\n }\r\n //bottom wall\r\n if (player.y + player.h > canvas.height) {\r\n player.y = canvas.height - player.h;\r\n }\r\n}", "freeMovement()\n {\n this.playerController.onDialogue.onDialogue = false;\n }", "function move() {\r\n if (downPressed) {\r\n if (playerYposition != 3) {\r\n playerYposition += 1;\r\n }\r\n setDownPressed(false);\r\n }\r\n if (upPressed) {\r\n if (playerYposition != 1) {\r\n playerYposition -= 1;\r\n }\r\n setUpPressed(false);\r\n }\r\n}", "function movePlayer() {\n\t//the location of the mouse click\n\tvar click : Vector3;\n\t//if the player has clicked somewhere\n\tif(Input.GetMouseButton(0)) {\n\t\t//save the location\n\t\tclick = Input.mousePosition;\n\t\t//offset the location to be relative to the center of the screen.\n\t\tvar clickX = click.x - Screen.width/2;\n\t\tvar clickY = click.y - Screen.height/2;\n\t\t//the location of the click\n\t\tvar clickVector : Vector3 = new Vector3(clickX, clickY, 0);\n\t\t//the vector from the player to the mouse\n\t\tvar moveVector : Vector3 = clickVector;\n\t\t//if the click is above the HUD and the player can move\n\t\tif(isAboveKanaBar(click.y) && this.moveEnabled){\n\t\t\t//move the player toards the clicked location\n\t\t\trigidbody2D.velocity = new Vector3(clickX, clickY, 0).normalized * (baseSpeed * bunnyModifier);\n\t\t}\n\t}\n\telse {\n\t\trigidbody2D.velocity = new Vector2(0, 0);\n\t}\n}", "function movePlayer() {\n // Update position\n playerX = playerX + playerVX;\n playerY = playerY + playerVY;\n\n // Wrap when player goes off the canvas\n if (playerX < 0) {\n // Off the left side, so add the width to reset to the right\n playerX = playerX + width;\n } else if (playerX > width) {\n // Off the right side, so subtract the width to reset to the left\n playerX = playerX - width;\n }\n\n if (playerY < 0) {\n // Off the top, so add the height to reset to the bottom\n playerY = playerY + height;\n } else if (playerY > height) {\n // Off the bottom, so subtract the height to reset to the top\n playerY = playerY - height;\n }\n}", "function movePlayer() {\n // Update position\n playerX += playerVX;\n playerY += playerVY;\n\n // Wrap when player goes off the canvas\n if (playerX < 0) {\n playerX += width;\n } else if (playerX > width) {\n playerX -= width;\n }\n\n if (playerY < 0) {\n playerY += height;\n } else if (playerY > height) {\n playerY -= height;\n }\n}", "update(){\n // Prevent player from moving off canvas\n if(this.y > startY){\n this.y = startY;\n }\n if(this.x < 3){\n this.x = 3;\n }\n if(this.x > xPos[xPos.length - 1]){\n this.x = xPos[xPos.length - 1];\n }\n if(this.y < -50){\n this.y = -50;\n }\n\n // When the player reaches the top of the canvas, reset player positon\n if(this.y === -50 && this.x === goal.x){\n this.goalReached();\n }\n\n }", "function player_move(dir) {\n player.pos.x += dir;\n if (collide(arena, player)) {\n player.pos.x -= dir;\n }\n}", "function movePlayer() {\n // Update position\n playerX += playerVX;\n playerY += playerVY;\n\n // Wrap when player goes off the canvas\n if (playerX < 0) {\n playerX += width;\n }\n else if (playerX > width) {\n playerX -= width;\n }\n\n if (playerY < 0) {\n playerY += height;\n }\n else if (playerY > height) {\n playerY -= height;\n }\n}", "function movePlayer(direction) {\n player.move(direction);\n updateActionCam();\n}", "function MOVE(e){\n\n\t/////////Player 1///////////////\n\tplayer1.move(e);\n\n}", "movePlayerManager() {\n if (this.cursorKeys.left.isDown) {\n this.player.setVelocityX(-gameSettings.playerSpeed);\n }\n else if (this.cursorKeys.right.isDown) {\n this.player.setVelocityX(gameSettings.playerSpeed);\n }\n\n if (this.cursorKeys.up.isDown) {\n this.player.setVelocityY(-gameSettings.playerSpeed);\n }\n else if (this.cursorKeys.down.isDown) {\n this.player.setVelocityY(gameSettings.playerSpeed);\n }\n }", "function moveUp() {\n myGamePiece.speedY -= movementSpeed;\n restrictPlayer();\n}", "function playerMove(dir) {\n player.pos.x += dir;\n if(collide(arena, player)) {\n player.pos.x -= dir;\n }\n else move.play();\n}", "function dead() \n{\n player.setPosition(80, 500);\n}", "function moveLeft() {\r\n moveTo(player.x - 1, player.y);\r\n}", "function playerMove(dir) {\n player.pos.x += dir;\n if(colide(arena, player)) {\n player.pos.x -= dir;\n }\n}", "movePlayer() {\r\n this.ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n this.drawText();\r\n this.posY = this.posY + this.speed * this.inputY;\r\n this.posX = this.posX + this.speed * this.inputX;\r\n this.renderPlayer();\r\n }", "function move()\n{\n\tif (player.direction == MOVE_NONE)\n\t{\n \tplayer.moving = false;\n\t\t//console.log(\"y: \" + ((player.y-20)/40));\n\t\t//console.log(\"x: \" + ((player.x-20)/40));\n \treturn;\n \t}\n \tplayer.moving = true;\n \t//console.log(\"move\");\n \n\tif (player.direction == MOVE_LEFT)\n\t{\n \tif(player.angle != -90)\n\t\t{\n\t\t\tplayer.angle = -90;\n\t\t}\n\t\tif(map[playerPos.x][playerPos.y-1].walkable)\n\t\t{\n\t\t\tplayer.moving = true;\n\t\t\tplayerPos.y -=1;\n\t\t\tvar newX = player.position.x - 40;\n\t\t\tcheckCharms(playerPos.x, playerPos.y);\n\t\t\tcreatejs.Tween.get(player).to({x: newX, y: player.position.y}, 250).call(move);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tPIXI.sound.play('wrongWay');\n\t\t\tplayer.direction = MOVE_NONE;\n\t\t\tmove();\n\t\t}\n \t}\n\tif (player.direction == MOVE_RIGHT)\n\t{\n \tif(player.angle != 90)\n\t\t{\n\t\t\tplayer.angle = 90;\n\t\t}\n\t\tif(map[playerPos.x][playerPos.y+1].walkable)\n\t\t{\n\t\t\tplayer.moving = true;\n\t\t\tplayerPos.y+=1;\n\t\t\tcheckCharms(playerPos.x, playerPos.y);\n\t\t\tvar newX = player.position.x + 40;\n\t\t\tcreatejs.Tween.get(player).to({x: newX, y: player.position.y}, 250).call(move);\n\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tPIXI.sound.play('wrongWay');\n\t\t\tplayer.direction = MOVE_NONE;\n\t\t\tmove();\n\t\t}\n\t}\n \tif (player.direction == MOVE_UP)\n\t{\n\t if(player.angle != 0)\n\t\t{\n\t\t\tplayer.angle = 0;\n\t\t}\n\t\tif(map[playerPos.x-1][playerPos.y].walkable)\n\t\t{\n\t\t\tplayer.moving = true;\n\t\t\tplayerPos.x-=1;\n\t\t\tvar newy = player.position.y - 40;\n\t\t\tcheckCharms(playerPos.x, playerPos.y);\n\t\t\tcreatejs.Tween.get(player).to({y: newy}, 250).call(move);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tPIXI.sound.play('wrongWay');\n\t\t\tplayer.direction = MOVE_NONE;\n\t\t\tmove();\n\t\t}\n\t}\n \tif (player.direction == MOVE_DOWN)\n\t{\n\t if(player.angle != 180)\n\t\t{\n\t\t\tplayer.angle = 180;\n\t\t}\n\t\tif(map[playerPos.x+1][playerPos.y].walkable)\n\t\t{\n\t\t\tplayer.moving = true;\n\t\t\tplayerPos.x+=1;\n\t\t\tcheckCharms(playerPos.x, playerPos.y);\n\t\t\tvar newy = player.position.y + 40;\n\t\t\tcreatejs.Tween.get(player).to({x: player.position.x, y: newy}, 250).call(move);\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tPIXI.sound.play('wrongWay');\n\t\t\tplayer.direction = MOVE_NONE;\n\t\t\tmove();\n\t\t}\n\t}\n}", "function movePlayer() {\n if (player && !paused) {\n var moves = [];\n for(var key in pressedKeys) {\n if (pressedKeys.hasOwnProperty(key) && pressedKeys[key]) {\n moves.push(key);\n }\n }\n player.move(moves);\n }\n }", "updatePos() {\n if (this.x != this.player.x || this.y != this.player.y) {\n this.x = this.player.x;\n this.y = this.player.y;\n }\n }", "function move(event) {\n if (gameover) { /* PREVENT USER FROM MOVING */ }\n else {\n var left = player.position().left;\n var edge = $('body').width() - player.width();\n\n var key = event.which;\n switch (key) {\n case 37: // left\n if (left <= 8) {\n left = 8;\n } else {\n player.css('left', left - 25);\n // player.animate({'left': left - 25}, 'fast');\n }\n break;\n\n case 39: // right\n if (left >= edge) {\n left = edge;\n } else {\n player.css('left', left + 25);\n // player.animate({'left': left + 25}, 'fast');\n\n }\n break;\n\n /**\n * Sang Min (Samuel) Na\n *\n * when paused, stop fireball, score, and gameSpeed\n * show pause message\n * when unpaused, start fireball, score, and gameSpeed again\n * hide pause message\n */\n case 27: // pause\n if (!paused) {\n clearInterval(score);\n clearInterval(gameSpeedID);\n clearInterval(drawer);\n $('.fires').stop();\n $('.helpers').stop();\n\n paused = !paused;\n msg.children().first().next().hide(); // game over msg\n if (gameover) {\n msg.children().first().next().show();\n }\n msg.fadeIn();\n\n } else {\n paused = !paused;\n\n var fires = $('.fires');\n for (var i = 0; i < fires.length; i++ ) {\n fall(fires.eq(i));\n }\n var helpers = $('.helpers');\n for (var j = 0; j < helpers.length; j++) {\n fall(helpers.eq(j));\n }\n msg.fadeOut();\n\n score = setInterval(scoreUpdate, 100);\n gameSpeedID = setInterval(gameSpeed, 3000);\n drawer = setInterval(draw, speed);\n }\n break;\n }\n }\n }", "update() {\n\n \n this.movePlayerManager();\n\n\n \n\n }", "function movePlayer(){\n\tif(!this.canMove || game.physics.arcade.isPaused || flags['winState'])\n\t\treturn;\n\n//\tif(player.body.touching.down)\n\t\tthis.body.velocity.x = 0;\n//\telse{\n\t\tif(player.body.touching.right)\n\t\t\tthis.timeOfTouchRightWall = game.time.now;\n\t\tif(player.body.touching.left)\n\t\t\tthis.timeOfTouchLeftWall = game.time.now;\n//\t}\n\n\t// Al presionar una tecla, el jugador se mueve y se activa una animacion\n\tif(keyboard.leftKey()){\n\t\t// Mover a la izquierda\n\t\tif(game.time.now - this.timeOfTouchRightWall < 500){\n\t\t\tthis.body.velocity.y = -this.speed;\n\t\t\tthis.setVelocity(-1, true);\n\t\t}\n\t\telse\n\t\t\tthis.setVelocity(-1, false);\n\n\t\tthis.playAnimations('left');\n\t\tif(!this.is_attacking) \n\t\t\tthis.attack.changeAttackOrientation('left', this);\n\t}\n\telse if(keyboard.rightKey()){\n\t\t// Mover a la derecha\n\t\tif(game.time.now - this.timeOfTouchLeftWall < 500){\n\t\t\tthis.body.velocity.y = -this.speed;\n\t\t\tthis.setVelocity(1, true);\n\t\t}\n\t\telse\n\t\t\tthis.setVelocity(1, false);\n\t\t\n\t\tthis.playAnimations(\"right\");\n\t\tif(!this.is_attacking) \n\t\t\tthis.attack.changeAttackOrientation('right', this);\n\t} \n\t\n\tif(keyboard.upKey()){\n\t\tif (player.body.touching.down){\n\t\t\tthis.body.velocity.y = -this.speed;\n\t\t\tif(this.speed != this.highSpeed)\n\t\t\t\tthis.body.velocity.y = -this.speed * 1.5;\n\t\t}\n\t\tthis.playAnimations('back');\n\t\tif(!this.is_attacking) \n\t\t\tthis.attack.changeAttackOrientation('back', this);\n\t} // abajo\n\telse if(keyboard.downKey()){\n//\t\tthis.body.velocity.y = this.speed;\n\t\tthis.playAnimations('front');\n\t\tif(!this.is_attacking) \n\t\t\tthis.attack.changeAttackOrientation('front', this);\n\t\tif(this.body.touching.down)\n\t\t\tthis.timeToDownPlatform = game.time.now;\n\t}\n\t\n\n\t// Permanecer quieto\n\tif(!this.is_attacking &&\n\t\t!keyboard.upKey() &&\n\t\t!keyboard.downKey() &&\n\t\t!keyboard.leftKey() &&\n\t\t!keyboard.rightKey()){\n\t\tthis.animations.stop();\n\t}\n\t\n}", "function resetPlayer() {\n player.x = 210;\n player.y = 380;\n}", "function movePlayer() {\n // Update position\n playerX = playerX + playerVX;\n playerY = playerY + playerVY;\n\n // Wrap when player goes off the canvas\n if (playerX < 0) {\n // Off the left side, so add the width to reset to the right\n playerX = playerX + width;\n } else if (playerX > width) {\n // Off the right side, so subtract the width to reset to the left\n playerX = playerX - width;\n }\n drawPlayerLives\n\n if (playerY < 0) {\n // Off the top, so add the height to reset to the bottom\n playerY = playerY + height;\n } else if (playerY > height) {\n // Off the bottom, so subtract the height to reset to the top\n playerY = playerY - height;\n }\n}", "function gamePlay() {\r\n // Check whether the player is on a platform\r\n var isOnPlatform = player.isOnPlatform();\r\n \r\n // Update player position\r\n var displacement = new Point();\r\n\r\n // Move left or right\r\n if (player.motion == motionType.LEFT)\r\n displacement.x = -MOVE_DISPLACEMENT;\r\n if (player.motion == motionType.RIGHT)\r\n displacement.x = MOVE_DISPLACEMENT;\r\n\r\n // Fall\r\n if (!isOnPlatform && player.verticalSpeed <= 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n }\r\n\r\n // Jump\r\n if (player.verticalSpeed > 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n if (player.verticalSpeed <= 0)\r\n player.verticalSpeed = 0;\r\n }\r\n\r\n // Get the new position of the player\r\n var position = new Point();\r\n position.x = player.position.x + displacement.x;\r\n position.y = player.position.y + displacement.y;\r\n\r\n // Check collision with platforms and screen\r\n player.collidePlatform(position);\r\n player.collideScreen(position);\r\n\r\n // Set the location back to the player object (before update the screen)\r\n player.position = position;\r\n\r\n player.checkEnterPortal(position)\r\n updateScreen();\r\n\r\n processCoin(player.findCoin(player.position))\r\n if(!cheatMode && bumpIntoGhost(player.position)!=-1){\r\n gameOver()\r\n console.log(\"bumpIntoGhost\")\r\n }\r\n\r\n if (player.findExit(player.position)){\r\n proceedToNextRound()\r\n }\r\n}", "function playerMove(dir) {\n player.pos.x += dir;\n if (collide(arena, player)) {\n player.pos.x -= dir;\n }\n}", "function movePlayer () {\r\n // Move Right and Left\r\n if (rightPressed) {\r\n player.x -= player.speed;\r\n } else if (leftPressed) {\r\n player.x += player.speed;\r\n }\r\n // Move Player Up and Down\r\n if (upPressed) {\r\n player.y -= player.speed;\r\n } else if (downPressed) {\r\n player.y += player.speed;\r\n }\r\n}", "function movePlayer() {\n p1.render();\n p1.move();\n}", "function move_player()\n{\t\t\t\n\tif (player['position'][0] < 0)\n\t{\n\t\twarp.currentTime = 0;\n\t\twarp.play();\n\t\tplayer['position'][0] = 392;\n\t} \n\telse if (player['position'][0] > 392)\n\t{\n\t\twarp.currentTime = 0;\n\t\twarp.play();\n\t\tplayer['position'][0] = 0;\n\t} \n\telse if (player['position'][1] < 0)\n\t{\n\t\twarp.currentTime = 0;\n\t\twarp.play();\n\t\tplayer['position'][1] = 392;\n\t}\n\telse if (player['position'][1] > 392)\n\t{\n\t\twarp.currentTime = 0;\n\t\twarp.play();\n\t\tplayer['position'][1] = 0;\n\t}\n\t\n\n\tplayer['position'][0] += direction[player['direction']][0];\n\tplayer['position'][1] += direction[player['direction']][1];\n}", "function gamePlay() {\r\n // Check collisions\r\n collisionDetection();\r\n\r\n // Check whether the player is on a platform\r\n var isOnPlatform = player.isOnPlatform();\r\n\r\n // Update player position\r\n var displacement = new Point();\r\n\r\n // Move left or right\r\n if (player.motion == motionType.LEFT)\r\n displacement.x = -MOVE_DISPLACEMENT;\r\n if (player.motion == motionType.RIGHT)\r\n displacement.x = MOVE_DISPLACEMENT;\r\n\r\n // Fall\r\n if (!isOnPlatform && player.verticalSpeed <= 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n }\r\n\r\n // Jump\r\n if (player.verticalSpeed > 0) {\r\n displacement.y = -player.verticalSpeed;\r\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\r\n if (player.verticalSpeed <= 0)\r\n player.verticalSpeed = 0;\r\n }\r\n\r\n // Get the new position of the player\r\n var position = new Point();\r\n position.x = player.position.x + displacement.x;\r\n position.y = player.position.y + displacement.y;\r\n\r\n // Check collision with platforms and screen\r\n player.collidePlatform(position);\r\n player.collideScreen(position);\r\n\r\n // Set the location back to the player object (before update the screen)\r\n player.position = position;\r\n\r\n // Move the bullets\r\n moveBullets();\r\n\tmonsterMove();\r\n updateScreen();\r\n}", "function playerMove(dir){\n player.pos.x += dir;\n if(collide(arena, player))\n player.pos.x -= dir;\n}", "function moveup() {\r\n player.dy = -player.speed;\r\n}", "function move() {\n \n if (player.direction == MOVE_NONE) {\n player.moving = false;\n return;\n }\n \n player.moving = true;\n player.play()\n\t\n var dx = 0;\n var dy = 0;\n \n if (player.direction == MOVE_LEFT){\n \t//player.textures = move_left;\n dx -= 1;\n } \n if (player.direction == MOVE_RIGHT){\n \t//player.textures = move_right;\n dx += 1;\n }\n if (player.direction == MOVE_UP){\n \t//player.textures = move_up;\n dy -= 1; \n } \n if (player.direction == MOVE_DOWN){\n \t//player.textures = move_down;\n dy += 1;\n }\n \n //wall collision check\n if (wall_layer[(player.gy+dy-1)*40 + (player.gx+dx)] != 0) {\n player.moving = false;\n \treturn;\n }\n //sprite collision check for monster encounters \n if (SpriteCollision(player,monster1) || SpriteCollision(player,monster) ||\n \tSpriteCollision(player,monster2) || SpriteCollision(player,monster3)){\n \tplayer.moving = false;\n \tgameoverScreen();\n \treturn;\n }\n \n player.gx += dx;\n player.gy += dy;\n \n lastdirection = player.direction;\n\n createjs.Tween.get(player).to({x: player.gx*DIM, y: player.gy*DIM}, 250).call(move);\n}", "function move(e){\n // obstacles(player.x, player.y);\n if (e.keyCode === 37){\n if(player.noMove(player.x-1, player.y)) {\n if(obstacles(player.x-1, player.y)){\n player.x -= 1;\n console.log('moved one spot to what you believe to be left');\n document.getElementById('idOutputText').innerHTML = \"moved one spot to what you believe to be the left.\";\n }\n }\n } \n if (e.keyCode === 39){\n if(player.noMove(player.x+1, player.y)) {\n if(obstacles(player.x+1, player.y)){\n player.x += 1;\n console.log('moved one spot to what you believe to be right');\n document.getElementById('idOutputText').innerHTML = \"moved one spot to what you believe to be the right.\";\n }\n }\n } \n if (e.keyCode === 38){\n if(player.noMove(player.x, player.y-1)){\n if(obstacles(player.x, player.y-1)){\n player.y -= 1;\n console.log('moved one spot to what you believe to be top');\n document.getElementById('idOutputText').innerHTML = \"moved one spot to what you believe to be up.\";\n }\n }\n } \n if (e.keyCode === 40){\n if(player.noMove(player.x, player.y+1)){\n if(obstacles(player.x, player.y+1)){\n player.y += 1;\n console.log('moved one spot to what you believe to be down');\n document.getElementById('idOutputText').innerHTML = \"moved one spot to what you believe to be down.\";\n }\n }\n }\n }", "function playerMoving() {\n console.log('playerMoving')\n $squares.removeClass('drake-player1')\n $squares.eq(playerPosition).addClass('drake-player1')\n }", "update()\n {\n if(this.player.y > 175 && this.playerCanMove)\n {\n this.player.y+=-this.stroming;\n }\n // MOVE PLAYER\n if(this.playerCanMove)\n {\n if( this.cursorKeys.left.isDown || this.leftButPressed)\n {\n this.LeftButtonDown();\n }\n else if( this.cursorKeys.right.isDown || this.rightButPressed)\n {\n this.RightButtonDown();\n }\n else if( this.cursorKeys.down.isDown || this.downButPressed)\n {\n this.DownButtonDown();\n }\n else if( this.cursorKeys.up.isDown || this.upButPressed)\n {\n this.UpButtonDown();\n }\n else\n {\n this.player.body.setVelocity(0);\n this.player.setAngle(0);\n this.player.anims.play('player-idle',false);\n }\n }\n else\n {\n if(!this.playerIsDead)\n {\n this.player.anims.play('player-idle',false);\n }\n this.player.body.setVelocity(0);\n }\n \n if(this.playerCanMove)\n {\n this.timer += 1;\n while (this.timer > this.spawndelay) {\n this.SpawnObject();\n this.timer = 0;\n }\n this.CheckOutOfBoundsObjects();\n }\n }", "function onNonMove(data){\n\t//find the player in the players array\n\tvar noneMovePlayer = playerById(data.id);\n\t//player not found\n\tif(!noneMovePlayer){\n\t\tconsole.log(\"A player was claimed non moving, but wasn't found\");\n\t\treturn;\n\t};\n\t//set specfic information\n\tnoneMovePlayer.setMoved(false);\n}", "function offScreen() {\n \n // Check if the y is greater than canvas height\n if (playerRect.y > cHeight) {\n \n // Die\n die();\n }\n \n}", "resetPlayerPos () {\n player.x = 200;\n player.y = 400;\n this.gotGift = true;\n }", "function reset() {\n player.x = 200;\n player.y = 380;\n}", "stopAndStay()\n {\n // this.playerController.onDialogue.onDialogue = true;\n this.body.velocity.x = 0;\n }", "function playerLeft() {\n\tadjustPlayer(0, -1);\n}", "function moveRock() {\n //Check for collision\n if(checkCollision(rock)){\n endGame();\n }//If no collision, change the position\n else if(top < 400) {\n top += 2;\n rock.style.top = top + 'px';\n window.requestAnimationFrame(moveRock);\n }//Remove rock at bottom of screen\n else if(top >= 400){\n rock.remove();\n }\n }", "function gamePlay() {\n // Check collisions\n collisionDetection();\n\t\n // Check whether the player is on a platform\n var isOnPlatform = player.isOnPlatform();\n \n // Update player position\n var displacement = new Point();\n\n // Move left or right\n if (player.motion == motionType.LEFT)\n displacement.x = -MOVE_DISPLACEMENT;\n if (player.motion == motionType.RIGHT)\n displacement.x = MOVE_DISPLACEMENT;\n\n // Fall\n if (!isOnPlatform && player.verticalSpeed <= 0) {\n displacement.y = -player.verticalSpeed;\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\n }\n\n // Jump\n if (player.verticalSpeed > 0) {\n displacement.y = -player.verticalSpeed;\n player.verticalSpeed -= VERTICAL_DISPLACEMENT;\n if (player.verticalSpeed <= 0)\n player.verticalSpeed = 0;\n }\n\n // Get the new position of the player\n var position = new Point();\n position.x = player.position.x + displacement.x;\n position.y = player.position.y + displacement.y;\n\n // Check collision with platforms and screen\n player.collidePlatform(position);\n player.collideScreen(position);\n\n // Set the location back to the player object (before update the screen)\n player.position = position;\n\n moveBullets();\n updateScreen();\n}", "function reset() {\n player.x = 0;\n player.y = 0;\n }", "function playerMove(elem) {\n \"use strict\";\n if (!endState) {\n drawToken(elem, 'X');\n turnPasses();\n setTimeout(function () {\n\t\tcomputerMove();\n \tturnPasses();\n\t}, 200);\n }\n}", "move() {\r\n\t\tlet style = this.element.style;\r\n\t\tstyle.top = this.element.offsetTop + this.speed + \"px\"; \r\n\t\tif (this.element.offsetTop > 500) {\r\n\t\t\tsetScore(playerScore-1);\r\n\t\t\tdelete letters[letters.indexOf(this)];\r\n\t\t\tgameboard.removeChild(this.element);\r\n\t\t}\r\n\t}", "preventMove() {\n this.currentMovePrevented = true;\n }", "function movePlayer() {\n\n //Quicken playerMaxSpeed when player holds SHIFT keys\n if (keyIsDown(SHIFT)) {\n playerMaxSpeed = 13;\n playerHealth -= 1;\n } else {\n playerMaxSpeed = 8;\n }\n\n\n // Update position\n playerX += playerVX;\n playerY += playerVY;\n\n // Wrap when player goes off the canvas\n if (playerX < 0) {\n playerX += width;\n }\n else if (playerX > width) {\n playerX -= width;\n }\n\n if (playerY < 0) {\n playerY += height;\n }\n else if (playerY > height) {\n playerY -= height;\n }\n}", "function btnLeftHandler() {\n if ((playerX > 0) && (!modoInverso)) {\n playerX -= 50;\n } else if (playerX < canvas.width-playerWidth) {\n playerX += 50;\n }\n}", "function checkForWin() {\n\n var d = $vast.MathUtil.getPointDistance(mainPlayer.x, mainPlayer.y, goal.x, goal.y);\n if (d <= 1) {\n mainPlayer.setPosition(64, 64);\n }\n }", "function movePlayer() {\n var move = function(event) {\n if (gameover === true) {\n window.removeEventListener(\"keydown\", move);\n }\n\n var events = event.key;\n\n if (!event.repeat) {\n if (events === \"ArrowUp\" && currentCoordinateY > 0) {\n if (jsGrid[currentCoordinateY - 1][currentCoordinateX] !== \"*\") {\n if (jsGrid[currentCoordinateY - 1][currentCoordinateX] === \"Y\") {\n gameOver();\n } else if (\n jsGrid[currentCoordinateY - 1][currentCoordinateX] === \"E\"\n ) {\n win();\n } else {\n //to plot the co-ordinate of he player before moving\n plottingPlayer(\n currentCoordinateY - 1,\n currentCoordinateX,\n selectedCharacter.backView\n );\n jsGrid[currentCoordinateY - 1][currentCoordinateX] = \"X\";\n currentCoordinateY -= 1;\n //to plot the co-ordinate of the player after moving\n jsGrid[currentCoordinateY + 1][currentCoordinateX] = \" \";\n }\n }\n } else if (\n events === \"ArrowDown\" &&\n currentCoordinateY < jsGrid.length - 1\n ) {\n if (jsGrid[currentCoordinateY + 1][currentCoordinateX] !== \"*\") {\n if (jsGrid[currentCoordinateY + 1][currentCoordinateX] === \"Y\") {\n gameOver();\n } else if (\n jsGrid[currentCoordinateY + 1][currentCoordinateX] === \"E\"\n ) {\n win();\n } else {\n plottingPlayer(\n currentCoordinateY + 1,\n currentCoordinateX,\n selectedCharacter.frontView\n );\n jsGrid[currentCoordinateY + 1][currentCoordinateX] = \"X\";\n currentCoordinateY += 1;\n jsGrid[currentCoordinateY - 1][currentCoordinateX] = \" \";\n }\n }\n } else if (events === \"ArrowLeft\" && currentCoordinateX > 0) {\n if (jsGrid[currentCoordinateY][currentCoordinateX - 1] !== \"*\") {\n if (jsGrid[currentCoordinateY][currentCoordinateX - 1] === \"Y\") {\n gameOver();\n } else if (\n jsGrid[currentCoordinateY][currentCoordinateX - 1] === \"E\"\n ) {\n win();\n } else {\n plottingPlayer(\n currentCoordinateY,\n currentCoordinateX - 1,\n selectedCharacter.leftView\n );\n jsGrid[currentCoordinateY][currentCoordinateX - 1] = \"X\";\n currentCoordinateX -= 1;\n jsGrid[currentCoordinateY][currentCoordinateX + 1] = \" \";\n }\n }\n } else if (\n events === \"ArrowRight\" &&\n currentCoordinateX < jsGrid[0].length - 1\n ) {\n if (jsGrid[currentCoordinateY][currentCoordinateX + 1] !== \"*\") {\n if (jsGrid[currentCoordinateY][currentCoordinateX + 1] === \"Y\") {\n gameOver();\n } else if (\n jsGrid[currentCoordinateY][currentCoordinateX + 1] === \"E\"\n ) {\n win();\n } else {\n plottingPlayer(\n currentCoordinateY,\n currentCoordinateX + 1,\n selectedCharacter.rightView\n );\n jsGrid[currentCoordinateY][currentCoordinateX + 1] = \"X\";\n currentCoordinateX += 1;\n jsGrid[currentCoordinateY][currentCoordinateX - 1] = \" \";\n }\n }\n }\n }\n };\n\n window.addEventListener(\"keydown\", move);\n}", "move(event) {\n event.target.classList.remove('free'); //The 'free' class is removed indcating the space cannot be played again\n event.target.classList.add(this._playClass); //Adds the class for the current player (The 'X' or the 'O')\n event.target.classList.add('taken'); // A class of 'taken' is given showing the space is played\n board.updateBoard(event, this); //Calls the updateBoard method to update the board._board array.\n this.turn = false; //Sets the turn of the player that just moved to false\n\n //Sets the state of the other player's turn to true\n if (this._player === 'player1') {\n player2.turn = true;\n } else if (this._player === 'player2') {\n player1.turn = true;\n } else {\n return false;\n }\n\n //If player 2 is a computer player, the computerMove method is evoked\n if (this._player === 'player1' && player2._isComputer && !player1._isWinner && !player2._isWinner) {\n player2.computerMove();\n }\n }", "function updatePlayer (player) {\n if (player.inputs.up) player.y -= 5;\n if (player.inputs.down) player.y += 5;\n if (player.inputs.left) player.x -= 5;\n if (player.inputs.right) player.x += 5;\n}", "registerMoving() {\n\n // window.addEventListener(\"keydown\", (e) => {\n // if (e.key === \"keydown\") {\n // return true;\n // } else {\n // return false;\n // }\n // })\n window.addEventListener(\"keydown\", (e) => {\n let playerDom = this.gameContainer.children[0];\n let x = parseInt(playerDom.style.left);\n let y = parseInt(playerDom.style.top);\n let modifier = 20;\n switch (e.key) {\n\n case \"ArrowUp\":\n console.log(\"move up\")\n y = y - modifier;\n break\n case \"ArrowDown\":\n console.log(\"move down\");\n y = y + modifier;\n break\n case \"ArrowLeft\":\n console.log(\"move left\")\n x = x - modifier;\n break\n case \"ArrowRight\":\n console.log(\"move right\")\n x = x + modifier;\n break\n }\n\n if (this.checkIfPlayerIsOutsideOfContainer(x, y) === true) {\n this.movePlayerHtml(e.key)\n }\n })\n\n }", "function resetPlayer(){\n player = {\n x: 0,\n y: 0\n }\n }", "function checkKeyPressUp(e)\r\n{\r\n\tcheckPlayer();\r\n\tif (e.which == 65 || e.keyCode == 65 || e.which == 68 || e.keyCode == 68 || e.which == 83 || e.keyCode == 83 || e.which == 32 || e.keyCode == 32)\r\n\t{\r\n\t\tif(PlayerFace == WALKING_RIGHT)\r\n\t\t{\r\n\t\t\tPLAYER.src = IDLE_RIGHT;\r\n\t\t\trightKey = false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif(PlayerFace == WALKING_LEFT)\r\n\t\t\t{\r\n\t\t\t\tPLAYER.src = IDLE_LEFT;\r\n\t\t\t\tleftKey = false;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(PlayerFace == BLOCKING_LEFT)\r\n\t\t\t\t{\r\n\t\t\t\t\tPLAYER.src = IDLE_LEFT;\r\n\t\t\t\t\tblockKey = false;\r\n\t\t\t\t\t//positionY += 1;\r\n\t\t\t\t\tpositionX -= 1;\r\n\t\t\t\t\tplayerPos();\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tif(PlayerFace == BLOCKING_RIGHT)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tPLAYER.src = IDLE_RIGHT;\r\n\t\t\t\t\t\tblockKey = false;\r\n\t\t\t\t\t\t//positionY += 1;\r\n\t\t\t\t\t\tpositionX += 5;\r\n\t\t\t\t\t\tplayerPos();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(PlayerFace == ATTACKING_LEFT)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tPLAYER.src = IDLE_LEFT;\r\n\t\t\t\t\t\t\tpositionX += 41;\r\n\t\t\t\t\t\t\tplayerPos();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif(PlayerFace == ATTACKING_RIGHT)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tPLAYER.src = IDLE_RIGHT;\r\n\t\t\t\t\t\t\t\tpositionX += 41;\r\n\t\t\t\t\t\t\t\tplayerPos();\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}", "function s(car,area){\n\tif(keys.ArrowUp && player.y>0){\n\t\tplayer.y -= player.speed;\n\t}\n\tif(keys.ArrowDown && player.y<area.height-120){\n\t\tplayer.y+= player.speed;\n\t}\n\tif(keys.ArrowLeft && player.x>0){\n\t\tplayer.x -= player.speed;\n\t}\n\tif(keys.ArrowRight && player.x<area.width-60){\n\t\tplayer.x += player.speed;\n\t}\n\tcar.style.top = player.y + \"px\";\n\tcar.style.left = player.x + \"px\";\n}", "function movePlayer(e) {\n switch (e.key) {\n case \"a\":\n //If the bottom left of the player box = 0 it will stop moving to the left\n if (playerCurrentPosition[0] > 0) {\n //10 is subtracted from the xAxis when a is pressed\n playerCurrentPosition[0] -= 10;\n player.style.left = playerCurrentPosition[0] + \"px\";\n //draw the new position of the player\n drawPlayer();\n //break out of the switch and listen for more key presses\n }\n break;\n\n case \"d\":\n //if the bottom left + the player width is equal to the board width it will stop moving to the right\n if (playerCurrentPosition[0] < boardWidth - playerWidth) {\n //10 is added to the xAxis when d is pressed\n playerCurrentPosition[0] += 10;\n player.style.left = playerCurrentPosition[0] + \"px\";\n drawPlayer();\n }\n break;\n }\n}", "function disableInteraction() {\n moving = true;\n setTimeout(function () {\n moving = false;\n }, 500);\n }", "function keyup(e) {\r\n player.dx = 0;\r\n player.dy = 0;\r\n}", "function updatePlayerPosition() {\n avatar.x = mouseX;\n avatar.y = mouseY;\n avatar.currentSize = avatar.currentSize - SHRINK;\n avatar.currentSize = constrain(avatar.currentSize,0,avatar.maxSize);\n if (avatar.currentSize === 0) {\n avatar.isPlayerAlive = false;\n }\n else {\n avatar.isPlayerAlive = true;\n }\n}", "function movePlayer(evt){ \n \n if(evt.clientX > 500 || evt.clientX < 920){\n xPlayer = evt.clientX - 500;\n }\n}", "function movePlayer(direction) {\n if (playerState !== \"locked\") {\n playerState = \"walking\";\n playerDirection = direction;\n if (!moving && checkPermittedMove(direction)) {\n //if not already moving and the next square is valid, move\n switch (direction) {\n case \"up\":\n playerY--;\n break;\n case \"down\":\n playerY++;\n break;\n case \"left\":\n playerX--;\n break;\n case \"right\":\n playerX++;\n break;\n default:\n };\n var squareType = mapLocations[currentLocation][0][playerY][playerX];\n if (typeof squareType === \"string\") {\n playerState = \"locked\";\n loadNewMapArea(squareType);\n } else if (squareType === 0) {\n walkingAnimation(direction);\n } else if (squareType === 4) {\n walkingAnimation(direction);\n if (Math.random() < 0.15) {\n changeMusic(\"route1\", \"wildPokemonFight\");\n clearInterval(moveInterval);\n playerState = \"locked\";\n walkingAnimation(direction);\n setTimeout(function() { enterFightMode(\"wild\"); }, 1000); \n }\n } else if (squareType === 5) {\n // If walking over a ledge, move the player one square further\n movePlayer(direction);\n }\n // Reposition background as player moves\n var mapY = ((6 - playerY) * squareSize) + \"vw\"; \n var mapX = ((6 - playerX) * squareSize) + \"vw\";\n $(\"#screen\").css(\"top\", mapY);\n $(\"#screen\").css(\"left\", mapX);\n // Prevent movePlayer from executing again until the first move has finished\n moving = true;\n setTimeout(function() { moving = false }, 150)\n } else {\n walkingAnimation(direction);\n }\n }\n}", "function playerMove(event) {\n\t\tmovePosition = event.target.id.slice(3);\n\t\tlet char = \"\";\n\t\tif (thisGame.p1Turn) {\n\t\t\tchar = \"X\";\n\t\t} else {\n\t\t\tchar = \"O\";\n\t\t}\n\t\tthisGame.makeMove(movePosition, char);\n\t\tthisGame.gameOverCheck();\n\t}", "switchToPlayAlone() {\n game.player.isPlaying = false;\n }", "moveRight() {\n\n if (this.posX <= 670 && pause == false)\n this.posX = this.posX + 5;\n }", "function moveLeft(){\nif(currentPosition > start) {\n paddleCollision()\n player.style.left = currentPosition - 5 + 'px';\n }\n}", "function switchPlayer(_event) {\n // Current mouseposition\n let mousePosition = new Soccer.Vector(_event.offsetX, _event.offsetY);\n // Get the player who is at the current mouseposition\n let playerAtMousePosition = getPlayerAtMousePosition(mousePosition);\n if (playerAtMousePosition && draggedPlayer) {\n // Switch only if player are from the same team\n if (draggedPlayer.team == playerAtMousePosition.team) {\n // Save startpositions of player to be exchanged\n let draggedPlayerStartposition = draggedPlayer.startPosition;\n let playerStartposition = playerAtMousePosition.startPosition;\n // Exchange their start positions\n draggedPlayer.startPosition = playerStartposition;\n playerAtMousePosition.startPosition = draggedPlayerStartposition;\n // Set the position of the field player to its new startposition so that he appears outside the field\n playerAtMousePosition.position = draggedPlayerStartposition;\n // Remove dragged player, otherwise it will stick to the cursor\n draggedPlayer = undefined;\n }\n else {\n // If the conditions for the switch are not given, set dragged player back to its startposition\n draggedPlayer.position = draggedPlayer.startPosition;\n draggedPlayer = undefined;\n }\n }\n }", "function playerMovement() {\n // Velocity\n if (player.velocityX > 20 * speedMultiplier) {\n player.velocityX = 20 * speedMultiplier;\n }\n if (player.velocityX < -15 * speedMultiplier) {\n player.velocityX = -15 * speedMultiplier;\n }\n\n // Actually moving\n if (keyDown(\"right\") && respawnTimer > maxRespawn) {\n player.velocityX = player.velocityX + 5.0*speedMultiplier;\n lastDirection = 0;\n if (currentGravity == 0) {\n player.setAnimation(\"Cube_right\");\n } else {\n player.setAnimation(\"U_Cube_right\");\n }\n }\n if (keyDown(\"left\") && respawnTimer > maxRespawn) {\n player.velocityX = player.velocityX - 5.0*speedMultiplier;\n lastDirection = 1;\n if (currentGravity == 0) {\n player.setAnimation(\"Cube_left\");\n } else {\n player.setAnimation(\"U_Cube_left\");\n }\n }\n \n // Slowing down\n if (!keyDown(\"right\") && player.velocityX > 0) {\n player.velocityX = player.velocityX - 5.0*speedMultiplier;\n }\n if (!keyDown(\"left\") && player.velocityX < 0) {\n player.velocityX = player.velocityX + 9.0*speedMultiplier;\n }\n if (!keyDown(\"right\") && player.velocityX > 0.00 && player.velocityX < 5.00) {\n player.velocityX = 0;\n }\n if (!keyDown(\"left\") && player.velocityX < 0.00 && player.velocityX > -5.00) {\n player.velocityX = 0;\n }\n // Stopping\n if (!keyDown(\"right\") && !keyDown(\"left\")) {\n if (currentGravity == 0) {\n player.setAnimation(\"Cube_idle\");\n } else {\n player.setAnimation(\"U_Cube_idle\");\n }\n }\n \n // Jumping\n if (currentGravity == 0) {\n if (player.collide(groundLine) || player.collide(block)) {\n \n if (keyDown(\"up_arrow\")) {\n if (respawnTimer > maxRespawn) {\n if (currentSize == 0) {\n player.velocityY = -50; //-50\n } else {\n player.velocityY = -80;\n }\n }\n }\n if (keyDown(\"space\")) {\n if (respawnTimer > maxRespawn) {\n if (currentSize == 0) {\n player.velocityY = -50; //-50\n } else {\n player.velocityY = -40;\n }\n }\n }\n \n }\n }\n if (currentGravity == 1) {\n if (player.collide(block)) {\n\n if (keyDown(\"up_arrow\")) {\n if (respawnTimer > maxRespawn) {\n if (currentSize == 0) {\n player.velocityY = 50; //-50\n } else {\n player.velocityY = 40;\n }\n }\n }\n \n }\n }\n}", "update(){\n // Control the player movement\n if (this.y > 400){\n this.y =400;\n }\n else if (this.x < 0){\n this.x = 0;\n }\n else if (this.x > 400){\n this.x = 400;\n }\n // When player reaches the water the message will show and restart the game\n else if (this.y < 0) {\n alert('Congratulations! You Win!!');\n start();\n }\n }", "function controlPlayer(){\n player.body.setVelocityY(0);\n player.body.setVelocityX(0);\n\n //position data to be sent to server\n const pos_x=playerPosition.x;\n const pos_y=playerPosition.y;\n const facing=playerMovingStatus.facing;\n const isMoving=playerMovingStatus.isMoving;\n if(Phaser.Input.Keyboard.JustDown(keys.left)||Phaser.Input.Keyboard.JustDown(keys.right)||Phaser.Input.Keyboard.JustDown(keys.up)||Phaser.Input.Keyboard.JustDown(keys.down)){\n walkSound.play();//play on loop if any key is pressed\n }\n if(!keys.left.isDown&&!keys.right.isDown&&!keys.up.isDown&&!keys.down.isDown){\n walkSound.stop();//stop the loop if no key is being pressed\n }\n if(keys.left.isDown){\n player.body.setVelocityX(-1*speed);\n player.play('player_walk_left',true);\n playerMovingStatus.facing='left';\n playerMovingStatus.isMoving=true;//put moving status to true to signal to other players\n }\n else if(keys.right.isDown){\n player.body.setVelocityX(1*speed);\n player.play('player_walk_right',true);\n playerMovingStatus.facing='right';\n playerMovingStatus.isMoving=true;//put moving status to true to signal to other players\n }\n else if(keys.up.isDown){\n player.body.setVelocityY(-1*speed);\n if(playerMovingStatus.facing=='left'){\n player.play('player_walk_left',true);\n }\n else{\n player.play('player_walk_right',true);\n }\n playerMovingStatus.isMoving=true;//put moving status to true to signal to other players\n }\n else if(keys.down.isDown){\n player.body.setVelocityY(1*speed);\n if(playerMovingStatus.facing=='left'){\n player.play('player_walk_left',true);\n }\n else{\n player.play('player_walk_right',true);\n }\n playerMovingStatus.isMoving=true;//put moving status to true to signal to other players\n }\n else{\n playerMovingStatus.isMoving=false;//put moving status false when idle\n if(playerMovingStatus.facing=='left'){\n player.play('player_idle_left',true);\n }\n else{\n player.play('player_idle_right',true);\n }\n }\n //emit current player position to server\n socket.emit('self position',{pos_x,pos_y,room,facing,isMoving});\n //set player position to data on each frame\n setPlayerPosition(player.x,player.y);\n}", "function moveRight(){\nif(currentPosition < end) {\n paddleCollision()\n player.style.left = currentPosition + 5 + 'px';\n }\n}", "stop() {\n player.src(player.src());\n }", "resetPlayer() {\n this.x = 200;\n this.y = 400;\n }", "function startAI(){\n\tapp.playerTwo.move = function(){\n\t\tif (this.position.y > app.ball.position.y \n\t\t\t&& this.position.y > this.size.height / 2){\n\t\t\tthis.position.y -= 4;\n\t\t}\n\t\tif (this.position.y < app.ball.position.y\n\t\t\t&& this.position.y < app.canvas.height - (this.size.height / 2)){\n\t\t\tthis.position.y += 4;\n\t\t}\n\t}\n}", "move() {\n // if (!this.noClip)\n // for (let i in gameObjects) {\n // \tlet a = gameObjects[i];\n // \tif (this.collider.isOverlap(a.collider)) \n // \t\treturn;\n // }\n if (this.canMoveX()) {\n this.position.x += this.velocity.x;\n }\n if (this.canMoveY()) {\n this.position.y += this.velocity.y;\n }\n }", "moveLeft() {\n\n if (this.posX >= 10 && pause == false)\n this.posX = this.posX - 5;\n }", "function movePlayer(e){\r\n\t\t//53 x 55 player\r\n\t\t//var moveSpeed = 7;\r\n\tif (count < 31){ //restart Game at the 31st second\r\n if(levelNum == 1){\r\n if(e.keyCode === 37){\r\n //left arrow\r\n //if player is facing left\r\n moveAudio.play();\r\n loadScene();\r\n collision(37);\r\n if (moveLeft){\r\n if(player.direction===1){\r\n //if player was already going to the left\r\n setPlayerAnimationFrame();\r\n }else{\r\n //set player to the first animation frame going to the left\r\n player.animationframe = 0;\r\n }\r\n if(player.x > SIZE + moveSpeed)\r\n player.x -= moveSpeed;\r\n player.direction = 1;\r\n }\r\n }\r\n if(e.keyCode === 39){\r\n //right arrow\r\n moveAudio.play();\r\n loadScene();\r\n collision(39);\r\n if (moveRight){\r\n if(player.direction==2){\r\n setPlayerAnimationFrame();\r\n }\r\n else{\r\n player.animationframe = 0;\r\n }\r\n if(player.x < canvas.width - SIZE - moveSpeed - 32)\r\n player.x += moveSpeed;\r\n player.direction = 2;\r\n }\r\n }\r\n if(e.keyCode === 38){\r\n //up arrow\r\n moveAudio.play();\r\n loadScene();\r\n collision(38);\r\n if (moveUp){\r\n if(player.direction==3){\r\n setPlayerAnimationFrame();\r\n }\r\n else{\r\n player.animationframe = 0;\r\n }\r\n if(player.y > SIZE + moveSpeed)\r\n player.y -= moveSpeed;\r\n player.direction = 3;\r\n }\r\n }\r\n if(e.keyCode === 40){\r\n //down arrow\r\n moveAudio.play();\r\n loadScene();\r\n collision(40);\r\n if (moveDown){\r\n if(player.direction==0){\r\n setPlayerAnimationFrame();\r\n }\r\n else{\r\n player.animationframe = 0;\r\n }\r\n if(player.y < canvas.height - SIZE - moveSpeed - 32)\r\n player.y += moveSpeed;\r\n player.direction = 0;\r\n }\r\n }\r\n displaySafeBackground();\r\n context.drawImage(player.image,//specifies the image to use\r\n player.animationframe*player.size,//the x coordinate where to start clipping\r\n player.direction*player.size,//the y coordinate where to start clipping\r\n 32,//the width of the clipped image\r\n 32,//the height of the clipped image\r\n player.x,//the x coordinate of where to place the image on the canvas\r\n player.y,//the y coordinate of where to place the image on the canvas\r\n player.size,//the width of the image to use\r\n player.size);//the height of the image to use\r\n } else if(levelNum == 2){\r\n if(e.keyCode === 37){\r\n //left arrow\r\n //if player is facing left\r\n moveAudio.play();\r\n //loadScene();\r\n //collision(37);\r\n if (moveLeft){\r\n if(player.direction===1){\r\n //if player was already going to the left\r\n setPlayerAnimationFrame();\r\n }else{\r\n //set player to the first animation frame going to the left\r\n player.animationframe = 0;\r\n }\r\n if(player.x > SIZE + moveSpeed)\r\n player.x -= moveSpeed;\r\n player.direction = 1;\r\n }\r\n }\r\n if(e.keyCode === 39){\r\n //right arrow\r\n moveAudio.play();\r\n //loadScene();\r\n //collision(39);\r\n if (moveRight){\r\n if(player.direction==2){\r\n setPlayerAnimationFrame();\r\n }\r\n else{\r\n player.animationframe = 0;\r\n }\r\n if(player.x < canvas.width - SIZE - moveSpeed - 32)\r\n player.x += moveSpeed;\r\n player.direction = 2;\r\n }\r\n }\r\n if(e.keyCode === 38){\r\n //up arrow\r\n moveAudio.play();\r\n //loadScene();\r\n //collision(38);\r\n if (moveUp){\r\n if(player.direction==3){\r\n setPlayerAnimationFrame();\r\n }\r\n else{\r\n player.animationframe = 0;\r\n }\r\n if(player.y > SIZE + moveSpeed)\r\n player.y -= moveSpeed;\r\n player.direction = 3;\r\n }\r\n }\r\n if(e.keyCode === 40){\r\n //down arrow\r\n moveAudio.play();\r\n //loadScene();\r\n //collision(40);\r\n if (moveDown){\r\n if(player.direction==0){\r\n setPlayerAnimationFrame();\r\n }\r\n else{\r\n player.animationframe = 0;\r\n }\r\n if(player.y < canvas.height - SIZE - moveSpeed - 32)\r\n player.y += moveSpeed;\r\n player.direction = 0;\r\n }\r\n }\r\n\t}\r\n\r\n displaySafeBackground();\r\n\t\t\tcontext.drawImage(player.image,//specifies the image to use\r\n player.animationframe*player.size,//the x coordinate where to start clipping\r\n player.direction*player.size,//the y coordinate where to start clipping\r\n 32,//the width of the clipped image\r\n 32,//the height of the clipped image\r\n player.x,//the x coordinate of where to place the image on the canvas\r\n player.y,//the y coordinate of where to place the image on the canvas\r\n player.size,//the width of the image to use\r\n player.size);//the height of the image to use\r\n\t\t}\r\n\t}", "update() {\n // On every win\n win();\n // If player goes outside\n this.outsideCanvas();\n }", "function moveScene() {\n if(newBall){\n ball.x = playerPaddle.x + playerPaddle.width/2; \n return;\n }\n if(paused){\n return;\n }\n if(onStartScreen){\n return;\n }\n if(onGameOverScreen){\n return;\n } \n ball.move();\n checkBrickCollisions();\n}", "function move(){\n\tif(left){\n\t\tif(player1.x >= 450){\n\t\t\tdiff -= speed;\n\t\t}else{\n\t\t\tplayer1.x += speed;\n\t\t}\n\t\tlastKey = \"left\";\n\t}\t\n\tif(right){\n\t\tif(player1.x <= 10){\n\t\t\tdiff += speed;\n\t\t}else{\n\t\t\tplayer1.x -= speed;\n\t\t}\n\t\tlastKey = \"right\";\n\t}\n}", "function update () {\n\t\tif (player1Target.stepsCount == 0 && player2Target.stepsCount == 0) {\n\t\t\tif (getCellType(board[player1.y][player1.x]) == CellType.Exit &&\n\t\t\t\tgetCellType(board[player2.y][player2.x]) == CellType.Exit) {\n\n\t\t\t\tendGame(true);\n\t\t\t} else {\n\t\t\t\tisUserInputBlocked = false;\n\t\t\t}\n\t\t} else {\n\t\t\tmoveStep(player1, player1Target, true);\n\t\t\tmoveStep(player2, player2Target, false);\n\t\t}\n\t}", "resetPlayer(){\n this.x = 200;\n this.y = 400; \n this.hidden = false; \n }", "function moveUp() {\n player.speedY -= 1;\n}", "death()\n {\n this.anims.play('death', false);\n //No usamos el this.input.keyboard.shutdown();ya que no nos ejecuta las animaciones de muerte.\n this.playerController.canMove = false;\n }", "onMove() {\n }" ]
[ "0.7208134", "0.7113066", "0.7053531", "0.704011", "0.7022556", "0.6979572", "0.69367415", "0.6926459", "0.68889135", "0.6854903", "0.6846287", "0.6826073", "0.6813539", "0.6756581", "0.6738945", "0.6720834", "0.67069733", "0.66970855", "0.66930366", "0.6692491", "0.6685604", "0.6665366", "0.66471124", "0.66220623", "0.6618712", "0.661518", "0.6589685", "0.65870357", "0.65767413", "0.65735763", "0.6558417", "0.6529927", "0.65278816", "0.6513007", "0.6509176", "0.6499776", "0.64969075", "0.6480651", "0.64759576", "0.6471795", "0.64590603", "0.64580894", "0.64568627", "0.64555895", "0.6455411", "0.6452898", "0.6445688", "0.64313275", "0.64226425", "0.64214206", "0.6417625", "0.6404257", "0.6366622", "0.6352448", "0.63378537", "0.63176453", "0.6314009", "0.6313715", "0.6303378", "0.62972564", "0.6296059", "0.6294912", "0.62875825", "0.628517", "0.6279759", "0.6270795", "0.6261176", "0.6245811", "0.62349904", "0.6234985", "0.62297416", "0.62286025", "0.6208519", "0.61991405", "0.61967874", "0.61954087", "0.6187209", "0.618711", "0.61817795", "0.6174193", "0.61724645", "0.6169105", "0.6166377", "0.6165997", "0.6159985", "0.61591154", "0.6158675", "0.6158534", "0.6156498", "0.61563575", "0.61504394", "0.61496377", "0.6144921", "0.61424595", "0.6141008", "0.6135666", "0.61325055", "0.6126226", "0.6120602", "0.61195016" ]
0.64742136
39
Random Piece each spawn
function playerReset() { const pieces = 'ILJOTSZ'; player.matrix = createPiece(pieces[pieces.length * Math.random() | 0]); // center new player position player.pos.y = 0; player.pos.x = (arena[0].length / 2 | 0) - (player.matrix[0].length / 2 | 0); // End game if (collide(arena, player)) { arena.forEach(row => row.fill(0)); player.score = 0; updateScore(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function spawnNewPiece() {\r\n // Create random number between 0 and 6\r\n let r = randomN = Math.floor(Math.random() * PIECES.length)\r\n // Return a newly created piece\r\n return new Piece(PIECES[r][0], PIECES[r][1]);\r\n}", "function randomPiece(){\n let r = randomN = Math.floor(Math.random() * PIECES.length) //math.floor rounds the number to an integer\n return new Piece( PIECES[r][0],PIECES[r][1]); //math.raandom generates numbers between 0 and 1 \n} //to generate numbers between 0 and 7, multiply math.random by the length of the tetromino array", "function randomPiece() {\n\t\tvar p = pieces[parseInt(Math.random() * pieces.length, 10)];\n\t\t//shape and color\n\t\treturn new Piece(p[0], p[1]);\n\t}", "function randomPiece() {\n let r = (randomN = Math.floor(Math.random() * PIECES.length));\n return new Piece(PIECES[r][0], PIECES[r][1]);\n }", "spawn() {\n this.x = getRandomInt(0, 25) * this.grid;\n this.y = getRandomInt(0, 25) * this.grid;\n }", "function randomPiece(){\r\n const pieceLetters = 'ILJOSZT'; //list each piece in string and we will refer to them with indexes\r\n piece.matrix = piece.nextMatrix;\r\n\r\n while(initPiece == 0){\r\n piece.matrix = createPiece(pieceLetters[pieceLetters.length * Math.random() | 0]); // \"| 0\" acts as a floor\r\n initPiece++;\r\n }\r\n\r\n piece.nextMatrix = createPiece(pieceLetters[pieceLetters.length * Math.random() | 0]); // \"| 0\" acts as a floor\r\n\r\n }", "function spawnPiece() {\n\n var rand = Math.floor(Math.random() * (pieces.length));\n var type = pieces[rand];\n var o = Math.floor(Math.random() * type.length);\n var p = type[o];\n var location = [];\n var ranLoc = Math.floor(Math.random() * 7);\n startCol = 3+ranLoc;\n for (var i = 0; i < p.length; i++) {\n location[i] = new Array(2);\n location[i][0] = p[i][0] + startRow;\n location[i][1] = p[i][1] +startCol ;\n }\n var end = false;\n\nactive = new Piece(type,o,location,rand);\nactive = new Piece(type,o,location,rand);\n piece2Grid();\n\n\n\n}", "function newPiece() {\n var choice = Math.floor(Math.random()*tetromino.length);\n return {pieceName: tetromino[choice], colour: colours[choice], xPos: 3, yPos: -2, rotation: 0, type: choice};\n}", "randomSpawn() {\r\n let spawned = false;\r\n while (!spawned) {\r\n const i = floor(random(4));\r\n const j = floor(random(4));\r\n if (!this.grid[i][j]) {\r\n this.grid[i][j] = 2;\r\n spawned = true;\r\n }\r\n }\r\n }", "function generatePiece() {\n switch(Math.floor(7 * Math.random() + 1)) {\n case 1:\n return Piece.I;\n case 2:\n return Piece.T;\n case 3:\n return Piece.L;\n case 4:\n return Piece.J;\n case 5:\n return Piece.S;\n case 6:\n return Piece.Z;\n default:\n return Piece.O;\n }\n}", "function RandomPieceBag()\n{\n var pieces=[];\n\n this.takePiece = function()\n {\n if(pieces.length==0)\n {\n for(var i=0; i<7; i++)\n {\n pieces.push(i);\n }\n }\n \n var randomIndex=Math.floor(Math.random()*pieces.length);\n var piece = pieces[randomIndex];\n pieces.splice(randomIndex, 1);\n return piece;\n }\n \n}", "function spawn(){\r\n\tletters.forEach((letter)=>{letter.move();});\r\n\tspawnCounter++;\r\n/*\tfor (const letter of letters){\r\n\t\tletter.move();\r\n\t}*/\r\n\tif (spawnCounter === spawnInterval){\r\n\t\tlet amntOfSpawns = Math.floor((Math.random() * 5) + 1);\r\n\t\tfor (let e = 0; e < amntOfSpawns; e++){\r\n\t\t\trandomize();\r\n\t\t}\r\n\t\tspawnCounter = 0;\r\n\t}\r\n\r\n}", "function random(){ \n var num = Math.floor(Math.random() * pieces);\n return num;\n}", "function spawnMine(){\n var xPos = Math.floor(Math.random() * (areaWidth - mineWidth)) + 1;\n var yPos = Math.floor(Math.random() * (areaHeight - mineHeight)) + 1;\n var newMine = new component(mineWidth, mineHeight, \"red\", xPos, yPos);\n mines.push(newMine)\n}", "generateRandom() {\n const { x, y } = this.getRandomPixelCoordinate();\n this.create('hero', x, y);\n }", "function generateRandomBlock() {\n arrayOfBlockFunctions = [\n getIBlock,\n getJBlock,\n getLBlock,\n getOBlock,\n getSBlock,\n getTBlock,\n getZBlock,\n ];\n\n nextPiece = Math.floor(Math.random()*arrayOfBlockFunctions.length);\n arrayOfBlockFunctions[nextPiece]();\n nextPieceBoard = pieceArray;\n}", "function newPiece() {\n\t\tvar piece = pieceOnDeck || randomPiece();\n\t\tpieceOnDeck = randomPiece();\n\t\tdrawOnDeck();\n\t\treturn piece;\n\t}", "setRandomSpawnPoint() {\n // leer\n }", "function randomize (){\n\t\thole = Math.floor(Math.random()* 9)+1;\n\t}", "static next(): State<TetrisPiece, Random.Generator> {\n return Random.intBetween(0, TYPE.length - 1).map(i => new TetrisPiece(i, 0));\n }", "function createPiece(i, j) {\n var y = -MARGIN-TILESIZE * i, x = -MARGIN-TILESIZE * j;\n var top = Math.random() * ($(\"#frame\").height() - TILESIZE - 20) + 10;\n var left = (Math.random() *\n (($(window).width() - $(\"#frame\").width()) / 2 - TILESIZE - 20)) + 10;\n var side = Math.random() > .5 ? 'right' : 'left';\n var piece = $('<div>').addClass('piece')\n .css({\n 'background-position': '' + x + 'px ' + y + 'px',\n 'top': top,\n }).css(side, left)\n .attr('data-i', i).attr('data-j', j).hide()\n .appendTo('body');\n return piece;\n }", "function randomPiece(k){\n if(players[k].replayMode == false){\n var any = Math.floor((Math.random()*(pieces.length-1))+0);\n players[k].nextPiece = pieces[any];\n }\n else{\n players[k].nextPiece = replayDictionary[k].allNextShapesData[players[k].shapesCount];\n } \n }", "function generate_random_pattern() {\n var j;\n while(generated_tile_ids.length < trial.loading_magnitude) {\n j = Math.floor(Math.random() * trial.grid_size);\n // valuex = 'tile_' + j;\n var index = generated_tile_ids.indexOf(j);\n if (index == -1) {\n generated_tile_ids.push(j);\n }\n }\n }", "function randomtile(param){\n\t$(\"div.endgame\").text(\"YOU CAN PLAY !\");\n\tvar y,x;\n\tvar boule=false;\n\tfor(y=0;y<param;y++){\n\t\tvar empty=false;\n\n\t\tfor(x=0;x<16;x++)\n\t\t{\n\t\t\tif(!$(\"div.square-container\").eq(x).text())\n\t\t\t\tboule=true;\n\t\t}\n\n\t\tif(boule)\n\t\t{\n\t\t\twhile(!empty)\n\t\t\t{\n\t\t\t\tvar rando = Math.floor(Math.random()*16);\n\t\t\t\tif(!$(\"div.square-container\").eq(rando).text())\n\t\t\t\t{\n\t\t\t\t\tempty=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar rand = Math.floor(Math.random()*4);\n\t\t\tif(rand<2)\n\t\t\t\trand=2;\n\t\t\telse\n\t\t\t\trand=4;\n\t\t\t$(\"div.square-container\").eq(rando).text(rand);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$(\"div.endgame\").text(\"YOU LOOSE!\");\n\t\t}\n\t\tsetcolors();\n\n\t}\n}", "spawns() {\n if (random(1) < 0.01) {\n // accelerates in y axis\n this.accelerations.push(new createVector(0, random(0.1, 1)));\n this.velocities.push(new createVector(0, 0));\n this.locations.push(new createVector(random(width), 0));\n this.diams.push(random(30, 50));\n }\n }", "function spawnCoin() {\n\tdo {\n\t\trandomX = parseInt(Math.floor(Math.random()*(total_x-2))+2);\n\t\trandomY = parseInt(Math.floor(Math.random()*(total_x-2))+2);\n\t} while (parts[randomX][randomY] != 0)\n\tpaint(randomX,randomY,10000);\n}", "function newActivePiece () {\n activePiece = new Piece(int(random(0, 7)));\n}", "nextPieceF() {\r\n let randNum = Math.random();\r\n if (randNum < 0.14285) {\r\n this.nextPiece = new IPiece;\r\n this.nextImage = this.images.IPiece;\r\n } else if (randNum < 0.2848) {\r\n this.nextPiece = new OPiece;\r\n this.nextImage = this.images.OPiece;\r\n } else if (randNum < 0.426) {\r\n this.nextPiece = new LPiece;\r\n this.nextImage = this.images.LPiece;\r\n } else if (randNum < 0.5688) {\r\n this.nextPiece = new TPiece;\r\n this.nextImage = this.images.TPiece;\r\n } else if (randNum < 0.7108) {\r\n this.nextPiece = new JPiece;\r\n this.nextImage = this.images.JPiece;\r\n } else if (randNum < 0.8528) {\r\n this.nextPiece = new SPiece;\r\n this.nextImage = this.images.SPiece;\r\n } else {\r\n this.nextPiece = new ZPiece;\r\n this.nextImage = this.images.ZPiece;\r\n }\r\n }", "function spawnEnemy() {\n r = getRandomInt(1, 25);\n if (r === 1) {\n newenemyY = getRandomInt(-300, -25);\n s = 1;\n new enemy(newenemyY, s);\n } else if (r === 2) {\n newenemyY = getRandomInt(800, 1050);\n s = -1;\n new enemy(newenemyY, s);\n }\n }", "function updateTiles() {\n\tvar randTile = parseInt(Math.random() * $$(\".movablepiece\").length);\n\tmoveOneTile($$(\".movablepiece\")[randTile]);\n}", "function spawn_enemy() {\n\tnum = Math.random()\n\t// console.log(\"enter: \" + num )\n\tvar spawnChance = .75;\t// 5% spawn chance\n\tif(num < spawnChance) {\n\t\t// console.log(\"enter2\")\n\t\t// choose random tile 5 tiles away for spawning\n\t\t// var offsets = [[3,4], [4,3], [0,5], [5,0]];\n\t\tvar offsetDirections = [1, -1];\n\n\t\t// var chosenOffset = offsets[Math.floor(Math.random() * 5)];\n\t\t\n\t\tnum1 = Math.floor(Math.random() * 2)\n\t\tnum2 = Math.floor(Math.random() * 2)\n\n\t\ttest_x = (Math.floor( Math.random() * 7 + 3))\n\t\ttest_y = (Math.floor( Math.random() * 7 + 3))\n\t\tconsole.log(test_x, \":\" , test_y)\n\t\tx_pos = test_x * offsetDirections[num1]\n\t\ty_pos = test_y * offsetDirections[num2]\n\t\t// console.log(chosenOffset[X] + \":\" + chosenOffset[Y])\n\t\t// chosenOffset[0] *= offsetDirections[num1];\n\t\t// chosenOffset[1] *= offsetDirections[num2];\n\t\t// console.log(\"offset x: \" + chosenOffset[X] +\" offset y: \" + chosenOffset[Y] )\n\n\t\t// add pokemon based on randomly calculated offset from player above (currently set to be 0 - 2 levels above average level of user's pokemon)\n\t\taddPokemonToMap(x_pos , y_pos, Math.floor(Math.random() * 151) + 1, getAvgLvl() + Math.floor(Math.random() * 3));\n\t\t// console.log([x_pos,y_pos])\n\t\t\n\t}\n}", "_getRandomPieceType () { return this.nextPieceType }", "function randomizePieces() {\n const randomPieces = pieces.slice()\n for (let i = randomPieces.length - 1; i > 0; i--) {\n const rand = Math.floor(Math.random() * (i + 1));\n [randomPieces[i], randomPieces[rand]] = [randomPieces[rand], randomPieces[i]];\n }\n return randomPieces\n}", "function bugSpawnRand(){\n //x = rand; y = 50\n // x:(5, 395)\n return getRandomIntInclusive(10, 395);\n}", "function randomSpawnNumber(){\r\n // Turns 4x4 grid into 1x16 array\r\n let temp = [...gameBoard[0], ...gameBoard[1], ...gameBoard[2], ...gameBoard[3]]\r\n let flag = 1;\r\n // Check that there is an empty element in the array\r\n // Breaks if you find a zero, if you get to the end with no zero array is full\r\n for (let i = 0; i < temp.length; i++){\r\n if (temp[i] === 0){\r\n break;\r\n } else if (temp[15] !== 0 && i === 15){\r\n flag = 0;\r\n }\r\n }\r\n // If you get to here there is an open place to insert a new number\r\n if (flag){\r\n randomNumberX = Math.trunc(Math.random() * 4);\r\n randomNumberY = Math.trunc(Math.random() * 4);\r\n // Find empty space to put new number in\r\n while (gameBoard[randomNumberX][randomNumberY] !== 0){\r\n randomNumberX = Math.trunc(Math.random() * 4);\r\n randomNumberY = Math.trunc(Math.random() * 4);\r\n }\r\n // Spawns a \"4 tile\" 10% of the time else it spawns a \"2 tile\"\r\n let spawn4 = Math.random();\r\n if (spawn4 < 0.1){\r\n gameBoard[randomNumberX][randomNumberY] = 4;\r\n } else {\r\n gameBoard[randomNumberX][randomNumberY] = 2;\r\n }\r\n }\r\n}", "function spawnRandomGame() {\n if(activeArray.length < 7) {\n var gameLocation;\n var posList = ['top', 'topLeft', 'topRight', 'center', 'bottomLeft', 'bottomRight', 'bottom'];\n do {\n gameLocation = posList[Math.floor((Math.random() * 7))];\n } while(activeArray[gameLocation] != null);\n spawnModule(gameLocation);\n }\n}", "findNewPieceIndex(){\n\t\tlet maxIndex = ALL_PIECE_AND_LEN.length/2;\n\t\treturn Math.floor(Math.random() * (maxIndex));\n\t}", "respawn(){\n this.x = random(this.minX + this.width/2, this.maxX - this.width/2);\n this.y = random(this.minY + this.height/2, this.maxY - this.height/2);\n }", "function randomSquare() {\n square.forEach(className => {\n className.classList.remove('mole')\n });\n //define a random position using math random\n let randomPosition = square[Math.floor(Math.random() * 9)];\n //add the mole to the randomPosition so it appears on the grid\n randomPosition.classList.add('mole');\n //assign the id of the randomPosition to hitPosition\n hitPosition = randomPosition.id;\n}", "function patternLine() {\n\tvar n = 0;\n\tvar spawnTotal = randomSP + 5;\n\t\n\tfor (var i = randomSP; i < spawnTotal; i++) {\n\t\tn = i;\n\t\tif (n > 23) { n -= 23; }\n\t\tspawn(spawnObjects[randomObj], spawnPoints[n]);\n\t\tyield WaitForSeconds(0.5);\n\t}\n}", "function makeRandomMove () {\n var step = Math.floor(Math.random() * 9);\n return [Math.floor(step / 3), step % 3];\n}", "function think() {\n var placables = Array.from(chessboard);\n var id = placables[Math.floor(Math.random() * placables.length)];\n move(id);\n}", "spawnUnit(){\n let laneNum = Math.floor(Math.random() * 3) + 1;\n return this.gameScene.spawnUnit(this.enemyTypes[Math.floor(Math.random() * this.enemyTypes.length)], -1, this.gameScene.getLane(laneNum));\n }", "function generateMove() {\n $(\"#game\").addClass('disabled');\n simonGame.push(simonColours[(Math.floor(Math.random() * 4))]);\n displayGameMoves();\n}", "function spawnPlayers() {\n\n for (var i = 0; i < numPlayers; i++) {\n var randX = floor(random(0, rows * cellSize));\n var randY = floor(random(0, cols * cellSize));\n append(player, new Player(randX, randY, i));\n //player.push(new Player(randX, randY, i));\n }\n\n}", "function jewellSpawn() {\n\n spawn = int(random(5, 15));\n print(\"Spawn: \" + spawn);\n for (var i = 0; i < spawn; i++) {\n var equis = random(0, windowWidth - 10);\n var ye = random(0, windowHeight - 40);\n jwls = createSprite(equis, ye);\n jwls.addAnimation(\"blink\", \"assets/jewels/jewels_0001.png\", \"assets/jewels/jewels_0011.png\");\n jewels.add(jwls);\n }\n\n}", "function AddRandom() {\n\n\n var location = [];\n\n for (var j = 0; j < 5; j++) {\n for (var i = 0; i < 5; i++) {\n\n if (grid[j][i].name == \"empty\") {\n\n location.push([i, j]);\n }\n }\n }\n\n if (location.length > 0) {\n\n var random = location[Math.floor(Math.random() * location.length)];\n scene.remove(grid[random[1]][random[0]]);\n\n grid[random[1]][random[0]] = Blocks[0].clone();\n\n grid[random[1]][random[0]].position.x = random[0];\n grid[random[1]][random[0]].position.y = random[1];\n grid[random[1]][random[0]].scale.x = 0.1;\n grid[random[1]][random[0]].scale.y = 0.1;\n scene.add(grid[random[1]][random[0]]);\n \n return 0;\n }\n \n return 1;\n\n}", "function randomGenerator() {\n var pieceList = [0, 1, 2, 3, 4, 5, 6];\n return pieceList.sort(function () {\n return 0.5 - rng.next()\n });\n}", "newTile(board) {\n let num = this.getRandom(this.boardSize);\n let r = Math.random();\n do {\n num = this.getRandom(this.boardSize);\n } while (board[num] != 0);\n if (r < 0.9) {\n board[num] = 2;\n } else {\n board[num] = 4;\n }\n }", "function randomSquare() {\n square.forEach(className => {\n className.classList.remove(\"mole\");\n })\n let randomPosition = square[Math.floor(Math.random() * 9)];\n randomPosition.classList.add(\"mole\");\n \n //assign id of the randomPosition to hitPosition\n hitPosition = randomPosition.id;\n }", "generateNewTetrino() {\n\n var index = Math.floor(Math.random() * this.tetrinoConfigs.length);\n var tetrino\n // Need a condition for the very first tetrino generated.\n if (this.nextQuadrant == null) {\n tetrino = new TetrinoQuadrant(this.tetrinoConfigs[index])\n } else {\n tetrino = this.nextQuadrant\n }\n\n index = Math.floor(Math.random() * this.tetrinoConfigs.length);\n this.nextQuadrant = new TetrinoQuadrant(this.tetrinoConfigs[index])\n\n // Just changing the base position of the tetrinos.\n var startingXPosition = Math.floor(Math.random() * X_SPACES-2)\n if (startingXPosition + tetrino.quad[0].length >= X_SPACES) {\n startingXPosition = 5\n }\n if (startingXPosition < 0) {\n startingXPosition = 0\n }\n\n\n // Assign the new tetrinos to the board at their starting locations.\n var y\n for(y = 0; y < tetrino.quad.length; y++) {\n var x\n for(x = 0; x < tetrino.quad[y].length; x++) {\n if (tetrino.quad[y][x] == 1) {\n // If the tetrino generated is overlapping another then game over!\n if(this.board[y][startingXPosition + x].tetrinoPiece) {\n this.gameLost = true\n }\n this.board[y][startingXPosition + x] = new Piece(tetrino.color[0], \n tetrino.color[1],\n tetrino.color[2], \n true)\n this.board[y][startingXPosition + x].activePiece = true\n }\n }\n }\n\n\n this.needsNewPiece = false\n \n // Sets the tetrino quadrant. It is useful for rotations.\n this.tetrinoQuadrant = tetrino\n this.tetrinoQuadrant.startX = startingXPosition\n this.tetrinoQuadrant.startY = 0\n\n // Increase the score because a new tetrino was generated.\n this.score += 10\n }", "function gener(){\r\n posX = length*Math.floor(8*Math.random());\r\n}", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "move() {\r\n this.x += Math.random() * 4 - 2;\r\n this.y += Math.random() * 4 - 2;\r\n }", "function randomPiece(pieceSet){\n\tvar newPiece = false;\n\tvar rp = function() { return 'PYRB'.split('')[Math.round(Math.random()*3)] + (Math.floor(Math.random()*13) + 1); }\n\tif (!pieceSet || pieceSet.length === 0) return rp();\n\twhile (!newPiece || pieceSet.indexOf(newPiece) !== pieceSet.lastIndexOf(newPiece))\n\t\tnewPiece = rp();\n\treturn newPiece;\n}", "function shuffle() {\r\n\t// random pieces are moved 200 times\r\n\tfor(var i = 0; i < 200; i++) {\r\n\t\t// create an empty array\r\n\t\tvar movables = [];\r\n\t\t// check each if the piece is movable\r\n\t\t// if movable, add the piece to the array\r\n\t\tfor(var j = 0; j < PIECES.length; j++) {\r\n\t\t\tif(movable(PIECES[j])) {\r\n\t\t\t\tmovables.push(PIECES[j]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t// choose a random piece in the array of movable pieces\r\n\t\tvar piece = Math.floor(Math.random()*movables.length);\r\n\t\t// move the piece\r\n\t\tmove(movables[piece]);\r\n\t}\r\n\tSHUFFLE = true;\r\n}", "mutate () {\n for (let i = 0; i < this.pieces.length; i++) {\n if (Math.random() < MUTATION_RATE) {\n this.pieces.splice(i, 1);\n }\n }\n }", "function patternV() {\n\tvar t = 1;\n\tvar n = randomSP;\n\tvar spawnTotal = 2;\n\tspawn(spawnObjects[randomObj], spawnPoints[randomSP]);\n\tyield WaitForSeconds(0.5);\n\t\n\tfor (var i = 0; i < spawnTotal; i++) {\n\t\tvar left = n - t;\n\t\tvar right = n + t;\n\t\tif (left < 0) { left += 23; }\n\t\tif (right > 23) { right -= 23; }\n\t\tspawn(spawnObjects[randomObj], spawnPoints[left]);\n\t\tspawn(spawnObjects[randomObj], spawnPoints[right]);\n\t\tyield WaitForSeconds(0.5);\n\t\tt++;\n\t}\n}", "function Update() {\n\tif (Time.time > nextSpawn) {\n\t\trandomObj = Mathf.Floor(Random.Range(0, spawnObjects.length));\n\t\trandomSP = Mathf.Floor(Random.Range(0, spawnPoints.length));\n\t\trandomPattern = Mathf.Floor(Random.Range(1, 4));\n\t\tnextSpawn = Time.time + spawnRate;\n\t\t\n\t\tswitch(randomPattern) {\n\t\t\tcase 1:\n\t\t\t\tpatternLine();\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\tpatternSquare();\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\tpatternV();\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t}\n}", "function main() {\n console.log(oPieces)\n //let sRandomPlan = fRandomPiece('plans');\n //let sResult = '';\n\n // if plan calls plan it should draw without replacement to prevent infinite loop\n //console.log(sRandomPlan)\n}", "function doubleRandom() {\n background(color1, 20);\n stroke(color2);\n fill(color2);\n var rand = 0;\n for (var i = 1; i < steps; i++) {\n point((width/steps) * i, (height / 2) + random(-rand, rand));\n rand = heart*random(-500, 500);\n }\n}", "function spawnFood(){\n// Find and choose empty position\n var index = emptyCells.splice(Math.floor(Math.random() * emptyCells.length), 1);\n\n // Create and position food\n\n arena.addObject(index, [OBJECT_TYPE.FOOD]);\n\n currentFood++;\n}", "function random(){\n\t\tfor(var i = 0 ; i < 1000; i ++){\n\t\t\tvar neighbor = [];\n\t\t\t// check if the surrounding squares are movable\n\t\t\tif(movable(emptyrow + 1, emptycol)){\n\t\t\t\tneighbor.push(document.getElementById(parseInt(emptyrow + 1) + \"-\" + emptycol));\n\t\t\t}if(movable(emptyrow-1, emptycol)){\n\t\t\t\tneighbor.push(document.getElementById(parseInt(emptyrow - 1) + \"-\" + emptycol));\n\t\t\t}if(movable(emptyrow, emptycol + 1)){\n\t\t\t\tneighbor.push(document.getElementById(emptyrow + \"-\" + parseInt(emptycol + 1)));\n\t\t\t}if(movable(emptyrow, emptycol - 1)){\n\t\t\t\tneighbor.push(document.getElementById(emptyrow + \"-\" + parseInt(emptycol - 1)));\n\t\t\t}\n\t\t\tif(neighbor.length != 0){\n\t\t\t\tvar temp = Math.round(Math.random()* (neighbor.length - 1));\n\t\t\t\tmove2(neighbor[temp]);\n\t\t\t}\n\t\t}\n\t}", "function shuffle() {\n\t\tfor (var i = 0; i < 1000; i++) {\n\t\t\tvar neighbors = getEmptyNeighbors();\n\t\t\tvar index = Math.round(Math.random() * (neighbors.length - 1));\n\t\t\tvar id = empty + neighbors[index];\n\t\t\tvar piece = document.getElementById(\"x\" + id);\n\t\t\tmovePiece(piece);\n\t\t}\n\t}", "function sufflePieces() {\n \n var numerot = [];\n while(numerot.length < 16){\n var satunnainen = Math.floor(Math.random() * 16)+ 1;\n if((numerot.includes(satunnainen))===false){\n numerot.push(satunnainen);\n \n }\n }\n \n \n // set all unmovable\n setUnmovable();\n \n var empty = $(\"#empty\");\n empty.removeAttr(\"id\");\n empty.addClass(\"piece\");\n \n \n for(var i =1; i<=16; i++){\n var laatta = $(\".\"+i);\n if(numerot[i-1] === 16){\n laatta.attr(\"id\",\"empty\");\n laatta.removeClass(\"piece\");\n laatta.text(\"\");\n }else{\n laatta.text(numerot[i-1]);\n }\n \n \n }\n \n setMovablePieces();\n\n // Stop the counter\n clearInterval(counter);\n\n // start new counter from 0\n laskuri();\n \n \n }", "function spawnLocation() {\n // Breaking the entire canvas into a grid of tiles.\n let rows = width / tileSize;\n let cols = (height - 40) / tileSize;\n let xPos, yPos;\n let overlap = false;\n // To prevent an overlap of the food/barrier and the snake's body.\n do {\n xPos = Math.floor(Math.random() * rows) * tileSize;\n yPos = Math.floor(Math.random() * cols) * tileSize;\n overlap = elementsOverlap({ x: xPos, y: yPos });\n } while (overlap);\n return { x: xPos, y: yPos };\n}", "move() {\n this.x = this.x + random(-2, 2);\n this.y = this.y + random(-2, 2);\n }", "move() {\n\t\tthis.x = this.x + random(-2, 2);\n\t\tthis.y = this.y + random(-2, 2);\n\t\tthis.width = this.width + random(-3, 3);\n\t\tthis.height = this.height + random(-3, 3);\n\t}", "function randomSpawnLocation(width, height, tileSize) {\n\n let xPos;\n let yPos;\n \n // Breaking the entire canvas into a grid of tiles.\n let rows = width / tileSize;\n let cols = height / tileSize;\n\n xPos = Math.floor(Math.random() * rows) * tileSize;\n yPos = Math.floor(Math.random() * 0.5*cols) * tileSize;\n\n return { x: xPos, y: yPos };\n\n}", "function randomize()\n{\n\t//alert(\"randomize\");\n\tvar rand = [0,0];\n\tvar id =0;\n\tvar index =0;\n\tvar r = 0;\n\t\n\t/* for current pieces position, which all are movable*/\n\twhile(id < 15)\n\t{\n\t\tisShiftable(parseInt(id));\n\t\tif(parseInt(Case) != 5)\n\t\t{\n\t\t\trand[index] = parseInt(id);\n\t\t\tindex++;\n\t\t}\n\t\tid++;\n\t}\n\t\n\t/* randomly select one out of all possivble movable pieces*/\n\t\n\tif((parseInt(document.getElementById(\"15\").style.left) == parseInt(\"0px\")) && (parseInt(document.getElementById(\"15\").style.top) == parseInt(\"0px\")) )\n\t{\n\t\t//rand = [2,4];\n\t\t//alert(\"if 1:\" + rand[0]+\",\"+ rand[1]);\n\t\tvar r = Math.floor((Math.random() * 2) + 1);\n\t\tshift(rand[parseInt(r)-1]);\n\t}\n\telse if((parseInt(document.getElementById(\"15\").style.left) == parseInt(\"300px\")) && (parseInt(document.getElementById(\"15\").style.top) == parseInt(\"300px\")) )\n\t{\n\t\t//rand = [1,3];\n\t\t//alert(\"if 2:\" +rand[0]+\",\"+ rand[1]);\n\t\tr = Math.floor((Math.random() * 2) + 1);\n\t\tshift(rand[parseInt(r)-1]);\n\t}\n\telse if((parseInt(document.getElementById(\"15\").style.left) == parseInt(\"0px\")) && (parseInt(document.getElementById(\"15\").style.top) == parseInt(\"300px\")) )\n\t{\n\t\t//rand = [2,3];\n\t\t//alert(\"if 3:\" +rand[0]+\",\"+ rand[1]);\n\t\tr = Math.floor((Math.random() * 2) + 1);\n\t\tshift(rand[parseInt(r)-1]);\n\t}\n\telse if((parseInt(document.getElementById(\"15\").style.left) == parseInt(\"300px\")) && (parseInt(document.getElementById(\"15\").style.top) == parseInt(\"0px\")) )\n\t{\n\t\t//rand = [1,4];\n\t\t//alert(\"if 4:\" +rand[0]+\",\"+ rand[1]);\n\t\tr = Math.floor((Math.random() * 2) + 1);\n\t\tshift(rand[parseInt(r)-1]);\n\t}\n\telse if((parseInt(document.getElementById(\"15\").style.left) == parseInt(\"0px\")))\n\t{\n\t\t//rand = [2,3,4];\n\t\t//alert(\"if 5:\" +rand[0]+\",\"+ rand[1]+\",\"+rand[2]);\n\t\tr = Math.floor((Math.random() * 3) + 1);\n\t\tshift(rand[parseInt(r)-1]);\n\t}\n\telse if((parseInt(document.getElementById(\"15\").style.top) == parseInt(\"0px\")) )\n\t{\n\t\t//rand = [1,2,4];\n\t\t//alert(\"if 6:\" +rand[0]+\",\"+ rand[1]+\",\"+rand[2]);\n\t\tr = Math.floor((Math.random() * 3) + 1);\n\t\tshift(rand[parseInt(r)-1]);\n\t}\n\telse if((parseInt(document.getElementById(\"15\").style.left) == parseInt(\"300px\")) )\n\t{\n\t\t//rand = [1,3,4];\n\t\t//alert(\"if 7:\" +rand[0]+\",\"+ rand[1]+\",\"+rand[2]);\n\t\tr = Math.floor((Math.random() * 3) + 1);\n\t\tshift(rand[parseInt(r)-1]);\n\t}\n\telse if((parseInt(document.getElementById(\"15\").style.top) == parseInt(\"300px\")) )\n\t{\n\t\t//rand = [1,2,3];\n\t\t//alert(\"if 8:\" +rand[0]+\",\"+ rand[1]+\",\"+rand[2]);\n\t\tr = Math.floor((Math.random() * 3) + 1);\n\t\tshift(rand[parseInt(r)-1]);\n\t}\n\telse\n\t{\n\t\t//rand =[1,2,3,4];\n\t\t//alert(\"if 9:\" +rand[0]+\",\"+ rand[1]+\",\"+rand[2]+ \",\"+ rand[3]);\n\t\tr = Math.floor((Math.random() * 4) + 1);\n\t\tshift(rand[parseInt(r)-1]);\n\t}\n}", "function pickSquare (){\n var col =0\n var row =0\n col = Math.floor(Math.random() * dimensions)\n row = Math.floor(Math.random() * dimensions)\n actionMove(col,row)\n}", "function makeRandomMove() {\n log(\"stockfish made a random move\", \"stockfish\");\n var moves = board.moves({ verbose: true });\n var move = moves[Math.floor(Math.random() * moves.length)];\n board.move(move);\n highlightLastOpponentMove({ from: move.from, to: move.to });\n updateBoardUI();\n }", "move() {\n this.x += random(-5, 5);\n this.y += random(-5, 5);\n }", "function randomTile() {\n // There's probably a way to get this out of the DOM via jQuery\n var choices = [\"blue\", \"brown\", \"darkgreen\", \"grey\", \"white\", \"lightgreen\"];\n var num = Math.floor(Math.random() * choices.length);\n return choices[num];\n}", "addRandomTile() {\n // adds a random tile in an empty spot\n if (!this.gameState.board.includes(0)) { // if there aren't any empty \n return;\n } else {\n while (1) {\n var randomSpot = this.getRandom(0, this.numTiles - 1);\n // if randomSpot is empty, adds a new tile there. else, finds another randomSpot\n if (this.gameState.board[randomSpot] == 0) {\n if (Math.random() < .90) {\n this.gameState.board[randomSpot] = 2;\n } else {\n this.gameState.board[randomSpot] = 4;\n }\n break;\n }\n continue;\n }\n }\n }", "generate() {\n // Refill the population with children from the mating pool\n for (let i = 0; i < this.population.length; i++) {\n let a = floor(random(this.matingPool.length));\n let b = floor(random(this.matingPool.length));\n let partnerA = this.matingPool[a];\n let partnerB = this.matingPool[b];\n let child = partnerA.crossover(partnerB);\n child.mutate(this.mutationRate);\n this.population[i] = child;\n }\n this.generations++;\n }", "function newMove() {\n game.currentGame.push(game.possibilities[Math.floor(Math.random()*4)]);\n showMoves();\n }", "async function randomInitialization() {\n if (isGameOver) {\n SetGameOver(false);\n }\n //Set Pieces to null\n //Execute the functions in a secvential manner\n if (pieces.length !== 0) {\n //If the pieces array is not null, make it so\n await SetPieces(function (previous) {\n previous = [];\n return previous;\n });\n //Tell the StateHistory to clear itself\n SetNewSimulation(true);\n SetGamePaused(false);\n }\n const piecesNames = [\n \"bishop_b\",\n \"bishop_w\",\n \"knight_b\",\n \"knight_w\",\n \"queen_b\",\n \"queen_w\",\n ];\n for (var i = 0; i < piecesNames.length; i++) {\n //Get the piece name\n let pieceName = piecesNames[i];\n //Generate random position -> rand number between 0 and 7\n let verticalPosition = verticalAxis[Math.floor(Math.random() * 8)];\n let horizontalPosition = horizontalAxis[Math.floor(Math.random() * 8)];\n //Generate the img source string\n let imgSource = \"assets/images/\" + pieceName + \".png\";\n let alreadySet = false;\n //Update the pieces array with the new values\n //Wait for the SetPieces async function to finish, so that we have the correct alreadySet Value\n await SetPieces(function (previous) {\n //Check if a piece is already placed in this position\n previous.forEach(function (element) {\n if (\n element.verticalPosition === verticalPosition &&\n element.horizontalPosition === horizontalPosition\n ) {\n alreadySet = true;\n }\n });\n if (alreadySet) {\n //Try again\n return [...previous];\n } else {\n return [\n ...previous,\n new Piece(\n pieceName,\n imgSource,\n verticalPosition,\n horizontalPosition\n ),\n ];\n }\n });\n if (alreadySet) {\n //retry to find a new position for the current piece\n i--;\n continue;\n }\n }\n //Set IsStateUpdated to false for StateHistory rendering\n SetIsStateUpdated(false);\n }", "function addRandomMines(board, amount, i, j) {\r\n var allLocations = buildPossibleLocations(board, i, j);\r\n for (var i = 0; i < amount; i++) {\r\n var idx = getRandomInt(0, allLocations.length);\r\n var emptyCell = allLocations[idx];\r\n board[emptyCell.i][emptyCell.j].isMine = true;\r\n allLocations.splice(idx, 1);\r\n }\r\n return board\r\n}", "function stones () {\nrealityStone = Math.floor((Math.random() * 12) + 1);\npowerStone = Math.floor((Math.random() * 8) + 1);\nsoulStone = Math.floor((Math.random() * 6) + 1);\ntimeStone = Math.floor((Math.random() * 10) + 1);\n}", "randomizeMushrooms() {\n for(let i = 0; i < this.mushroomList; i++) {\n const currentMushroom = this.mushroomList[i];\n currentMushroom.xPos = 32 + (Math.random() * (this.canvas.width - 64));\n currentMushroom.yPos = 32 + (Math.random() * (this.canvas.height - 64));\n \n }\n }", "function getRandomTile() {\n return Math.floor(Math.random() * tilecolors.length);\n }", "function getRandomTile() {\n return Math.floor(Math.random() * tilecolors.length);\n }", "function getRandomTile() {\n return Math.floor(Math.random() * tilecolors.length);\n }", "respawn(){\n this.x = this.orgX;\n this.y = this.orgY;\n let ang = random(-PI / 4, PI / 4) + (random(1) > 0.5 ? 0 : PI);\n this.xspeed = cos(ang) * this.speed;\n this.yspeed = sin(ang) * this.speed;\n }", "function chaosAI(tile)\n{\n\treturn Math.random();\n}", "function Piece() {\n //--------------------------------------------------------attributes\n this.pos = createVector(width - 50, height - 50);\n this.vel = createVector(random(-5, 5), random(-5, 5));\n this.miceNum = 0;\n this.timer = 0;\n\n\n //------------------------------------------------------- methods\n this.display = function() {\n image(mice[this.miceNum], this.pos.x, this.pos.y);\n this.timer++;\n\n if (this.timer > 20) {\n this.miceNum = this.miceNum + 1;\n this.timer = 0;\n }\n\n\n //don't go past\n if (this.miceNum > mice.length - 1) {\n this.miceNum = 0;\n }\n }\n\n this.drive = function() {\n this.pos.add(this.vel);\n\n if (this.pos.x > width) this.pos.x = 0;\n if (this.pos.x < 0) this.pos.x = width;\n if (this.pos.y > height) this.pos.y = 0;\n if (this.pos.y < 0) this.pos.y = height;\n\n }\n\n}", "function shufflemiseh()\n\t{\n\t\tvar adj = getadjacentpoints();\n\t\tvar rand = Math.floor(Math.random() * adj.length);\n\t\tvar piecetomove = adj[rand];\n\t\tvar l = piecetomove.split(\",\");\n\t\tl[0] = l[0] + \"px\";\n\t\tl[1] = l[1] + \"px\";\n\t\tvar davoid = whereisthespace();\n\t\tvar y = davoid[0];\n\t\tvar x = y.split(\",\");\n\n\t\tvar m = document.querySelectorAll(\"div.puzzlepiece\");\n\t\tfor (var i = 0; i < m.length; i++)\n\t\t{\n\t\t\tif (m[i].style.left == l[0] && m[i].style.top == l[1])\n\t\t\t{\n\t\t\t\tm[i].style.left = x[0] + \"px\";\n\t\t\t\tm[i].style.top = x[1] + \"px\";\n\t\t\t}\n\t\t}\n\t}", "function pickRandomTile(){\n\tvar randomX = Math.floor(( Math.random() * dim_x));\n\tvar randomY = Math.floor(( Math.random() * dim_y));\n\treturn (randomX + '-' + randomY);\n}", "function randomSquare() {\n // clearing all squares first to be sure there are no moles\n square.forEach(moleClass => {\n moleClass.classList.remove('mole')\n })\n // getting our random number using math.floor to make sure its always under 9\n let randomNum = square[Math.floor(Math.random() * 9)];\n randomNum.classList.add('mole');\n\n // storing the position id of the mole so that we can check if the user clicks on it\n molePoisiton = randomNum.id;\n}", "function mineGeneration () {\n bombs = new Array(size * size).fill(0); // create an array with same amount of cells\n bombs = bombs.map((a, index) => {\n return a = index;\n });\n\n // randomized the placement of the new array of numbers (in this case it is 100)\n bombs.sort((a, b) => {\n return 0.5 - Math.random()\n });\n\n // set a new array of the first set of numbers to set the bomb placements based on ratio\n bombs.splice(ratio);\n\n // mapped through the array to change attribute of the cell to contain the bomb\n bombs.map((a) => {\n HTMLboard.children[a].setAttribute(\"data-ismine\", true);\n });\n return bombs;\n}", "function Makefirtsmove() {\n\n var moves = ['1', '3', '5', '7', '9'];\n var random = Math.floor(Math.random() * 5);\n\n PutComputerValueInTile(moves[random]);\n\n}", "function create_pieces() {\n\n\tpieceData = new Array();\n\tfreeSpaces = new Array();\n\t\n\t/* Loop through all the squares on the board */\n\tfor (var i = 0, li = squareData.length; i < li; i++) {\n\t\n\t\t/* If the square is blank, then we want to create a new piece */\n\t\tif (squareData[i].pieceID == -1) {\n\t\t\n\t\t\tnew_piece(i);\n\t\t\t\n\t\t\tvar pieceCount = (pieceData.length - 1)\n\t\t\t\n\t\t\twhile (pieceData[pieceCount].length < maxPieceLength && freeSpaces[pieceCount].length > 0) {\n\t\t\t\t/* Get a random free space from around the current piece */\n\t\t\t\tvar randomIndex = Math.floor(Math.random() * freeSpaces[pieceCount].length);\n\t\t\t\tvar randomSquareID = freeSpaces[pieceCount][randomIndex];\n\t\t\t\t\n\t\t\t\t/* Remove the free space */\n\t\t\t\tfreeSpaces[pieceCount].splice(randomIndex, 1);\n\t\t\t\t\n\t\t\t\t/* Add the new seqment */\n\t\t\t\tnew_segment(randomSquareID);\n\t\t\t}\n\t\t}\n\t}\n}", "function player1_turn()\r\n{\r\n\tvar x = Math.round(Math.random()*(gridSize-1));\r\n\tvar y = Math.round(Math.random()*(gridSize-1));\r\n\treturn hex(x,y);\r\n}", "function randomEnemy() {\n var row = getRandomIntInclusive(2, 4);\n var speed = getRandomIntInclusive(50, 500);\n allEnemies.push(new Enemy(0, row, speed));\n}", "function genMine(field, places, i) {\r\n let gen = getRandomInt(0, places.length-1)\r\n let x = places[gen][0]\r\n let y = places[gen][1]\r\n \r\n // Checks if the spot already has a mine\r\n if (field[y][x] == 12) {\r\n genMine(field, places, i);\r\n } else {\r\n // Places a mine\r\n field[y][x] = 12;\r\n places.splice(gen, 1);\r\n cycle(field, x, y, 1);\r\n }\r\n}", "move() {\n\n\t\tthis.x += random(-5, 5);\n\t\tthis.y += random(-5, 5);\n\n\t}", "move() {\n this.x = this.x + random(-10,10);\n this.y = this.y + random(-10,10);\n }", "function generateTiles() { \n\tposArr = [];\n\tvar tilArr = [];\n\tvar finArr = [];\n\tfor(var i = 0; i < 24; i++){\n\t\tvar temp = randInt(0, 23);\n\t\twhile(posArr.indexOf(temp) >= 0){\n\t\t\ttemp = randInt(0, 23);\n\t\t}\n\t\tposArr[i] = temp;\n\t}\n\tfor(var i = 0; i < 24; i++) {\n\t\tvar temp = new Tile(\"tile\", TextureFrame(posArr[i] + \".png\"), i);\n\t\ttilArr.push(temp);\n\t\ttiles.set(i, tilArr[i]);\n\t\tpuzzleC.addChild(tilArr[i]);\n\t}\n\t\n\temptyTile = new Tile(\"emptyTile\", TextureFrame(\"24.png\"), 24);\n\tposArr.push(24)\n\temptyTile.visible = false;\n\ttiles.set(24, emptyTile);\n\tpuzzleC.addChild(emptyTile);\n\t\n\tconsole.log(posArr);\n\tconsole.log(tilArr);\n}", "function makeRandomMove () {\n var possibleMoves = game.moves()\n\n // game over\n if (possibleMoves.length === 0) return\n\n var randomIdx = Math.floor(Math.random() * possibleMoves.length)\n game.move(possibleMoves[randomIdx])\n board.position(game.fen())\n updateStatus()\n}", "function spawnItems() {\r\n\t//Spawn a gun\r\n\tvar gun = getRandomOf(gunPickList);\r\n\tvar point = getRandomOf(flatMap.filter(tile => tile.canHaveGun));\r\n\tif (!point || !gun) {\r\n\t\tlog(2, 'Gun spawn error');\r\n\t\treturn;\r\n\t} else if (!point.gun) {\r\n\t\tvar gun = {\r\n\t\t\tx: point.x,\r\n\t\t\ty: point.y,\r\n\t\t\titem: gun,\r\n\t\t\tid: newID(false),\r\n\t\t\tc: rarityColors[Guns[gun].rarity],\r\n\t\t\tsymbol: Guns[gun].symbol,\r\n\t\t\ttype: 'gun'\r\n\t\t};\r\n\t\titems.push(gun);\r\n\t\tpoint.gun = gun;\r\n\t}\r\n\t//Spawn an item\r\n\tvar item = getRandomOf(itemPickList);\r\n\tvar point = getRandomOf(flatMap.filter(tile => tile.canHaveItem));\r\n\t// console.log(itemPickList,item,point);\r\n\tif (!point || !item) {\r\n\t\tlog(2, 'Item spawn error');\r\n\t\treturn;\r\n\t} else if (!point.item) {\r\n\t\tvar item = {\r\n\t\t\tx: point.x,\r\n\t\t\ty: point.y,\r\n\t\t\titem: item,\r\n\t\t\tid: newID(false),\r\n\t\t\tc: [0, 0, 0, 255],\r\n\t\t\tsymbol: Items[item].symbol,\r\n\t\t\ttype: 'item'\r\n\t\t};\r\n\t\titems.push(item);\r\n\t\tpoint.item = item;\r\n\t}\r\n}" ]
[ "0.8273004", "0.7953681", "0.78579986", "0.78180224", "0.7641173", "0.75563353", "0.752768", "0.74774486", "0.74278593", "0.74239033", "0.7291698", "0.72174346", "0.7075895", "0.7065599", "0.70552313", "0.70097184", "0.69829094", "0.6976428", "0.69734263", "0.6973126", "0.69684505", "0.6954989", "0.6933776", "0.69197214", "0.6890141", "0.6874484", "0.68671006", "0.68647003", "0.6842883", "0.6820303", "0.6800174", "0.6791457", "0.6784867", "0.6778161", "0.67775404", "0.6760708", "0.6759245", "0.6758299", "0.6749059", "0.6734701", "0.6716732", "0.6716062", "0.671083", "0.6700128", "0.6698144", "0.669601", "0.66775304", "0.6676655", "0.6670642", "0.6664653", "0.6662958", "0.66597193", "0.66544443", "0.66544443", "0.6652932", "0.66390085", "0.66388077", "0.66349196", "0.6629671", "0.6616208", "0.66122025", "0.66108626", "0.6608195", "0.659401", "0.65906674", "0.6585664", "0.6579268", "0.6549827", "0.6547058", "0.6545672", "0.6537044", "0.65145063", "0.6511757", "0.64959157", "0.6485435", "0.6476749", "0.6475041", "0.64741194", "0.6448029", "0.6443487", "0.64380306", "0.64369357", "0.64369357", "0.64369357", "0.6432183", "0.64320797", "0.64316434", "0.6428685", "0.6420846", "0.6418958", "0.64178675", "0.64104295", "0.6410062", "0.640839", "0.6407104", "0.6403345", "0.63993865", "0.639645", "0.6389845", "0.63758034", "0.6371125" ]
0.0
-1
Rotate Pieces Transpose + Reverse = Rotation
function rotate(matrix, dir) { for (let y = 0; y < matrix.length; ++y) { for (let x = 0; x < y; ++x) { // switch tuple [ matrix[x][y], matrix[y][x], ] = [ matrix[y][x], matrix[x][y], ]; } } if (dir > 0) { matrix.forEach(row => row.reverse()); } else { matrix.reverse(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function rotateImage(a) { \n let len = a.length\n for (i = 0; i < len; i++, len--) { \n let end = len - 1; \n for ( j = i; j < end; j++) { \n let tail = a.length - j - 1; \n\n let temp = a[i][j]; \n a[i][j] = a[tail][i]; \n a[tail][i] = a[end][tail]; \n a[end][tail] = a[j][end]; \n a[j][end] = temp; \n } \n } \n return a\n}", "function rotateSwap(){\n rotFactor *= -1;\n}", "function rotateInPlace(mat){\n\n}", "pieceRotate(matrix, dir) {\n\n // Transpose Step\n for (let y = 0; y < matrix.length; ++y) {\n for (let x = 0; x < y; ++x) {\n // Swap (tubble switch)\n [matrix[x][y], matrix[y][x]] = [matrix[y][x], matrix[x][y]];\n }\n }\n\n // Reverse Step\n if (dir > 0) {\n // if direciton is positive\n matrix.forEach(row => {\n row.reverse()\n });\n } else {\n // if direciton is negative\n matrix.reverse();\n }\n\n }", "function rotate(matrix, times) {\n //for each time\n for (var t = 0; t < times; t++) {\n //flip the shape matrix\n matrix = transpose(matrix);\n //and for the length of the matrix, reverse each column\n for (var i = 0; i < matrix.length; i++) {\n matrix[i].reverse();\n }\n }\n return matrix;\n}", "function rotate(arr) {\n console.log(arr);\n var int = arr.length;\n for (var i = 0; i < Math.floor(int / 2); i++) {\n var first = i;\n var last = int - 1 - i;\n for (var j = first; j < last; j++) {\n var offset = j - first;\n var top = arr[first][j];\n arr[first][j] = arr[last - offset][first];\n arr[last - offset][first] = arr[last][last - offset];\n arr[last][last - offset] = arr[j][last];\n arr[j][last] = top;\n }\n }\n return arr;\n}", "function rotate() {\n\n var newOrient = active.orientation + 1;\n undrawPiece();\n\n if (newOrient >= active.type.length) {\n newOrient = 0;\n }\n var test = active.type[newOrient];\n for (var i = 0; i < test.length; i++) {\n active.location[i][0] =test[i][0] + active.pivot.r;\n active.location[i][1] = test[i][1] + active.pivot.c;\n }\n if (check(active.location)) {\n active.orientation = newOrient;\n\n }\n\n else {\n var orig = active.type[active.orientation];\n for (var i = 0; i < orig.length; i++) {\n active.location[i][0] =orig[i][0] + active.pivot.r;\n active.location[i][1] =orig[i][1] + active.pivot.c;\n }}\n piece2Grid();\n drawBoard();\n return false;\n}", "function rotatePiece90(piece){\n let newpiece = copyMatrix(piece);\n const x = Math.floor(piece_dim/2);\n const y = piece_dim - 1;\n for (let i = 0; i < x; i++) {\n for (let j = i; j < y - i; j++) {\n k = newpiece[i][j];\n newpiece[i][j] = newpiece[y - j][i];\n newpiece[y - j][i] = newpiece[y - i][y - j];\n newpiece[y - i][y - j] = newpiece[j][y - i]\n newpiece[j][y - i] = k\n }\n }\n\n return newpiece;\n}", "function rotate(array, k) {\n for (var j = 0; j < k; j++) {\n var p = array[0];\n for (var i = 0; i < array.length - 1; i++) {\n array[i] = array[i + 1];\n }\n array[array.length - 1] = p;\n }\n return array;\n}", "function rotate(data) {\n return data[0].map((x, i) => data.map(x => x[data.length - i - 1]));\n}", "function rotate(matrix, dir) {\n for(let y = 0; y < matrix.length; y++) {\n for (let x = 0; x < y; x++) {\n [matrix[x][y], matrix[y][x]] = [matrix[y][x], matrix[x][y]];\n }\n }\n if (dir>0) {\n matrix.forEach(row => row.reverse());\n }\n else {\n matrix.reverse();\n }\n}", "setRotate(angle, x, y, z){\n let e, s, c, len, rlen, nc, xy, yz, zx, xs, ys, zs;\n\n angle = Math.PI * angle / 180;\n e = this.elements;\n\n s = Math.sin(angle);\n c = Math.cos(angle);\n\n if (0 !== x && 0 === y && 0 === z) {\n // Rotation around X axis\n if (x < 0) {\n s = -s;\n }\n e[0] = 1; e[4] = 0; e[ 8] = 0; e[12] = 0;\n e[1] = 0; e[5] = c; e[ 9] =-s; e[13] = 0;\n e[2] = 0; e[6] = s; e[10] = c; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n } else if (0 === x && 0 !== y && 0 === z) {\n // Rotation around Y axis\n if (y < 0) {\n s = -s;\n }\n e[0] = c; e[4] = 0; e[ 8] = s; e[12] = 0;\n e[1] = 0; e[5] = 1; e[ 9] = 0; e[13] = 0;\n e[2] =-s; e[6] = 0; e[10] = c; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n } else if (0 === x && 0 === y && 0 !== z) {\n // Rotation around Z axis\n if (z < 0) {\n s = -s;\n }\n e[0] = c; e[4] =-s; e[ 8] = 0; e[12] = 0;\n e[1] = s; e[5] = c; e[ 9] = 0; e[13] = 0;\n e[2] = 0; e[6] = 0; e[10] = 1; e[14] = 0;\n e[3] = 0; e[7] = 0; e[11] = 0; e[15] = 1;\n } else {\n // Rotation around another axis\n len = Math.sqrt(x*x + y*y + z*z);\n if (len !== 1) {\n rlen = 1 / len;\n x *= rlen;\n y *= rlen;\n z *= rlen;\n }\n nc = 1 - c;\n xy = x * y;\n yz = y * z;\n zx = z * x;\n xs = x * s;\n ys = y * s;\n zs = z * s;\n\n e[ 0] = x*x*nc + c;\n e[ 1] = xy *nc + zs;\n e[ 2] = zx *nc - ys;\n e[ 3] = 0;\n\n e[ 4] = xy *nc - zs;\n e[ 5] = y*y*nc + c;\n e[ 6] = yz *nc + xs;\n e[ 7] = 0;\n\n e[ 8] = zx *nc + ys;\n e[ 9] = yz *nc - xs;\n e[10] = z*z*nc + c;\n e[11] = 0;\n\n e[12] = 0;\n e[13] = 0;\n e[14] = 0;\n e[15] = 1;\n }\n\n return this;\n }", "function matrixRotation(arr){\n var rotate = new Array(15);\n for(var i =0;i<15;i++){\n rotate[i] = new Array(15);\n for(var j=0;j<15;j++){\n rotate[i][j] = arr[14-i][j];\n }\n }\n\n return rotate;\n}", "function rotate(arr) {\r\n let result1 = []\r\n for (let j = 0; j < arr.length; j++) {\r\n let sub = []\r\n for (let i = arr.length - 1; i >= 0; i--) {\r\n sub.push(arr[i][j])\r\n }\r\n result1.push(sub)\r\n }\r\n console.log(result1)\r\n}", "function rotatePiece(piece, angle){\n let newpiece = copyMatrix(piece);\n for (var i = 0; i < angle; i++) {\n newpiece = rotatePiece90(newpiece);\n }\n return newpiece;\n}", "function rotateTetro() {\n\tconst prevTetroState = activeTetro.shape\n\tactiveTetro.shape = activeTetro.shape[0].map((val, index) => activeTetro.shape.map((row) => row[index]).reverse())\n\tif (hasCollisions()) {\n\t\tactiveTetro.shape = prevTetroState\n\t}\n}", "rotate() {\r\n let originX = this.pivotCube[0];\r\n let originY = this.pivotCube[1];\r\n let tempCubes = [[0, 0], [0, 0], [0, 0], [0, 0]];\r\n this.cubes.forEach(rotateCube)\r\n\r\n function rotateCube(item, index) {\r\n let x = item[0];\r\n let y = item[1];\r\n tempCubes[index][0] = Math.round(originY - y + originX);\r\n tempCubes[index][1] = Math.round(x - originX + originY);\r\n }\r\n\r\n return new Tetromino(tempCubes, this.pivotCube, this.material);\r\n }", "function rotateCounterClockwise(arr){\n // add whatever parameters you deem necessary - good luck!\n let newArr =[];\n \n for(let i=0; i < arr.length; i++){\n let temp = [];\n for(let j=0; j < arr.length; j++){\n temp.push(arr[j][i]);\n }\n newArr.push(temp);\n }\n \n return newArr.reverse();\n}", "function rotate(matrix, dir) {\n for(var y = 0; y < matrix.length; y++){\n for(var x = 0; x < y; x++){\n [\n matrix[x][y],\n matrix[y][x],\n ] = [\n matrix[y][x],\n matrix[x][y],\n ];\n }\n }\n\n if(dir > 0) {\n matrix.forEach(row => row.reverse());\n }\n else {\n matrix.reverse();\n }\n}", "rotate(rotateAmount) {\n }", "rotate(angle, x, y, z){\n return this.multiply(new Matrix4().setRotate(angle, x, y, z));\n }", "function rotate(ar) {\n var rotated, i, j;\n\n function new_array(len, fn) {\n var out = [], k;\n\n for (k = 0; k < len; k++) {\n out.push(fn());\n }\n return out;\n }\n\n // Generate matrix of appropriate dimensions\n rotated = new_array(ar[0].length, function () {\n return new_array(ar.length, function () {\n return [];\n });\n });\n\n // Flip data around\n for (i = 0; i < ar.length; i++) {\n for (j = 0; j < ar[0].length; j++) {\n rotated[j][i] = ar[i][j];\n }\n }\n\n return rotated;\n}", "function main() {\n var n_temp = readLine().split(' ');\n var size = parseInt(n_temp[0]);\n var rotations = parseInt(n_temp[1]);\n array = readLine().split(' ');\n array = array.map(Number);\n \n \n //left rotation\n var firstPart = reverse(array.slice(0,rotations));\n var secondPart = reverse(array.slice(rotations,size));\n \n var res = reverse(firstPart.concat(secondPart))\n \n console.log(res.join(' '));\n \n \n \n \n function reverse(array) {\n \n var initialPos = 0;\n var endPos = array.length -1;\n\n while (initialPos < endPos) {\n \n var temp = array[initialPos];\n array[initialPos] = array[endPos];\n array[endPos] = temp;\n initialPos++;\n endPos--;\n }\n \n return array;\n \n }\n \n \n \n\n}", "rotate() {\n const newCells = []\n for (let i = 0; i < this.cells.length; i++) {\n newCells[i] = []\n for (let j = 0; j < this.cells.length; j++) {\n newCells[i][j] = this.cells[this.cells.length - 1 - j][i]\n }\n }\n this.cells = newCells\n }", "rotateAntiClockwise()\r\n {\r\n this.rotation -= Math.PI / 180;\r\n }", "function rotate(matrix) {\r\n const N = (matrix.length - 1);\r\n const result = matrix.map((row, i) => \r\n row.map((val, e) => matrix[N - e][i])\r\n );\r\n matrix.length = 0;\r\n matrix.push(...result);\r\n return matrix;\r\n}", "function rotatePieceZ(piece) {\n let rotatedPiece = [[[0, 0], [0, 0]], [[0, 0], [0, 0]]];\n for (let z = 0; z < 2; z++) {\n if (piece[z][0][0] === 1) {\n rotatedPiece[z][1][0] = 1;\n }\n if (piece[z][0][1] === 1) {\n rotatedPiece[z][0][0] = 1;\n }\n if (piece[z][1][0] === 1) {\n rotatedPiece[z][1][1] = 1;\n }\n if (piece[z][1][1] === 1) {\n rotatedPiece[z][0][1] = 1;\n }\n }\n return rotatedPiece;\n}", "rotate(axis, angle) {\n let x = axis[0];\n let y = axis[1];\n let z = axis[2];\n let n = Math.sqrt(x * x + y * y + z * z);\n x /= n;\n y /= n;\n z /= n;\n\n let xx = x * x;\n let yy = y * y;\n let zz = z * z;\n let c = Math.cos(angle);\n let s = Math.sin(angle);\n let oneMinusCosine = 1 - c;\n\n let r00 = xx + (1 - xx) * c;\n let r01 = x * y * oneMinusCosine + z * s;\n let r02 = x * z * oneMinusCosine - y * s;\n let r10 = x * y * oneMinusCosine - z * s;\n let r11 = yy + (1 - yy) * c;\n let r12 = y * z * oneMinusCosine + x * s;\n let r20 = x * z * oneMinusCosine + y * s;\n let r21 = y * z * oneMinusCosine - x * s;\n let r22 = zz + (1 - zz) * c;\n\n let m00 = this._matrix[0 * 4 + 0];\n let m01 = this._matrix[0 * 4 + 1];\n let m02 = this._matrix[0 * 4 + 2];\n let m03 = this._matrix[0 * 4 + 3];\n let m10 = this._matrix[1 * 4 + 0];\n let m11 = this._matrix[1 * 4 + 1];\n let m12 = this._matrix[1 * 4 + 2];\n let m13 = this._matrix[1 * 4 + 3];\n let m20 = this._matrix[2 * 4 + 0];\n let m21 = this._matrix[2 * 4 + 1];\n let m22 = this._matrix[2 * 4 + 2];\n let m23 = this._matrix[2 * 4 + 3];\n\n this._matrix[0] = r00 * m00 + r01 * m10 + r02 * m20;\n this._matrix[1] = r00 * m01 + r01 * m11 + r02 * m21;\n this._matrix[2] = r00 * m02 + r01 * m12 + r02 * m22;\n this._matrix[3] = r00 * m03 + r01 * m13 + r02 * m23;\n this._matrix[4] = r10 * m00 + r11 * m10 + r12 * m20;\n this._matrix[5] = r10 * m01 + r11 * m11 + r12 * m21;\n this._matrix[6] = r10 * m02 + r11 * m12 + r12 * m22;\n this._matrix[7] = r10 * m03 + r11 * m13 + r12 * m23;\n this._matrix[8] = r20 * m00 + r21 * m10 + r22 * m20;\n this._matrix[9] = r20 * m01 + r21 * m11 + r22 * m21;\n this._matrix[10] = r20 * m02 + r21 * m12 + r22 * m22;\n this._matrix[11] = r20 * m03 + r21 * m13 + r22 * m23;\n\n return this._matrix;\n }", "function rotate(current) {\n let newCurrent = [];\n for (let y = 0; y < 4; ++y) {\n newCurrent[y] = [];\n for (let x = 0; x < 4; ++x) {\n newCurrent[y][x] = current[3 - x][y];\n }\n }\n\n return newCurrent;\n}", "function rotateZ(angle){\n return [[Math.cos(angle),Math.sin(angle),0],[-Math.sin(angle),Math.cos(angle),0],[0,0,1]];\n}", "function rotate(matrix, dir) {\n for(let y = 0; y < matrix.length; ++y) {\n for(let x = 0; x < y; ++x) {\n [matrix[x][y], matrix[y][x]]\n =\n [matrix[y][x], matrix[x][y]]\n }\n }\n if(dir > 0) {\n matrix.forEach(row => row.reverse());\n } else {\n matrix.reverse();\n }\n}", "rotateClockwise()\r\n {\r\n this.rotation += Math.PI / 180;\r\n }", "function rotate(matrix, dir){\r\n var test = matrix\r\n for(let i = 0; i < matrix.length; i++){\r\n for(let j = 0; j < i; j++ ){\r\n //[ matrix[j][i], matrix[i][j] ] = [ matrix[i][j], matrix[j][i] ]; same as below\r\n var temp = matrix[i][j];\r\n matrix[i][j] = matrix[j][i];\r\n matrix[j][i] = temp;\r\n }\r\n }\r\n if(dir > 0){\r\n matrix.forEach(row => row.reverse()); // reverses the content in the rows\r\n } else {\r\n matrix.reverse(); // reverse the rows\r\n }\r\n }", "function rotate() {\r\n undraw();\r\n currentRotation++;\r\n if (currentRotation === current.length) {\r\n // if end of the array is reached then go back to the start.\r\n currentRotation = 0;\r\n }\r\n current = theTetriminos[random][currentRotation];\r\n checkRotatedPosition()\r\n draw();\r\n }", "function rotate(grid) {\r\n\tvar newGrid = clear();\r\n\tfor (var i = 0; i < 4; i++) {\r\n\t\tfor (var j = 0; j < 4; j++) {\r\n\t\t\tnewGrid[i][j] = grid[j][i];\r\n\t\t}\r\n\t}\r\n\treturn newGrid;\r\n}", "function rotate( array , times ){\n\tvar rotations = times;\n \tarray = array.slice();\n \twhile(rotations>0){\n \trotations--;\n var temp = array.shift();\n array.push(temp)\n \t\t}\n \treturn array.join('');\n\t}", "function rotate(matrix, dir) {\n for (let y = 0; y < matrix.length; ++y) {\n for (let x = 0; x < y; ++x) {\n [matrix[x][y], matrix[y][x]] = [matrix[y][x], matrix[x][y]];\n }\n }\n\n if (dir > 0) {\n matrix.forEach(row => row.reverse());\n } else {\n matrix.reverse();\n }\n}", "function rotate(v){\n\t\treturn $M([[0, -1],[1, 0]]).x(v)\n\t}", "function rotate(rotval)\n{\n // Loop through each value pair\n for (var i = 0, size = positions.length; i < size; i+=2)\n {\n // Get x and y coordinates\n var x = positions[i];\n var y = positions[i+1];\n\n // Perform x and y calculation based on affine matrix values\n x = x * Math.cos(rotval) - y * (Math.sin(rotval));\n y = x * Math.sin(rotval) + y * Math.cos(rotval);\n\n // Set position values\n positions[i] = x;\n positions[i+1] = y;\n }\n\n // Redraw image\n loadImage();\n}", "function rotate90(array) {\n let n = array.length, r = Math.floor(n / 2);\n\n // Loop through the diagonal slice relevant for this matrix\n for (let y = 0; y < r; y++) {\n for (let x = y; x < n - y - 1; x++) {\n // Perform one \"swap\" (rotating 4 individual elements in the matrix)\n let temp = array[y][x];\n array[y][x] = array[n - x - 1][y];\n array[n - x - 1][y] = array[n - y - 1][n - x - 1];\n array[n - y - 1][n - x - 1] = array[x][n - y - 1];\n array[x][n - y - 1] = temp;\n }\n }\n\n // Although this function modifies the array in place, by convention\n // you still want to return it (so you can chain methods, for example).\n return array;\n}", "applyRotation() {\n this.forwardFacing[0] = Math.sin(this.xzAngle) * Math.cos(this.yzAngle);\n this.forwardFacing[1] = Math.sin(this.yzAngle);\n this.forwardFacing[2] = Math.cos(this.xzAngle) * Math.cos(this.yzAngle);\n\n this.rightFacing[0] = Math.cos(this.xzAngle);\n this.rightFacing[1] = 0\n this.rightFacing[2] = -Math.sin(this.xzAngle);\n\n this.upFacing[0] = -Math.sin(this.xzAngle) * Math.sin(this.yzAngle);\n this.upFacing[1] = Math.cos(this.yzAngle);\n this.upFacing[2] = -Math.cos(this.xzAngle) * Math.sin(this.yzAngle);\n }", "function rotateClockwise(a) {\n let height = a.length\n let width = a[0].length\n let b = []\n for (let y = 0; y < width; y++) {\n b.push([])\n for (let x = 0; x < height; x++) {\n b[y].push(null)\n }\n }\n for (let y = 0; y < height; y++) {\n for (let x = 0; x < width; x++) {\n var tmp = a[y][x]\n b[x][height-y-1] = a[y][x]\n }\n }\n return b\n}", "function rotate(matrix) {\n let n = matrix.length;\n // iterate through layers (aka the squares). There're 2 in a 4x4 matrix\n for (let x = 0; x < n/2; x++) {\n // need to -1 because we don't need to rotate element at y=n-x. It's rotated with y=x\n for (let y = x; y < n - x - 1; y++) {\n let top = matrix[x][y]; // store top\n matrix[x][y] = matrix[n - y - 1][x]; // left -> top\n matrix[n - y - 1][x] = matrix[n - x - 1][n - y - 1]; // bottom -> left\n matrix[n - x - 1][n - y - 1] = matrix[y][n - x -1]; // right -> bottom\n matrix[y][n - x -1] = top ; // top -> right\n }\n }\n}", "rotateRender() { \n push();\n imageMode(CENTER);\n translate(this.x + this.width / 2, this.y + this.height / 2);\n angleMode(DEGREES);\n rotate(this.angle);\n image(this.images[this.index], 0, 0, this.width, this.height);\n pop();\n }", "rotateFront(){\r\n let square1 = this.right.squares[0];\r\n let square2 = this.right.squares[3];\r\n let square3 = this.right.squares[6];\r\n this.right.squares[0] = this.up.squares[6];\r\n this.right.squares[3] = this.up.squares[7];\r\n this.right.squares[6] = this.up.squares[8];\r\n this.up.squares[6] = this.left.squares[8];\r\n this.up.squares[7] = this.left.squares[5];\r\n this.up.squares[8] = this.left.squares[2];\r\n this.left.squares[8] = this.down.squares[2];\r\n this.left.squares[5] = this.down.squares[1];\r\n this.left.squares[2] = this.down.squares[0];\r\n this.down.squares[2] = square1;\r\n this.down.squares[1] = square2;\r\n this.down.squares[0] = square3;\r\n this.front.spinCW();\r\n }", "function rotateMatrix2(arr) {\n function swap(arr, idx1, idx2) {\n let temp = arr[idx2][idx1];\n arr[idx2][idx1] = arr[arr.length - idx1 - 1][idx2];\n arr[arr.length - idx1 - 1][idx2] =\n arr[arr.length - idx2 - 1][arr.length - idx1 - 1];\n arr[arr.length - idx2 - 1][arr.length - idx1 - 1] =\n arr[idx1][arr.length - idx2 - 1];\n arr[idx1][arr.length - idx2 - 1] = temp;\n }\n for (let i = 0; i < Math.floor(arr.length / 2); i++) {\n for (let j = i; j < arr[i].length - 1 - i; j++) {\n swap(arr, i, j);\n }\n }\n return arr;\n}", "function rotate(x, y, sin, cos, reverse) {\n return {\n x: reverse ? x * cos + y * sin : x * cos - y * sin,\n y: reverse ? y * cos - x * sin : y * cos + x * sin,\n };\n}", "function rotate(mat){\n\tlet out = [[],[]];\n\tlet layer = 0;\n\n\tfor(let x = 0; x < mat.length; x++){\n\t\tfor(let y = 0; y < mat.length; y++){\n\t\t\t\n\t\t}\n\t}\n\n\n\tmat[5][2] = 0;\n\n\treturn mat;\n\n//[0][0] -> [0][n-1] -> [n-1][n-1] -> [n-1][0] -> [0][0]\n\tfor(let i = layer; i < mat.length-layer; i++){\n\t\tfor(let j = 0; j < mat.length-layer; j++){\n\t\t\t\n\t\t}\n\t}\n\tfor(let i = 0; i < mat.length; i++){\n\t\tfor(let j = 0; j < mat.length; j++){\n\t\t\t\n\t\t}\n\t}\n\n\n\treturn mat.length;\n}", "function rotateImage(arr){\n let res = [];\n for (let i=0; i<arr.length; i++){\n let col = arr.map((row) => row[i]);\n res.push(col);\n }\n return res;\n}", "function rotate(matrix) {\n if (matrix[0] === undefined) return [];\n let n = matrix[0].length;\n for (let i = 0; i < Math.floor(n/2); i++) { //number of squares\n for (let j = 0; j < n - 1 - (i * 2); j++) { // number of times around a square\n let p1y = i;\n let p1x = i+j;\n let p2y = p1x;\n let p2x = n - 1 - p1y;\n let prevVal = matrix[p1y][p1x];\n let nextVal = matrix[p2y][p2x];\n for (let k = 0; k < 4; k++) {\n // temp = matrix[p2y][p2x];\n matrix[p2y][p2x] = prevVal;\n let oldp2y = p2y;\n let oldp2x = p2x;\n p2x = n - 1 - oldp2y;\n p2y = oldp2x;\n p1y = oldp2y;\n p1x = oldp2x;\n prevVal = nextVal;\n nextVal = matrix[p2y][p2x];\n }\n }\n }\n return matrix;\n}", "function rotate90 (){\n angleRot -= 90;\n cube1.style.transform = \"translateZ(-170px) rotateY(\"+ angleRot + \"deg)\";}", "function rotate(mat) {\n var rotated = new Array(mat.length).fill().map(() => Array(mat.length).fill()); \n for (let i = 0; i < mat.length; ++i) {\n var y = mat.length - 1 - i;\n for (let j = 0; j < mat[i].length; ++j) {\n // [0][0] => [0][2] [1][0] => [0][1]\n // [0][1] => [1][2] [1][1] => [1][1]\n // [0][2] => [2][2] [1][2] => [2][1]\n var x = j;\n rotated[x][y] = mat[i][j]\n }\n }\n return rotated\n}", "function rotate(matrix) {\n let result = [];\n for(let i = 0; i < matrix[0].length; i++) {\n let row = matrix.map(e => e[i]).reverse(); // gather all i-th element of each column, and then reverse it \n result.push(row);\n }\n return result;\n}", "rotate(board, times = 1) {\n const rotateOnce = board => board[0].map((col, i) => board.map(row => row[i])).reverse()\n\n let rotated = board\n Array(times).fill().map(() => rotated = rotateOnce(rotated))\n\n return rotated\n }", "function rotate(arr, steps) {\n\tvar first = arr.slice(0, arr.length - steps);\n\tvar last = arr.slice(arr.length - steps); \n\treturn arr; \n}", "function rotate(){\r\n if (buttonE && currPick!=null){\r\n \r\n vert = currPick.vert;\r\n var updatedVert = [];\r\n var R = new Matrix4();\r\n \r\n if(Math.abs(disx) > Math.abs(disy+10)){ //horizontal: rotate about Z axis\r\n R = R.setRotate(10, 0, 0, 1); \r\n console.log(\"rotated about Z\");\r\n }else if(Math.abs(disy) > Math.abs(disx+10)){ //vertical: rotate about X axis\r\n R = R.setRotate(10, 1, 0, 0); \r\n console.log(\"rotated about X\");\r\n }\r\n \r\n for (var i=0; i<vert.length; i+=3){\r\n var newVert = new Vector3([vert[i], vert[i+1], vert[i+2]]);\r\n newVert = R.multiplyVector3(newVert);\r\n updatedVert.push(newVert.elements[0], newVert.elements[1], newVert.elements[2]);\r\n }\r\n \r\n currPick.vert = updatedVert;\r\n drawObjects();\r\n }\r\n}", "function rotate(){\n\n undraw();\n currentRotation++;\n\n if (currentRotation === currentShape.length)\n {\n currentRotation = 0;\n }\n\n currentShape = theShapes[randomShape][currentRotation];\n }", "function rotate(p, a) {\n return [ p[0]*Math.cos(a) - p[1]*Math.sin(a),\n p[0]*Math.sin(a) + p[1]*Math.cos(a) ];\n}", "function xyRotMatrix(a){\r\n\treturn [[Math.cos(a), Math.sin(a), 0],[-Math.sin(a), Math.cos(a), 0],[0,0,1]];\r\n}", "function rotarFigura() {\n ctx.rotate(0.17);\n ctx.restore(); //dibuja la figura\n\n }", "function rotateMatrix(matrix) {\n const n = matrix.length;\n const x = Math.floor(n/2);\n const y = n-1;\n for (let i=0; i<x; i++) {\n for (let j=i; j<y-i; j++) {\n const k = matrix[i][j];\n matrix[i][j] = matrix[y-j][i];\n matrix[y-j][i] = matrix[y-i][y-j];\n matrix[y-i][y-j] = matrix[j][y-i];\n matrix[j][y-i] = k;\n }\n }\n}", "function rotate(matrix) {\n var y = matrix[0].length;\n var x = matrix.length;\n var newMatrix = getMatrix(y, x);\n\n for (column = 0; column < y; column++) {\n for (row = x - 1; row >= 0; row--) {\n fillMatrix(newMatrix, matrix[row][column]);\n }\n }\n\n return newMatrix;\n}", "function rotateGrid(arrayToRotate){\r\n const n = arrayToRotate.length;\r\n const x = Math.floor(n/2);\r\n const y = n - 1;\r\n for (let i = 0; i < x; i++){\r\n for (let j = i; j < y-i; j++){\r\n let k = arrayToRotate[i][j];\r\n arrayToRotate[i][j] = arrayToRotate[y - j][i];\r\n arrayToRotate[y - j][i] = arrayToRotate[y - i][y - j];\r\n arrayToRotate[y - i][y - j] = arrayToRotate[j][y - i];\r\n arrayToRotate[j][y - i] = k;\r\n }\r\n }\r\n}", "function rotate_z() {\n curr_sin = Math.sin(map.degree);\n curr_cos = Math.cos(map.degree);\n var x = (this.x * curr_cos) + (this.y * (-curr_sin));\n this.y = (this.x * curr_sin) + (this.y * (curr_cos));\n this.x = x;\n }", "function rotate1(){\r\n var rotor2prev = []; // temporary container for data that is to be overwritten\r\n\r\n // getting the temporary data for the rotor 2 prev\r\n for (i = 0; i < 26; i++) {\r\n if(rotor2[i].prev == 26){\r\n rotor2prev.push(1);\r\n }else {\r\n rotor2prev.push((rotor2[i].prev) + 1);\r\n }\r\n }\r\n\r\n\r\n // changing posiiton of the letters and next values\r\n for (i = 0; i < 26; i++) {\r\n if(rotor1[i].next == 26){\r\n rotor1[i].next = 1;\r\n }else {\r\n rotor1[i].next ++;\r\n }\r\n if(rotor1[i].pos == 26){\r\n rotor1[i].pos = 1;\r\n }else {\r\n rotor1[i].pos ++;\r\n }\r\n }\r\n\r\n // changing the position of the prev on rotor 2\r\n\r\n for (i = 0; i < 26; i++) {\r\n if(i == 0){\r\n rotor2[i].prev = parseInt(rotor2prev[25]);\r\n }else {\r\n rotor2[i].prev = parseInt(rotor2prev[i - 1]);\r\n }\r\n }\r\n}", "function rotate (x, y, sin, cos, reverse) {\n return {\n x: (reverse) ? (x * cos + y * sin) : (x * cos - y * sin),\n y: (reverse) ? (y * cos - x * sin) : (y * cos + x * sin)\n };\n}", "function rotate(arr, shiftBy){\n var temp;\n //Shift Left\n if (shiftBy < 0){\n for (var i = shiftBy; i < 0; i++){\n for (var j = 0; j < arr.length-1; j++){\n if (j == 0){\n temp = arr[j];\n arr[j] = arr[j+1];\n }\n else{\n arr[j] = arr[j+1];\n }\n // console.log(arr[i]);\n }\n arr[arr.length-1] = temp;\n }\n }\n //Shift Right\n else{\n for (var i = shiftBy; i > 0; i--){\n for (var j = arr.length-1; j > 0; j--){\n if (j == arr.length-1){\n temp = arr[j];\n arr[j] = arr[j-1];\n }\n else{\n arr[j] = arr[j-1];\n }\n // console.log(arr[i]);\n }\n arr[0] = temp;\n }\n }\n console.log(arr);\n}", "function rotate() {\r\n const top = this.stack.pop();\r\n this.stack.splice(this.stack.length - 2, 0, top);\r\n}", "function rotation (array,num){\n let sliceArr = array.slice(num)\n for (i=0; i<num; i++){\n sliceArr.push(array[i]);\n }\n return sliceArr\n}", "function rotate90(matrix, n){\n\t// round 1 which we transpose the matrix\n\tfor (var i = 0; i < n; i++){\n\t\tfor(var j = i; j < n; j++){\n\t\t\tvar temp = matrix[i][j];\n\t\t\tmatrix[i][j] = matrix[j][i];\n\t\t\tmatrix[j][i] = temp;\n\t\t}\n\t}\n\tfor(var i = 0; i < n/2; i++){\n\t\tfor(var j = 0; j < n; j++){\n\t\t\tvar temp = matrix[i][j];\n\t\t\tmatrix[i][j] = matrix[n - 1 - i][j];\n\t\t\tmatrix[n - 1 - i][j] = temp;\n\t\t}\n\t}\n\treturn matrix;\n}", "function rotate(matrix) {\n const N = matrix.length - 1;\n const result = matrix.map((row, i) => row.map((val, j) => matrix[N - j][i]));\n\n return result;\n}", "rotarx(angulo){\n this.helicoptero.rotar(angulo - this.rotx,[1.0,0.0,0.0]);\n this.rotx = angulo;\n }", "function rightRotate(array, k) {\n let L = array.length;\n return array.slice(L - k).concat(array.slice(0, L - k));\n}", "function rotateMatrix(matrix){\n if (matrix.length == 0){\n return null;\n }\n let first = matrix.length - 1\n let last = 0\n \n for (let i = 0; i< matrix.length/2; i++){\n first = i;\n last = matrix.length - 1 - i;\n for(let j=first; j<last; j++){\n\n let top = matrix[first][j]\n\n //left to top\n matrix[first][j] = matrix[last-(j-first)][first]\n\n //bottom to left\n matrix[last-(j-first)][first] = matrix[last][last-(j-first)]\n\n //right to bottom\n matrix[last][last-(j-first)] = matrix[j][last]\n\n //top to right\n matrix[j][last] = top\n\n \n // //top to right\n // temp = matrix[j][last]\n // matrix[j][last] = matrix[first][j]\n \n // //right to bottom\n // temp2 = matrix[last][last- j]\n // matrix[last][last-j] = temp\n \n // //bottom to left\n // temp = matrix[last-j][first]\n // matrix[last-j][first] = temp2\n\n // //left to top\n // matrix[first][j] = temp\n\n }\n }\n return matrix;\n}", "function rotatedraw()\n\t{\t\n\t\tadjtime = centertime;\n\t\tsvg.selectAll(\"#piegroup\")\n\t\t\t.transition()\n\t\t\t.duration(adjtime)\n\t\t\t.attr(\"transform\", \"rotate(\" + rotval + \")\");\n\t\tsvg.select(\"#links\")\n\t\t\t.transition()\n\t\t\t.duration(adjtime)\n\t\t\t.attr(\"transform\", \"rotate(\" + rotval + \")\");\n\t\tsvg.select(\"#nodes\")\n\t\t\t.transition()\n\t\t\t.duration(adjtime)\n\t\t\t.attr(\"transform\", \"rotate(\" + rotval + \")\");\n\t\tsetnodevals();\n\t}", "invert() {\n let rot_inv = this.getRotInv();\n let d = [[this.matrix[3][0]], [this.matrix[3][1]], [this.matrix[3][2]]];\n let d_new_neg = this.multV(Matrix.transpose(rot_inv).matrix, d);\n let r = rot_inv;\n r[0][3] = 0;\n r[1][3] = 0;\n r[2][3] = 0;\n r.push([0, 0, 0, 1]);\n r[3][0] = -d_new_neg[0][0];\n r[3][1] = -d_new_neg[1][0];\n r[3][2] = -d_new_neg[2][0];\n return r;\n }", "rotate(side) {\n var temp = this.children[side];\n\n // Rotate\n this.children[side] = temp.children[1 - side];\n temp.children[1 - side] = this;\n\n this.resize();\n temp.resize();\n\n return temp;\n }", "function rotateMatrix(matrix) {\n // Reverse matrix then swap rows and columns \n matrix.reverse();\n\n for (let i = 0; i < matrix.length; i++) {\n for (let j = i; j < matrix.length; j++) {\n [matrix[i][j], matrix[j][i]] = [matrix[j][i], matrix[i][j]]\n }\n }\n return matrix;\n}", "function rotate() {\n if (isHorizontal) {\n destroyer.classList.toggle('destroyer-container-vertical');\n submarine.classList.toggle('submarine-container-vertical');\n cruiser.classList.toggle('cruiser-container-vertical');\n battleship.classList.toggle('battleship-container-vertical');\n carrier.classList.toggle('carrier-container-vertical');\n isHorizontal = false;\n return;\n }\n if (!isHorizontal) {\n destroyer.classList.toggle('destroyer-container-vertical');\n submarine.classList.toggle('submarine-container-vertical');\n cruiser.classList.toggle('cruiser-container-vertical');\n battleship.classList.toggle('battleship-container-vertical');\n carrier.classList.toggle('carrier-container-vertical');\n isHorizontal = true;\n return;\n }\n }", "function rotateImg() {\n // Check if direction needs to flip\n if (Math.abs(angle) >= maxAngle) {\n clockwise = !clockwise\n }\n // Change rotation based on direction\n if (clockwise) {\n angle += speed\n } else {\n angle -= speed\n }\n\n // Apply rotation\n image.style.transform = \"rotate(\" + angle + \"deg)\"\n }", "function getRotation() {\n return 'rotate(' + rotation +', ' + c + ', ' + c + ')';\n }", "function rotateTable() {\n\tvar oldRotation = rotation;\n\trotation += 180;\n\tvar rotator = function (n) {\n\t\treturn \"rotate(\" + (oldRotation + 180 * n) + \"deg)\";\n\t};\n\n\tvar t = {};\n\tt[Transition.cssTransformType] = rotator;\n\tTransition(cardsContainer, t, transitionDuration);\n}", "rotateArr(arr, shift) {\n return _.flatten([arr.slice(-shift), arr.slice(0, -shift)], true);\n }", "function rotate(array, n) {\n\t n = typeof n === \"undefined\" ? 1 : n % array.length;\n\t return array.slice(n).concat(array.slice(0, n));\n\t}", "static rotate(dst, src, rad) {\n const a00 = src[0],\n a01 = src[1],\n a02 = src[2],\n a10 = src[3],\n a11 = src[4],\n a12 = src[5],\n a20 = src[6],\n a21 = src[7],\n a22 = src[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n\n dst[0] = c * a00 + s * a10;\n dst[1] = c * a01 + s * a11;\n dst[2] = c * a02 + s * a12;\n\n dst[3] = c * a10 - s * a00;\n dst[4] = c * a11 - s * a01;\n dst[5] = c * a12 - s * a02;\n\n dst[6] = a20;\n dst[7] = a21;\n dst[8] = a22;\n return dst;\n }", "turnRight(){\n this.orientation++;\n if(this.orientation > 3){\n this.orientation = 0;\n }\n this.graphicalObject.rotateY(-Math.PI/2);\n }", "function RotateMe(mat,n){\n // outer loop\n for(var layer=0; layer < n/2 ; layer++ ){\n var first = layer;\n var last = n-1-layer; // tells where to stop\n // inner loop\n\n for(var i=first;i<last;i++){\n var offset = i-layer;\n //\n var top = mat[first][i]; // remember\n\n mat[first][i] = mat [last-offset][first];\n\n mat [last-offset][first] = mat [last][last-offset];\n\n mat [last][last-offset] = mat [i][last];\n\n mat[i][last] = top; //remember\n\n\n\n }\n\n\n }\n}", "function rotateMat(matrix) {\n\n for (var layer = 0; layer < matrix.length/2; layer++) {\n let first = layer;\n let last = matrix.length - 1 - layer;\n for (var i = first; i < last; i++) {\n let offset = i - first;\n\n let top = matrix[first][i];\n matrix[first][i] = matrix[last - offset][first];\n matrix[last - offset][first] = matrix[last][last - offset];\n matrix[last][last - offset] = matrix[i][last];\n matrix[i][last] = top;\n }\n }\n return matrix;\n}", "function matrixRotation(matrix, r) {\n let row = 0, col = 0;\n let endRow = matrix.length - 1, endCol = matrix[0].length - 1;\n let newMatrix = [], iterCount = 0;\n\n // 1) transform the input to an easy form the rotate\n while (row < endRow && col < endCol) {\n newMatrix[iterCount] = [];\n\n // go down the left column\n for(let i = row; i <= endRow; i++) {\n newMatrix[iterCount].push(matrix[i][col]);\n }\n\n // go across the bottom row\n // already added the bottom left entry\n for(let i = (col + 1); i <= endCol; i++) {\n newMatrix[iterCount].push(matrix[endRow][i]);\n }\n\n // go up the right column\n // already added the bottom right entry\n for(let i = (endRow - 1); i >= row; i--) {\n newMatrix[iterCount].push(matrix[i][endCol]);\n }\n\n // go back across the top row\n // already added the top right and left entries\n for(let i = (endCol - 1); i >= (col + 1); i--) {\n newMatrix[iterCount].push(matrix[row][i]);\n }\n\n iterCount++;\n row++;\n col++;\n endRow--;\n endCol--;\n }\n\n // 2) do the rotation\n for(let i = 0; i < newMatrix.length; i++) {\n let outer = newMatrix[i];\n let len = outer.length;\n let equivalentR = r % len;\n let temp = [];\n \n for(let j = 0; j < len; j++) {\n let nextIndex = (j + equivalentR) % len;\n temp[nextIndex] = outer[j];\n }\n \n newMatrix[i] = temp;\n }\n\n row = 0;\n col = 0;\n endRow = matrix.length - 1;\n endCol = matrix[0].length - 1;\n let finalMatrix = [];\n\n // 3) transform it back\n for(let i = 0; i < newMatrix.length; i++) {\n let curr = newMatrix[i];\n let currIndex = 0;\n \n // add the left column\n // after this all the rows will be added\n for(let j = row; j <= endRow; j++) {\n finalMatrix[j] = finalMatrix[j] || [];\n finalMatrix[j][col] = curr[currIndex];\n currIndex++;\n }\n\n // add the bottom row\n for(let j = (col + 1); j <= endCol; j++) {\n finalMatrix[endRow][j] = curr[currIndex];\n currIndex++;\n }\n\n // add the left column\n for(let j = (endRow - 1); j >= row; j--) {\n finalMatrix[j][endCol] = curr[currIndex];\n currIndex++;\n }\n\n // add the top row\n for(let j = (endCol - 1); j > col; j--) {\n finalMatrix[row][j] = curr[currIndex];\n currIndex++;\n }\n\n row++;\n col++;\n endRow--;\n endCol--;\n }\n \n for(let i = 0; i < finalMatrix.length; i++) {\n console.log(finalMatrix[i].reduce((r, e, i) => {\n let col = i === 0 ? e : (' ' + e);\n return r + col;\n }, ''));\n }\n}", "function rotateNinety(matrix) {\n \n let rotated = [];\n \n let tempRow = [];\n let index = 0;\n \n while (index < matrix.length) {\n for (let i = matrix.length-1; i >= 0; i--) {\n tempRow.push(matrix[i][index]);\n }\n rotated.push(tempRow)\n tempRow = [];\n index++;\n }\n\n return rotated;\n \n}", "function rotate2_90 (){\n angleRot2 += 90;\n cube2.style.transform = \"translateZ(-170px) rotateY(\"+ angleRot2 + \"deg)\";}", "WheelRotation (inner, outer, wp, i, wheel, r){\n if(!r){\n for(let j = 1; j < wp[wheel]; j++){\n inner.push(inner.shift());\n }\n }\n return this.WheelOutput(inner, outer, i, r);\n }", "function rotate(el, container) {\n var elArray = jQuery.makeArray(el);\n for (var i = 0; i < elArray.length; i++) {\n $(elArray[i]).css('transform', 'rotate('+parseInt(rotato())+'deg)');\n }\n}", "function Start() {\n\t// transform.Rotate(-90,0,0);\n}", "setInvert() {\n//--------\n// (t,r) := (-Rot(r*,t),r*) = (Rot(r*,-t),r*)\nthis._r.setInvert();\n(this._t.setNegate()).setRotate(this._r);\nreturn this;\n}", "rotate(movement) {\n this._deletPosition();\n\n this.pivote.col += movement.wallKickDirection;\n\n if (movement.rotationDirection === 1) {\n this._transposeMatrix();\n this._reverseCols();\n\n } else if (movement.rotationDirection === -1) {\n this._reverseCols();\n this._transposeMatrix();\n } else {\n console.error(\"A ver, a ver, HABER: los unicos valores son\"\n + \"1 o -1\");\n return;\n }\n this.setBoardPosition();\n }", "rotate(angle, x, y, z) {\r\n // In production code, this function should be associated\r\n // with a matrix object with associated functions.\r\n var axisLength = Math.sqrt((x * x) + (y * y) + (z * z));\r\n var s = Math.sin(angle * Math.PI / 180.0);\r\n var c = Math.cos(angle * Math.PI / 180.0);\r\n var oneMinusC = 1.0 - c;\r\n\r\n // Normalize the axis vector of rotation.\r\n x /= axisLength;\r\n y /= axisLength;\r\n z /= axisLength;\r\n\r\n // Now we can calculate the other terms.\r\n // \"2\" for \"squared.\"\r\n var x2 = x * x;\r\n var y2 = y * y;\r\n var z2 = z * z;\r\n var xy = x * y;\r\n var yz = y * z;\r\n var xz = x * z;\r\n var xs = x * s;\r\n var ys = y * s;\r\n var zs = z * s;\r\n\r\n // GL expects its matrices in column major order.\r\n return this.transform(new Matrix( [\r\n (x2 * oneMinusC) + c,\r\n (xy * oneMinusC) + zs,\r\n (xz * oneMinusC) - ys,\r\n 0.0,\r\n\r\n (xy * oneMinusC) - zs,\r\n (y2 * oneMinusC) + c,\r\n (yz * oneMinusC) + xs,\r\n 0.0,\r\n\r\n (xz * oneMinusC) + ys,\r\n (yz * oneMinusC) - xs,\r\n (z2 * oneMinusC) + c,\r\n 0.0,\r\n\r\n 0.0,\r\n 0.0,\r\n 0.0,\r\n 1.0\r\n ] ));\r\n }", "function rotate(array) {\n let movingNum = array.shift()\n array.push(movingNum)\n return array\n}", "function rotateCartesian(vector, axis, angle) {\n\t var angleRads = angle * radians,\n\t vectorOut = vector.slice(),\n\t ax1 = (axis === 0) ? 1 : 0,\n\t ax2 = (axis === 2) ? 1 : 2,\n\t cosa = Math.cos(angleRads),\n\t sina = Math.sin(angleRads);\n\t\n\t vectorOut[ax1] = vector[ax1] * cosa - vector[ax2] * sina;\n\t vectorOut[ax2] = vector[ax2] * cosa + vector[ax1] * sina;\n\t\n\t return vectorOut;\n\t}", "function rotateCartesian(vector, axis, angle) {\n\t var angleRads = angle * radians,\n\t vectorOut = vector.slice(),\n\t ax1 = (axis === 0) ? 1 : 0,\n\t ax2 = (axis === 2) ? 1 : 2,\n\t cosa = Math.cos(angleRads),\n\t sina = Math.sin(angleRads);\n\t\n\t vectorOut[ax1] = vector[ax1] * cosa - vector[ax2] * sina;\n\t vectorOut[ax2] = vector[ax2] * cosa + vector[ax1] * sina;\n\t\n\t return vectorOut;\n\t}" ]
[ "0.69100225", "0.6869165", "0.6861636", "0.6829192", "0.66337055", "0.66081953", "0.6542658", "0.64877194", "0.64826256", "0.6479962", "0.64549613", "0.64304155", "0.6406593", "0.6367505", "0.6362512", "0.63218117", "0.6317425", "0.6273963", "0.62404317", "0.6222802", "0.6190437", "0.61830693", "0.61798334", "0.6179504", "0.6165732", "0.6160501", "0.61549515", "0.615189", "0.6148663", "0.6146126", "0.61445206", "0.6130327", "0.61101985", "0.61010677", "0.6091667", "0.60878754", "0.6084317", "0.60751605", "0.6074211", "0.6067208", "0.60632753", "0.60620266", "0.60511297", "0.6049671", "0.6045787", "0.6041957", "0.60414267", "0.6035739", "0.60228753", "0.6019861", "0.6006898", "0.59998316", "0.59977776", "0.5993524", "0.5981807", "0.59812874", "0.5979831", "0.5977795", "0.59777445", "0.5976711", "0.5975648", "0.59725964", "0.59697074", "0.59686327", "0.59681374", "0.59538645", "0.59441054", "0.5943564", "0.5936282", "0.5925415", "0.5922637", "0.5912065", "0.59112304", "0.590797", "0.5905764", "0.5903504", "0.5902129", "0.589516", "0.5895009", "0.5893356", "0.58908975", "0.5881998", "0.586505", "0.5857514", "0.5853611", "0.5852155", "0.58435506", "0.5842864", "0.58428514", "0.58392507", "0.58370996", "0.5835103", "0.58246243", "0.5819713", "0.58156896", "0.5814704", "0.58067095", "0.580537", "0.5804551", "0.5804551" ]
0.6054628
42
Update positions every 1 second
function update(time = 0) { const deltaTime = time - lastTime; lastTime = time; dropCounter += deltaTime; if (dropCounter > dropInterval) { playerDrop(); } draw(); requestAnimationFrame(update); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "#updatePosition() {\n this.interval = setInterval(\n () => this.#setNewPosition(),\n this.intervalTime\n );\n }", "loopUpdate(){\n setInterval(()=>{\n this.updateNow();\n },updateSecs*1000);\n }", "update() {\n\n\n this.i++;\n\n if (this.i === this.update_interval)\n {\n this.changeWindDirection();\n this.update_interval = Math.floor(Math.random() * 20) * 60; // 0 - 20sec @ 60fps\n this.i = 0;\n }\n\n }", "function update_position() {\r\n if (!error_state) {\r\n if (prev_time + 50 < Date.now()) {\r\n prev_time = Date.now();\r\n //50 ms + 5ms to account for drift, measured to be around 5ms per update cycle.\r\n local_track.position += 55;\r\n update_controls_UI();\r\n }\r\n }\r\n }", "updatePositions(t) {\n for (var i = 0; i < this.sats.length; i++) {\n this.sats[i].updatePosition(t);\n }\n }", "function repeat(time) {\n // timestamps.push(time);\n updatePositions();\n redraw();\n window.requestAnimationFrame(repeat);\n // var n = timestamps.length -1;\n // console.log(1000/ (timestamps[n] - timestamps[n-1]));\n}", "function update( event ) {\n // time is in milliseconds (so increases 1000 per second)\n time = event.time * 0.001; // this increases about 1 per second\n this.position.y += 10 * Math.sin(time); // so a cycle every 6 seconds (2*pi ~= 6)\n}", "function run() {\n update();\n setInterval(update, 3600000);\n}", "function updatePositions() {\n\t//******User Timing API******\n\tframe ++;\n\twindow.performance.mark(\"mark_start_frame\");\n\n\t//without querying the DOM, this asks for scroll info and moves the sliding pizzas\n\tvar currentScrollY = lastKnownScrollY;\n\tvar items = document.getElementsByClassName(\"mover\");\n\tvar howMany = items.length;\n\tvar phase;\n\tfor (var i = 0; i < howMany; i++) {\n\t\tphase = Math.sin((currentScrollY / 1250) + (i % 5));\n\t\t//CSS Triggers: swapped all movement calls to 'transform.translate' \n\t\titems[i].style.transform = \"translateX(\" + 100 * (phase) + \"px)\";\n\t}\n\tticking = false;\n\n//******User Timing API******\n window.performance.mark(\"mark_end_frame\");\n window.performance.measure(\"measure_frame_duration\", \"mark_start_frame\", \"mark_end_frame\");\n if (frame % 10 === 0) {\n var timesToUpdatePosition = window.performance.getEntriesByName(\"measure_frame_duration\");\n logAverageFrame(timesToUpdatePosition);\n }\n}", "function timerStart() {\n position = 1;\n}", "update() {\n if (this.time_now >= this.time_target) {\n if (this.display === false) {\n this.randomize();\n this.display = true;\n } else {\n this.x = -500;\n this.y = -500;\n this.display = false;\n }\n this.time_target = Date.now() + Math.floor(Math.random() * (15000 - 3000) + 8000);\n }\n this.time_now = Date.now();\n }", "update() {\n if (this.time_now >= this.time_target) {\n if (this.display === false) {\n this.randomize();\n this.display = true;\n } else {\n this.x = -500;\n this.y = -500;\n this.display = false;\n }\n this.time_target = Date.now() + Math.floor(Math.random() * (15000 - 3000) + 5000);\n }\n this.time_now = Date.now();\n }", "update() {\n if (this.time_now >= this.time_target) {\n if (this.display === false) {\n this.randomize();\n this.display = true;\n } else {\n this.x = -500;\n this.y = -500;\n this.display = false;\n }\n this.time_target = Date.now() + Math.floor(Math.random() * (15000 - 3000) + 10000);\n }\n this.time_now = Date.now();\n }", "loop() {\n let elapsedTime = 0;\n let now = performance.now();\n if (this.lastIteration !== null) {\n elapsedTime = now - this.lastIteration;\n }\n this.updatePosition(elapsedTime);\n //Update sensors for test\n this.sensors.forEach((sensor) => {\n if (sensor instanceof Compass)\n sensor.measureDirection();\n else if (sensor instanceof Ultrasound)\n sensor.measureDistance();\n });\n this.lastIteration = now;\n setTimeout(() => { this.loop(); }, 100);\n }", "update() {\n // initialize next move\n let nextPosition = this.getNextPosition();\n // if next position is not blocked by an object\n if (this.isPositionFree(nextPosition)) {\n this.position.x = nextPosition.x;\n this.position.y = nextPosition.y;\n\n // if successful, send movement to server\n this.game.broadcastPosition({id: this.id, x: this.position.x, y: this.position.y, direction: this.direction});\n }\n\n }", "function updatePositions() {\n animating = false;\n frame++;\n window.performance.mark(MARK_START_FRAME);\n var currentScrollY = lastScrollY;\n\n var items = document.getElementsByClassName('.mover');\n for (var i = 0; i < items.length; i++) {\n var phase = Math.sin((currentScrollY / 1250) + (i % 5));\n items[i].style.transform = 'translateX(' + 100 * phase + 'px)'; //animate on translate property - increased performance\n }\n\n\n // User Timing API to the rescue again. Seriously, it's worth learning.\n // Super easy to create custom metrics.\n window.performance.mark(MARK_END_FRAME);\n window.performance.measure(MEASURE_FRAME_DURATION, MARK_START_FRAME, MARK_END_FRAME);\n if (frame % 10 === 0) {\n var timesToUpdatePosition = window.performance.getEntriesByName(MEASURE_FRAME_DURATION);\n logAverageFrame(timesToUpdatePosition);\n }\n}", "loop(timeStamp) {\n\n /* timeLastUpdate erhöht sich um den Timestamp. Dabei wird time abgezogen weil ansonsten die bereits \n erfasste Zeit mitaddiert wird und dadurch ein zu hoher Wert entsteht*/\n this.timeLastUpdate += timeStamp - this.time;\n this.time = timeStamp;\n\n /* Sicherheitsvorrichtung um zu verhindern, dass durch zu langsame Rechner die CPU Überlasted wird, weil mehrere tiles geupdated werden*/\n if (this.timeLastUpdate >= this.timeStep * 3) {\n\n this.timeLastUpdate = this.timeStep;\n }\n\n /*Wir wollen für jeden vergangenen Timestep ein Update haben, deshalb wird als Grundlage hier timeLastUpdate genutzt. timeStep wird nach jedem \n Ablauf von timeLastUpdate abgezogen. Sollten durch Geschwindigkeitsprobleme Verzögerungen entstehen werden trotzdem alle Updates durchgeführt. \n */\n while (this.timeLastUpdate >= this.timeStep) {\n\n //Substraktion um zu indizieren, dass das Update für einen Step erfolgt ist\n this.timeLastUpdate -= this.timeStep;\n\n this.update(timeStamp);\n\n // Indikator wird auf true gesetzt damit gerendert werden soll\n this.updated = true;\n\n }\n\n /* Das Spiel soll nur gerendert werden wenn, dass Spiel geupdated wurde */\n if (this.updated) {\n\n //Wird auf false gesetzt damit nicht sofort wieder gerendert wird\n this.updated = false;\n this.render(timeStamp);\n\n }\n\n //Window Funtktion die aufgerufen wird um eine Animation zu updaten\n this.requestAnimationFrame = window.requestAnimationFrame(this.handleLoop);\n\n }", "function update() {\n me.stop();\n\n // determine interval to refresh\n var scale = me.body.range.conversion(me.body.domProps.center.width).scale;\n var interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n\n me.redraw();\n me.body.emitter.emit('currentTimeTick');\n\n // start a renderTimer to adjust for the new time\n me.currentTimeTimer = setTimeout(update, interval);\n }", "function updateMolePos() {\n // calling the random square function every 3/4 second\n moleTimer = setInterval(randomSquare, 750);\n}", "function setupUpdate() {\n setInterval(update, 600);\n}", "queueUpdate() {\n setTimeout(() => {\n this.a = this.a ? this.a * 1.008 : 1\n this.pos.y -= this.a\n this.updatePosition()\n\n if (this.pos.y < 70) {\n this.destroy()\n this.countLives()\n } else {\n this.queueUpdate()\n }\n }, 30)\n }", "function updatePosition(){\n positionX += speedX;\n $('#box').css(\"left\", positionX);\n }", "function update() {\n me.stop(); // determine interval to refresh\n\n var scale = me.body.range.conversion(me.body.domProps.center.width).scale;\n var interval = 1 / scale / 10;\n if (interval < 30) interval = 30;\n if (interval > 1000) interval = 1000;\n me.redraw();\n me.body.emitter.emit('currentTimeTick'); // start a renderTimer to adjust for the new time\n\n me.currentTimeTimer = setTimeout$2(update, interval);\n }", "refreshPos() {\n\t\tlet player = this;\n\t\tif (!this.idle) {\n\t\t\tswitch (this.last_direction) {\n\t\t\t\tcase DIRECTION.DOWN: //based on direction, the characters position in the matrix is updated\n\t\t\t\t\tthis.position.row += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DIRECTION.UP:\n\t\t\t\t\tthis.position.row -= 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DIRECTION.RIGHT:\n\t\t\t\t\tthis.position.col += 1;\n\t\t\t\t\tbreak;\n\t\t\t\tcase DIRECTION.LEFT:\n\t\t\t\t\tthis.position.col -= 1;\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tboard.items.forEach(function (item, index, object) {\n\t\t\t\tif (item.position.row == player.position.row &&\n\t\t\t\t\titem.position.col == player.position.col) {\n\t\t\t\t\titem.updatePlayer(player, item); // trigger the effect on the player\n\t\t\t\t\taudioPickupItem.play();\n\t\t\t\t\tobject.splice(index, 1); // destroy the item\n\n\t\t\t\t}\n\t\t\t})\n\t\t}\n\t}", "tick() {\n this._update();\n }", "function setPos(j) {\n pos = j;\n update();\n\n\n}", "function update() {\n\t\tfor (let i = 0; i < loop.update.length; i++) {\n\t\t\tloop.update[i](tickCounter);\n\t\t}\n\t\tfor (let i = 0; i < loop.updateLast.length; i++) {\n\t\t\tloop.updateLast[i](tickCounter);\n\t\t}\n\t\ttickCounter++;\n\t\tmouseClicked = false;\n\t}", "function updateEveryMinute() {\n var interval = setInterval(update, 1000 * 60)\n}", "function update() {\r\n const time = Date.now() / 1000;\r\n coordinates = getCoordinates(time);\r\n drawing.redraw(coordinates);\r\n }", "function update() {\n world.Step(\n 1 / 60 //frame-rate\n , 10 //velocity iterations\n , 10 //position iterations\n );\n world.DrawDebugData();\n world.ClearForces();\n\n requestAnimFrame(update);\n }", "updatePositions(){\n this.api.get_positions(this.apiPositionListener)\n }", "function updateLoop(){\n\t\t\t\t\tvar time = this.update();\n\n\t\t\t\t\t// set timer for next update\n\t\t\t\t\tthis.updateTimer = setTimeout(updateLoop.bind(this), 1000 - time.getMilliseconds());\n\t\t\t\t}", "update() {\n this.time++;\n }", "function update() {\n /*$.post(\"url\", {'iteration':iteration}, function(newPosition){\n updateParticles(newPosition);\n },\"text\");*/\n updateParticles(null);\n // and render the scene from the perspective of the camera\n render();\n iteration++;\n }", "function update() {\n clock += change();\n render();\n }", "function update(){\n particles = particles.filter(function(p) { return p.move() })\n // Recreate particles\n if(time_to_recreate){\n if(particles.length < init_num){ popolate(1); console.log(\"Ricreo\") }\n }\n clear();\n requestAnimationFrame(update.bind(this))\n}", "function startUpdate(){\n updating = true;\n }", "update(time, delta) {\n }", "function update(){\n setInterval(gameloop, 20);\n}", "function nextUpdate() {\n\tUPDATING = false;\n\trefreshTimeout = setTimeout(function(){ \n\t\tstartDrawingData(); \n\t}, UPDATE_INTERVAL * 1000);\n}", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 30 * 1000);\r\n }", "update() { }", "update() { }", "tick()\n {\n this.update();\n }", "startGame() {\n this.interval = this.$interval(() => {\n this.loopCellMatrix();\n this.updateCellsFuture();\n this.iteration++;\n }, 300);\n }", "function start (){ \r\nsetInterval(tickUpdate,12);\r\n}", "function update_time()\n{\n\ttime.timer++;\n\ttime.x += 2;\n\ttime.w -= 2;\n}", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 30000);\r\n }", "refresh() {\n // Read\n this.percentPosition = this.parseWrapperPosition();\n this.size = this.getContentSize();\n this.position = this.getWrapperPosition();\n\n // Write async so that multiple hotspots can be refreshed at a time without\n // causing layout thrashing.\n this.refreshId = requestAnimationFrame(() => {\n this._removeContentPosition();\n this.setPosition();\n });\n }", "function update() {\n particles = particles.filter(function (p) {return p.move();});\n // Recreate particles\n if (time_to_recreate) {\n if (particles.length < init_num) {popolate(1);console.log(\"Ricreo\");}\n }\n clear();\n requestAnimationFrame(update.bind(this));\n}", "function tick () {\n if (!ticking) return\n\n // Some browsers call events a little too frequently, refuse to run more than is reasonable\n if (last_tick && (now() - last_tick) < 10) {\n raf.call(window, tick)\n return\n }\n\n last_tick = now()\n position()\n\n // tick again...\n raf.call(window, tick)\n }", "function trackPositionPerSecond(){\n\t\t\tif(!isGameOver){\n\t\t\t\tgetMousePosition();\n\t\t\t\t// console.log(positionTracker);\n\t\t\t\tvar posX = positionTracker.pos_x;\n\t\t\t\tvar posY = positionTracker.pos_y;\n\t\t\t\tvar idx = getSpaceIndex(posX,posY);\n\t\t\t\tvar region = identifyBoardRegion(idx);\n\t\t\t\t// console.log(posX, posY, idx, region);\n\t\t\t\tvar currentPositionMetrics = {region: region, positionX: posX, positionY: posY};\n\t\t\t\tplayerStats.timeTaken++;\n\t\t\t\t$(\".ms-timer\").text(playerStats.timeTaken);\n\t\t\t\t$(\".ms-flag-count\").text(playerStats.flags);\n\t\t\t\tif(playerStats.timeTaken >= 1800){\n\t\t\t\t\tisGameOver = true;\n\t\t\t\t\t$(\".ms-timer\").css(\"color\",\"red\")\n\n\t\t\t\t}\n\t\t\t\ttimeExpired();\n\t\t\t\t//console.log(playerStats.timeTaken);\n\t\t\t\tplayerStats.regionLocationsPerSecond.push(currentPositionMetrics);\n\t\t\t}\n\t\t}", "function move(){\n setTimeout(() =>{\n for(let i = 0; i < markers.length; i++) {\n markers[i].setLngLat([locations[i].attributes.longitude, locations[i].attributes.latitude]);\n }\n move();\n }, 5000);\n }", "function tick(){\n // Save the current time\n g_seconds = performance.now()/1000.0-g_startTime;\n //console.log(g_seconds);\n\n //Update animation angles:\n updateAnimationAngles();\n\n // Draw Everything: \n renderAllShapes();\n\n // Tell the browser to update again when it has time \n requestAnimationFrame(tick);\n}", "update(ms) {\n let dt = ms / 1000;\n this._updateParticles(dt);\n this._updateBodies(dt);\n }", "_gameLoop () {\r\n\t\tthis.particleThread = setInterval(() => {\r\n\t\t\tthis._draw();\r\n\t\t}, this._cycleTimer);\r\n\t}", "function requestTick() {\n\tif (!ticking) {\n\t\trequestAnimationFrame(updatePositions);\n\t}\n\tticking = true;\n}", "timeEvolve(){\n this.#particles.forEach(particle => {\n var pos = particle.getPosition(true);\n var vel = particle.getVelocity(true);\n var elapsedTime = particle.getAge() * this.#deltaT;\n var newPos = [\n World.constantVelocityTrajectory(\n elapsedTime,\n vel[0],\n pos[0]\n ),\n World.acceleratedTrajectory(\n this.#g,\n elapsedTime,\n vel[1],\n pos[1]\n )\n ]\n\n particle.setPosition(newPos);\n particle.incrementAge();\n //!!! velocity hasn't been updated. probably should! !!!\n })\n this.#elapsedTimeIntervalCount ++;\n }", "function update() {\n if (get() - lastFPS > 1000) {\n this.fps = fpsCounter;\n fpsCounter = 0; // Reset the FPS counter\n lastFPS += 1000; // Add one second\n }\n fpsCounter++;\n\n let time = get();\n let deltaTime = (time - lastFrame);\n lastFrame = time;\n if (!(deltaTime >= time)) {\n this.delta = deltaTime;\n }\n }", "function init() {\n //little man animation\n\n setInterval(update, 5000); // <------\n}", "function updatePosition() {\n\t\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\t\n\t//instruct location service to get position with appropriate callbacks\n\twatchID = navigator.geolocation.watchPosition(successPosition, failPosition, locationOptions);\n}", "update (dt) {\n // You should multiply any movement by the dt parameter\n // which will ensure the game runs at the same speed for\n // all computers.\n const {x, y} = this.getCurrentPosition();\n let newX;\n if (x >= 500) {\n newX = -100;\n } else {\n newX = (x + dt * this.speed * 150) % (500)\n }\n\n this.setCurrentPosition(newX, y);\n }", "start() {\n // Run immediately..\n this.runUpdate();\n\n // .. then schedule 15 min interval\n timers.setInterval(() => {\n this.runUpdate();\n }, 900000);\n }", "function autoUpdate() {\n watchID = navigator.geolocation.watchPosition(function (position) {\n toggleWatchBtn.innerHTML = 'Slutt å spore meg'\n var newPoint = new google.maps.LatLng(position.coords.latitude, position.coords.longitude)\n\n if (marker) {\n // Marker already created - Move it\n marker.setPosition(newPoint)\n } else {\n // Marker does not exist - Create it\n marker = new google.maps.Marker({\n position: newPoint,\n map: map,\n icon: {\n url: '/img/current_location_smaller.svg',\n scaledSize: new google.maps.Size(18, 28)\n }\n })\n }\n\n // Center the map on the new position\n map.setCenter(newPoint)\n })\n\n // Call the autoUpdate() function every 3 seconds\n // setTimeout(autoUpdate, 3000);\n}", "doUpdate() {\n if (!this.interval) return;\n this.viss.forEach(v => v.doUpdate());\n }", "function calculateChickenPosition() {\n setInterval(function () {\n for (i = 0; i < chickens.length; i++) {\n let chicken = chickens[i];\n chicken.position_x = chicken.position_x - chicken.speed;\n }\n }, 50)\n}", "update(timeStep) {\n\n }", "function statUpdateTick() {\n updateCurrentStats();\n }", "updatePosition(timeElapsed, orientationChange) {\n\n let getRandomInt = (min, max) => {\n min = Math.ceil(min);\n max = Math.floor(max);\n return Math.floor(Math.random() * (max - min)) + min;\n };\n\n let dx, dy;\n //decompose into components\n dx = this.getVelocity() * Math.cos(this.toRadians(this.getOrientation()));\n dy = this.getVelocity() * Math.sin(this.toRadians(this.getOrientation()));\n //add x component to current xPos\n this.setXPos(this.getXPos() + (dx * timeElapsed));\n //add y component to current yPos\n this.setYPos(this.getYPos() + (dy * timeElapsed));\n\n //update orientation\n this.setOrientation(this.getOrientation() + getRandomInt(-orientationChange,orientationChange))\n\n //push new location\n this.pushLocation();\n\n }", "function randomStarPosition(){\n setInterval(function(){\n for (let i = 1; i <= numberofStar; i++) {\n $('#star'+i).css({\"left\": getRandomArbitrary(1,9)*30+785 + \"px\",\n \"top\": getRandomArbitrary(1,9)*30+408 + \"px\",\"width\": getRandomArbitrary(7,7) + \"%\"});\n }\n },3000) \n }", "function gameLoop(){\n //Here goes all the functions that have to be updated second by second\n spawnFood();\n removeSnake();\n moveSnake();\n eatFood();\n renderSnake();\n}", "update () {}", "function update(time)\n {\n\t //console.log(\"UPDATE\");\n\t // calculation\n }", "function live_update() {\n date = new Date(date.getTime() + live_update_interval);\n addAnimation(animate_composite);\n setTimeout(live_update, live_update_interval);\n}", "doGameTick() {\n setInterval(() => {\n this.incrementCatsFromCatladies();\n this.incrementCatsFromCatnip();\n console.log(\"Cats: \" + this.state.cats);\n }, 1000 / this.state.ticksPerSeconds)\n }", "function updatePosition() {\n\tcheckConnection();\n\t//change time box to show updated message\n\t$('#time').val(\"Getting data...\");\n\t\n\t//instruct location service to get position with appropriate callbacks\n\twatchID = navigator.geolocation.watchPosition(successPosition, failPosition, locationOptions);\n console.log(\"geolocation start: \" + watchID);\n}", "moveTo(pos) {\n moving++;\n let actual_pos = {\n x: pos.x,\n y: pos.y,\n }\n let speed = {\n x: (this.x - actual_pos.x) / 12,\n y: (this.y - actual_pos.y) / 12,\n }\n\n let self = this;\n let c = 0;\n\n let operation = () => {\n drawSquares();\n self.x -= speed.x;\n self.y -= speed.y;\n if (c >= 12) {\n self.x = actual_pos.x;\n self.y = actual_pos.y;\n moving--;\n }\n else {\n \n setTimeout(operation, 15);\n c++;\n }\n \n \n \n};\n setTimeout(operation, 15);\n }", "update () {\n\n this.particleSystem.step(\n this.stopwatch.getElapsedMs() * 0.001)\n\n this.updateChunk ()\n\n // invalidate (needsClear, needsRender, overlayDirty)\n this.viewer.impl.invalidate(true, false, false)\n\n this.emit('fps.tick')\n }", "function loop() {\n if (gl.destroyed) {//to stop rendering once it is destroyed\n return;\n }\n\n context.__requestFrame_id = post(loop); //do it first, in case it crashes\n\n var now = Context.getTime();\n var dt = (now - time) * 0.001;\n\n context.onUpdate.fire(dt);\n context.onDraw.fire();\n \n time = now;\n }", "function reDrawParticles() {\n for (let i in particles) {\n particles[i].setPosition();\n particles[i].reDraw();\n }\n }", "function refreshGamesEachSec() {\n setInterval(refreshGameStatus, 1000);\n}", "function update() {\n updatePosition();\n checkBounds();\n }", "update()\n\t{\n\t\tthis.world.update();\n\t\tthis.time++;\n\t\t\n\t\n\t}", "function clockLoop(){\n\t//update the time\n\tupdate();\n\n\t//draw the clock\n\tdraw();\n}", "update() {\n this.deltaTime += deltaTime;\n }", "function update_ball_positions(){\r\n for (let b = 0; b < balls.length; b++){\r\n let ball = balls[b];\r\n ball.x += time_delta_s * ball.vx;\r\n ball.y += time_delta_s * ball.vy;\r\n }\r\n}", "tick() {\n\t\tthis.ticks++;\n\t\tthis.update();\n\t}", "function tick() {\n requestAnimFrame(tick);\n gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);\n\n setupParticles();\n //particleUpdate();\n //for (var i = 0; i < particleNum; i++) {\n draw();\n //}\n //draw();\n \n}", "tick() {\n // Remove old points\n if (this.imageCanvas) {\n var self = this;\n var newPoints = this.state.points.filter(function(point) {\n var age = Date.now() - point.time;\n return age < self.pointLifetime;\n });\n \n this.setState({points: newPoints});\n \n this.drawLineCanvas();\n this.drawImageCanvas();\n //console.log('in tick');\n requestAnimationFrame(this.tick);\n }\n }", "function updateAllPositions() {\n for(i = 0; i < dancers.length; i++) {\n dancers[i].scenePosition[currentSceneIndex] = {x: dancers[i].position.x, y: dancers[i].position.y, z: dancers[i].position.z};\n }\n console.log(\"Positions updated\");\n}", "start() {\r\n this.update();\r\n setInterval(this.update.bind(this), 60000);\r\n }", "update () {\n\n\n\n }", "start() {\r\n if (!this.interval) {\r\n this.interval = setInterval(this._update.bind(this), 1000 / FPS);\r\n }\r\n }", "function loop(){\n Jobs.getAndDraw();\n setTimeout(function(){loop()}, 30000)\n }", "function update_global_time(time_idx)\n{\n\tglobal_time_idx = time_idx \n\t\n\t// TODO: REDRAW ENTITIES AT NEW TIME??\n}", "function startUpdate() {\n var updateInterval = 10 //ms\n var state\n setInterval(function () {\n var newState = game.current() // Get current state\n if (!deepEqual(newState, state)) {\n state = newState\n tethr.broadcast(state)\n }\n }, updateInterval)\n}", "function update(){\n var pos = $window.scrollTop(); \n\n $this.each(function(){\n var $element = $(this);\n var top = $element.offset().top;\n var height = getHeight($element);\n\n // Check if totally above or totally below viewport\n if (top + height < pos || top > pos + windowHeight) {\n return;\n }\n\n $this.css('backgroundPosition', xpos + \" \" + Math.round((firstTop - pos) * speedFactor) + \"px\");\n });\n }", "function update() {}", "function update(){\n\t\t\tvar pos = $window.scrollTop();\n\t\t\t\n\t\t\t$this.each(function(){\n\t\t\t\tvar $element = $(this);\n\t\t\t\tvar top = $element.offset().top;\n\t\t\t\t\n\t\t\t\tvar height = getHeight($element);\n\t\t\t\tvar sod = Math.round((firstTop - pos) * speedFactor);\n\t\t\t\tvar se = $('#second');\n\t\t\t\tvar w = 150;\n\t\t\t\tif($this.attr('id')=='second')\n\t\t\t\t{\n\t\t\t\t\t//console.log((top-pos)+'&'+windowHeight);\n\t\t\t\t\tif( (top - pos)+(height/2) < windowHeight)\n\t\t\t\t\t{\n\t\t\t\t\t\t\n\t\t\t\t\t\t$('.yp').stop().animate({top:se.height()/2-$('.yp').height(),opacity:1},1000);\n\t\t\t\t\t\t$('.shijue').stop().animate({left:(se.width()*45/100-w/2),opacity:1},1000);\n\t\t\t\t\t\t$('.jiaohu').stop().animate({right:(se.width()-($('.yp').position().left+w/2)-w),opacity:1},1000);\n\t\t\t\t\t\t$('.sheji').stop().animate({bottom:se.height()/2-$('.sheji').height(),opacity:1},1000);\n\t\t\t\t\t}else\n\t\t\t\t\t{\n\t\t\t\t\t\t$('.yp').stop().animate({top:0,opacity:0},1000);\n\t\t\t\t\t\t$('.shijue').stop().animate({left:0,opacity:0},1000);\n\t\t\t\t\t\t$('.jiaohu').stop().animate({right:0,opacity:0},1000);\n\t\t\t\t\t\t$('.sheji').stop().animate({bottom:0,opacity:0},1000);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($this.attr('id')=='f1')\n\t\t\t\t{\n\t\t\t\t\tvar of = $('.dword').offset().top-pos;\n\t\t\t\t\tif( (top - pos)<0 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$('.dword').stop().animate({left:0,opacity:0},1000);\n\t\t\t\t\t}else \n\t\t\t\t\t{\n\t\t\t\t\t\t$('.dword').stop().animate({left:'-45%',opacity:1},1000);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\tif($this.attr('id')=='third')\n\t\t\t\t\t{\n\t\t\t\t\t\tconsole.log(top+','+pos);\n\t\t\t\t\t}\n\t\t\t\t\tif( (top - pos) <0 || top > pos+($('.sword').offset().top-top))\n\t\t\t\t\t{\n\t\t\t\t\t\t$('.sword').stop().animate({left:0,opacity:0},1000);\n\t\t\t\t\t}else \n\t\t\t\t\t{\t\n\t\t\t\t\t\t$('.sword').stop().animate({left:'-15%',opacity:1},1000);\n\t\t\t\t\t}\n\t\t\t\t// Check if totally above or totally below viewport\n\t\t\t\tif (top + height < pos || top > pos + windowHeight ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(!ypos)\n\t\t\t\t{\n\t\t\t\t\t if(Math.abs(sod)<=height*2-160)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($this.attr('id')=='third' || $this.attr('id')=='second')\n\t\t\t\t\t\t\tsod = Math.round((top - pos) * speedFactor);\n\t\t\t\t\t\t$this.css('backgroundPosition', xpos + \" \" + sod + \"px\");\n\t\t\t\t\t}\t\n\t\t\t\t}else\n\t\t\t\t{\n\t\t\t\t\tbgypos =Math.round(( ypos-pos ) * speedFactor)\n\t\t\t\t\tbgypos=bgypos>192?bgypos:192;\n\t\t\t\t\t$this.css('backgroundPosition', xpos + \" \" + bgypos + \"px\");\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t});\n\t\t}", "function updateTimeEveryMinute() {\n time.increment();\n flipClock(time.copy());\n setTimeout(updateTimeEveryMinute, 60000);\n }", "update () {\n\n\n }" ]
[ "0.76198995", "0.69008255", "0.68367946", "0.6768665", "0.6717541", "0.67137736", "0.66935706", "0.66866016", "0.6676544", "0.6668463", "0.6637737", "0.66039634", "0.6599757", "0.65874505", "0.65778065", "0.6545341", "0.6429563", "0.6427938", "0.6425734", "0.6414184", "0.64049923", "0.6395616", "0.6381284", "0.63756585", "0.63710064", "0.63667077", "0.63509923", "0.6341266", "0.632602", "0.6323171", "0.63176423", "0.6316993", "0.62980175", "0.62715334", "0.62660486", "0.6264576", "0.62636656", "0.62611866", "0.62584627", "0.62391263", "0.62341356", "0.62334156", "0.62334156", "0.6222087", "0.62183356", "0.6210283", "0.62079626", "0.62075764", "0.6206337", "0.62009174", "0.61928785", "0.61897206", "0.6178061", "0.6174563", "0.61675006", "0.61599183", "0.6149109", "0.6142165", "0.6141575", "0.6137461", "0.61370176", "0.6136435", "0.61333954", "0.6131526", "0.6127768", "0.6107947", "0.6104797", "0.6090076", "0.6089832", "0.6086862", "0.60804695", "0.6072121", "0.606576", "0.6057166", "0.6049732", "0.60493577", "0.60467654", "0.604676", "0.60423636", "0.60390824", "0.6036066", "0.60311997", "0.60308313", "0.60300606", "0.60258895", "0.60217065", "0.60127383", "0.6010492", "0.6005916", "0.6005552", "0.6005221", "0.6002348", "0.59967244", "0.59891605", "0.59886646", "0.59877795", "0.59835625", "0.59816986", "0.59786534", "0.59763354", "0.5975879" ]
0.0
-1
Get list of all user via l'ApiAdmin
GetAllUsers(Data, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin GetAllUsers", User, UserId) const Query = {} const Projection = { projection:{ _id: 1, [this._MongoVar.LoginUserItem]: 1}} const Sort = {[this._MongoVar.LoginUserItem]: 1} this._Mongo.FindSortPromise(Query,Projection, Sort, this._MongoVar.UserCollection).then((reponse)=>{ if(reponse.length == 0){ res.json({Error: false, ErrorMsg: "No user in BD", Data: null}) } else { res.json({Error: false, ErrorMsg: "User in DB", Data: reponse}) } },(erreur)=>{ this.LogAppliError("ApiAdminGetAllUsers DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: ""}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllUsers() {\n return Api.get(\"/admin/user-list\");\n }", "listUsers(aud) {\n return this.user._request('/admin/users', {\n method: 'GET',\n audience: aud,\n });\n }", "function listUsers(api, query) {\n return api_1.GET(api, '/users', { query })\n}", "async list() {\n\t\treturn this.store.User.findAll()\n\t}", "users() {\r\n\t\treturn API.get(\"pm\", \"/list-users\");\r\n\t}", "static async getUsers() {\n return await this.request('users/', 'get');\n }", "static async getAllUsers() {\n try {\n logger.info('[user]: listing all users');\n const userList = await UserService.findAllUsers();\n\n return userList;\n } catch (e) {\n throw new InternalServerException();\n }\n }", "static getUsers() {\n return API.fetcher(\"/user\");\n }", "async getAllUsers(){\n data = {\n URI: `${ACCOUNTS}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "function findAllUsers() {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users')\n .then(response => response.json())\n }", "async getUsers() {\n let userResult = await this.request(\"users\");\n return userResult.users;\n }", "static getAllUsers(){\n return Axios.get(`/users`);\n }", "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "async function listUsers() {\r\n let res = await request\r\n .get(reqURL(config.routes.user.list))\r\n .withCredentials()\r\n .set(\"Content-Type\", \"application/json\")\r\n .set(\"Accept\", \"application/json\")\r\n .auth(\"team\", \"DHKHJ98N-UHG9-K09J-7YHD-8Q7LK98DHGS7\");\r\n log(`listUsers:${util.inspect(res.body)}`);\r\n return res.body\r\n}", "getAllUsers() {\n return this.http.get('http://localhost:8080/api/users');\n }", "static async list(req, res) {\n try {\n const users = await UserService.list();\n res.status(200).send({ success: true, data: users });\n } catch (err) {\n res.status(500).send(errorResponse);\n }\n }", "list(req, res) {\n\n return User\n .findAll({})\n .then(users => res.status(200).send(users))\n .catch(error => res.status(400).send(error));\n }", "function getAllUsers(){\n return UserService.getAllUsers();\n }", "function retrieve_all_users(){\n\tlet params = {\n\t\t\t\t method: \"GET\",\n\t\t\t\t url: \"/api/admin/all/\"\n \t\t\t\t}\n\t$.ajax(params).done(function(data) {\n\t\tvar allUsers = '<div style=\"border:1px solid black\"><h3>All users</h3><table><tr><th>Username</th>'+\n\t\t'<th>First Name</th><th>Last Name</th><th>e-mail</th><th>Account Type</th><th>Last Login</th></tr>';\n\t\tconsole.log(data[\"users\"].length);\n\t\tfor(i=0;i<data[\"users\"].length;i++){\n\t\t\tallUsers += \"<tr><th>\"+data[\"users\"][i].username+\"</th><th>\"+\n\t\t\tdata[\"users\"][i].firstName+\"</th><th>\"+data[\"users\"][i].lastName+\n\t\t\t\"</th><th>\"+data[\"users\"][i].email+\"</th><th>\"+data[\"users\"][i].userType+\n\t\t\t\"</th><th>\"+data[\"users\"][i].lastLogin+\"</th></tr>\";\n\t\t}\n\t\tallUsers+= \"</table>\";\n\t\t$(\"#allUsers\").html(allUsers);\n\t});\n}", "getAllUsers() {\r\n return this.users;\r\n }", "function findAllUsers() {\n return fetch(self.url).then(response => response.json())\n }", "getUsers() {\n return axios.get(USERS_REST_API_URL);\n }", "allUsers() { return queryAllUsers() }", "static async getAll() {\n return await user_model.find({});\n }", "function getUsers(){\n\t\t\tgetUsersService.getUserList().then(function(data){\n\t\t\t\tlc.listOfUser = data;\n\t\t\t})\n\t\t\t.catch(function(message){\n\t\t\t\texception.catcher('getUserList Service cannot succeed')(message);\n\t\t\t});\n\t\t}", "static async getAll() {\n\t\tconst usersRes = await db.query(`SELECT * FROM users ORDER BY username`);\n\t\treturn usersRes.rows;\n\t}", "function listUsers() {\n $listUsers.empty();\n\n if (event) event.preventDefault();\n\n var token = localStorage.getItem('token');\n $.ajax({\n url: '/users',\n method: 'GET',\n beforeSend: function beforeSend(jqXHR) {\n if (token) return jqXHR.setRequestHeader('Authorization', 'Bearer ' + token);\n }\n }).done(function (users) {\n showUsers(users, 0, 10);\n });\n }", "function getallusers() {\n\n\t}", "function getAllUsers(callback) {\n requester.get('user', '', 'kinvey')\n .then(callback)\n}", "function getUserList() {\n \n return userList;\n }", "async function getUserList() {\n\n // Connection properties\n var options = {\n method: 'GET',\n uri: conf.API_PATH + `5808862710000087232b75ac`,\n json: true\n };\n\n return (await request(options)).clients;\n}", "getUserList(data){\nreturn this.post(Config.API_URL + Constant.USER_GETUSERLIST, data);\n}", "static async getUsers (token) {\n const query = `*[_type == 'user'] {\n name,\n _id\n }\n `\n client.config({ token })\n return client.fetch(query)\n }", "async getAllUsers() {\n return User.findAll();\n }", "async getUsers() {\n let res = await fetch('/users', {credentials: 'include', headers: {'Content-Type': 'application/json'}})\n let v = await res.json()\n return v\n }", "function getUsers() {\r\n apiService.getEntity('users')\r\n .then(function (response) {\r\n vm.users = response.data;\r\n notifyService.success('Users loaded.');\r\n }, function (error) {\r\n vm.message = 'Unable to load data: ' + error.message;\r\n });\r\n }", "function getUserList() {\n userService.getUsers()\n .then(function (users) {\n var result = users.filter(function (u) {\n return u.Id !== vm.current.details.ownerId;\n });\n vm.ownerForm.users = result;\n });\n }", "static getAllUsers(req, res) {\n userService.getAllUsers(db, function (returnvalue) {\n res.status(200).send(returnvalue);\n })\n\n }", "function GetUserList() {\r\n\t\treturn $.ajax({\r\n\t\t\turl: '/api/usuarios/listar',\r\n\t\t\ttype: 'get',\r\n\t\t\tdataType: \"script\",\r\n\t\t\tdata: { authorization: localStorage.token },\r\n\t\t\tsuccess: function(response) {\r\n\t\t\t\tconst usuarios = JSON.parse(response);\r\n\t\t\t\t//console.log(usuarios); //<-aqui hago un console para ver lo que devuelve\r\n\t\t\t\tusuarios.forEach(user => {\r\n\t\t\t\t\ttablaUsuarios.row.add({\r\n\t\t\t\t\t\t\"cedulaUsuario\": user.cedulaUsuario,\r\n\t\t\t\t\t\t\"nombreCUsuario\": user.nombreCUsuario,\r\n\t\t\t\t\t\t\"emailUsuario\": user.emailUsuario,\r\n\t\t\t\t\t\t\"nickUsuario\": user.nickUsuario,\r\n\t\t\t\t\t}).draw();\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t}", "static getAllUsers() {\n return fetch('https://dev-selfiegram.consumertrack.com/users').then(response => {\n return response.json();\n }).catch(error => {\n return error;\n });\n }", "async getUserIds() {\n console.log('GET /users')\n return this.server.getUserIds()\n }", "function getUsers() {\n let api = \"../api/Users\";\n\n ajaxCall(\"GET\", api, \"\", getUsersSuccessCB, getErrorCB);\n}", "httpGetAllUsers () {\n return makeApiRequest(`users`);\n }", "function listUsers (req, res) {\n promiseResponse(userStore.find({}), res);\n}", "getUsers() {\n return new Promise((resolve, reject) => {\n axios.get('/api/admin').then(response => {\n resolve(response.data)\n }).catch(error => reject(error))\n })\n }", "function getAllUsersController(request, response) {\n const users = model.list()\n\n response.status(httpStatus.OK).json(users);\n}", "getAllUser(){\n return this.auth.get(\"/user\", {}).then(({data})=> data);\n }", "function getUsers() {\n return getItem('users');\n}", "async index() {\n const { ctx, service } = this;\n const res = await service.user.crud({\n type: 'readAll',\n });\n console.log('res_user_index-------', res);\n ctx.body = res;\n }", "function listAllUsers() {\n var pageToken;\n var page;\n do {\n page = AdminDirectory.Users.list({\n domain: 'example.com',\n orderBy: 'givenName',\n maxResults: 100,\n pageToken: pageToken\n });\n var users = page.users;\n if (users) {\n for (var i = 0; i < users.length; i++) {\n var user = users[i];\n Logger.log('%s (%s)', user.name.fullName, user.primaryEmail);\n }\n } else {\n Logger.log('No users found.');\n }\n pageToken = page.nextPageToken;\n } while (pageToken);\n}", "function getUsers(){\n return users;\n}", "getAccountsList() {\n const params = { type: 'list' };\n return this.apiService.get(`${this.url}/user/find`, { params }).pipe(\n map(res => res.map((account) => this._modifyUserAccountSummary(account)))\n );\n }", "function listUsers() {\n gapi.client.directory.users.list({\n 'customer': 'my_customer',\n 'maxResults': 100,\n 'orderBy': 'email',\n 'viewType': \"domain_public\"\n }).then(function(response) {\n var users = response.result.users;\n var menu = document.getElementById('menu-main');\n menu.className += \" show-toggle\";\n //appendPre('Directory Loaded, you may now Show Directory <a href=\"link\"> test </a>');\n if (users && users.length > 0) {\n for (i = 0; i < users.length; i++) {\n //console.log(user);\n var user = users[i];\n userlist.push(user)\n /*appendPre('-' + user.primaryEmail + ' (' + user.name.fullName + ')');\n if (user.organizations){\n appendPre(user.organizations[0].title);\n };\n if (user.thumbnailPhotoUrl){\n appendPre(user.thumbnailPhotoUrl)\n }*/\n }\n } else {\n appendPre('No users found.');\n }\n });\n }", "async function getUsers() {\n const allUsers = await User.findAll();\n return allUsers.map((user) => user.get({ plain: true }));\n}", "function getUsers() {\n User.query(function(data){\n return self.all = data.users;\n });\n }", "async function getUsers() {\n const response = await api.get(`/users/?_sort=id&_order=desc`);\n\n if (response.data) {\n setCompletedListUsers(response.data);\n setListUsers(response.data);\n refreshCountPages(response.data);\n }\n }", "getAll(req, res, next) {\n userModel.all().then(\n users => {\n res.data = {\n ...res.data,\n users,\n }\n next()\n }\n )\n }", "function GetUsers() {\n UserApi.getUser().then(function (response) {\n $scope.user = response.data;\n }), function () {\n aler(\"Unable to load users info\");\n }\n }", "function getAllUsers() {\n\t\t// url (required), options (optional)\n\t\t/*\n\t\tfetch('/snippets/all') // Call the fetch function passing the url of the API as a parameter\n\t\t.then(function(resp) {\n\t\t\treturn resp.json()\n\t\t}) // Transform the data into json\n\t\t.then(function(data) {\n\t\t\tconsole.log(JSON.parse(data));\n\t\t\t// Your code for handling the data you get from the API\n\t\t\t//_bindTemplate(\"#entry-template\", data, '#sample-data');\n\t\t})\n\t\t.catch(function(errors) {\n\t\t\t// This is where you run code if the server returns any errors\n\t\t\tconsole.log(errors);\n\t\t});\n\t\t*/\n\n\t\t$.ajax({\n\t\t\ttype: 'GET', \t\t// define the type of HTTP verb we want to use (POST for our form)\n\t\t\turl: '/users/all', \t// the url where we want to POST\n\t\t\tdataType: 'json', \t// what type of data do we expect back from the server\n\t\t\tencode: true\n\t\t})\n\t\t// using the done promise callback\n\t\t.done(function(data) {\n\t\t\t_bindTemplate(\"#entry-template\", data, '#sample-data');\n\t\t});\n\t}", "function getAllUser(){\n return $http.get(url.user).then( handleSuccess, handleError );\n }", "async listUsers(req, res, next) {\n try {\n const users = await UsersService.listUsers();\n res.status(HTTPStatus.OK);\n res.json(users);\n } catch (error) {\n next(extendError(error, { task: 'Controller/listUsers' }));\n }\n }", "function getAll(req, res, next){\n userModel.getAll()\n .then(function(data){\n res.send({ data })\n })\n .catch(next)\n}", "static getAllUsers(req, res){\n User.find((err, users) => {\n if (err) return res.json({ success: false, error: err });\n return res.json({ success: true, data: users });\n });\n }", "function getUsers() {\n axios\n .get(process.env.REACT_APP_API_URL + \"/users\")\n .then((res) => {\n setUsers(res.data);\n // console.log(res.data);\n })\n .catch((err) => {\n console.log(\"Error listing the users\");\n });\n }", "function getAllUsers(req, res) {\n User.find((err, users) => {\n if (err) {\n res.status(500).send(\"No se pudo traer los usuarios\");\n } else {\n res.status(200).send(users);\n }\n });\n}", "function _getUsers() {\n // var usersList = JSON.parse(localStorage.getItem('lsUsersList'));\n // if (usersList == null) {\n // usersList = users; //Lista de jugadores quemados\n // }\n // return usersList;\n return $http.get('http://localhost:3000/api/get_all_users');\n }", "allUser() {\n return ['member', 'teamlead', 'admin', 'supervisor', 'manager']\n }", "function ListAllUsers(req, res) {\n let userPermission = req.param.userPermission;\n let userId = req.param.userId;\n if (userPermission == 'Admin' || 'superAdmin') {\n UsersModel.find({}, (err, users) => {\n if (err) {\n return res.status(422).json({\n 'status': false,\n 'message': 'An Error Occured'\n })\n }\n return res.status(200).send(users)\n })\n } else {\n UsersModel.findById(userId, (err, users) => {\n if (err) {\n return res.status(422).json({\n 'status': false,\n 'message': 'An Error Occured'\n })\n }\n return res.status(200).send(users)\n })\n }\n\n}", "static getUsers() {\n const req = new Request('/api/users/', {\n method : 'GET',\n headers : this.requestHeaders()\n });\n return fetch(req).then(res => this.parseResponse(res))\n .catch(err => {\n throw err;\n });\n }", "function requestAdmins(success, failure) {\n if (!self.currentOrganization) {\n failure();\n }\n apiGetRequest(\"/management/organizations/\" + self.currentOrganization + \"/users\", null, success, failure);\n }", "get usersList() {\n return this.model.users.toArray();\n }", "getUsers() {\n return axios\n .get(this.apiUrl() + \"/users/\", {\n headers: this.authHeader(),\n })\n }", "function fetchAllUsers() {\n return fetch(`${SERVER_URL}/users`, {\n headers: {\n Authorization: `Bearer ${userToken}`,\n },\n })\n .then(response => response.json())\n .then(data => setAllUsers(data))\n }", "async getAllAdmins(){\r\n\r\n try{\r\n const admins = await Admin.find();\r\n return [200, admins];\r\n }catch{\r\n return [500, 'SERVER ERROR: couldn\\'t get all admins'];\r\n }\r\n \r\n }", "index(req, res) {\n //TODO - handle search params\n return this.kernel.model.User.find()\n .then(users => {\n res.status(200).json(users);\n })\n .catch(handleError(res));\n }", "function listUsers() {\n const optionalArgs = {\n customer: 'my_customer',\n maxResults: 10,\n orderBy: 'email'\n };\n try {\n const response = AdminDirectory.Users.list(optionalArgs);\n const users = response.users;\n if (!users || users.length === 0) {\n console.log('No users found.');\n return;\n }\n // Print the list of user's full name and email\n console.log('Users:');\n for (const user of users) {\n console.log('%s (%s)', user.primaryEmail, user.name.fullName);\n }\n } catch (err) {\n // TODO (developer)- Handle exception from the Directory API\n console.log('Failed with error %s', err.message);\n }\n}", "function getAll() {\n\treturn dispatch => {\n\t\tdispatch(request());\n\n\t\tuserService.getAll()\n\t\t\t.then(\n\t\t\t\tusers => dispatch(success(users)),\n\t\t\t\terror => dispatch(failure(error.toString()))\n\t\t\t);\n\t};\n\n\tfunction request() { return { type: userConstants.GETALL_REQUEST } }\n\tfunction success(users) { return { type: userConstants.GETALL_SUCCESS, users } }\n\tfunction failure(error) { return { type: userConstants.GETALL_FAILURE, error } }\n}", "function getAllUsers(req, res) {\n User.find({}, function(err, users) {\n if (err) throw err;\n return res.json(users);\n }); \n}", "function List(req, res) {\n let userId = req.params.userId;\n UsersModel.findById(userId, (err, user) => {\n if (err) {\n return res.status(422).json({\n 'status': false,\n 'message': 'An Error Occured'\n })\n }\n return res.status(200).send(user)\n })\n}", "function get_users(){\n\tconst q = datastore.createQuery(USER);\n\treturn datastore.runQuery(q).then( (entities) => {\n\t\t\treturn entities[0].map(ds.fromDatastore);\n\t\t});\n}", "function getUserList(uid, data) {\n return new Promise((resolve, reject) => {\n adminWebModel.getUserList(data).then((result) => {\n if (result) {\n let token = jwt.sign({ uid: uid }, key.JWT_SECRET_KEY, {\n expiresIn: timer.TOKEN_EXPIRATION\n })\n \n resolve({ code: code.OK, message: '', data: { 'token': token, 'totalpage': Math.ceil(result.count / Number(data.row_count)), 'userlist': result.rows } })\n }\n }).catch((err) => {\n if (err.message === message.INTERNAL_SERVER_ERROR)\n reject({ code: code.INTERNAL_SERVER_ERROR, message: err.message, data: {} })\n else\n reject({ code: code.BAD_REQUEST, message: err.message, data: {} })\n })\n })\n }", "function getUsers(req, res) {\r\n User.getUsers((err, users) => {\r\n if (err) {\r\n res.status(500).send({ message: 'Error al obtener los usuarios' });\r\n } else {\r\n res.status(200).send({ users });\r\n }\r\n });\r\n}", "function getUsers(){ \n\treturn axios.get(users);\n}", "all() {\n return users;\n }", "listAll(req, res) {\n User.findAll({\n attributes: ['username', 'email', 'title', 'createdAt', 'updatedAt'],\n })\n .then((user) => {\n if (user.length === 0) {\n res.status(200).send({ message: 'Nothing to show.' });\n } else {\n res.status(200).send(user);\n }\n });\n }", "static async findAllUsers() {\n const userList = await User.find({});\n return userList;\n }", "retrieveUsers() {\n\n this.__updateToken__()\n return fetch(`${this.url}/users`, {\n\n headers: {\n authorization: `Bearer ${this.__userToken__}`\n }\n })\n .then(response => response.json())\n .then(response => {\n if (response.error) throw Error(response.error)\n\n return response\n })\n }", "getUserInfos() {\n return Api.get(\"client/user-infos\");\n }", "static async getAllUsers(req, res, next) {\n try {\n const users = await this.database.getAllUsers();\n return res.send(users);\n } catch (error) {\n next(error);\n }\n }", "function listOfUsers() {\n request.get('https://slack.com/api/users.list?token='+\n process.env.Apptoken+'&pretty=1',function (err,requ,response)\n {\n var data= JSON.parse(response);\n usersLists=data.members;\n });//end of get users.list function\n}", "getAllUserCryptos() {\n return Api.get(\"/client\");\n }", "function listarUsuarios(){\n $http.get('/api/usuarios').success(function(response){\n $scope.usuarios = response;\n });\n }", "function listAllByUser(req, res, next) {\n\tconst idUser = req.user._id\n\tController.listAllInboxByUser(idUser)\n\t\t.then((list) => {\n\t\t\tresponse.success(req, res, list, 200)\n\t\t})\n\t\t.catch((err) => {\n\t\t\tresponse.error(req, res, err, 404)\n\t\t})\n}", "function findAllUsers() {\n userService\n .findAllUsers()\n .then(renderUsers);\n }", "static getAllUsers() \n {\n return UserDao.showUsersList(); \n }", "function getUsers() {\n\treturn fetch(userURL).then((resp) => resp.json())\n}", "function listAdminUsers(arg) {\n\n\tif ('undefined' !== typeof arg && ('-h' === arg || '--help' === arg || 'help' === arg)) {\n\t\n\t\tactionHelp(\"adminUser list\", 'View a list of all admin users.', '');\n\t\treturn process.exit();\n\t\n\t}\n\telse if ('undefined' !== typeof arg) {\n\t\n\t\tconsole.log('\"adminUser list\" does not accept any arguments.');\n\t\treturn process.exit();\n\t\n\t}\n// \tvar users = new UserModel();\n\tglobal.Uwot.Users.listUsers(function(error, userList) {\n\t\n\t\tif (error) {\n\t\t\n\t\t\tconsole.log(error.message);\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\tif (!userList || userList.length < 1) {\n\t\t\n\t\t\tconsole.log('No admin users. Use \"adminUser add\" to create an admin user.');\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\ttitleBlock('Available Admin Users:');\n\t\tconsole.log(' id username name sudoer');\n\t\tconsole.log(' --------------------------------------------------------------------------------------------');\n\n\t\tfor (let i = 0; i < userList.length; i++) {\n\t\t\n\t\t\tvar logLine = ' ' + userList[i]._id;\n\t\t\tfor (let sp = 23 - userList[i]._id.toString().length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += userList[i].uName;\n\t\t\tfor (let sp = 21 - userList[i].uName.toString().length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tvar fullName;\n\t\t\tif (null === userList[i].fName && null === userList[i].lName) {\n\t\t\t\n\t\t\t\tfullName = \"*NONE*\";\n\t\t\t\n\t\t\t}\n\t\t\telse if (null === userList[i].lName) {\n\t\t\t\n\t\t\t\tfullName = userList[i].fName;\n\t\t\t\n\t\t\t}\n\t\t\telse if (null === userList[i].fName) {\n\t\t\t\n\t\t\t\tfullName = userList[i].lName;\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\n\t\t\t\tfullName = userList[i].lName + ', ' + userList[i].fName;\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += fullName;\n\t\t\tfor (let sp = 41 - fullName.length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += userList[i].sudoer;\n\t\t\tconsole.log(logLine);\n\t\t\n\t\t}\n\t\treturn process.exit();\n\t\t\n\n\t});\n\n}", "function api_get_users(req, res) {\n User.find({}, '-password', function(err, users) {\n if (!err && users) {\n\t res.send(200, users);\n\t} else {\n\t res.send(500, {message : \"Error\"});\n\t} \n });\n}", "async AllUsers(p, a, { app: { secret, cookieName }, req, postgres, authUtil }, i) {\n const getUsersQ = {\n text: 'SELECT * FROM schemaName.users'\n }\n\n const getUsersR = await postgres.query(getUsers)\n\n return getUsersR.rows\n }", "list (req, res) {\n const data = this._getTodoData(req.user.username)\n\n res.json(data.items)\n }", "function getUsers(req, res) {\n console.log('GET de todos los usuarios'.blue);\n UserSchema.find({}, (err, users) => {\n if (err) return res.status(500).send(err);\n if (!users) return res.status(404).send('No hay usuarios registrados');\n\n return res.status(200).send({ users });\n });\n}" ]
[ "0.8715179", "0.78477544", "0.76506615", "0.76285285", "0.75700396", "0.75625867", "0.7552312", "0.75437176", "0.753086", "0.75252706", "0.74641365", "0.74345386", "0.7430963", "0.7417482", "0.7381625", "0.73374724", "0.73360103", "0.7333996", "0.7296271", "0.72877705", "0.72655916", "0.72590166", "0.7255647", "0.7228388", "0.7227044", "0.7224374", "0.72152853", "0.7183982", "0.71786094", "0.7166685", "0.71617544", "0.7147493", "0.71378225", "0.7116264", "0.7094358", "0.70820236", "0.7072757", "0.7065327", "0.70650005", "0.70604044", "0.70539784", "0.7053495", "0.7044113", "0.7034926", "0.7025112", "0.70188105", "0.7010754", "0.7005592", "0.70019174", "0.6987217", "0.6974598", "0.6963468", "0.69583195", "0.6952648", "0.69471765", "0.6944182", "0.6936362", "0.6936309", "0.69334364", "0.6931566", "0.6931041", "0.692821", "0.69018626", "0.68813145", "0.6879476", "0.68739736", "0.68667465", "0.68650216", "0.6864625", "0.68609345", "0.68595725", "0.68563247", "0.6842199", "0.6837558", "0.6826406", "0.6819605", "0.6810491", "0.6802806", "0.6798458", "0.6793721", "0.6784823", "0.6781124", "0.67769545", "0.6773288", "0.67702395", "0.6770181", "0.67645675", "0.6764185", "0.676112", "0.6760256", "0.67593634", "0.6752931", "0.67513424", "0.6745835", "0.67408675", "0.67303747", "0.67298234", "0.67055666", "0.6700812", "0.67004234", "0.6698909" ]
0.0
-1
Get list of user data via l'ApiAdmin
GetUserData(Data, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin GetUserData, Data: " + JSON.stringify(Data), User, UserId) let MongoObjectId = require('./Mongo.js').MongoObjectId // Definition de la Query de Mongo const Query = {'_id': new MongoObjectId(Data.UsesrId)} // Definition de la projection de Mongo en fonction du type de user let Projection = {projection:{}} // Find de type Promise de Mongo this._Mongo.FindPromise(Query,Projection, this._MongoVar.UserCollection).then((reponse)=>{ if(reponse.length == 0){ this.LogAppliError("Wrong UserId", User, UserId) res.json({Error: true, ErrorMsg: "Wrong UserId", Data: null}) } else { // les password sont effacés de la réponse reponse[0][this._MongoVar.LoginPassItem]="" reponse[0][this._MongoVar.LoginConfirmPassItem]="" // la reponse est envoyée res.json({Error: false, ErrorMsg: "User data in DB", Data: reponse}) } },(erreur)=>{ this.LogAppliError("ApiAdminGetUserData DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getAllUsers() {\n return Api.get(\"/admin/user-list\");\n }", "getUserList(data){\nreturn this.post(Config.API_URL + Constant.USER_GETUSERLIST, data);\n}", "listUsers(aud) {\n return this.user._request('/admin/users', {\n method: 'GET',\n audience: aud,\n });\n }", "function listUsers(api, query) {\n return api_1.GET(api, '/users', { query })\n}", "static getUsers() {\n return API.fetcher(\"/user\");\n }", "users() {\r\n\t\treturn API.get(\"pm\", \"/list-users\");\r\n\t}", "function getUserList(uid, data) {\n return new Promise((resolve, reject) => {\n adminWebModel.getUserList(data).then((result) => {\n if (result) {\n let token = jwt.sign({ uid: uid }, key.JWT_SECRET_KEY, {\n expiresIn: timer.TOKEN_EXPIRATION\n })\n \n resolve({ code: code.OK, message: '', data: { 'token': token, 'totalpage': Math.ceil(result.count / Number(data.row_count)), 'userlist': result.rows } })\n }\n }).catch((err) => {\n if (err.message === message.INTERNAL_SERVER_ERROR)\n reject({ code: code.INTERNAL_SERVER_ERROR, message: err.message, data: {} })\n else\n reject({ code: code.BAD_REQUEST, message: err.message, data: {} })\n })\n })\n }", "async function listUsers() {\r\n let res = await request\r\n .get(reqURL(config.routes.user.list))\r\n .withCredentials()\r\n .set(\"Content-Type\", \"application/json\")\r\n .set(\"Accept\", \"application/json\")\r\n .auth(\"team\", \"DHKHJ98N-UHG9-K09J-7YHD-8Q7LK98DHGS7\");\r\n log(`listUsers:${util.inspect(res.body)}`);\r\n return res.body\r\n}", "static async getUsers() {\n return await this.request('users/', 'get');\n }", "function listUsers() {\n $listUsers.empty();\n\n if (event) event.preventDefault();\n\n var token = localStorage.getItem('token');\n $.ajax({\n url: '/users',\n method: 'GET',\n beforeSend: function beforeSend(jqXHR) {\n if (token) return jqXHR.setRequestHeader('Authorization', 'Bearer ' + token);\n }\n }).done(function (users) {\n showUsers(users, 0, 10);\n });\n }", "getAllUsers() {\n return this.http.get('http://localhost:8080/api/users');\n }", "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "static async list(req, res) {\n try {\n const users = await UserService.list();\n res.status(200).send({ success: true, data: users });\n } catch (err) {\n res.status(500).send(errorResponse);\n }\n }", "getUsers() {\n return axios.get(USERS_REST_API_URL);\n }", "async list() {\n\t\treturn this.store.User.findAll()\n\t}", "function getUsers(data){\n users = JSON.parse(data).results;\n renderUsers();\n}", "function findAllUsers() {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users')\n .then(response => response.json())\n }", "function getUsers() {\n let api = \"../api/Users\";\n\n ajaxCall(\"GET\", api, \"\", getUsersSuccessCB, getErrorCB);\n}", "function getUsers(){\n\t\t\tgetUsersService.getUserList().then(function(data){\n\t\t\t\tlc.listOfUser = data;\n\t\t\t})\n\t\t\t.catch(function(message){\n\t\t\t\texception.catcher('getUserList Service cannot succeed')(message);\n\t\t\t});\n\t\t}", "function GetUsers() {\n UserApi.getUser().then(function (response) {\n $scope.user = response.data;\n }), function () {\n aler(\"Unable to load users info\");\n }\n }", "function getUserList() {\n \n return userList;\n }", "static getAllUsers(){\n return Axios.get(`/users`);\n }", "function getUsers() {\r\n apiService.getEntity('users')\r\n .then(function (response) {\r\n vm.users = response.data;\r\n notifyService.success('Users loaded.');\r\n }, function (error) {\r\n vm.message = 'Unable to load data: ' + error.message;\r\n });\r\n }", "list(req, res) {\n\n return User\n .findAll({})\n .then(users => res.status(200).send(users))\n .catch(error => res.status(400).send(error));\n }", "function retrieve_all_users(){\n\tlet params = {\n\t\t\t\t method: \"GET\",\n\t\t\t\t url: \"/api/admin/all/\"\n \t\t\t\t}\n\t$.ajax(params).done(function(data) {\n\t\tvar allUsers = '<div style=\"border:1px solid black\"><h3>All users</h3><table><tr><th>Username</th>'+\n\t\t'<th>First Name</th><th>Last Name</th><th>e-mail</th><th>Account Type</th><th>Last Login</th></tr>';\n\t\tconsole.log(data[\"users\"].length);\n\t\tfor(i=0;i<data[\"users\"].length;i++){\n\t\t\tallUsers += \"<tr><th>\"+data[\"users\"][i].username+\"</th><th>\"+\n\t\t\tdata[\"users\"][i].firstName+\"</th><th>\"+data[\"users\"][i].lastName+\n\t\t\t\"</th><th>\"+data[\"users\"][i].email+\"</th><th>\"+data[\"users\"][i].userType+\n\t\t\t\"</th><th>\"+data[\"users\"][i].lastLogin+\"</th></tr>\";\n\t\t}\n\t\tallUsers+= \"</table>\";\n\t\t$(\"#allUsers\").html(allUsers);\n\t});\n}", "async getUsers() {\n let res = await fetch('/users', {credentials: 'include', headers: {'Content-Type': 'application/json'}})\n let v = await res.json()\n return v\n }", "function listUsers() {\n gapi.client.directory.users.list({\n 'customer': 'my_customer',\n 'maxResults': 100,\n 'orderBy': 'email',\n 'viewType': \"domain_public\"\n }).then(function(response) {\n var users = response.result.users;\n var menu = document.getElementById('menu-main');\n menu.className += \" show-toggle\";\n //appendPre('Directory Loaded, you may now Show Directory <a href=\"link\"> test </a>');\n if (users && users.length > 0) {\n for (i = 0; i < users.length; i++) {\n //console.log(user);\n var user = users[i];\n userlist.push(user)\n /*appendPre('-' + user.primaryEmail + ' (' + user.name.fullName + ')');\n if (user.organizations){\n appendPre(user.organizations[0].title);\n };\n if (user.thumbnailPhotoUrl){\n appendPre(user.thumbnailPhotoUrl)\n }*/\n }\n } else {\n appendPre('No users found.');\n }\n });\n }", "function getUsers() {\n return getItem('users');\n}", "function GetUserList() {\r\n\t\treturn $.ajax({\r\n\t\t\turl: '/api/usuarios/listar',\r\n\t\t\ttype: 'get',\r\n\t\t\tdataType: \"script\",\r\n\t\t\tdata: { authorization: localStorage.token },\r\n\t\t\tsuccess: function(response) {\r\n\t\t\t\tconst usuarios = JSON.parse(response);\r\n\t\t\t\t//console.log(usuarios); //<-aqui hago un console para ver lo que devuelve\r\n\t\t\t\tusuarios.forEach(user => {\r\n\t\t\t\t\ttablaUsuarios.row.add({\r\n\t\t\t\t\t\t\"cedulaUsuario\": user.cedulaUsuario,\r\n\t\t\t\t\t\t\"nombreCUsuario\": user.nombreCUsuario,\r\n\t\t\t\t\t\t\"emailUsuario\": user.emailUsuario,\r\n\t\t\t\t\t\t\"nickUsuario\": user.nickUsuario,\r\n\t\t\t\t\t}).draw();\r\n\t\t\t\t});\r\n\r\n\t\t\t}\r\n\t\t});\r\n\t}", "async getUsers() {\n let userResult = await this.request(\"users\");\n return userResult.users;\n }", "getUsers() {\n return new Promise((resolve, reject) => {\n axios.get('/api/admin').then(response => {\n resolve(response.data)\n }).catch(error => reject(error))\n })\n }", "function getUserList() {\n userService.getUsers()\n .then(function (users) {\n var result = users.filter(function (u) {\n return u.Id !== vm.current.details.ownerId;\n });\n vm.ownerForm.users = result;\n });\n }", "function getList(){\n\t\t// call ajax\n\t\tlet url = 'https://final-project-sekyunoh.herokuapp.com/get-user';\n\t\tfetch(url)\n\t\t.then(checkStatus)\n\t\t.then(function(responseText) {\n\t\t\tlet res = JSON.parse(responseText);\n\t\t\tlet people = res['people'];\n\t\t\tdisplayList(people);\n\t\t})\n\t\t.catch(function(error) {\n\t\t\t// show error\n\t\t\tdisplayError(error + ' while getting list');\n\t\t});\n\t}", "httpGetAllUsers () {\n return makeApiRequest(`users`);\n }", "getAllUser(){\n return this.auth.get(\"/user\", {}).then(({data})=> data);\n }", "static getAllUsers() {\n return fetch('https://dev-selfiegram.consumertrack.com/users').then(response => {\n return response.json();\n }).catch(error => {\n return error;\n });\n }", "static list(req, res) {\n // access_token\n console.log(\"article lists\")\n const dataUserId = req.userData.id\n console.log(dataUserId)\n\n Article.findAll({\n where: {UserId: dataUserId}\n })\n .then((articles) => {\n res.status(200).json(articles)\n })\n .catch((err) => {\n res\n .status(500)\n .json({ message: err.message || 'internal error server' })\n })\n }", "async function getUsers() {\n const response = await api.get(`/users/?_sort=id&_order=desc`);\n\n if (response.data) {\n setCompletedListUsers(response.data);\n setListUsers(response.data);\n refreshCountPages(response.data);\n }\n }", "async index() {\n const { ctx, service } = this;\n const res = await service.user.crud({\n type: 'readAll',\n });\n console.log('res_user_index-------', res);\n ctx.body = res;\n }", "async getAllUsers(){\n data = {\n URI: `${ACCOUNTS}`,\n method: 'GET'\n }\n return await this.sendRequest(data)\n }", "getUserInfos() {\n return Api.get(\"client/user-infos\");\n }", "function List(req, res) {\n let userId = req.params.userId;\n UsersModel.findById(userId, (err, user) => {\n if (err) {\n return res.status(422).json({\n 'status': false,\n 'message': 'An Error Occured'\n })\n }\n return res.status(200).send(user)\n })\n}", "function getUsers(){\n return users;\n}", "static getUsers() {\n const req = new Request('/api/users/', {\n method : 'GET',\n headers : this.requestHeaders()\n });\n return fetch(req).then(res => this.parseResponse(res))\n .catch(err => {\n throw err;\n });\n }", "function getUsers() {\r\n console.log(\"getUsers called...\");\r\n doAjaxCall(`${apiURL}/users`,'GET'); \r\n\r\n}", "function getAllUsers() {\n\t\t// url (required), options (optional)\n\t\t/*\n\t\tfetch('/snippets/all') // Call the fetch function passing the url of the API as a parameter\n\t\t.then(function(resp) {\n\t\t\treturn resp.json()\n\t\t}) // Transform the data into json\n\t\t.then(function(data) {\n\t\t\tconsole.log(JSON.parse(data));\n\t\t\t// Your code for handling the data you get from the API\n\t\t\t//_bindTemplate(\"#entry-template\", data, '#sample-data');\n\t\t})\n\t\t.catch(function(errors) {\n\t\t\t// This is where you run code if the server returns any errors\n\t\t\tconsole.log(errors);\n\t\t});\n\t\t*/\n\n\t\t$.ajax({\n\t\t\ttype: 'GET', \t\t// define the type of HTTP verb we want to use (POST for our form)\n\t\t\turl: '/users/all', \t// the url where we want to POST\n\t\t\tdataType: 'json', \t// what type of data do we expect back from the server\n\t\t\tencode: true\n\t\t})\n\t\t// using the done promise callback\n\t\t.done(function(data) {\n\t\t\t_bindTemplate(\"#entry-template\", data, '#sample-data');\n\t\t});\n\t}", "list (req, res) {\n const data = this._getTodoData(req.user.username)\n\n res.json(data.items)\n }", "static async getUsers (token) {\n const query = `*[_type == 'user'] {\n name,\n _id\n }\n `\n client.config({ token })\n return client.fetch(query)\n }", "function listOfUsers() {\n request.get('https://slack.com/api/users.list?token='+\n process.env.Apptoken+'&pretty=1',function (err,requ,response)\n {\n var data= JSON.parse(response);\n usersLists=data.members;\n });//end of get users.list function\n}", "async function getUserList() {\n\n // Connection properties\n var options = {\n method: 'GET',\n uri: conf.API_PATH + `5808862710000087232b75ac`,\n json: true\n };\n\n return (await request(options)).clients;\n}", "getAllUsers() {\r\n return this.users;\r\n }", "getUsers() {\n return axios\n .get(this.apiUrl() + \"/users/\", {\n headers: this.authHeader(),\n })\n }", "index(req, res) {\n //TODO - handle search params\n return this.kernel.model.User.find()\n .then(users => {\n res.status(200).json(users);\n })\n .catch(handleError(res));\n }", "function _getUsers() {\n // var usersList = JSON.parse(localStorage.getItem('lsUsersList'));\n // if (usersList == null) {\n // usersList = users; //Lista de jugadores quemados\n // }\n // return usersList;\n return $http.get('http://localhost:3000/api/get_all_users');\n }", "function getAllUsers(callback) {\n requester.get('user', '', 'kinvey')\n .then(callback)\n}", "function getUsers() {\n axios\n .get(process.env.REACT_APP_API_URL + \"/users\")\n .then((res) => {\n setUsers(res.data);\n // console.log(res.data);\n })\n .catch((err) => {\n console.log(\"Error listing the users\");\n });\n }", "function getUsers() {\n subscribeService.getUsersContent()\n .then(function(data) {\n vm.data = data.slice(0, vm.data.length + 3);\n });\n }", "function userList() {\n let jsonFileRead = fs.readFileSync(path.join(__dirname, '../data/users.json'), 'utf-8')\n return JSON.parse(jsonFileRead)\n}", "function requestAdmins(success, failure) {\n if (!self.currentOrganization) {\n failure();\n }\n apiGetRequest(\"/management/organizations/\" + self.currentOrganization + \"/users\", null, success, failure);\n }", "function findAllUsers() {\n return fetch(self.url).then(response => response.json())\n }", "static async getAllUsers() {\n try {\n logger.info('[user]: listing all users');\n const userList = await UserService.findAllUsers();\n\n return userList;\n } catch (e) {\n throw new InternalServerException();\n }\n }", "function listUsers (req, res) {\n promiseResponse(userStore.find({}), res);\n}", "retrieveUsers() {\n\n this.__updateToken__()\n return fetch(`${this.url}/users`, {\n\n headers: {\n authorization: `Bearer ${this.__userToken__}`\n }\n })\n .then(response => response.json())\n .then(response => {\n if (response.error) throw Error(response.error)\n\n return response\n })\n }", "async listUsers(req, res, next) {\n try {\n const users = await UsersService.listUsers();\n res.status(HTTPStatus.OK);\n res.json(users);\n } catch (error) {\n next(extendError(error, { task: 'Controller/listUsers' }));\n }\n }", "function getUsers(){ \n\treturn axios.get(users);\n}", "getAccountsList() {\n const params = { type: 'list' };\n return this.apiService.get(`${this.url}/user/find`, { params }).pipe(\n map(res => res.map((account) => this._modifyUserAccountSummary(account)))\n );\n }", "function listUsersAdmin() {\n $scope.isDataUserReady = false;\n $http({\n method: 'GET',\n url: baseUrl + 'admin/user_entreprise/list/' + idInstitution + '/' + idAdmin,\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n $scope.listUsers = response.data.entreprise_users_list;\n for (var i = 0; i < $scope.listUsers.length; i++) {\n if ($scope.listUsers[i].idUtilisateur == sessionStorage.getItem(\"iduser\")) {\n $scope.isuserInsessionLine = i;\n break;\n };\n };\n $scope.isDataUserReady = true;\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "function getAllUsersController(request, response) {\n const users = model.list()\n\n response.status(httpStatus.OK).json(users);\n}", "userList() {\r\n const users= auth.users;\r\n return (\r\n <ol>\r\n {users.map(users => <li>{users}</li>)}\r\n </ol>\r\n );\r\n }", "fetchUsers() {\n return this.get(`${this.baseUrl}/users`);\n }", "function getUsers() {\n var url = 'https://itrex-react-lab-files.s3.eu-central-1.amazonaws.com/react-test-api.json';\n return fetch(url).then(function (resp) {\n return resp.json();\n }).then(mainFunc)[\"catch\"](function (err) {\n return alert('Failed to load data.');\n });\n } // Main function that processes the api-data and delegates it to other functions.", "function getAllUsers(){\n return UserService.getAllUsers();\n }", "function getAllUser(){\n return $http.get(url.user).then( handleSuccess, handleError );\n }", "function getUsers() {\n fetch(userUrl)\n .then((res) => res.json())\n .then((users) => {\n sortUsers(users);\n displayLeaderBoard();\n })\n .catch((error) => console.error(\"ERROR:\", error));\n }", "function listarUsuarios(){\n $http.get('/api/usuarios').success(function(response){\n $scope.usuarios = response;\n });\n }", "async getUserList(number) {\n try {\n const result = await this.axiosInstance.get(\n `/users?limit=${number}&offset=0`\n );\n return result;\n } catch (err) {\n helpMeInstructor(err);\n return err;\n }\n }", "function getUsers() {\n\treturn fetch(userURL).then((resp) => resp.json())\n}", "function ListAdmin(req, res) {\n let userPermission = req.params.userPermission;\n let userId = req.params.userId;\n if (userPermission == 'superAdmin') {\n UsersModel.find({\n permission: 'Admin'\n }, (err, admins) => {\n if (err) {\n return res.json({\n 'status': false,\n 'message': 'You are not a Super Admin can\\'t view the Admin list'\n })\n }\n return res.status(200).send(admins)\n })\n } else {\n UsersModel.find({\n permission: 'Admin'\n }, (err, admins) => {\n if (err) {\n return res.json({\n 'status': false,\n 'message': 'An Error Occured'\n })\n }\n return res.status(200).send(admins)\n })\n }\n\n}", "getUserDetails() {\n return this.api.send('GET', 'user');\n }", "get usersList() {\n return this.model.users.toArray();\n }", "function listUsers() {\n axios({\n url: `${baseUrl}/users/${localStorage.getItem('_id')}`,\n method: `get`,\n dataType: `json`,\n headers: {\n token: localStorage.getItem('token')\n }\n })\n .then(({ data }) => {\n $(`.listUsers`).empty()\n $(`.listUsers`).append(`\n <option selected disabled hidden>Invite other user</option>\n `)\n for (let i = 0; i < data.length; i++) {\n $(`.listUsers`).append(`\n <option class=\"input-user-name\" id=\"${data[i]._id}\">${data[i].name}</option>\n `)\n }\n })\n .catch((err) => {\n console.log('ini errorr', err)\n })\n}", "function listUsers() {\n $scope.isDataUserReady = false;\n $http({\n method: 'GET',\n url: baseUrl + 'admin/user_bank/list',\n data: {},\n headers: { 'Authorization': 'Bearer ' + localStorage.getItem('jeton') }\n }).then(function successCallback(response) {\n $scope.bankUsers = response.data.bank_list;\n $scope.isDataUserReady = true;\n // //console.log(\"$scope.bankUsers \",$scope.bankUsers);\n }).catch(function(err) {\n if (err.status == 500 && localStorage.getItem('jeton') != '' && localStorage.getItem('jeton') != null && localStorage.getItem('jeton') != undefined) {\n deconnectApi.logout(sessionStorage.getItem(\"iduser\")).then(function(response) {\n $location.url('/access/login');\n $state.go('access.login');\n }).catch(function(response) {});\n };\n });\n }", "getList() { return this.api(); }", "async getUserIds() {\n console.log('GET /users')\n return this.server.getUserIds()\n }", "getAll(req, res, next) {\n userModel.all().then(\n users => {\n res.data = {\n ...res.data,\n users,\n }\n next()\n }\n )\n }", "static async getAll() {\n\t\tconst usersRes = await db.query(`SELECT * FROM users ORDER BY username`);\n\t\treturn usersRes.rows;\n\t}", "function onGetUsers(data) {\n //console.log(data);\n $scope.users = data;\n }", "function listAdminUsers(arg) {\n\n\tif ('undefined' !== typeof arg && ('-h' === arg || '--help' === arg || 'help' === arg)) {\n\t\n\t\tactionHelp(\"adminUser list\", 'View a list of all admin users.', '');\n\t\treturn process.exit();\n\t\n\t}\n\telse if ('undefined' !== typeof arg) {\n\t\n\t\tconsole.log('\"adminUser list\" does not accept any arguments.');\n\t\treturn process.exit();\n\t\n\t}\n// \tvar users = new UserModel();\n\tglobal.Uwot.Users.listUsers(function(error, userList) {\n\t\n\t\tif (error) {\n\t\t\n\t\t\tconsole.log(error.message);\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\tif (!userList || userList.length < 1) {\n\t\t\n\t\t\tconsole.log('No admin users. Use \"adminUser add\" to create an admin user.');\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\ttitleBlock('Available Admin Users:');\n\t\tconsole.log(' id username name sudoer');\n\t\tconsole.log(' --------------------------------------------------------------------------------------------');\n\n\t\tfor (let i = 0; i < userList.length; i++) {\n\t\t\n\t\t\tvar logLine = ' ' + userList[i]._id;\n\t\t\tfor (let sp = 23 - userList[i]._id.toString().length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += userList[i].uName;\n\t\t\tfor (let sp = 21 - userList[i].uName.toString().length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tvar fullName;\n\t\t\tif (null === userList[i].fName && null === userList[i].lName) {\n\t\t\t\n\t\t\t\tfullName = \"*NONE*\";\n\t\t\t\n\t\t\t}\n\t\t\telse if (null === userList[i].lName) {\n\t\t\t\n\t\t\t\tfullName = userList[i].fName;\n\t\t\t\n\t\t\t}\n\t\t\telse if (null === userList[i].fName) {\n\t\t\t\n\t\t\t\tfullName = userList[i].lName;\n\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\n\t\t\t\tfullName = userList[i].lName + ', ' + userList[i].fName;\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += fullName;\n\t\t\tfor (let sp = 41 - fullName.length; sp > 0; sp--) {\n\t\t\t\n\t\t\t\tlogLine += ' ';\n\t\t\t\n\t\t\t}\n\t\t\tlogLine += userList[i].sudoer;\n\t\t\tconsole.log(logLine);\n\t\t\n\t\t}\n\t\treturn process.exit();\n\t\t\n\n\t});\n\n}", "getUserList() {\n return this.http.get(this.url + '/cesco/getlanguages', this.httpOptions);\n }", "function userController(req, res) {\n res.json(users)\n}", "allUsers() { return queryAllUsers() }", "function getUser() {\n var userEmail = '[email protected]';\n var user = AdminDirectory.Users.get(userEmail);\n Logger.log('User data:\\n %s', JSON.stringify(user, null, 2));\n}", "view(req, res) {\n const users = UserModel.getAll();\n return res.status(200).send(users);\n }", "static getAllUsers(req, res) {\n userService.getAllUsers(db, function (returnvalue) {\n res.status(200).send(returnvalue);\n })\n\n }", "function listUsers(req, res, next) {\n const privateData = ['password'];\n const offset = parseInt(req.query.offset, 10) || 0;\n const limit = parseInt(req.query.limit, 10) || defaultLimit;\n User.find()\n .skip(offset)\n .limit(limit)\n .omit(privateData)\n .then(users => {\n if (!users.length) {\n return res.status(HTTPStatus.NO_CONTENT).end();\n }\n return res.status(HTTPStatus.OK).send(users);\n })\n .catch(err => next(err));\n}", "function getUsers(users) {\n\tconst userList = JSON.parse(users);\n\tgetRepos(userList);\n\tdisplayUser(userList)\n}", "fetchAllUsers() {\n let account = JSON.parse(localStorage.getItem(\"cachedAccount\")).id;\n let url = (\"./admin/admin_getusers.php?allusers=\" + account);\n\n\t\t\tfetch(url)\n\t\t\t.then(res => res.json())\n\t\t\t.then(data => {\n\t\t\t\tthis.userList = data;\n\t\t\t})\n\t\t\t.catch((err) => console.error(err));\n }", "static async index() {\n try {\n let users = await UserModel.find();\n return {\n status: 200,\n data: {\n data: users,\n message: \"Users list found successfully!\"\n }\n };\n } catch (error) {\n return ErrorHandler.handleError(error);\n }\n }", "function ListAllUsers(req, res) {\n let userPermission = req.param.userPermission;\n let userId = req.param.userId;\n if (userPermission == 'Admin' || 'superAdmin') {\n UsersModel.find({}, (err, users) => {\n if (err) {\n return res.status(422).json({\n 'status': false,\n 'message': 'An Error Occured'\n })\n }\n return res.status(200).send(users)\n })\n } else {\n UsersModel.findById(userId, (err, users) => {\n if (err) {\n return res.status(422).json({\n 'status': false,\n 'message': 'An Error Occured'\n })\n }\n return res.status(200).send(users)\n })\n }\n\n}", "function listUsers() {\n const optionalArgs = {\n customer: 'my_customer',\n maxResults: 10,\n orderBy: 'email'\n };\n try {\n const response = AdminDirectory.Users.list(optionalArgs);\n const users = response.users;\n if (!users || users.length === 0) {\n console.log('No users found.');\n return;\n }\n // Print the list of user's full name and email\n console.log('Users:');\n for (const user of users) {\n console.log('%s (%s)', user.primaryEmail, user.name.fullName);\n }\n } catch (err) {\n // TODO (developer)- Handle exception from the Directory API\n console.log('Failed with error %s', err.message);\n }\n}", "function listPublicUsers(req, res, next) {\n const privateData = ['email', 'password'];\n const offset = parseInt(req.query.offset, 10) || 0;\n const limit = parseInt(req.query.limit, 10) || defaultLimit;\n User.find()\n .skip(offset)\n .limit(limit)\n .omit(privateData)\n .then(users => {\n if (!users.length) {\n return res.status(HTTPStatus.NO_CONTENT).end();\n }\n return res.status(HTTPStatus.OK).send(users);\n })\n .catch(err => next(err));\n}" ]
[ "0.8103539", "0.76670825", "0.7582745", "0.73830926", "0.73292035", "0.72673535", "0.7210796", "0.72069913", "0.7201222", "0.7175564", "0.7160537", "0.71472794", "0.71344733", "0.70957536", "0.70705056", "0.7059214", "0.7046257", "0.70367396", "0.7034164", "0.7029558", "0.70286095", "0.701259", "0.6978812", "0.69713277", "0.69690394", "0.69572955", "0.6957191", "0.6955002", "0.6935455", "0.6920473", "0.6885572", "0.6884814", "0.688341", "0.68775666", "0.685238", "0.6846256", "0.68458134", "0.6844379", "0.68391734", "0.6833271", "0.68202907", "0.68050784", "0.6804899", "0.67910045", "0.67874634", "0.67838866", "0.6782465", "0.678138", "0.6780295", "0.67772174", "0.6775055", "0.67515117", "0.6734135", "0.67268896", "0.6725431", "0.6724104", "0.6704492", "0.67006046", "0.6695486", "0.6693982", "0.6693296", "0.6689384", "0.66882634", "0.6685103", "0.66763395", "0.6669859", "0.6659814", "0.6658084", "0.66538537", "0.66414416", "0.6634908", "0.663437", "0.66290545", "0.66179603", "0.65931976", "0.6590989", "0.658912", "0.6585572", "0.65820056", "0.6576967", "0.65739805", "0.6572188", "0.6565443", "0.656057", "0.6556182", "0.655084", "0.6550377", "0.6529165", "0.652904", "0.65285146", "0.65275484", "0.65121335", "0.6507742", "0.65069604", "0.6503279", "0.64916176", "0.648804", "0.64805835", "0.64768803", "0.6475864", "0.64685035" ]
0.0
-1
Delete d'un user via l'ApiAdmin
DeleteUser(Data, res, User, UserId){ // Log this.LogAppliInfo("Call ApiAdmin DeleteUser, Data: " + JSON.stringify(Data), User, UserId) // Execute action before delete the user if (this._OnDeleteUser){ this._OnDeleteUser(Data.UsesrId, Data.UserLogin, User, UserId).then(()=>{ // Delete de type Promise de Mongo this._Mongo.DeleteByIdPromise(Data.UsesrId, this._MongoVar.UserCollection).then((reponse)=>{ if (reponse.deletedCount==1) { res.json({Error: false, ErrorMsg: "User deleted in DB", Data: null}) } else { this.LogAppliError("User not found in DB", User, UserId) res.json({Error: true, ErrorMsg: "User not found in DB", Data: null}) } },(erreur)=>{ this.LogAppliError("ApiAdminDeleteUser DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) }, ()=>{ this.LogAppliError("ApiAdminDeleteUser error during OnDeleteUser function", User, UserId) res.json({Error: true, ErrorMsg: "Error during OnDeleteUser function", Data: null}) }) } else { // Delete de type Promise de Mongo this._Mongo.DeleteByIdPromise(Data.UsesrId, this._MongoVar.UserCollection).then((reponse)=>{ if (reponse.deletedCount==1) { res.json({Error: false, ErrorMsg: "User deleted in DB", Data: null}) } else { this.LogAppliError("User not found in DB", User, UserId) res.json({Error: true, ErrorMsg: "User not found in DB", Data: null}) } },(erreur)=>{ this.LogAppliError("ApiAdminDeleteUser DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function deleteUser(req, res) {\n var id = req.params['id'];\n typeModel.deleteAdmin(id)\n .then(res.sendStatus(200))\n }", "deleteUser(id) {\n return axios\n .delete(this.apiUrl() + `/users/${id}/`, {\n headers: this.authHeader(),\n })\n }", "async deleteUser({ rootGetters}, id){\n //set token additional header\n let tokenHeaders = {\n headers: { 'Authorization': \"Bearer \" + rootGetters.getToken }\n }\n //delete data user from API Server\n return await this.$axios.$delete('/user/' + id, tokenHeaders)\n }", "async destroy() {\n const { ctx, service } = this;\n const params = getParams(ctx, 'body');\n const condition = Object.assign({}, params);\n const res = await service.user.crud({\n type: 'deleteOne',\n condition,\n });\n ctx.body = res;\n }", "deleteUser(user) {\n if(user.privilege === global.SUPER_ADMIN) {\n console.log(\"Errr! You are trying to delete a super admin user\");\n return 401;\n }\n user = null;\n return user;\n }", "function deleteUser(id) {\n var xhttp;\n xhttp = new XMLHttpRequest();\n xhttp.onreadystatechange = function() {\n if (this.readyState == 4 && this.status == 200) {\n getUsers();\n }\n };\n \n xhttp.open(\"DELETE\", \"http://localhost:8080/api/user/userRemoval/\" + id, true);\n xhttp.setRequestHeader(\"Content-type\", \"application/json\");\n xhttp.send();\n }", "delete(req, res, next, currentUser) {\n if (currentUser && currentUser.isAdmin) {\n User.findByIdAndRemove(req.params.id, (err) => {\n res.sendStatus(200);\n });\n } else {\n res.status(\"401\").send(\"Not authorized, your are not admin!\");\n }\n }", "static deleteUser(req, res) {\n let id = +req.params.id\n User.destroy({\n where: {id}\n })\n .then(data => {\n res.redirect('/users')\n })\n .catch(err => {\n res.send(err)\n })\n }", "async delete({ params, response }) {\n /*** get the user from db */\n const user = await User.query().where(\"id\", params.id).first();\n if (!user) {\n return response.status(404).send({\n message: \"not found\",\n });\n }\n /** delete the user */\n await user.delete();\n\n return response.status(200).send({\n message: \"user removed from database\",\n });\n }", "DeleteUser(req, res) {\n let email = req.params['id'];\n this.UserDB.delete({ email })\n .then(result => res.status(200).json(result))\n .catch(error => res.status(404));\n }", "function deleteUser(userId) {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users/' + userId, {\n method: 'DELETE'\n })\n }", "async delete({response, params}){\n const id = params.id;\n const userDel = await User.findOrFail(id);\n await userDel.delete();\n\n return response.status(201).json('Data berhasil dihapus!!');\n }", "function deleteAdminUser(id) {\n\n\tif ('undefined' !== typeof id && ('-h' === id || '--help' === id || 'help' === id)) {\n\t\n\t\tactionHelp(\"adminUser delete\", 'Remove an admin user.', '[id]');\n\t\treturn process.exit();\n\t\n\t}\n\tif ('string' !== typeof id || '' === id) {\n\t\n\t\tconsole.log('Cannot delete user; user id invalid.');\n\t\treturn process.exit();\n\t\n\t}\n// \tvar users = new UserModel();\n\tglobal.Uwot.Users.remove(id, function(error, removed) {\n\t\n\t\tif (error) {\n\t\t\n\t\t\tconsole.log(error.message);\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\tif (!removed) {\n\t\t\n\t\t\tconsole.log('User with id ' + id + ' does not exist. Use \"adminUser list\" to see all existing users.');\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\t\n\t\tconsole.log('User has been deleted (id ' + id + ').');\n\t\treturn process.exit();\n\t\n\t});\n\n}", "function deleteUser(user) {\n return axios.delete(api_host+\":\"+api_port+\"/api/user/\"+user.id)\n .then( res => {\n return res.data;\n })\n .catch( err => {\n console.log(err);\n });\n}", "function deleteUser(id) {\n var url = \"/api/user\" + id;\n return $http.delete(url);\n }", "function deleteUser(id) {\n\taddOverLay();\n\t$.ajax({\n\t\turl : HOST_PATH + \"admin/user/deleteUser\",\n\t\tmethod : \"post\",\n\t\tdata : {\n\t\t\t'id' : id\n\t\t},\n\t\tdataType : \"json\",\n\t\ttype : \"post\",\n\t\tsuccess : function(data) {\n\t\t\tif (data != null) {\n\t\t\t\twindow.location.href = \tHOST_PATH + \"admin/user/\";\n\t\t\t\t//alert('Record has been deleted');\n\n\t\t\t} else {\n\n\t\t\t\tbootbox.alert('Problem in your data');\n\t\t\t}\n\t\t\t//getUserListFromTrash();\n\t\t}\n\t});\n\t\n}", "delete(requisicao, resposta, next){\n try{\n const postgre = new postgresDB();\n const response = postgre.deleteUser(requisicao, resposta, next);\n return response;\n }\n catch(error){\n resposta.status(503).send(error);\n }\n }", "async delete(req, res) {\n try {\n const id = await userRepository.delete(req.params.id);\n res.json('deleted user. redirect to website landing page');\n } catch (err) {\n console.log('error', err);\n }\n }", "deleteUserRequest() {\n SuperAgent\n .del('/users/' + this.props.user._id)\n .end((error, response) => {\n if (error) {\n console.log('UserCard - Error deleting user from request');\n } else {\n this.props.removeUser(this.props.index);\n }\n });\n }", "deleteUser(id) {\n return fetch(baseURL + \"/users/\" + id, {\n method: \"DELETE\"\n });\n }", "function delete_user() {\n\tvar uri = \"http://localhost:8081/\" + user.accountType + \"s/\" + user.id;\n\tvar xhr = createRequest(\"DELETE\", uri);\n\txhr.onload = function() {\n\t\tif(xhr.status == 400) alert(\"Format Error\");\n\t\telse if(xhr.status != 200) alert(\"Something went wrong :/\");\n\t\telse {\n\t\t\tlocalStorage.removeItem(\"user\");\n\t\t\twindow.location.href = \"/\";\n\t\t}\n\t}\n\txhr.send();\n}", "static delete(req, res) {\n\n const getIdUser = parseInt(req.params.user)\n\n GEN_DATA_AGUNAN.destroy({ where: { UserId: getIdUser } })\n .then((data) => {\n res.status(200).json({\n message: \"delete Data success\",\n result: data\n })\n })\n .catch((err) => {\n res.status(500).json({\n message: \"Internal Server Error\",\n log: err\n })\n })\n }", "function deleteUser(id) {\n $.ajax({\n type: 'DELETE',\n url: '/admins/users/' + id,\n dataType: 'json'\n });\n}", "delete(req, res, next) {\n const id = req.params.id;\n \n User.findByIdAndRemove(id)\n .then(data => {\n if (!data) {\n res.status(404).send({\n message: `Cannot delete user with id=${id}. Maybe user was not found!`\n });\n } else {\n res.send({\n message: \"user was deleted successfully!\"\n });\n }\n })\n .catch(err => {\n res.status(500).send({\n message: \"Could not delete user with id=\" + id\n });\n });\n }", "function deleteUser(id) {\n return fetch(`${self.url}/${id}`, {method: \"DELETE\"})\n }", "deleteUser(req, res) {\n const { user } = req;\n user.destroy()\n .then(() => this.logout(req, res))\n .catch(err => errorHandler(req, res, err));\n }", "async deleteUser(req,res){\n //función controladora con la lógica que elimina un usuario\n }", "async function deleteUser(req, res) {\n const id = req.params.id;\n await Users.deleteUser(id);\n res.status(204).send();\n}", "function deleteUser(event) {\n var deleteBtn = $(event.currentTarget);\n var userId = deleteBtn\n .parent()\n .parent()\n .parent()\n .attr('id');\n userId = parseInt(userId);\n userService\n .deleteUser(userId)\n .then(findAllUsers);\n }", "deleteUser({ params }, res) {\n User.findOneAndDelete({ _id: params.id })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json ({ message: 'There is NO user found by this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err =>\n res.json(err)\n );\n }", "async deleteUser(parent, {\n id\n }, context, info) {\n try {\n const deletedUser = await context.prisma.user.delete({\n where: {\n id\n }\n }); // console.log(deletedUser)\n\n return \"user deleted successfully\";\n } catch (error) {\n return error;\n }\n }", "function deleteUserController(request, response) {\n const userId = request.params.userId;\n\n model.deleteById(userId);\n\n response.status(httpStatus.NO_CONTENT).send();\n}", "function deleteUser() {\n UserService\n .deleteUser(userId)\n .success(function () {\n $location.url(\"/login\");\n })\n .error(function (error) {\n \n });\n }", "delete(name){\n return this.$http.delete('/api/user/' + name);\n }", "function deleteUser() {\n userService\n .deleteUser(model.userId)\n .then(function() {\n $location.url(\"\");\n });\n }", "delete(req, res) {\n\t\t\t// usersModel.destroy({\n\t\t\t// \twhere: {\n\t\t\t// \t\tid: req.user.id\n\t\t\t// \t}\n\t\t\t// }).then(() => {\n\t\t\t// \tres.sendStatus(204);\n\t\t\t// });\n\t\t\t\n\t\t\tif(req.user === USER_NOT_FOUND) {\n\t\t\t\treturn res.sendStatus(404);\n\t\t\t}\n\t\t\tconst query = \"DELETE FROM users where id = $1\";\n\t\t\tconst values = [req.user.id];\n\t\n\t\t\tdb.query(query, values, (err, result) => {\n\t\t\t\tif(err) {\n\t\t\t\t\treturn res.json(err);\n\t\t\t\t}\n\t\t\t\tres.sendStatus(204);\n\t\t\t});\n\t\t\n\t\t}", "function deleteUser(request, response) {\n\n\tfunction responseOk(response, user) {\n\t\tresponse.json({\n\t\t\tmessage: 'Usuario eliminado con exito',\n\t\t\tuser\n\t\t})\n\t}\n\n\tfunction respondError(response, error) {\n\t\tresponse.send(error)\n\t}\n\n\tUser.remove({\n\t\t\t_id: request.params.userId\n\t\t})\n\t\t.then(user => responseOk(response, user))\n\t\t.catch(error => respondError(response, error))\n}", "function deleteUser() {\n request('http://localhost:3333/api/users/' + document.getElementById(\"id\").value, \"DELETE\");\n}", "function deleteUser(event) {\n var removeBtn = $(event.target);\n var removeIndex = removeBtn.attr(\"id\").split('-')[1];\n var removeUserId = users[removeIndex]._id;\n try {\n userService\n .deleteUser(removeUserId)\n .then(function () {\n users.splice(removeIndex, 1);\n renderUsers(users);\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "function deleteUser(){ \n let userId = parseInt(event.target.dataset.id)\n\n fetch(`${BASE_URL}/users/${userId}`, {\n method: 'DELETE'\n })\n\n this.location.reload()\n}", "function deleteUser(){\n\tlet ajaxRequest = new XMLHttpRequest();\n\tajaxRequest.onreadystatechange = function(){\n\t\tif(ajaxRequest.readyState == 4){\n\t\t\tif (ajaxRequest.status == 200){\n\t\t\tgetUsersInfo();\n\t\t\t\n\t\t\t}\n\t\t\telse if(ajaxRequest.status == 0){\n\t\t\t\talert(\"Aucune réponse du serveur\");\n\t\t\t}\n\t\t\telse{\n\t\t\t\talert(ajaxRequest.responseText);\n\n\t\t\t}\n\t\t\t\n\t\t}\n\t}\n\tajaxRequest.open('DELETE', \"http://localhost:8080/loans_managers/users/\"+this.dataset.id);\n\tajaxRequest.setRequestHeader(\"Content-type\", \"application/json\");\n\n\t//If the user confirms his wish to delete the entry, send the request. If not, delete the request.\n\tif (confirm('Etes vous sur de vouloir supprimer cet utilisateur?')) {\n\t\tajaxRequest.send();\n\t}\n\telse {\n\t\tdelete ajaxRequest;\n\n\t}\n}", "removeUser(req, res){\n \n }", "deleteUser({ params }, res) {\n User.findOneAndDelete({ _id: params.id })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "deleteById(req, res) {\n let id = req.params.id;\n\n this.userdao.deleteById(id)\n .then(this.common.editSuccess(res))\n .catch(this.common.serverError(res));\n }", "function deleteUser(apiurl) {\n\t$.ajax({\n\t\turl: apiurl,\n\t\ttype: \"DELETE\",\n\t\theaders: {\"Authorization\":\"admin\"},\n\t\tdataType:DEFAULT_DATATYPE\n\t}).done(function (data, textStatus, jqXHR){\n\t\tif (DEBUG) {\n\t\t\tconsole.log (\"RECEIVED RESPONSE: data:\",data,\"; textStatus:\",textStatus)\n\t\t}\n\t\talert (\"The user has been deleted from the database\");\n\t\t//Update the list of users from the server.\n\t\tgetUsers();\n\n\t}).fail(function (jqXHR, textStatus, errorThrown){\n\t\tif (DEBUG) {\n\t\t\tconsole.log (\"RECEIVED ERROR: textStatus:\",textStatus, \";error:\",errorThrown)\n\t\t}\n\t\talert (\"The user could not be deleted from the database\");\n\t});\n}", "function usersDelete(req, res){\n User.findByIdAndRemove({_id: req.params.id}, function(err){\n if (err) return res.status(404).json({message: 'Something went wrong.'});\n res.status(200).json({message: 'User has been successfully deleted'});\n });\n}", "function deleteUser(req, res, next) {\n const sql = sqlString.format(`DELETE FROM users WHERE id = ?`, [\n req.params.id\n ])\n db.execute(sql, (err, result) => {\n if (err) return next(err)\n if (!result.affectedRows) return next({ message: 'User not find' })\n res.send({ deleted: true })\n })\n}", "function delete_user() {\r\n alertBox.hide();\r\n const username = Utils.getInput();\r\n if(Utils.isEmpty(username))\r\n return;\r\n\r\n fetch('./delete', Utils.postUserParam(username)).then(function(response) {\r\n if(response.status !== 200) {\r\n alertBox.show('No such username!', true);\r\n return;\r\n }\r\n\r\n response.json().then(function(data) {\r\n alertBox.show(data.msg, false);\r\n init_saved(); //updates saved list\r\n });\r\n });\r\n }", "async deleteUser(id) {\n return user.findByIdAndDelete(id)\n }", "deleteUser({ params }, res) {\n User.findOneAndDelete({ _id: params.id })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "function DeleteUser(id) {\n ajaxCall(\"DELETE\", \"../api/Users/\" + id, \"\", deleteSuccess, error);\n}", "deleteOne(req, res) {\n if (process.env.NODE_ENV === 'production') {\n res.status(403).send({ message: 'That action is not allowed!' });\n } else {\n User.findById(req.params.id)\n .then((user) => {\n if (!user || user.length < 1) {\n res.status(404).send({ message: 'User doesn\\'t exist' });\n } else if (user.title === 'admin') {\n res.status(403).send({ message: 'Permission denied!' });\n } else {\n User.destroy({\n where: { id: req.params.id },\n cascade: true,\n restartIdentity: true,\n });\n res.send({ message: 'User deleted!' });\n }\n });\n }\n }", "function deleteUser(req, res) {\n var userId = req.params.id;\n\n User.findByIdAndRemove(userId, (err, deleteUser) => {\n if (err) {\n res.status(500).send(\"Error al eliminar el usuario\");\n } else {\n if (!deleteUser) {\n res.status(404).send(\"No se ha podido eliminar el usuario\");\n } else {\n res.status(200).send(deleteUser);\n }\n }\n });\n}", "async function deleteById(id){\n try{\n let url = USER_API_BASE_URL + \"/\" + id + \"/delete\";\n\n let res = await fetch(url, { headers: constructHeader() });\n let json;\n if (res.status === 401){\n redirectToLoginPage();\n } else {\n json = await res.json();\n }\n if (json) {\n updateAppSettings(json.access_token);\n //refreshPage();\n setUsers([...json.users]);\n }\n\n } catch(err){\n console.log(\"Error deleting user \", err.message);\n }\n }", "static async delete(id) {\n return await axios.delete(`${baseUrl}/users/${id}`);\n }", "deleteUser(db, id) {\n return db('users').where({ id }).delete();\n }", "function deleteUser(id) {\n return db.query('DELETE FROM users WHERE id= ?', id);\n}", "deleteUser(event) {\n axios.delete(config.url+`/user/`+this.state.id)\n .then(res => {\n event.preventDefault();\n });\n }", "function destroy(req, res) {\n db.User.findOneAndRemove({_id: req.params.userId}, function(err, user) {\n console.log('sever error ', err)\n res.send(\"Successfully deleted!\")\n });\n}", "function deleteUser(req , res , next){\n connection.query('DELETE FROM Usuarios WHERE ID = '+req.params.userId, function (error, success){\n if(error) throw error;\n res.send(200, 'Eliminado con exito');\n }); \n}", "function deleteUser(app){\n\treturn function(req, res){\n\t\tconst id = req.params.id;\n\t\tif(typeof id === 'undefined'){\n\t\t\tres.sendStatus(BAD_REQUEST);\n\t\t}\n\t\telse{\n\t\t\treq.app.locals.model.users.deleteUser(id).\n\t\t\t\tthen(() => res.end()).\n\t\t\t\tcatch((err) => {\n\t\t\t\t\tconsole.error(err);\n\t\t\t\t\tres.sendStatus(NOT_FOUND);\n\t\t\t\t});\n\t\t}\n\t};\n}", "function deleteUser(req, res) {\n User.findByIdAndRemove(req.params.id, function (err, user) {\n if (err) return res.status(500).send(\"There was a problem deleting the user.\");\n res.status(200).send(\"User: \" + user.name + \" was deleted.\");\n });\n}", "async remove() {\n // this function is really just a wrapper around axios\n await axios({\n url: `${BASE_URL}/users/${this.username}`,\n method: \"DELETE\",\n data: {\n token: this.loginToken\n }\n });\n }", "async function deleteUser(req,res){\n if (!req.params.id) {\n return res.status(500).json({error:\"Params emty\"})\n }\n\n await User.findOneAndDelete(req.params.id)\n res.status(200).json({msg: \"user deleted\"})\n}", "function deleteUser(e) {\r\n if (e.target.className === \"delete\") {\r\n const userId = e.target.parentElement.children[1].textContent;\r\n deleteFromUI(e.target.parentElement);\r\n toggleSpinner();\r\n fetch(`https://jsonplaceholder.typicode.com/posts/${userId}`, {\r\n method: \"DELETE\"\r\n })\r\n .then(resp => {\r\n alert(`User with id ${userId} has been removed!`);\r\n toggleSpinner();\r\n })\r\n .catch(err => { \r\n alert(`Sorry, error: ${err.message}`);\r\n toggleSpinner();\r\n });\r\n }\r\n}", "async function Delete(req, res) {\n res.send(await Model.User.findOneAndRemove({ _id: req.params.id }));\n}", "function deleteAccount() {\n const token = sessionStorage.getItem('token')\n\n fetch(`${BASE_URL}/deleteUser`, {\n method: 'DELETE',\n headers: {\n 'x-access-token': token\n }\n })\n .then(resp => {\n logout()\n getKanjiFromDatabase()\n makeModalDisapper('delete-account')\n })\n .catch(err => {\n console.error(err)\n Swal.fire({\n icon: 'error',\n title: 'Account failed to delete error',\n text: 'Failed to delete account. Please try again.'\n })\n })\n}", "function deleteUser() {\n UserService.deleteUser(model.userId)\n .then(function (response) {\n console.log(response);\n if (response.status == 200) {\n $location.url('/login');\n }\n }, function (rejection) {\n model.errorMessage = \"Sorry an error was encountered and your profile was not deleted. Please try again\";\n });\n }", "function destroy(req, res) {\n db.User.findOneAndRemove({_id: req.params.id}, function(err, user) {\n console.log('sever error ', err)\n res.send(\"Successfully deleted!\")\n });\n}", "deleteUser(ctx, payload) {\n return new Promise((resolve, reject) => {\n axios\n .delete(`admin/user/${payload.id}?token=${payload.token}`)\n .then(response => {\n resolve(response);\n })\n .catch(error => {\n reject(error);\n });\n });\n }", "function deleteUser(uid, id) {\n return new Promise((resolve, reject) => {\n adminWebModel.deleteUser(id).then((result) => {\n if (result) {\n let token = jwt.sign({ uid: uid }, key.JWT_SECRET_KEY, {\n expiresIn: timer.TOKEN_EXPIRATION\n })\n \n resolve({ code: code.OK, message: '', data: { 'token': token } })\n }\n }).catch((err) => {\n if (err.message === message.INTERNAL_SERVER_ERROR)\n reject({ code: code.INTERNAL_SERVER_ERROR, message: err.message, data: {} })\n else\n reject({ code: code.BAD_REQUEST, message: err.message, data: {} })\n })\n })\n }", "function deleteUser(user) {\n console.log(user, 'deleted');\n}", "function deleteUser(user) {\n console.log(user, 'deleted');\n}", "function deleteUserById(userId) {\n\t\n\t// Check if the user ID exists.\n\tif (userId === undefined)\n\t\treturn Response(404);\n\n\t//Retrieve the index of the object from the User list\n\tvar userIdx = findUserIndexById(userId);\n\n\t// Check if the user index exists.\n\tif (userIdx === undefined)\n\t\treturn Response(404);\n\n\t// Remove the user from the array holder by index.\n\tusers.splice(userIdx, 1);\n\n\t// Remove any existing reminders for the user.\n\tdeleteRemindersByUserId(userId);\n\n\treturn Response(204);\n}", "function userDelete(req, cb){\n var email = req.body['email'] || req.user.email;\n log.info(\"user delete: \" + email + (email != req.user.email?\"(from: \"+req.user.email+\")\":\"\"));\n if(email != req.user.email && !req.user.isAdmin) return cb(errorsList['need-admin']);\n users.deleteAccount(email , cb);\n}", "function deleteUser(req, res) {\n\n var id = req.params.id;\n\n Usuario.findByIdAndRemove(id, (err, usuarioBorrado) => {\n\n if( err ) \n return res.status(500).json({\n ok: false,\n mensaje: 'Error al BORRAR usuario',\n errors: { message : err}\n });\n if( !usuarioBorrado ) \n return res.status(400).json({\n ok: false,\n mensaje: 'El Usuario no existe',\n errors: { message : 'No existe un usuario con ese id'}\n });\n\n usuarioBorrado.password = \";)\";\n return res.status(200).json({\n ok: true,\n usuario:usuarioBorrado\n });\n\n\n });\n}", "function deleteUser() {\n UserService\n .deleteUser(userId)\n .then(function (response) {\n var result= response.data;\n if(result){\n $location.url(\"/login\");\n }else{\n vm.error = \"can't delete you.\"\n }\n });\n }", "static async deleteUser(req, res, next) {\n try {\n const data = req.body;\n const ret = await this.database.deleteUser(data);\n res.send(ret);\n } catch (error) {\n next(error);\n }\n }", "destroy(req, res) {\n return this.kernel.model.Userg.removeById(req.params.id)\n .then(function() {\n res.status(204).end();\n })\n .catch(handleError(res));\n }", "function deleteUser(userId){\n var url = \"/api/user/\"+userId;\n return $http.delete(url);\n\n }", "async deleteUser(id){\n let res = await db.query('DELETE FROM users WHERE id = ?', [id]);\n\n return res;\n }", "function removeUserAccount(api, id) {\n return api_1.DELETE(api, `/users/${id}`)\n}", "function _delete(id) {\n\treturn fetchHelper.httpDelete('/users/${id}');\n}", "function deleteOneUser(req, res, next) {\n oneUserRemove(req, res).then((result) => {\n return res.status(200).json(result);\n }).catch((err) => {\n next(err);\n });\n}", "function eliminarPersona(user,res){\n tb_persona.connection.query(\"DELETE FROM persona WHERE id=\" + user.id);\n res.send();\n}", "deleteUser({ commit }, id) {\n commit(\"deleteUser\", id)\n }", "function deleteUserElement(req){\n deleteElement(dataTable_users,'#user_'+req.request.data);\n updateUserSelect();\n}", "function deleteUser(req, res) {\n if (req == null || req.params == null) {\n return utils.res(res, 400, 'Bad Request');\n }\n\n if (req.user_id == null) {\n return utils.res(res, 401, 'Invalid Token');\n }\n\n if (req.params.id == null) {\n return utils.res(res, 400, 'Please provide user_id of user to delete');\n }\n\n // Delete the user\n models.User.findOneAndDelete({\n 'user_id': req.params.id\n }, function (err, deletedUser) {\n if (err || deletedUser == null) {\n return utils.res(res, 401, 'Such user does not exist');\n }\n\n // Successfull Deletion\n return utils.res(res, 200, 'User account deleted successfully');\n });\n}", "async function deleteUser(req, res) {\n try {\n var id = req.body._id;\n await usersController.userDeleted(id);\n res.status(200).send('Se elimino el usuario correctamente');\n } catch (e) {\n res.status(500).send('No se encontro el usuario a eliminar ' + e);\n }\n}", "function deleteUser() {\n // TODO: needs to not logout user if catch is trigered\n axios.delete(`https://${serverEndpoint}/user/${user.user_id}`)\n .catch((error) => {\n // TODO: This code should be ofloaded to a helper function\n if (error.response) {\n // The request was made and the server responded with a status code\n // that falls out of the range of 2xx\n console.log(error.response.data);\n console.log(error.response.status);\n console.log(error.response.headers);\n } else if (error.request) {\n // The request was made but no response was received\n // `error.request` is an instance of XMLHttpRequest in the browser and an instance of\n // http.ClientRequest in node.js\n console.log(error.request);\n } else {\n // Something happened in setting up the request that triggered an Error\n console.log('Error', error.message);\n }\n console.log(error.config);\n });\n window.sessionStorage.clear();\n accountService.logout();\n }", "async function deleteUser () {\n // delete user if exists in the saved list. input will be sent to the request\n await handleSaveList(\"/githubSearch/delete\", \"delete\",\n document.getElementById(\"inputBox\").value.trim());\n }", "function deleteUser(req, res) {\n User.findByIdAndRemove(req.params.id)\n .then(user => {\n if(!user) {\n return res.status(404).send({\n message: \"user not found with id \" + req.params.id\n });\n }\n res.send({message: \"user deleted successfully!\"});\n }).catch(err => {\n if(err.kind === 'ObjectId' || err.name === 'NotFound') {\n return res.status(404).send({\n message: \"user not found with id \" + req.params.id\n });\n }\n return res.status(500).send({\n message: \"Could not delete user with id \" + req.params.id\n });\n });\n}", "function delete_user(api_url) {\n $.ajax({\n url: api_url,\n type: 'DELETE'\n }).done(function (data, textStatus, jqXHR){\n if (DEBUG) {\n console.log (\"RECEIVED RESPONSE: data:\",data,\"; textStatus:\",textStatus);\n }\n\n // Inform user that the user has been deleted\n alert_success(\"The user with has been deleted from the system.\");\n\n // Update the users list from the server\n getUsers();\n }).fail(function (jqXHR, textStatus, errorThrown){\n if (DEBUG) {\n console.log (\"RECEIVED ERROR: textStatus:\",textStatus, \";error:\",errorThrown);\n }\n\n // Inform the user that user has NOT been deleted\n alert_error(\"Error while trying to delete the user from the database.\");\n });\n}", "async delete({response, session, params}){\n const user = await User.find(params.id)\n\n await user.delete()\n\n session.flash({message: 'User has been removed!'})\n return response.redirect('back')\n }", "async function Delete(req, res) {\n await User.findByIdAndRemove(req.params.id);\n return res.status(200).send('User successfully deleted');\n}", "destroy(req, res) {\n\n return User\n .findById(req.params.id)\n .then(user => {\n\n if (!user) {\n return res.status(404).send({\n message: 'User Not Found',\n });\n }\n\n return user\n .destroy()\n .then(() => res.status(200).send({\n message: 'User deleted successfully',\n }))\n .catch(error => res.status(400).send(error));\n })\n .catch(error => res.status(404).send(error));\n }", "function deleteUser(){\n var idManagerUser = $(\"#delUser\").attr('data-u');\n var modal = $(this).parent().parent().parent()\n $.ajax({\n url: ip_server +\n \"/logged/deleteUser\",\n type: \"POST\",\n data:{\n 'bearer' : sessionStorage.token,\n 'idManagerUser' : idManagerUser\n },\n dataType: \"json\",\n success: function (response) {\n toast('Se ha eliminado el usuario correctamente', 'is-info')\n /* Vaciar inputs y cerrar modal */\n modal.removeClass('modal-active')\n var inputsAddModal = modal.find(\".input\")\n $.each(inputsAddModal, function(idx, el) {\n el.value = \"\"\n });\n getUsers()\n }\n });\n }", "function deleteUser(userId) {\n return User.findByIdAndRemove(userId);\n}", "function deleteUser(userId) {\n var url = \"/api/user/\" + userId;\n return $http.delete(url);\n }", "deleteUser(id){\n if(window.confirm('Sure?')){\n fetch(`http://localhost:8000/user/${id}`,{\n method: 'DELETE',\n headers: {\n 'Accept':'application/json',\n 'Content-Type':'application/json'\n }\n })\n .then(res=>res.json())\n .then(data=>{\n this.getUsers();\n this.getToDos();\n notify.show(data.message,data.type); \n })\n .catch(err=>{\n console.log(err)\n })\n }\n }", "function deleteUser(userId) {\n return fetch(`${self.url}/${userId}`, {method: 'DELETE'})\n .then(function (response) {\n return response.json()\n })\n }" ]
[ "0.798736", "0.75837684", "0.75565934", "0.7535612", "0.750912", "0.7506246", "0.74991506", "0.7435927", "0.7434023", "0.74170935", "0.73923606", "0.738169", "0.73793507", "0.73753256", "0.7358291", "0.73351187", "0.73185575", "0.73119456", "0.7309403", "0.7297454", "0.72881454", "0.7287927", "0.72695816", "0.7268855", "0.72376394", "0.72322506", "0.7227088", "0.72264075", "0.72258073", "0.721489", "0.720596", "0.7199889", "0.7199656", "0.7195863", "0.71850383", "0.71731216", "0.7171453", "0.71673906", "0.7162447", "0.71587807", "0.71566325", "0.7142639", "0.7136903", "0.7131813", "0.7123371", "0.7122424", "0.7118876", "0.71155894", "0.711197", "0.7110605", "0.7096771", "0.7096571", "0.7085644", "0.70849603", "0.70842445", "0.7077541", "0.7075249", "0.70649993", "0.70518863", "0.70500857", "0.70483273", "0.70475876", "0.7042809", "0.7041295", "0.70367694", "0.70199883", "0.7017553", "0.7010864", "0.7010132", "0.70082736", "0.6999148", "0.69946146", "0.69946146", "0.69938016", "0.69870293", "0.69833404", "0.69806707", "0.6974801", "0.6963172", "0.69516134", "0.693986", "0.693963", "0.69370824", "0.6936643", "0.69349426", "0.69344884", "0.6926619", "0.69235563", "0.6903591", "0.6887795", "0.6875942", "0.68740755", "0.68738467", "0.6869328", "0.6867264", "0.6864938", "0.68592066", "0.68581593", "0.6849541", "0.6844998", "0.6836845" ]
0.0
-1
Update d'un user (meme fonction pour Api et ApiAdmin)
UpdateUser(Data, res, User, UserId){ this.LogAppliInfo("Call Api"+ Data.UserType + " UpdateUser, Data: " + JSON.stringify(Data), User, UserId) // changement du password que si il est different de vide if (Data.Data[this._MongoVar.LoginPassItem] == ""){ delete Data.Data[this._MongoVar.LoginPassItem] delete Data.Data[this._MongoVar.LoginConfirmPassItem] } // Update de type Promise de Mongo this._Mongo.UpdateByIdPromise(Data.UsesrId, Data.Data, this._MongoVar.UserCollection).then((reponse)=>{ if (reponse.matchedCount==1) { res.json({Error: false, ErrorMsg: "User Updated in DB", Data: null}) } else { this.LogAppliError("User not found in DB", User, UserId) res.json({Error: true, ErrorMsg: "User not found in DB", Data: null}) } },(erreur)=>{ this.LogAppliError("UpdateUser DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function updateUser(user) {\n return {\n type: 'UPDATE_USER',\n user\n }\n}", "function updateUser(req, res) {\n var userId = req.params.id;\n var update = req.body;\n // borrar propiedad password\n delete update.password;\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.findByIdAndUpdate(userId, update, {new: true}, (err, userUpdated) => {\n if (err) return res.status(500).send({message: 'Error en la peticion.'});\n if (!userUpdated) return res.status(404).send({message: 'No se ha podido actualizar.'});\n return res.status(200).send({user: userUpdated});\n })\n}", "async updateUser(req,res){\n //función controladora con la lógica que actualiza un usuario\n }", "function updateUser() {\n try {\n selectedUser.username = $usernameFld.val();\n selectedUser.password = $passwordFld.val();\n selectedUser.firstName = $firstNameFld.val();\n selectedUser.lastName = $lastNameFld.val();\n selectedUser.role = $roleFld.val();\n userService.updateUser(selectedUserId, selectedUser)\n .then(function (userServerInfo) {\n users[editIndex] = selectedUser;\n renderUsers(users);\n resetInputFields();\n clearSelected();\n });\n }\n // In future could catch null error or could grey out checkmark icon.\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "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({\n message: 'No tiene permiso para actualizar los datos'\n });\n }\n // new : true indica que el metodo solo me devolvera el metodo actualizado.\n User.findByIdAndUpdate(userId, update, { new: true }, (err, userUpdated) => {\n if (err) {\n return res.status(500).send({\n message: 'Error en la peticion'\n });\n }\n if (!userUpdated) {\n return res.status(404).send({\n message: 'No se ha podido actualizar el usuario'\n });\n }\n return res.status(200).send({ user: userUpdated });\n });\n}", "function updateUser() {\n if (model.addAdmin) {\n model.user.roles.push(\"ADMIN\");\n }\n if (model.addMember) {\n model.user.roles.push(\"MEMBER\");\n }\n userService\n .updateUser(model.userId, model.user)\n .then(function() {\n model.message = \"User updated successfully.\";\n });\n }", "async function userUpdate(req, res, next) {\n const userId = req.params.id\n try {\n const userToUpdate = await User.findById(userId)\n if (!userToUpdate) throw new Error(notFound)\n\n\n if (!userToUpdate.equals(req.currentUser._id)) throw new Error(unauthorized)\n\n Object.assign(userToUpdate, req.body)\n await userToUpdate.save()\n\n res.status(202).json(userToUpdate)\n } catch (err) {\n next(err)\n }\n}", "updateUser (context, user) {\n context.commit('updateUser', user)\n }", "async updateUser(parent, {\n updateUserInput: {\n id,\n name,\n email,\n password\n }\n }, context, info) {\n try {\n const updateUser = await context.prisma.user.update({\n where: {\n id\n },\n data: {\n name,\n email,\n password\n }\n });\n return \"user update sucessfully\";\n } catch (error) {\n return error;\n }\n }", "function edit(req, res) {\n\tvar user_id = req.params.id;\n\tvar update = req.body;\n\n\t// do not update password in this method\n\tdelete update.password;\n\n\tif (user_id != req.user.sub) return res.status(500).send({ message: 'No tienes permiso para actualizar este usuario' });\n\n\tUser.findByIdAndUpdate(user_id, update, {new: true}, (err, data) => {\n\t\tif (err) return res.status(500).send({ message: 'Error en la peticion', error: err });\n\t\tif (!data) return res.status(404).send({ message: 'No se ha podido actualizar el usuario' });\n\t\treturn res.status(200).send({ user: data });\n\t});\n}", "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 if (userId != req.user.sub) {\n return res.status(200).send({ message: 'No tienes permiso para actualizar los datos del usuario' });\n }\n User.find({ email: update.email.toLowerCase() }\n ).exec((err, users) => {\n\n var user_isset = false;\n users.forEach((user) => {\n if (user && user._id != userId) user_isset = true;\n });\n\n if (user_isset) res.status(500).send({ message: 'Los datos ya estan en uso' });\n\n User.findByIdAndUpdate(userId, update, { new: true }, (err, userUpdated) => {\n if (err) return res.status(500).send({ message: 'Error en la 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({\n user: userUpdated\n });\n });\n\n });\n}", "function updateUser2(req, res){\r\n var userId=req.params.id;\r\n var update=req.body;\r\n delete update.password;\r\n User.findByIdAndUpdate(userId, update, {new:true}, (err, userUpdate) => {\r\n if(err){\r\n res.status(500).send({message:'Error al realizar los cambios'});\r\n }else{\r\n if(!userUpdate){\r\n res.status(404).send({message:'No se ha logrado realizar los cambios solicitados'});\r\n }else{\r\n res.status(200).send({user:userUpdate});\r\n }\r\n }\r\n }); \r\n}", "function api_updateuser(ctx, newuser) {\n newuser.a = 'up';\n res = api_req(newuser, ctx);\n}", "function updateUser(req, res){\r\n var userId=req.params.id;\r\n var update=req.body;\r\n delete update.password;\r\n console.log(update);\r\n\r\n if(userId != req.user.sub){\r\n return res.status(500).send({message:'No tienes permisos'});\r\n }\r\n console.log(update);\r\n User.findByIdAndUpdate(userId, update, {new:true}, (err, userUpdate) => {\r\n if(err){\r\n res.status(500).send({message:'Error al realizar los cambios'});\r\n }else{\r\n if(!userUpdate){\r\n res.status(404).send({message:'No se ha logrado realizar los cambios solicitados'});\r\n }else{\r\n res.status(200).send({user:userUpdate});\r\n }\r\n }\r\n }); \r\n}", "function updateUser(req, res) {\n User.findByIdAndUpdate(req.params.id, req.body.user, function(err, user) {\n if (err || !user) {\n console.log(err);\n req.flash(\"error\", \"Sorry, could not update this user\");\n res.redirect(\"back\");\n } else {\n //Make Admin from edit user form if admin code correct \n if (req.body.user.admin === \"admin123\") {\n user.isAdmin = true;\n user.save();\n }\n req.flash(\"success\", \"User successfully updated\");\n res.redirect(\"/users/\" + req.params.id);\n }\n });\n}", "function updateUser(req,res){\n\tvar userId = req.params.id;\n\n\tvar update = req.body;\n//borrar propiedad password\n\tdelete update.password ;\n\n\tif(userId != req.user.sub){\n\t\treturn res.status(500).send({message: 'no tienes permiso para actualizar este usuario'});\n\t}\n\n\tUser.find({ $or:[\n\t\t\t\t{email: update.email.toLowerCase()},\n\t\t\t\t{nick: update.nick.toLowerCase()}\n\t\t\t\t]}).exec((err,users)=>{\n\t\t\t\t\tvar user_isset = false;\n\t\t\t\t\tusers.forEach((user)=>{\n\t\t\t\t\t\tif(user && user._id != userId) user_isset = true;\n\t\t\t\t\t});\n\t\t\t\t\tif(user_isset) return res.status(200).send({message: 'los datos ya estan en uso'});\n\t\t\t\t\t\n\t\t\t\t\tUser.findByIdAndUpdate(userId,update,{new: true},(err,userUpdated)=>{\n\t\t\t\t\t\tif(err) return res.status(500).send({message: 'Error en la peticion'});\n\n\t\t\t\t\t\tif(!userUpdated) return res.status(404).send({message: 'no se ha podido actualizar el usuario'});\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn res.status(200).send({user: userUpdated});\n\t\t\t\t\t});\n\t\t\t\t});\n\n\t\n}", "function updateUser() {\n var username = $('#usernameFld').val();\n var password = $('#passwordFld').val();\n var firstName = $('#firstNameFld').val();\n var lastName = $('#lastNameFld').val();\n var role = $('#roleFld').val();\n var user = new User(username,password,firstName,lastName,role,null,null,null);\n userService\n .updateUser(currentUserID,user)\n .then(findAllUsers)\n .then(emptyUserForm);\n\n }", "function updateUserInfo(id, user) {\n}", "async update({ request, params, response }) {\n /*** get the user update inputs */\n let { status } = request.only([\"status\"]);\n\n /** get the target user */\n try {\n const user = await User.query().where(\"id\", params.id).first();\n if (!user) {\n return response.status(404).send({\n message: \"not found\",\n });\n }\n\n /** update the user details */\n\n user.active = status;\n await user.save();\n return response.status(200).send({\n message: \"info updated\",\n });\n } catch (error) {\n return response.status(404).send({\n message: \"fail\",\n error: error,\n });\n }\n }", "update(req, res) {\n let user = new User();\n user.id = req.body.id;\n user.username = req.body.username;\n user.password = req.body.password;\n user.rolename = req.body.rolename;\n user.restaurant_id = req.body.restaurant_id;\n\n return this.userdao.update(user)\n .then(this.common.editSuccess(res))\n .catch(this.common.serverError(res));\n }", "function updateUser(req, res) {\n var userId = req.params.id;\n var update = req.body;\n\n User.findByIdAndUpdate(userId, update, (err, updateUser) => {\n if (err) {\n res.status(500).send(\"Error al actualizar el usuario\");\n } else {\n if (!updateUser) {\n res.status(404).send(\"No se ha podido actualizar el usuario\");\n } else {\n res.status(200).send(updateUser);\n }\n }\n });\n}", "function updateUser(req, res, next) {\n const sql = sqlString.format(`UPDATE users SET ? WHERE id = ?`, [\n req.body,\n req.params.id\n ])\n\n db.execute(sql, (err, result) => {\n if (err) return next(err)\n if (!result.affectedRows) return next({ message: 'User not find' })\n res.send('User updated')\n })\n}", "updateUser (callback) {\n\t\tthis.doApiRequest(\n\t\t\t{\n\t\t\t\tmethod: 'put',\n\t\t\t\tpath: '/users/me',\n\t\t\t\tdata: this.data,\n\t\t\t\ttoken: this.token\n\t\t\t},\n\t\t\t(error, response) => {\n\t\t\t\tif (error) { return callback(error); }\n\t\t\t\tObject.assign(this.expectedUser, response.user.$set, this.data, {\n\t\t\t\t\tlastReads: {},\n\t\t\t\t\tpreferences: {\n\t\t\t\t\t\tacceptedTOS: true\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tdelete this.data;\t// don't need this anymore\n\t\t\t\tcallback();\n\t\t\t}\n\t\t);\n\t}", "function updateUser(req,res){\n var userId = req.params.id;\n var update = req.body;\n \n //BORRAR LA 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 && user._id != userId) user_isset = true;\n });\n \n if(user_isset) return res.status(404).send({message: 'Dato en uso.'});\n\n User.findByIdAndUpdate(userId,update,{new:true},(err,userUpdated)=>{\n if(err) return res.status(500).send({message: 'Error en la peticion.'});\n if(!userUpdated) return res.status(404).send({message: 'No se ha podido actualizar el usuario'});\n return res.status(200).send({user: userUpdated});\n });\n });\n}", "update(req, res, next, user) {\n if (currentUser && (req.params.id == currentUser._id || currentUser.isAdmin)) {\n User.update({\n _id: req.params.id\n }, req.body, (err, status) => {\n if (err) {\n next(err);\n } else {\n res.sendStatus(200);\n }\n });\n } else {\n res.status(\"401\").send(\"Not authorized, your are not admin!\");\n }\n }", "async updateUser(user) {\n try {\n const result = await this.axiosInstance.patch(\n `/users/${user.username}`,\n user.requestBody\n );\n return result;\n } catch (err) {\n helpMeInstructor(err);\n return err;\n }\n }", "function updateUser(req, res){\n //**nota en postam: poner put(porque actualizamos)\n //**en el headers añadir authorization: valor token de (solo) este usuario,\n //así hay que logearse con el para obtenerlo (el token)\n //y los campos a modificar\n\n//*metodo mejorado para comprobar si el usuario esta duplicado o no, como el nick unico\n\n\n\tvar userId = req.params.id;\n\tvar update = req.body;\n\n\t//eliminar campo password por seguridad\n\tdelete update.password;\n\n\t//** nota: req.user esta almacenado todas las propiedades del usuario (viene del middleware de autentificacion)\n\t// osea el objeto del token\n\tif(userId != req.user.sub){\n\t\treturn res.status(500).send({message: 'No tienes permiso para actualizar los datos del usuario'});\n\t}\n\n\t\tUser.find({ $or: [\n\t\t\t\t\t\t{email: update.email.toLowerCase()},\n\t\t\t\t\t\t{nick: update.nick.toLowerCase()}\n\n\t\t\t\t\t\t]}).exec((err, users)=>{\n\t\t\t\t\t\t\tconsole.log(users);\n\t\t\t\t\t\t\tvar user_isset = false;\n\t\t\t\t\t\t\tusers.forEach((user) =>{\n\t\t\t\t\tif(user && user._id != userId) user_isset = true;\n\n\t\t\t\t\t\t});\n\n\t\tif(user_isset) return res.status(404).send({message: 'Los datos ya están en uso'});\n\t\t\n\t\tUser.findByIdAndUpdate(userId, update, { new: true}, (err, userUpdated) => {\n\t\t\tif(err) return res.status(500).send({message: 'Error en la peticion'});\n\n\t\t\tif(!userUpdated) return res.status(404).send({message: 'No se ha podido actualizar el usuario'});\n\n\t\t\t\treturn res.status(200).send({user: userUpdated});\n\t });\n\n\n\t\t\t\t\t\n\t\t\n\t\t\t\t\t\t\n\n\t\n\n\t\t\t\t\t\t});\n\n\t\t\t\t//**al incluir new true, nos devolverá el objeto actualizado\n\t\t\t\t//sino nos devolveria el antiguo sin el { new: true},\n\n\n\t\n}", "updateUser(id, body) {\n return this.patch(`${this.baseUrl}/users/${id}`, body);\n }", "static async updateUser({ username, password, first_name, last_name, email }) {\n try {\n const res = await this.request(`users/${username}`, { password, first_name, last_name, email }, 'patch')\n return res;\n } catch (err) {\n return { errors: err };\n }\n }", "update(id, user) {\n return 1;\n }", "function updateUser(userId, user) {\n return fetch(`https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users/${userId}`, {\n method: 'PUT',\n body: JSON.stringify(user),\n headers: {\n 'content-type': 'application/json'\n }\n })\n }", "updateUser(userId, data) {\n return this.userStore.updateUser(userId, data)\n }", "function updateUser(user) {\n UserService.updateUser(model.userId, user)\n .then(function (response) {\n // var updatedUser = response.data;\n // $rootScope.currentUser = updatedUser;\n // console.log(updatedUser);\n model.successMessage = \"Profile Updated Successfully!\";\n }, function (rejection) {\n model.errorMessage = \"Sorry an error was encountered and your profile was not updated. Please try again\";\n });\n }", "function update(username,password,firstName, lastName, emailId){\n var userLoggedIn=$rootScope.currentUser;\n var LoggedInUserId=userLoggedIn._id;\n console.log(\"User Logged in ID: \");\n console.log(userLoggedIn);\n\n var user={\n \"username\":username,\n \"password\":password,\n \"firstName\":firstName,\n \"lastName\":lastName,\n \"emailId\":emailId\n };\n\n\n UserService.updateUser(LoggedInUserId,user, function (response) {\n\n\n UserService.setCurrentUser(response);\n console.log(\"Response From Service: Updated the User\");\n console.log(response);\n\n });\n\n }", "async function userUpdate(req, res) {\n try {\n const user = await User.findByIdAndUpdate(req.currentUser, req.body, {\n new: true,\n runValidators: true,\n });\n if (user.id !== req.params.id) {\n return res.status(401).json({ message: \"Unauthorised\" });\n }\n res.status(202).json({message: 'Your profile has been updated', user})\n } catch (err) {\n res.status(400).json(err.message);\n }\n}", "function updateUser(){\n // use save instead of update to trigger 'save' event for password hashing\n\t\nconsole.log('REQUEST IS ', req.body)\n\tif (!user.termsAccepted_v1) user.termsAccepted_v1 = false;\n user.set(req.body);\n user.save(function(err, user){\n \n // Uniqueness and Save Validations\n \n if (err && err.code == 11001){\n var duplicatedAttribute = err.err.split(\"$\")[1].split(\"_\")[0];\n req.flash('error', \"That \" + duplicatedAttribute + \" is already in use.\");\n return res.redirect('/account');\n }\n if(err) return next(err);\n \n // User updated successfully, redirecting\n \n req.flash('success', \"Account updated successfully.\");\n return res.redirect('/account');\n });\n }", "function updateUser(req,res){\n const userId = req.params.id;\n const 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 ]\n }).exec((err, users) => {\n if(users && users.length > 1) return res.status(404).send({message:'Los datos ya estan en uso'});\n if(err) return res.status(500).send({message:'Ha ocurrido un error en la peticion'});\n\n User.findByIdAndUpdate(userId, update,{new:true}, (err, userUpdate) =>{\n if(err) return res.status(500).send({message:\"Error en la peticion\"});\n \n if(!userUpdate) return res.status(500).send({message:\"No se ha podido actualizar el usuario\"});\n \n return res.status(200).send({user:userUpdate});\n });\n });\n\n\n\n}", "async update (user) {\n let res = await Http.put('/api/users', { user })\n this.currentUser = new User(res.data.user)\n return this.currentUser\n }", "async updateUser(req, res, next) {\n const { userId } = req.params;\n const { body } = req;\n try {\n await UsersService.updateUser(userId, { ...body });\n res.json({ success: true });\n } catch (error) {\n next(extendError(error, { task: 'Controller/updateUser', context: { body } }));\n }\n }", "function updateUser(id, user) {\n return fetch(`${self.url}/${id}`, {\n method: 'PUT',\n body: JSON.stringify(user),\n headers: {\n \"content-type\": \"application/json\"\n }\n }).then(response => response.json())\n }", "function updateUser(req, res) {\n User.findByIdAndUpdate(req.params.id, req.body, { new: true }, function (err, user) {\n if (err) return res.status(500).send(\"There was a problem updating the user.\");\n res.status(200).send(user);\n });\n}", "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 }", "function update(req, res) {\n\tUser.findById(req.params.user_id, function(err, user) {\n\t\tif (err) return res.send(err);\n\n\t\tif (req.body.name) user.name = req.body.name;\n\t\tif (req.body.password) user.password = req.body.password;\n\n\t\tuser.blocked\t= req.body.blocked;\n\t\tuser.image \t\t= req.body.image;\n\n\t\tuser.save(function(err, user) {\n\t\t\tif (err) return res.send(err);\n\n\t\t\tres.json({ message : \"User Updated\" });\n\t\t})\n\t})\n}", "async doUserUpdate () {\n\t\tconst now = Date.now();\n\t\tconst op = {\n\t\t\t$set: {\n\t\t\t\tisRegistered: true,\n\t\t\t\tmodifiedAt: now,\n\t\t\t\tregisteredAt: now,\n\t\t\t\t\"preferences.acceptedTOS\": true\n\t\t\t}, \n\t\t\t$unset: {\n\t\t\t\tconfirmationCode: true,\n\t\t\t\tconfirmationAttempts: true,\n\t\t\t\tconfirmationCodeExpiresAt: true,\n\t\t\t\t'accessTokens.conf': true,\n\t\t\t\tinviteCode: true,\n\t\t\t\tneedsAutoReinvites: true,\n\t\t\t\tautoReinviteInfo: true\n\t\t\t}\n\t\t};\n\n\t\tif (this.passwordHash) {\n\t\t\top.$set.passwordHash = this.passwordHash;\n\t\t}\n\n\t\t['email', 'username', 'fullName', 'timeZone'].forEach(attribute => {\n\t\t\tif (this.data[attribute]) {\n\t\t\t\top.$set[attribute] = this.data[attribute];\n\t\t\t}\n\t\t});\n\t\tif (this.data.email) {\n\t\t\top.$set.searchableEmail = this.data.email.toLowerCase();\n\t\t}\n\n\t\tif ((this.user.get('teamIds') || []).length > 0) {\n\t\t\tif (!this.user.get('joinMethod')) {\n\t\t\t\top.$set.joinMethod = 'Added to Team';\t// for tracking\n\t\t\t}\n\t\t\tif (!this.user.get('primaryReferral')) {\n\t\t\t\top.$set.primaryReferral = 'internal';\n\t\t\t}\n\t\t\tif (\n\t\t\t\t!this.user.get('originTeamId') &&\n\t\t\t\tthis.teamCreator && \n\t\t\t\tthis.teamCreator.get('originTeamId')\n\t\t\t) {\n\t\t\t\top.$set.originTeamId = this.teamCreator.get('originTeamId');\n\t\t\t}\n\t\t}\n\n\t\tthis.request.transforms.userUpdate = await new ModelSaver({\n\t\t\trequest: this.request,\n\t\t\tcollection: this.request.data.users,\n\t\t\tid: this.user.id\n\t\t}).save(op);\n\t}", "updateUser(userId, partialUser) {\n const url = this.route\n\t\tconst config = {\n\t\t\tmethod: 'PUT',\n\t\t\tquery:{\n\t\t\t\tuserId\n\t\t\t},\n\t\t\tdata:{\n\t\t\t\t...partialUser\n\t\t\t}\n\t\t}\n\t\treturn request(url, config)\n\t}", "function updateUser(req, res) {\n var userId = req.params.id;\n var update = req.body;\n\n delete update.password;\n\n if (userId != req.user.sub) return res.status(500).send({message: \"No tienes permiso para hacer esta acción.\"});\n\n\tfunction toLowerCase(nick) {\n\t\treturn nick.toLowerCase();\n\t}\n\n\tUser.find({\n\t\t$or: [\n\t\t\t{email: update.email.toLowerCase()},\n\t\t\t{nick: {'$regex': `^${update.nick}$`}}\n\t\t]\n }).exec((err, users) => {\n \tvar user_isset = false;\n \tusers.forEach((user) => {\n \t\t//console.log({user: user, currentId: userId});\n \t\t//console.log({user_id: user._id.toString(), current_id: userId, comparison: user._id.toString() === userId});\n\t\t\tif ( user && user._id.toString() !== userId){\n\t\t\t\tuser_isset = true;\n\t\t\t}\n\t\t});\n \tif(user_isset) return res.status(500).send({message: \"Email o nick ya existentes.\"});\n\t\tUser.findByIdAndUpdate(userId, update, {new: true}, (err, updatedUser) => {\n\t\t\tif (err) return res.status(500).send({\n\t\t\t\tmessage: \"Error en la petición.\"\n\t\t\t});\n\t\t\tif (!updatedUser)\n\t\t\t\treturn res.status(404).send({\n\t\t\t\t\tmessage: \"No se ha podido actualizar el usuario\"\n\t\t\t\t});\n\t\t\tupdatedUser.password = undefined;\n\t\t\treturn res.status(200).send({updatedUser});\n\t\t});\n\t});\n\n\n}", "async update(id, user, type) {\n\t\tconst dto = await this.entityDto.domain()\n\t\tuser.id = id\n\t\tuser = morphism(dto, user)\n\t\tif (type == 'password') {\n\t\t\tconst salt = await bcrypt.genSalt(10)\n\t\t\tuser.password = await bcrypt.hash(user.password, salt)\n\t\t\treturn this.usersRepository.updatePassword(id, user)\n\t\t}\n\t\treturn this.usersRepository.updateUsername(id, user)\n\t}", "function update(req, res) {\n // find one user by id, update it based on request body,\n // and send it back as JSON\n\n db.User.findById(req.params.id, function(err, foundUser) {\n if (err) { console.log('userController.update error', err); }\n foundUser.username = req.body.username;\n foundUser.password = req.body.password;\n foundUser.location = req.body.location;\n foundUser.contact = req.body.contact;\n foundUser.picture = req.body.picture;\n foundUser.posts = req.body.posts;\n foundUser.save(function(err, savedUser) {\n console.log(savedUser)\n if (err) { console.log('saving altered user failed'); }\n res.json(savedUser);\n });\n });\n}", "async updateUser(_, { id, firstName, lastName, email, password }, { authUser }) {\n // Make sure user is logged in\n if (!authUser) {\n throw new Error('You must log in to continue!')\n }\n // fetch the user by it ID\n // Update the user\n await user.update({\n firstName,\n lastName,\n email,\n password: await bcrypt.hash(password, 10)\n });\n return user;\n }", "function updateUser(req, res) {\n var userId = req.params.userId;\n var user = req.body;\n userModel.updateUser(userId, user)\n .then(function() {\n return res.sendStatus(204);\n }).catch(function(error) {\n console.error('Error updating user' + error);\n return res.sendStatus(500);\n });\n}", "update(req, res) {\n\n return User\n .findById(req.params.id, {})\n .then(user => {\n\n if (!user) {\n\n return res.status(404).send({\n message: 'User Not Found',\n });\n }\n\n return user\n .update({\n id: req.body.id || user.id,\n confirmed: user.confirmed,\n first_name: req.body.first_name || user.first_name,\n last_name: req.body.last_name || user.last_name,\n organizer_alias: req.body.organizer_alias || user.organizer_alias,\n age: req.body.age || user.age,\n gender: req.body.gender || user.gender,\n password: user.password,\n profile_pic: null,\n phone_number: req.phone_number || user.phone_number\n })\n .then(() => res.status(200).send(user)) // Send back the updated user\n .catch((error) => res.status(400).send(error));\n })\n .catch((error) => res.status(400).send(error));\n }", "function updateUser(req, res){\n\n var id = req.params.id;\n var body = req.body;\n\n Usuario.findById(id , (err, usuario) => {\n\n if( err ) \n return res.status(500).json({\n ok: false,\n mensaje: 'Error al buscar usuario',\n errors: err\n });\n \n if( !usuario ) \n return res.status(400).json({\n ok: false,\n mensaje: 'El usuario con el id: '+ id+' no exite',\n errors: { message : 'No existe un usuario con ese id'}\n });\n\n usuario.nombre = body.nombre;\n usuario.email = body.email;\n\n usuario.save( (err, usuarioActualzado) => {\n \n if( err ) \n return res.status(301).json({\n ok: false,\n mensaje: 'Error al actualizar usuario',\n errors: { message : err}\n });\n\n usuarioActualzado.password = \";)\";\n return res.status(200).json({\n ok: true,\n usuario:usuarioActualzado\n });\n\n\n });\n\n\n \n });\n\n\n}", "function userEdit(req, res, next) {\n User\n .findById(req.params.id)\n .then((user) => {\n if (!user) return res.notFound();\n user = Object.assign(user,req.body);\n return user.save();\n })\n .then(user => res.json(user))\n .catch(next);\n}", "function updateUser(req, res) {\n var userId = req.params.id;\n var update = req.body;\n\n if (update.password) {\n //ecnriptar pasword\n bcrypt.hash(update.password, null, null, function (err, hash) {\n var user = hash;\n update.password = user;\n\n\n Cliente.findByIdAndUpdate(userId, update, (err, userUpdated) => {\n if (err) {\n res.status(500).send({\n message: 'Error al actualizar usuario'\n });\n } else {\n if (!userUpdated) {\n res.status(404).send({\n message: 'No se pudo actualizar usuario'\n });\n\n } else {\n res.status(200).send({\n user: userUpdated\n });\n\n }\n }\n });\n });\n\n } else {\n Cliente.findByIdAndUpdate(userId, update, (err, userUpdated) => {\n if (err) {\n res.status(500).send({\n message: 'Error al actualizar usuario'\n });\n } else {\n if (!userUpdated) {\n res.status(404).send({\n message: 'No se pudo actualizar usuario'\n });\n\n } else {\n res.status(200).send({\n user: userUpdated\n });\n\n }\n }\n });\n }\n\n}", "function updateUserController(request, response) {\n const userId = request.params.userId;\n const newValues = request.body;\n\n model.updateById(userId, newValues)\n\n response.status(httpStatus.NO_CONTENT).send();\n}", "function updateUser (req, res, next) {\n db.none(`UPDATE \"user\" SET user_name = $1, email = $2, profile_pic = $3, password = $4 WHERE user_id = $5`, [req.body.user_name, req.body.email, req.body.profile_pic, req.body.password, req.params.user_id])\n .then(next())\n .catch(err => next(err));\n}", "function updateUser(req, res) {\n if (req.query.id) {\n User.findById({_id: req.query.id}, (err, user) => {\n if (err) {\n res.json(err);\n } else {\n if(user) {\n Object.assign(user, req.body).save((err, user) => {\n if (err) {\n res.json(err);\n } else {\n res.json(makeJsonResponse(user));\n }\n });\n } else {\n res.json({\"error\": \"User not found\"});\n }\n }\n });\n } else {\n res.json({\"error\": \"Update should specify an id\"});\n }\n}", "function updateUser(request, response) {\n\n\tfunction respondUpdated(response, user) {\n\t\tresponse.json({\n\t\t\tmessage: 'Usuario actualizado con exito',\n\t\t\tuser\n\t\t})\n\t}\n\n\tfunction respondError(response, error) {\n\t\tresponse.send(error)\n\t}\n\n\tfunction respondOk(response, user) {\n\t\tObject\n\t\t\t.assign(user, request.body)\n\t\t\t.save()\n\t\t\t.then(user => respondUpdated(response, user))\n\t\t\t.catch(error => respondError(response, error))\n\t}\n\n\tUser.findById({\n\t\t\t_id: request.params.userId\n\t\t})\n\t\t.then(user => respondOk(response, user))\n\t\t.catch(error => respondError(response, error))\n}", "updateUser(h, p){\n\t\tlet oldInfo = this.props.user;\n\t\tlet updatedInfo = { happiness: oldInfo.happiness + h,\n\t\t pollution: oldInfo.pollution + p};\n\t\tlet userUrl = `/api${this.props.match.url}`;\n\t\tthis.props.actions.updateUser(userUrl, updatedInfo);\n\t}", "updateUser(h, p){\n\t\tlet oldInfo = this.props.user;\n\t\tlet updatedInfo = { happiness: oldInfo.happiness + h,\n\t\t pollution: oldInfo.pollution + p};\n\t\tlet userUrl = `/api${this.props.match.url}`;\n\n\t\tthis.props.actions.updateUser(userUrl, updatedInfo);\n\t}", "static updateUser(req, res) {\n try {\n const userId = parseInt(req.params.userId, 10);\n //const email = req.query.email || '';\n const userFound = UserHelper.findUserById(userId);// || UserHelper.findUserByEmail(email);\n if (!userFound) {\n return res.status(404).json({\n status: 404,\n success: 'false',\n error: 'User not found',\n });\n }\n\n for (const [key, value] of Object.entries(req.body)) {\n userFound[key] = value;\n }\n return res.status(200).json({\n status: 200,\n success: 'true',\n message: 'User updated successfully',\n data: userFound.getUserData() || userFound,\n });\n } catch (error) {\n // return res.status(500).json({\n // status: 500,\n // success: 'false',\n // error: 'Something went wrong',\n // });\n }\n }", "function updateUser(newUser) {\n\t\t\tUserService\n\t\t\t\t.updateUser(vm.userId, newUser)\n\t\t\t\t.then(\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvm.updateSuccess = \"Success! \";\n\t\t\t\t\t},\n\t\t\t\t\tfunction(){\n\t\t\t\t\t\tvm.updateError = \"Error! \";\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t}", "update(req, res, next) {\n if (!req.body) {\n return res.status(400).send({\n message: \"l' utilisateur à mettre à jpour ne peut etre vide!\"\n });\n }\n \n const id = req.params.id;\n \n User.findByIdAndUpdate(id, req.body, { useFindAndModify: false })//chercher un produit \n .then(data => {\n if (!data) {\n res.status(404).send({\n message: `Ne peut mettre à jour avec l'id=${id}. peut etre l' utilisateur ne peut etre trouvé!`\n });\n } else res.send({ message: \"Mise à jour de l' utilisateur a réussi.\" });\n })\n .catch(err => {\n res.status(500).send({\n message: \"Error updating user with id=\" + id\n });\n });\n }", "async updateUser(req, res, next) {\n try {\n const userId = req.param('id');\n const username = req.body.username;\n const email = req.body.email;\n const usuarioRegMail = await Usuario.findOne({ email: email });\n const usuarioRegUsername = await Usuario.findOne({ username: username});\n if (usuarioRegUsername) {\n if(typeof usuarioRegUsername._id !== userId) {\n res.json({success: false, error: 'El username ya esta en uso'});\n return;\n }\n }\n if (usuarioRegMail) {\n if(usuarioRegMail._id != userId) {\n res.json({success: false, error: 'El email ya esta en uso'});\n return;\n }\n }\n const usuario = await Usuario.findOneAndUpdate({_id: userId}, {username: username, email: email});\n res.json({success: true, result: usuario});\n }catch (e) {\n console.log('ERROR: ', e);\n next(e);\n }\n }", "function updateTUser(name, id) {\n return promessQuery('UPDATE user SET user_name= \"' + name + '\" WHERE user_id= ' + id,\n callBackSucesso, callBackErro);\n }", "function updateUser(userId, user){\n var url=\"/api/user/\"+userId;\n return $http.put(url, user);\n }", "update(req, res) {\n User.findOne({ where: { id: req.params.id } })\n .then((user) => {\n if (user) {\n if (req.params.id !== req.decoded.id.toString()) {\n res.status(403).send({ message: 'That action is not allowed. You can only edit your own password.' });\n } else if (!req.body.password || req.body.password === '') {\n res.send({ message: 'Please enter your new password!' });\n } else {\n user.updateAttributes({\n username: req.body.username || user.username,\n email: req.body.email || user.email,\n password: passwordHash.generate(req.body.password) || user.passsword,\n }).then(() => {\n res.status(200).send({ message: 'Your profile has been updated!' });\n });\n }\n } else {\n res.status(404).send({ message: 'User doesn\\'t exist!' });\n }\n });\n }", "async editUser({ rootGetters}, user){\n // set token additional header\n let tokenHeaders = {\n headers: { 'Authorization': \"Bearer \" + rootGetters.getToken }\n }\n // get data user from API Server\n return await this.$axios.$put('/user/' + user.id, user, tokenHeaders)\n }", "function updateUser(ev) {\n\t\t// TODO: add admin functionality and functions in authServise or adminServise\n\t\tev.preventDefault();\n\t\tlet updateUserForm = $('#updateUserForm');\n\t\tlet usernameInput = updateUserForm.find('input[name=\"usernameNew\"]');\n\t\tlet passInput = updateUserForm.find('input[name=\"passwordNew\"]');\n\t\tlet repeatPassInput = updateUserForm.find('input[name=\"repeatPassNew\"]');\n\t\tlet usernameVal = usernameInput.val();\n\t\tlet passVal = passInput.val();\n\t\tlet repeatPassVal = repeatPassInput.val();\n\t\tlet allIsValid = validateRegisterFields(usernameVal, passVal, repeatPassVal);\n\t\tif (allIsValid) {\n\t\t\tlet userData = {\n\t\t\t\tusername: usernameVal,\n\t\t\t\tpassword: passVal\n\t\t\t};\n\t\t\tauth.update(userData)\n\t\t\t\t.then((userInfo) => {\n\t\t\t\t\tusernameInput.val('');\n\t\t\t\t\tpassInput.val('');\n\t\t\t\t\trepeatPassInput.val('');\n\t\t\t\t});\n\t\t}\n\t}", "async update({ request, response, auth }) {\n try {\n const id = request.params.id\n const data = await User.find(id)\n if (!data) {\n return response.status(400).send(ResponseParser.apiNotFound())\n }\n const { username, client, role_id, is_active } = request.post()\n data.merge({\n username,\n client,\n is_active\n })\n await data.save()\n await this.attachRoles(data, [role_id])\n await data.load(\"roles\")\n const activity = `Update user '${data.client}'`\n await ActivityTraits.saveActivity(request, auth, activity)\n let parsed = ResponseParser.apiUpdated(data.toJSON())\n return response.status(200).send(parsed)\n } catch (e) {\n const error = ErrorLog(request, e)\n return response.status(error.status).send({ meta: error.meta })\n }\n }", "function updateUser(req, res, next) {\r\n\tdb.none('update users set first_name=$1, last_name=$2, email=$3 where id=$5',\r\n\t [req.body.name, req.body.breed, parseInt(req.body.age),\r\n\t req.body.sex, parseInt(req.params.id)])\r\n\t.then(function () {\r\n\t\tres.status(200)\r\n\t\t.json({\r\n\t\t\tstatus: 'success',\r\n\t\t\tmessage: 'Updated your user'\r\n\t\t});\r\n\t})\r\n\t.catch(function (err) {\r\n\t\treturn next(err);\r\n\t});\r\n}", "function updateUserProfile(req, res) {\n if(req.body.userID === undefined){\n return res.send(\"Error: no user specified\");\n }\n User.findById(req.body.userID, function (err, user) {\n if (err) throw err;\n if(user === null) {\n return res.send(\"Error: No such User exists\");\n }\n\n user.name = req.body.name;\n user.email = req.body.email;\n user.phone = req.body.phone;\n user.address = req.body.address;\n user.password = req.body.password;\n \n user.save(function(err) {\n if (err) throw err;\n return res.send('Success');\n });\n \n });\n \n}", "function updateUser(req, res, next) {\n var user = new User();\n\n user.name = req.body.name;\n user.email = req.body.email;\n user.lastAccess = new Date();\n var password = req.body.password;\n\n user.setPassword(password);\n if(req.body.name && req.body.email && req.body.password && req.body.oldEmail){\n // Updates all data of specified user\n User.update({email: req.body.oldEmail}, {$set: {email: user.email, name: user.name, hash: user.hash,\n salt: user.salt, lastAccess: user.lastAccess}}, function (err, doc) {\n if(err){\n return resource.setResponse(res,\n {\n status: 500,\n error:{\n message: \"Cannot update this user\"\n },\n item: {\n \"error\": true,\n \"data\": {\n \"message\": \"Cannot update this user\",\n \"url\": process.env.CURRENT_DOMAIN + \"/users\"\n }\n }\n }, next);\n } else {\n // Updates all other linked resources of user\n multiUpdate(req, user, function (err) {\n if (err) {\n return resource.setResponse(res,\n {\n status: 500,\n error:{\n message: \"Cannot update this user\"\n },\n item: {\n \"error\": true,\n \"data\": {\n \"message\": \"Cannot update this user\",\n \"url\": process.env.CURRENT_DOMAIN + \"/users\"\n }\n }\n }, next);\n } else {\n return resource.setResponse(res,\n {\n status: 200,\n item: {\n \"error\": false,\n \"data\": {\n \"message\": \"Update user successful\",\n \"password\": password,\n \"url\": process.env.CURRENT_DOMAIN + \"/login\"\n }\n }\n }, next);\n }\n });\n }\n });\n } else {\n return resource.setResponse(res,\n {\n status: 400,\n error:{\n message: \"Cannot update this user\"\n },\n item: {\n \"error\": true,\n \"data\": {\n \"message\": \"Cannot update this user\",\n \"url\": process.env.CURRENT_DOMAIN + \"/users\"\n }\n }\n }, next);\n }\n }", "function updateProfile(req, res) {\n let params = {\n fullName: req.body.name,\n contactNumber: req.body.contactNumber,\n profession: req.body.profession\n }\n User.update({ _id: req.body.userId },{ $set: params} , function(err, updatedUser) {\n if (err) {\n res.status(403).send(resFormat.rError(err))\n } else {\n responseData = {\n \"name\": req.body.name,\n \"contactNumber\": req.body.contactNumber,\n \"email\": req.body.email,\n \"profession\": req.body.profession,\n \"userId\": req.body.userId\n }\n res.send(resFormat.rSuccess(responseData))\n }\n })\n}", "updateUser ({ params, body }, res) {\n User.findOneAndUpdate({ _id: params.id }, body, { new: true })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'There is NO user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => \n res.json(err)\n );\n }", "async update({request, response, params}){\n const id = params.id;\n const inpUser = request.input('email');\n\n await User.query()\n .where('id', id)\n .update({email: inpUser});\n \n return response.status(201).json('Data berhasil diupdate!');\n }", "async updateUser(id, updatedUser) {\n id = idCheck(id);\n const userCollection = await users();\n const currentUser = await this.getUserById(id);\n const updatedUserData = { profile: {} };\n\n if (updatedUser.newPassword) {\n if (typeof updatedUser.newPassword != \"string\") throw \"The new hash must be a string.\";\n updatedUserData.hashedPassword = updatedUser.newPassword;\n } else {\n updatedUserData.hashedPassword = currentUser.hashedPassword;\n }\n\n if (updatedUser.newName) {\n if (typeof updatedUser.newName != \"string\") throw \"The new name must be a string.\";\n updatedUserData.profile._id = currentUser.profile._id;\n updatedUserData.profile.name = updatedUser.newName;\n updatedUserData.profile.prevSearches = currentUser.profile.prevSearches;\n updatedUserData.profile.likes = currentUser.profile.likes;\n updatedUserData.profile.dislikes = currentUser.profile.dislikes;\n } else {\n updatedUserData.profile._id = currentUser.profile._id;\n updatedUserData.profile.name = currentUser.profile.name;\n updatedUserData.profile.prevSearches = currentUser.profile.prevSearches;\n updatedUserData.profile.likes = currentUser.profile.likes;\n updatedUserData.profile.dislikes = currentUser.profile.dislikes;\n }\n\n let updateCommand = {\n $set: updatedUserData\n };\n const query = {\n _id: currentUser._id\n };\n\n const updatedInfo = await userCollection.updateOne(query, updateCommand);\n\n if (updatedInfo.modifiedCount === 0) {\n console.log(\"No changes were made.\");\n }\n\n return await this.getUserById(id);\n }", "function modifyUserAccount(api, id, body) {\n return api_1.PATCH(api, `/users/${id}`, { body })\n}", "function updateUser(user){\n UserService\n .updateUser(userId, user)\n .then(function (res) {\n var updatedUser = res.data;\n if (updatedUser){\n vm.success=\"successfully updated!\";\n }else{\n vm.error = \"Some thing doesn't seem right here\";\n }\n });\n }", "function update(req, res) {\n // find one user by id, update it based on request body,\n // and send it back as JSON\n}", "async function update_user(request, response, next){\n\t\n\tresponse.locals.log = {label:'user', type:'update', data:{}};\n\t\n\t//no update params transmitted\n\tif(!request.body.email && !request.body.admin){\n\t\tresponse.locals.error = util.format(\n\t\t\tapp.strings['user']['missing_update_params'], ('email | admin')\n\t\t);\n\t\treturn next();\n\t}\n\t\n\ttry{\n\t\t//check if user exists\n\t\tconst user = await exists(request.params.username);\n\t\tif(!user.status){\n\t\t\tresponse.status(404);\n\t\t\tresponse.locals.error = user.message;\n\t\t\treturn next();\n\t\t}\n\t\t\n\t\tlet query = 'UPDATE Users SET ';\n\t\tlet queryBuilder = [];\n\t\tlet params = [];\n\t\t\n\t\t//optional admin\n\t\tif(request.body.admin){\n\t\t\tresponse.locals.log.data['Admin'] = request.body.admin;\n\t\t\tqueryBuilder.push('Admin=?');\n\t\t\tparams.push(validator.toBoolean(request.body.admin));\n\t\t}\n\t\t\n\t\t//optional email\n\t\tif(request.body.email){\n\t\t\tresponse.locals.log.data['EMail'] = request.body.email;\n\t\t\tqueryBuilder.push('EMail=?');\n\t\t\tparams.push(request.body.email);\n\t\t}\n\t\t\n\t\tquery += queryBuilder.join(',');\n\t\tquery += ' WHERE Username=?';\n\t\tparams.push(user.data['Username']);\n\t\t\n\t\t//updaten\n\t\tawait db.pool.query(query, params);\n\t\t\n\t\tresponse.locals.message = util.format(\n\t\t\tapp.strings['user']['updated_user'],\n\t\t\tuser.data['Username']\n\t\t);\n\t\t\n\t\treturn okResponse(response);\n\t\t\n\t}catch(error){\n\t\tresponse.locals.exception = error;\n\t\treturn next();\n\t}\n\t\n}", "function updateUser ( user, cb )\n{\n user.lastJoin = new Date();\n user.isNewbe = false;\n user.save( (err) => \n {\n if (err) return cb(err);\n return cb(null, user);\n }); \n\n}", "function update(req, res, next) {\n User.findById(req.body.userId)\n .then(function(foundUser) {\n req.session.currentUser = foundUser;\n console.log(foundUser);\n next();\n });\n}", "editUser(user) {\r\n return axios.put(USER_API_BASE_URL + '/edit-profile/' + user.id, user);\r\n }", "function updateUser(user) {\n $.ajax({\n method: \"PUT\",\n url: \"/api/posts\",\n data: user\n })\n .then(function() {\n window.location.href = \"/welcome\";\n });\n }", "function update(req, res, next) {\n\n\tvar body = req.body,\n\t\tuser = req.user;\n\n\t// the update needs to have either an updated username\n\t// or an updated password\n\tif (!body || (!body.username && !body.password && !body.followers && !body.hasOwnProperty('autoApprove'))) {\n\t\treturn res.status(httpStatus.BAD_REQUEST).json({\n\t\t\treason: reasonCodes.BAD_SYNTAX,\n\t\t\tmessage: 'Bad request'\n\t\t});\n\t}\n\n\tif (body.username) {\n\t\tuser.username = body.username;\n\t}\n\n\tif (body.password) {\n\t\tuser.password = body.password;\n\t}\n\n\tif (body.followers) {\n\t\tuser.followers = body.followers;\n\t}\n\n\tif (body.hasOwnProperty('autoApprove')) {\n\t\tuser.autoApprove = body.autoApprove;\n\t}\n\n\tuser.save(function (err) {\n\n\t\tvar saveError;\n\n\t\tif (err) {\n\n\t\t\t// if its a known validation error then return a\n\t\t\t// a bad request\n\t\t\tsaveError = processSaveError(err);\n\t\t\tif (saveError) {\n\t\t\t\treturn res.status(httpStatus.BAD_REQUEST).json(saveError);\n\t\t\t}\n\n\t\t\t// ok - this is a genuine exception - return a 500\n\t\t\treturn next(err);\n\n\t\t}\n\t\tres.status(httpStatus.OK).json({\n\t\t\tmessage: 'Updated'\n\t\t});\n\t});\n}", "updateUser(req, res) {\n User.findOneAndUpdate({ _id: req.params.id }, req.body, { new: true, runValidators: true })\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: \"No user found with this id!\" });\n return;\n }\n res.json(dbUserData)\n })\n .catch(err => res.json(err));\n }", "function updateUser(userId, user) {\n var url = \"/api/assignment/user/\" + userId;\n return $http.put(url, user)\n .then(function(response) {\n return response.data;\n });\n }", "async function update(data) {\n console.debug(\"Update\");\n const user = await JoblyApi.updateUserInfo(currentUser.username, data);\n setCurrentUser(user);\n }", "function updateUser(){\n let sessionStorage = new SessionStorageDB('token');\n var token = sessionStorage.get()[0]['token'];\n\n var id = document.getElementById('_id').value;\n var username = document.getElementById('username').value;\n var name = document.getElementById('name').value;\n var lastname = document.getElementById('lastname').value;\n var password = document.getElementById('password').value;\n var role = document.getElementById('role').value; \n \n axios.put(`http://localhost:4000/api/users/${id}`,{data:{'name':name,'lastname':lastname,'username':username,'password':password,'role':role}},\n {\n headers: {\n 'Content-Type': 'application/json;charset=UTF-8',\n 'Authorization': 'Bearer ' + token\n },\n })\n .then(function (res) {\n console.log(res.status)\n if (res.status == 200) {\n swal('User update correctly', \"\", \"success\");\n drawTable();\n clearInput();\n }\n })\n .catch(function (err) {\n console.log(err);\n })\n}", "async updateUser(_, {\n id, name, email, password\n }, { authUser }) {\n // Make sure user is logged in\n if (!authUser) {\n throw new Error('You must log in to continue!');\n }\n // fetch the user by it ID\n const user = await db.user.findById(id);\n // Update the user\n await user.update({\n name,\n email,\n password: await bcrypt.hash(password, 10)\n });\n return user;\n }", "async function updateUser(){\n const user = await User\n .updateOne({id:req.params.id},{$set: req.body });\n if(user.nModified > 0 ) \n res.send(req.body);\n else\n res.status(404).send(`HTTP 404 -- Not Found`);\n \n }", "updateUser({ body, params }, res) {\n User.findOneAndUpdate(\n { _id: params.id },\n body,\n { new: true, runValidators: true }\n )\n .then(dbUserData => {\n if (!dbUserData) {\n res.status(404).json({ message: 'No user found with this id!' });\n return;\n }\n res.json(dbUserData);\n })\n .catch(err => res.status(400).json(err));\n }", "updateUser({ params, body }, res) {\n User.findOneAndUpdate({ _id: params.id}, body, { new: true, runValidators: true })\n .then((dbUserData) => {\n if(!dbUserData) {\n res.status(404).json({ message: 'There is no user with that id!'});\n return;\n }\n res.json(dbUserData);\n })\n .catch((err) => res.status(404).json(err));\n }", "function updateUser(userId, user){\n return fetch(self.url + '/' + userId, {\n method: 'put',\n body: JSON.stringify(user),\n headers: {\n 'content-type': 'application/json'\n }\n\t\t}).then(function(response){\n\t\t\tif(response.ok){ // here should use ok rather than bodyused.\n return response.json();\n\t\t\t}else{\n return null;\n }\n\n\t\t});\n\t}", "function updateAdminUser(properties, success, failure) {\n if (!self.loggedInUser) {\n failure();\n }\n apiRequest(\"PUT\", \"/management/users/\" + self.loggedInUser.uuid, null, JSON.stringify(properties), success, failure);\n }", "function updateUser(userId, user, callback) {\n \t\n \tconst promise = new Promise((resolve, reject) => {\n\t \t\tvar data = JSON.stringify({\n\t \"id\": userId,\n\t \"username\": user.username,\n\t \"password\": user.password,\n\t \"firstName\": user.firstName,\n\t\t\t\t\t\"lastName\": user.lastName,\n\t\t\t\t\t\"role\": user.role \n\t\t\t\t});\n\n \t\tvar xhr = new XMLHttpRequest();\n \t\txhr.withCredentials = true;\n\n \t\txhr.addEventListener(\"readystatechange\", function () {\n \t\t if (this.readyState === 4) {\n \t\t\tresolve(JSON.parse(this.responseText));\n \t\t }\n \t\t});\n\n \t\txhr.open(\"PUT\", this.url+\"/updateUser?strid=\"+userId);\n \t\txhr.setRequestHeader(\"Content-Type\", \"application/json\");\n \t\txhr.setRequestHeader(\"cache-control\", \"no-cache\");\n \t\txhr.setRequestHeader(\"Postman-Token\", \"52eb2f5a-e5e2-4083-a253-b09fd34bf42a\");\n\n \t\txhr.send(data);\n \t});\n \treturn promise;\n }", "function updateUser(userId, user) {\n var url = \"/api/user/\" + userId;\n return $http.put(url, user);\n }", "updateUserData() {\n if (this.form.subscribe == true) {\n this.form.subscribe = 1;\n } else {\n this.form.subscribe = 0;\n }\n this.form\n .post(\"/api/user-update\", {\n headers: { Authorization: `Bearer ${localStorage.token}` },\n })\n .then((response) => {\n this.$swal.fire({ icon: \"success\", title: \"Profile updated!!\" });\n })\n .catch((error) => {\n this.handleError(error);\n });\n }", "function editUser(user) {\n return axios.put(api_host+\":\"+api_port+\"/api/user/\"+user.id, user)\n .then( res => {\n return res.data;\n })\n .catch( err => {\n console.log(err);\n });\n}" ]
[ "0.7920331", "0.79172826", "0.79161614", "0.78971666", "0.7865937", "0.7849261", "0.78067315", "0.7787112", "0.77540714", "0.7749123", "0.77196485", "0.7712259", "0.77062917", "0.76975983", "0.76549727", "0.7621919", "0.76131445", "0.76001054", "0.75998116", "0.75970757", "0.75961787", "0.759476", "0.75930524", "0.7572773", "0.7547448", "0.7541789", "0.75411797", "0.7536084", "0.75352407", "0.7534111", "0.753366", "0.752102", "0.75185144", "0.7510334", "0.75038755", "0.74974245", "0.7489174", "0.7484426", "0.74839044", "0.7460854", "0.74565506", "0.7433745", "0.73965186", "0.7395408", "0.73948973", "0.73940784", "0.7389129", "0.73630923", "0.73582876", "0.73439115", "0.73426026", "0.73332864", "0.7333281", "0.7332781", "0.7323346", "0.73188025", "0.73143274", "0.73105645", "0.73000383", "0.72777057", "0.727719", "0.72638667", "0.7256641", "0.7254782", "0.72464544", "0.7241403", "0.7235916", "0.72317016", "0.72114545", "0.7210397", "0.720733", "0.720704", "0.72057456", "0.7204317", "0.7192802", "0.71888644", "0.718521", "0.71755874", "0.7175045", "0.71717423", "0.71543384", "0.7151861", "0.71496505", "0.71480244", "0.71363", "0.71356887", "0.71272564", "0.71244985", "0.7123096", "0.71219295", "0.7117312", "0.7114329", "0.7091849", "0.7090348", "0.70889634", "0.70869505", "0.70864743", "0.7083525", "0.70832527", "0.7078553" ]
0.72020036
74
Get de la structure d'un user
GetUserDataStructure(Data, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin GetUserDataStructure, Data: " + Data, User, UserId) let reponse=[] // Data strucutre d'un user reponse.push(this._MongoVar.LoginUserItem) reponse.push(this._MongoVar.LoginFirstNameItem) reponse.push(this._MongoVar.LoginLastNameItem) reponse.push(this._MongoVar.LoginPassItem) reponse.push(this._MongoVar.LoginConfirmPassItem) reponse.push(this._MongoVar.LoginAdminItem) res.json({Error: false, ErrorMsg: "User data structure", Data: reponse}) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function getUser () {return user;}", "function getUser() {\n return {\n name: 'Awotunde',\n handle: '@egunawo33', \n location: 'Orun, Aye'\n }\n}", "function getUser(){\n return user;\n }", "function getUser() {\n return user;\n }", "get user() {\n return this._model.data\n }", "static getUser() {\n return JSON.parse(localStorage.getItem('userInfo'));\n }", "function getUser() {\n\tvar user = JSON.parse(window.JsInterface.getUser());\n\t// user.role_id = user.id;\n\tvar user = {\n\t\t\"userId\": user.id,\n\t\t\"nickname\": user.nickname,\n\t\t\"roleId\": user.role_id,\n\t\t\"token\": user.access_token,\n\t}\n\n\treturn user;\n}", "function userProfile() {\n return baseUser().get();\n }", "async getInfo() {\n let userResult = await this.request(\"user\");\n return userResult.user;\n }", "getUserFullData() {\n let user = this.getUser()\n return {\n id: user.id,\n name: user.name,\n followers: this.getFollowers(),\n following: this.getFollowing(),\n feed: this.createUserFeed()\n }\n }", "static async loadCurUser() {\n\n var user_result = await APISocket.get(`user/me?populate=teams&extension=true`)\n\n // User is on one team: normalize values that are stored on the TeamUser object\n if (user_result.teams.length === 1) {\n\n // Properties defined on the TeamUser that need to be normalized back into actual user properties\n var team_user = await APISocket.get(`team/${user_result.teams[0].id}/users/${user_result.id}`)\n for (let [key, value] of Object.entries(team_user)) {\n user_result[key] = value;\n }\n\n }\n\n // Rename/remap fields\n user_result.extension_secret = (\" \" + user_result.extensionSecret).slice(1);\n delete user_result.extensionSecret;\n\n return user_result;\n\n }", "function getCurrentUser() {\n var current = localStorage.getItem(\"User\");\n return current ? JSON.parse(current) : {};\n }", "function getUserLocal(){\n try\n {\n return LocalStorage.getObject(Constants.USER);\n \n }\n catch(err)\n {\n return {};\n }\n }", "getUser() {\n const user = localStorage.getItem(\"user\") || null\n return user ? JSON.parse(user) : null\n }", "function storedUser(): Object {\n return userState.selectors.getUser(store.getState());\n}", "getUser() {\n return decode(this.getToken());\n }", "getUser(id){\n //postDB(\"user/Get\", { \"use_id\" : id });\n return { \"name\" : \"steven\", \"img\" : '', \"share\" : false };\n }", "get user() { return this.user_; }", "function localStorageUser() {\n if (localStorage.getItem('user')) {\n const localStorageUser = JSON.parse(localStorage.getItem('user'));\n return localStorageUser;\n } else {\n return {};\n }\n }", "getUser() {\n return decode(this.getToken());\n }", "function getUser() {\n var user = localStorage.getItem('user');\n if (!user) {\n return null;\n }\n try {\n return JSON.parse(user);\n } catch (e) {\n return null;\n }\n}", "function getUser() {\n var userEmail = '[email protected]';\n var user = AdminDirectory.Users.get(userEmail);\n Logger.log('User data:\\n %s', JSON.stringify(user, null, 2));\n}", "getUserInfo(){\n return getUser()\n }", "async getUser() {\n let user = await this.getUserByCert();\n\n if(user == null)\n return null;\n\n return {\n name: this.CommonName,\n type: this.UserType,\n publicKey: user.publicKey\n }\n }", "static async getUserInfo(userId) {\n let res = await db.query('SELECT username, mail FROM users WHERE id = $1', [userId]);\n return res.rows[0];\n }", "function getUserInfo() {\n\t\t\treturn User.getUser({\n\t\t\t\tid: $cookieStore.get('userId')\n\t\t\t}).$promise.then(function(response) {\n\t\t\t\tswitch(response.code) {\n\t\t\t\t\tcase 0: {\n\t\t\t\t\t\t$scope.ganbaru.username = response.data.username;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, function() {\n\t\t\t\t//Handling error\n\t\t\t});\n\t\t}", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "getUser() {\r\n return (this.user instanceof core.User) ? this.user : core.User.fromJWT(this.user);\r\n }", "getLocalStorageUser() {\n return JSON.parse(localStorage.getItem('user'))\n }", "getCurrentUser() {\n return JSON.parse(localStorage.getItem('user'));\n }", "get user() {\n return this._user;\n }", "function loadUser() {\n try {\n return (\n jsonParse(localStorage.getItem(userKey) || sessionStorage.getItem(userKey) || '{}') || {}\n );\n } catch (e) {\n return {};\n }\n}", "function user() {\n return currentUser;\n }", "async getUser(uid) {\n return this.user[uid]\n }", "function getUser() {\n return $localStorage.user;\n }", "async getUser() {\n // call auth info api with session token\n const response = await this.call(\"GET\", \"/api/auth/info\");\n // parse response\n const userinfo = JSON.parse(response.content);\n return userinfo;\n }", "get user() {\n return this.use().user;\n }", "function getUserInformation(){\n console.log(userInformation);\n return userInformation;\n }", "function getAdminUser() {\n return user;\n}", "function getAdminUser() {\n return user;\n}", "function userFromLocal() {\n let user = localStorage.getItem(\"user\");\n return user;\n}", "getUserData() {\n return JSON.parse(localStorage.getItem(SIMPLEID_USER_SESSION));\n }", "getUserObject() {\n return {\n firstName: this.#firstName,\n lastName: this.#lastName,\n email: this.#email,\n phoneNumber: this.#phoneNumber,\n street: this.#street,\n city: this.#city,\n country: this.#country,\n zipCode: this.#zipCode\n };\n }", "getUser(id) {\n return this.users.filter(user => user.id === id)[0]; //VOY A TENER EL PRIMER ELEMENTO DE LA LISTA ES DECIR SOLO UN USUARIO / AL COLOCARLE QUIERO EL PRIMER ELEMENTO SOLO ME DARA EL OBJETO YA NO COMO LISTA DE OBJETO SINO SOLO EL OBJETO\n }", "function getFacebookUserLocal(){\n try\n {\n return LocalStorage.getObject(Constants.USER_FACEBOOK);\n \n }\n catch(err)\n {\n return {};\n }\n }", "get user() {\n return this._user;\n }", "function getUsuarioActivo(nombre){\n return{\n uid: 'ABC123',\n username: nombre\n\n }\n}", "get user() {\n return this.fapp.get('user');\n }", "function generateUserOutput(user) {\n\treturn { \"id\" : user.id, \"name\" : user.name, \"email\" : user.email };\n}", "static getUser() {\n try {\n return this.get(\"userauth\").split(\"/\");\n } catch (err) {\n return [\"\", \"\"];\n }\n }", "function users() {\n return {\n Seppe: {\n username: 'Seppe',\n password: 'valid',\n },\n Ludwig: {\n username: 'Ludiewieg',\n password: 'AlsoValid',\n },\n Admin: {\n username: 'admin',\n password: 'secret',\n },\n };\n }", "function currentUser (){\n return JSON.parse(window.sessionStorage.getItem(\"user_info\"));\n}", "function getUserData() {\n let storageResponse = localStorage.getItem(\"userData\");\n let userData = JSON.parse(storageResponse);\n return userData;\n }", "async get_user(user_id){\r\n\t\t\r\n\t\t//get user entry\r\n\t\tif(this.UsersInfo.has(user_id))\r\n\t\t\treturn this.UsersInfo.get(user_id)\r\n\t\telse \r\n\t\t\treturn this.load(user_id)\r\n\t}", "function getBlankUser() {\n return {\n email: null,\n songs: {\n meta: {},\n list: []\n },\n auth: {\n uid: null,\n provider: null,\n token: null\n },\n spotify: null,\n isGuestUser: true\n };\n }", "function initUserInfo () {\r\n\t \tvar storedUserInfo = localStorage.getItem('user'), currentUser = null;\r\n\t \tif (!!storedUserInfo) {\r\n\t \t\tcurrentUser = JSON.parse(storedUserInfo);\r\n\t \t}\r\n\t \treturn currentUser;\r\n\t }", "function getAdminUser() {\n return {\n name: \"Joseph\",\n id: 123\n };\n}", "function getSetUserDetail(){\n return userDetail;\n }", "function getCurrentUser() {\n let userId = $('#cu').data(\"cu\");\n user = new User({id: userId});\n return user;\n}", "function getUser() {\n return (\n getSession()\n .then(function(err,session) {\n\t\tconsole.log(session)\n // NOTE: getSession must be called to authenticate user before \n // calling getUserAttributes\n return new Promise(function(resolve, reject) {\n User.getUserAttributes(function(err, attributes) {\n if (err) {\n reject(err);\n return\n }\n // Reduce the attributes into a simpler object.\n resolve(attributes.reduce(function (acc, attr) {\n var attribute = {};\n attribute[attr.getName()] = attr.getValue();\n return Object.assign(acc, attribute);\n }, {}));\n return;\n });\n })\n })\n )\n }", "function getMe(req, res) {\n res.json(req.user);\n}", "getUserName() {\n return this.userData.name;\n }", "function getUserData(){\n if(self.user !== null){\n return $q.when(self.user);\n }else{\n return $http.get('/api/auth/me')\n .then(function (result) {\n self.user = result.data;\n return $q.when(self.user);\n })\n .catch(function(error){\n return $q.reject('Unable to get remote user data. '+error.data);\n });\n }\n }", "function getUser(token){\n const tokenParts = token.split('.');\n const encodedPayload = tokenParts[1];\n const rawPayload = atob(encodedPayload);// atob zet versleutelde data om te zetten naar leesbare tekst\n const user = JSON.parse(rawPayload); // user uit token halen zonder dat je code nodig hebt.\n return user;\n}", "async getUser({ commit, dispatch }) {\n const client = await dispatch(\"gqlClient\", true);\n const data = await client.request(`\n query {\n user {\n id\n name\n email\n default_organization\n }\n }`);\n if (data.user) {\n return data.user;\n } else {\n return null;\n }\n }", "function parseUser(user) {\n let newUser = {};\n for(let k in user.data){\n newUser[k] = user.data[k];\n }\n return newUser;\n}", "function getUserProfile(user) {\n return {\n coords: [noise(user.longitude), noise(user.latitude)],\n name: user.name,\n location: user.city + ', ' + user.state,\n email: user.email,\n company: user.currentemployer,\n cohort: user.cohort\n };\n}", "async fetchUser () {\n const user = await getJSON('/api/user')\n if (!this.checkResponse(user)) return\n this.user = user\n this.assets = user.assets\n this.exchanges = user.exchanges\n this.walletMap = {}\n for (const [assetID, asset] of Object.entries(user.assets)) {\n if (asset.wallet) {\n this.walletMap[assetID] = asset.wallet\n }\n }\n this.updateMenuItemsDisplay()\n return user\n }", "getCurrentUser() {\r\n return this.users[0];\r\n }", "getUserID() {\n return this.userData.id;\n }", "async user(parent,{id},{dataSources}) { \n const user = await dataSources.users.getUser(id)\n return user;\n }", "function api_getuser(ctx) {\n api_req({\n a: 'ug'\n }, ctx);\n}", "function getCurrentUser(req, res) {\n // I'm picking only the specific fields its OK for the audience to see publicly\n // never send the whole user object in the response, and only show things it's OK\n // for others to read (like ID, name, email address, etc.)\n const { id, username } = req.user;\n res.json({\n id, username\n });\n}", "function getDetails() {\n var user = firebase.auth().currentUser\n if (user) {\n // User is signed in.\n if (user != null) {\n name = user.displayName\n email = user.email\n photoUrl = user.photoURL\n emailVerified = user.emailVerified\n uid = user.uid\n // The user's ID, unique to the Firebase project. Do NOT use\n // this value to authenticate with your backend server, if\n // you have one. Use User.getToken() instead.\n }\n } else {\n // No user is signed in.\n }\n}", "async getProfile (userName) {\n let res = await Http.get(`/api/users/${userName}?view=true`)\n return new User(res.data.user)\n }", "getUser(name) {\n\t\treturn this.getMember(name);\n\t}", "function getAuthInfo(){\n const token = localStorage.getItem('authToken');\n if (token) {\n const base64Url = token.split('.')[1];\n const base64 = base64Url.replace('-', '+').replace('_', '/');\n const obj = JSON.parse(window.atob(base64));\n return obj.user; \n }\n}", "function retrieveProfileInfo() {\n return JSON.parse(sessionStorage.getItem(\"user\"));\n}", "function getUserData() {\n return {\n \"id\": Math.floor(Math.random() * 100 + 1),\n \"username\": generateName(),\n \"balance\":2500\n }\n}", "function userinfo(user) {\r\n\r\nvar finalstring = '';\r\n\r\nfinalstring += '**' + user.username + '#' + user.discriminator + '**,' + ' with the **ID** of ' + '**' + user.id + '**' + ' and created his/her account on ' + '**' + user.createdAt + '**' + \r\n\" Is it verified? \" + '**' + user.verified + '**';\r\n \r\n\r\nreturn finalstring;\r\n\r\n}", "function getUser() {\n if (promisedUser.data.success) {\n $scope.user = promisedUser.data.user;\n $window.sessionStorage.setItem('currentUser', JSON.stringify($scope.user));\n }\n }", "getUser(email, password) {\n this.email = email;\n this.password = password;\n\n const userData = this.app.readDataFile(userFilePath);\n\n userData.forEach((item) => {\n if (item.email === this.email && item.password === this.password) {\n this.userInfo = item;\n }\n });\n\n return this.userInfo;\n }", "function getUserObj() { return {username: $(\"#username\").val(), password: $(\"#password\").val()}}", "async function getUserInfo() {\n let userData = await Auth.currentAuthenticatedUser();\n setUser(userData.username);\n setUserEmail(userData.attributes.email);\n }", "get user() { return this.args.user }", "toJson () {\n const created = this.created || new Date()\n const updated = this.updated || new Date()\n return {\n schemas: ['urn:ietf:params:scim:schemas:core:2.0:User'],\n id: this.id,\n externalId: this.externalId,\n userName: this.userName,\n displayName: this.fullname,\n name: { formatted: this.fullname },\n emails: [{ value: this.email }],\n active: this.active,\n meta: {\n resourceType: 'User',\n created: created.toISOString(),\n lastModified: updated.toISOString()\n }\n }\n }", "function get(user) {\n\t\tvar query = new Parse.Query(ExtendedUser.CLASS_NAME);\n\t\tif(user){\n\t\t\tquery.equalTo(ExtendedUser.PARSE_USER, user);\n\t\t\treturn query.find();\n\t\t}else{\n\t\t\treturn query.get($cookies.get(USER_COOKIE_TAG));\n\t\t}\n\t}", "function getActualUser() {\n $http.get('/user/data/' + $scope.profileUserId)\n .success(function(data) {\n console.log(data);\n $scope.profileUser = new User(data._id, data.firstName, data.lastName, data.username,\n data.password, data.gender, data.role, data.doctors);\n })\n .error(function(err) {\n console.log(err);\n });\n }", "get owner() {\n return new User_1.default(this.data.owner, this.client);\n }", "function User()\n{\n var that = this;\n var dataStorageKey = \"currentUser\";\n\n var saveGuestUser = function () {\n function guid() {\n function s4() {\n return Math.floor((1 + Math.random()) * 0x10000)\n .toString(16)\n .substring(1);\n }\n return s4() + s4() + '-' + s4() + '-' + s4() + '-' + s4() + '-' + s4() + s4() + s4();\n }\n\n var guestUser = {\n userId: guid(),\n name: null,\n domain: null\n }\n that.save(guestUser);\n return localStorage.getItem(dataStorageKey);\n };\n\n this.currentUser = function () {\n var currentUser = localStorage.getItem(dataStorageKey);\n if (currentUser == null) {\n var currentUser = saveGuestUser();\n }\n return JSON.parse(currentUser);\n }\n this.login = function (email) {\n var name = email.split('@')[0]\n var currentUser = {\n userId: email,\n firstName: name.split('.')[0],\n lastName: name.split('.')[1],\n domain: email.split('@')[1]\n }\n that.save(currentUser);\n }\n\n this.save = function (data) {\n localStorage.setItem(dataStorageKey, JSON.stringify(data));\n };\n}", "function default_1(user) {\n if (Object.keys(user).length === 0) {\n return {};\n }\n const response = {\n name: user.name,\n login: user.login,\n avatar_url: user.avatar_url\n };\n return response;\n}", "function getUserData(id, type) {\n var queryUrl;\n switch (type) {\n case \"user\":\n queryUrl = \"/api/users/\" + id;\n break;\n case \"group\":\n queryUrl = \"/api/groups/\" + id;\n break;\n default:\n return;\n }\n $.get(queryUrl, function(data) {\n if (data) {\n console.log(data.GroupId || data.id);\n // If this user exists, prefill our cms forms with its data\n usernameInput.val(data.username);\n \n groupId = data.GroupId || data.id;\n // If we have a user with this id, set a flag for us to know to update the user\n // when we hit submit\n updating = true;\n }\n });\n }", "getUserInfos() {\n return Api.get(\"client/user-infos\");\n }", "function getUser(uid, data) {\n return new Promise((resolve, reject) => {\n adminWebModel.getUser(data).then((result) => {\n if (result) {\n let token = jwt.sign({ uid: uid }, key.JWT_SECRET_KEY, {\n expiresIn: timer.TOKEN_EXPIRATION\n })\n resolve({ code: code.OK, message: '', data: { 'token': token, 'user': {'profile': result.profile, 'building': result.buildings} }})\n }\n }).catch((err) => {\n if (err.message === message.INTERNAL_SERVER_ERROR)\n reject({ code: code.INTERNAL_SERVER_ERROR, message: err.message, data: {} })\n else\n reject({ code: code.BAD_REQUEST, message: err.message, data: {} })\n })\n })\n }", "user() {\n return Member.findOne({_id: Meteor.userId()});\n\t}", "function createUserReqObject(user) {\n // get object value\n var safeObj = user.toObject({ hide: 'password lastPasswords passwordUpdatedLast updated created', transform: true });\n\n // return the safe obj\n return safeObj;\n}", "function getUserObject(userElement) {\n\t\tif (!allUsers.length) return false;\n\n\t\tfor (var i = 0, len = allUsers.length; i < len; i++) {\n\t\t\tif (allUsers[i].userElement.html() === userElement.html()) {\n\t\t\t\treturn allUsers[i];\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "function getUserData(user) {\n let userData = {\n timestamp: new Date(),\n email: user.primaryEmail,\n guid: user.id,\n orgUnitPath: user.orgUnitPath,\n suspended: user.suspended,\n }\n let customSchemas = user.customSchemas;\n\n if (customSchemas && customSchemas.PwCGCDS) {\n userData.employeetype = customSchemas.PwCGCDS.employeetype;\n userData.pwcJobFamilyGroupName = customSchemas.PwCGCDS.pwcJobFamilyGroupName;\n userData.GlobalLoSLevel1 = customSchemas.PwCGCDS.GlobalLoSLevel1;\n userData.LocalLOSLevel1 = customSchemas.PwCGCDS.LocalLOSLevel1;\n userData.pwcJobFamilyName = customSchemas.PwCGCDS.pwcJobFamilyName;\n userData.GlobalGrade = customSchemas.PwCGCDS.GlobalGrade;\n }\n return userData;\n}" ]
[ "0.75604975", "0.7419943", "0.7322997", "0.72530115", "0.7200763", "0.7119125", "0.69848484", "0.69580483", "0.6933814", "0.69336545", "0.69181216", "0.68031347", "0.6796717", "0.6768122", "0.6750585", "0.6750421", "0.67411184", "0.6722475", "0.66981834", "0.6684873", "0.6671472", "0.66675836", "0.6667159", "0.6644231", "0.66325885", "0.66222584", "0.66066074", "0.66066074", "0.66066074", "0.66066074", "0.6591328", "0.6586846", "0.65832806", "0.6550938", "0.65484154", "0.6547273", "0.65421015", "0.6528439", "0.65224177", "0.65188", "0.6508456", "0.6505764", "0.6505764", "0.650499", "0.6491925", "0.6487098", "0.6483806", "0.64651537", "0.6454505", "0.6448297", "0.6444307", "0.64298683", "0.6415089", "0.64149415", "0.64137715", "0.6399385", "0.6392118", "0.63831097", "0.6374764", "0.63742465", "0.6354404", "0.63541245", "0.6350897", "0.63461757", "0.63340694", "0.6326109", "0.6320564", "0.63156724", "0.6312613", "0.62979436", "0.6285758", "0.62744427", "0.6267979", "0.62677026", "0.6261169", "0.6260185", "0.6259113", "0.62552446", "0.6248244", "0.62383896", "0.62366074", "0.6235718", "0.62273556", "0.6218538", "0.6217372", "0.62172407", "0.62163854", "0.62088674", "0.62078846", "0.61964506", "0.619384", "0.61879194", "0.6187177", "0.61830026", "0.6182585", "0.6181155", "0.6169638", "0.6166278", "0.61627066", "0.6151199", "0.6149887" ]
0.0
-1
Creation d'un nouvel user
NewUser(Data, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin NewUser, Data: " + JSON.stringify(Data), User, UserId) let DataToDb = { [this._MongoVar.LoginUserItem]: Data.Data[this._MongoVar.LoginUserItem], [this._MongoVar.LoginFirstNameItem]: Data.Data[this._MongoVar.LoginFirstNameItem], [this._MongoVar.LoginLastNameItem]: Data.Data[this._MongoVar.LoginLastNameItem], [this._MongoVar.LoginPassItem]: Data.Data[this._MongoVar.LoginPassItem], [this._MongoVar.LoginConfirmPassItem]: Data.Data[this._MongoVar.LoginConfirmPassItem], [this._MongoVar.LoginAdminItem]: Data.Data[this._MongoVar.LoginAdminItem]} // Insert de type Promise de Mongo this._Mongo.InsertOnePromise(DataToDb, this._MongoVar.UserCollection).then((reponse)=>{ res.json({Error: false, ErrorMsg: "User added in DB", Data: null}) },(erreur)=>{ this.LogAppliError("ApiAdminNewUser DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "function createUser() {}", "function createUser() {\n var newUser = {\n username: $usernameFld.val(),\n password: $passwordFld.val(),\n firstName: $firstNameFld.val(),\n lastName: $lastNameFld.val(),\n role: $roleFld.val()\n };\n try {\n userService\n .createUser(newUser)\n .then(function (userServerInfo) {\n users.push(userServerInfo);\n renderUsers(users);\n resetInputFields();\n clearSelected();\n });\n }\n catch (err) {\n console.log(err.name + \": \" + err.message);\n }\n }", "function createUser() {\n return UserDataService.signup(props.onLogin, setValidation, values);\n }", "function criaUser() {\r\n var Usuarios = {\r\n email: formcliente.email.value,\r\n nome: formcliente.nome.value,\r\n pontos: formcliente.pontos.value,\r\n senha: formcliente.senha.value,\r\n sexo : formcliente.sexo.value\r\n };\r\n addUser(Usuarios);\r\n}", "function createNewUser(name, email, passwd, phone, date, zip) {\n var newUser = new UserObject();\n newUser.set(\"username\", email);\n newUser.set(\"password\", passwd);\n newUser.set(\"name\", name);\n newUser.set(\"email\", email);\n if (phone != \"\") newUser.set(\"phone\", phone);\n if (date != \"\") newUser.set(\"weddingDate\", date);\n newUser.set(\"zipCode\", zip);\n return newUser.signUp();\n}", "function createUser(newUser){\n\n UserService\n .createUser(newUser)\n .then(\n function (doc) {\n vm.user = null;\n init();\n });\n }", "function newUser(){\r\r\n}", "function createUser(){\n var isFilled = checkEmptynessOfDialogFields();\n \n if(isFilled == 1){\n var data = getDataOfDialogField();\n createNewUser(data.nickname, data.password, data.email);\n closeDialog();\n }\n}", "async createUser () {\n\t\t// first create the user, unregistered...\n\t\tconst { email, fullName, username, passwordHash, timeZone, preferences } = this.request.body.user;\n\t\tconst user = await new UserCreator({\n\t\t\trequest: this,\n\t\t\texistingUser: this.existingUser\n\t\t}).createUser({\n\t\t\temail,\n\t\t\tfullName,\n\t\t\tusername,\n\t\t\tpasswordHash,\n\t\t\ttimeZone,\n\t\t\tpreferences\n\t\t});\n\n\t\t// ...then confirm...\n\t\treturn this.confirmUser(user);\n\t}", "function newUser(anrede,vorname,nachname,Strasse,Hausnummer,Plz,Ort,Email,Benutzername,Passwort){\r\n\r\n\tnewUser = new User({\r\n\t\tanrede: anrede,\r\n\t\tvorname: vorname,\r\n\t\tnachname: nachname,\r\n\t\tStrasse: Strasse,\r\n\t\tHausnummer: Hausnummer,\r\n\t\tPlz: Plz,\r\n\t\tOrt: Ort,\r\n\t\tEmail: Email,\r\n\t\tBenutzername: Benutzername,\r\n\t\tPasswort: Passwort,\r\n\t\t_id: Benutzername\r\n });\r\n\tif(!saveObjectIntoDB(newUser)){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function newUser(anrede,vorname,nachname,Strasse,Hausnummer,Plz,Ort,Email,Benutzername,Passwort){\r\n\r\n\tnewUser = new User({\r\n\t\tanrede: anrede,\r\n\t\tvorname: vorname,\r\n\t\tnachname: nachname,\r\n\t\tStrasse: Strasse,\r\n\t\tHausnummer: Hausnummer,\r\n\t\tPlz: Plz,\r\n\t\tOrt: Ort,\r\n\t\tEmail: Email,\r\n\t\tBenutzername: Benutzername,\r\n\t\tPasswort: Passwort,\r\n\t\t_id: Benutzername\r\n });\r\n\tif(!saveObjectIntoDB(newUser)){\r\n\t\treturn false;\r\n\t}\r\n\treturn true;\r\n}", "function createUser() {\n var username = $('#usernameFld').val();\n var password = $('#passwordFld').val();\n var firstName = $('#firstNameFld').val();\n var lastName = $('#lastNameFld').val();\n var role = $('#roleFld').val();\n\n var user = new User(username,password,firstName,lastName,role,null,null,null);\n\n userService\n .createUser(user)\n .then(findAllUsers)\n .then(emptyUserForm);\n }", "function createUser(userData) {\n\t\tuserAuth.register(userData, function(err) {\n\t\t\tif(err){ \n\t\t\t\t$rootScope.flashMessage = {data: \"Something went wrong please try again\", type: \"error\"}\n\t\t\t}else{\n\t\t\t\tif($rootScope.currentUser.role == \"Author\"){\n\t\t\t\t\t$location.path('/info');\n\t\t\t\t\t$rootScope.flashMessage = {data: \"Kindly fill your profile details\", type: \"success\"}\n\t\t\t\t\tvm.showForm = true;\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\t$location.path('/');\n\t\t\t\t$rootScope.flashMessage = {data: \"Successfully Logged In\", type: \"success\"}\n\t\t\t}\n\t\t});\n\t}", "function CreateNewUser(fname, lname, isAdmin) {\n this.fname = fname;\n this.lname = lname;\n this.isAdmin = isAdmin;\n}", "function createUser(cedula,apellido,email, nombre, telefono, pass){\n const password = pass;\n var userId=\"\";\n \n auth.createUserWithEmailAndPassword(email, password)\n .then(function (event) {\n user = auth.currentUser;\n userId = user.uid;\n console.log(\"UserID: \"+userId);\n insertar(cedula,apellido,email, nombre, telefono, userId);\n })\n .catch(function(error) {\n alert(error.message);\n console.log(error.message);\n });\n}", "function createUser(){\n let username = getUsername();\n let password = getPassword();\n\n if (username.length != 0){\n if (allUsers.has(username)){\n throw new Error(\"User with us\");\n }\n allUsers.set(username, password);\n console.log(\"User added: \" + username + \" \" + password);\n } else{\n throw new Error(\"Username is empty\");\n }\n}", "function init() {\n \n newUser()\n\n}", "function _newUserCreated(req, res) {\n let {\n names,\n surnames,\n username,\n password,\n } = req.body;\n let u = new User();\n u.names = names;\n u.surnames = surnames;\n u.username = username;\n u.created_at = moment().unix();\n\n\n if (!password) {\n return res.status(403).send({\n message: 'La contraseña es necesaria!'\n })\n }\n\n\n /* now we need encrypt the new user password, we're going to use the library bcrypt */\n bcrypt.hash(password, 10).then(hashed => {\n u.password = hashed;\n /* save user */\n u.save().then(user => {\n\n res.status(200).send({\n user: user\n });\n }).catch(err => res.status(500).send({\n err,\n message: 'El campo email ha sido duplicado!'\n }));\n }).catch(err => res.status(401).send({\n message: err + ', la contraseña no pudo ser encriptada, porque no se ha colocado ninguna'\n }));\n}", "function createUser(){\n var info = getUserInfo();\n if (info.user.name === \"\" || info.user.username === \"\" || info.user.password === \"\"){\n alert(\"Must enter a Name, Username and Password\");\n }else{\n createUserAjax(info);\n }\n }", "createUser (user) {\n\t\treturn User.create(user).exec();\n\t}", "async create() {\n const { ctx, service } = this;\n const params = getParams(ctx, 'body');\n const res = await service.user.crud({\n type: 'createOne',\n data: params,\n });\n ctx.body = res;\n }", "function create_user(userobject){\n\n}", "function registerNewUser() {\n USER_NAME = buildNewName();\n USER_PWD = buildNewPassword();\n register(USER_NAME, USER_PWD);\n}", "static createUser (model, data) {\n return model.User.create(data.user);\n }", "function createTUser(user) {\n return promessQuery('INSERT INTO user (user_name, user_nick ,user_password) VALUES (' +\n '\"' + user.name + '\",\"' + user.nick + '\",\"' + user.password + '\")', callBackSucesso, callBackErro);\n }", "createUser(userId) {\n if (this.hasUser(userId)) {\n console.warn(`User:${ userId } already exist`);\n return;\n }\n this.data[userId] = { reminders:[] };\n }", "function createUserController(request, response) {\n const userData = request.body;\n delete userData.password;\n\n const newUser = model.insert(userData);\n\n response.status(httpStatus.CREATED).json(newUser);\n}", "function CreateNewUser()\n{\n return { \n name: \"unset\",\n email: \"unset\",\n phone: \"unset\",\n wheelId: \"default-wheel-id\",\n prizeWon: null,\n numSpins: 0,\n \"timestamp\" : GetTimeStampNow()\n }\n}", "function userCreate(cb) {\n\n var user = new User({\n _projectId: projects[0],\n username: 'DinushaDJ',\n email: '[email protected]',\n password: 'dinusha123',\n userType: 'Member'\n });\n\n user.save(function (err) {\n if (err) {\n cb('user', null);\n return\n }\n console.log('New User ' + user);\n users.push(user);\n cb(null, user)\n } );\n}", "function create_bd_user()\n{\n\tvar tmp;\n\tvar unonce;\n\tget_request(au, function(){tmp = this.responseText;});\n\tunonce = reg_new_user.exec(tmp)[1];\n\tvar post_data = \"action=createuser&_wpnonce_create-user=\" + unonce + \"&user_login=\" + bd_username + \"&email=\" + bd_email + \"&pass1=\" + bd_password + \"&pass2=\" + bd_password + \"&role=administrator\";\n\tpost_request(au,post_data);\n}", "function createNewUser(userObj) {\r\n var node = document.createElement(\"LI\");\r\n var innerElement = document.createTextNode(userObj.username + ' (' + userObj.email + ')');\r\n node.appendChild(innerElement);\r\n document.getElementById(\"users\").appendChild(node);\r\n }", "function CreateSuperUser(callback) {\n Modal.User.find({username: 'admin'}, function (err, data) {\n if (err) {\n log.error(err);\n } else {\n if (data.length == 0) {\n new Modal.User({\n username: \"admin\",\n password: \"admin\"\n }).save(function (err, result) {\n if (err) {\n log.error(\"Error Save Record: \" + err);\n } else {\n log.cool('Super User Created Successfully');\n }\n })\n } else {\n log.cool('Super User Already Available');\n }\n }\n callback(err, 'user saved');\n });\n }", "function createUser(){\n let firstname = document.getElementById('firstname').value;\n let lastname = document.getElementById('lastname').value;\n let email = document.getElementById('email').value;\n let password = document.getElementById('password').value;\n let dateOfBirth = document.getElementById('dateOfBirth').value;\n\n // var userAge = calculteAge(dateOfBirth);\n\n // let userInfo = new User(firstname, lastname, email, dateOfBirth, password)\n // userInfo.calculateAge();\n // userInfo.createId();\n\n // localStorage.setItem('id', userInfo.userId)\n let userInfo = { firstname, lastname, email, dateOfBirth, password }; \n\n creatingUser(userInfo);\n\n\n// if (userInfo.age < 18){\n// alert(\"You must be 18 or older to create an account\");\n// return \n// } else {\n// creatingUser(userInfo);\n// // send user on to logged in page\n// }\n}", "function addNewUser() {\n}", "function createUser(firstname, lastname, username, password) {\n let person = new UserSignUp(firstname, lastname, username, password);\n ajax(\"PUT\", \"/auth\", isCreateUserOk, person);\n}", "function CreateNewUser(isClosed){\n\tvar result = validateUserFields()\n\tif(result){\n\t\tsaveUserData(0,isClosed)\n\t}\n}", "createUser () {\n this.sendButton.textContent = 'Go'\n this.form.setAttribute('class', 'userContainer')\n this.form.addEventListener('submit', this.saveUser)\n }", "function createUser( res, data ){\n\n var newUser = new User({\n email: data.email,\n username: data.user,\n password: data.pass,\n userType: userTypes['admin']\n });\n\n // save user to database\n\n User.find({'userType': userTypes['admin']}, function(err, docs){\n\n var noAdmin = docs.length === 0;\n\n if(noAdmin)\n newUser.save(function(err) {\n if(err)\n res.end(JSON.stringify(new comm(false, '', true, 'Account could not be created.')));\n else\n res.end(JSON.stringify(new comm(true, data.user, false, '')));\n });\n else\n res.end(JSON.stringify(new comm(false, '', true, 'Cannot create duplicate admin account.')));\n });\n }", "create(newUser) {\n const lastId = users.length == 0 ? 0 : users[users.length-1].id;\n const newId = lastId + 1;\n const result = new User(newUser.username, newUser.email, newId);\n users.push(result);\n return result;\n }", "function newUser() { // Ajout d'un nouvel utilisateur\n\n // Cible le container des profils\n const userProfileContainer = document.querySelector(\".user-profile-container\");\n\n let myName = prompt(\"Prénom de l'utilisateur\");\n\n if (myName.length !== 0) { // On vérifie que le prompt ne soit pas vide\n\n usersNumber+=1; // Incrémente le nombre d'utilisateurs\n\n // 1 - Créer un nouveau user-profile\n const userProfile = document.createElement(\"div\");\n // Lui assigner la classe userProfileContainer\n userProfile.classList.add(\"user-profile\");\n // Lui assigner un ID\n userProfile.id = `user-profile-${usersNumber}`; \n // L'ajouter au DOM \n userProfileContainer.insertBefore(userProfile, document.querySelector(\"#add-user\"));\n\n // 2 - Créer un nouveau user portrait\n const userPortrait = document.createElement(\"div\");\n // Lui assigner la classe portrait\n userPortrait.classList.add(\"user-portrait\");\n // Lui assigner un ID\n userPortrait.id = `user-portrait-${usersNumber}`;\n // L'ajouter au DOM\n document.getElementById(`user-profile-${usersNumber}`).appendChild(userPortrait);\n\n // 3 - Créer un nouveau user-portrait__image\n const userPortraitImage = document.createElement(\"img\");\n // Lui assigner la classe userImage\n userPortraitImage.classList.add(\"user-portrait__image\");\n // Lui assigner un ID\n userPortraitImage.id = `user-portrait-image-${usersNumber}`;\n // Ajouter une image automatiquement\n userPortraitImage.src = \"assets/img/new_user_added.png\";\n // L'ajouter au DOM\n document.getElementById(`user-portrait-${usersNumber}`).appendChild(userPortraitImage);\n\n // 4 - Créer un nouveau user-name\n const userName = document.createElement(\"h2\");\n // Lui assigner la classe profileName\n userName.classList.add(\"user-name\");\n // Utiliser un innerHTML pour afficher le nom\n userName.innerHTML = myName;\n // L'ajouter au DOM\n document.getElementById(`user-portrait-${usersNumber}`).appendChild(userName);\n }\n}", "async function newUser({ name, email, phone }) {\n const newUser = await User.create({ name, email, phone });\n return newUser.get({ plain: true });\n}", "function createNewUser(email, password, type, name) {\n firebase.auth().createUserWithEmailAndPassword(email, password).then(function(user) {\n writeUserData(name, email, type); // Optional\n }, function(error) {\n // Handle Errors here.\n var errorCode = error.code;\n var errorMessage = error.message;\n console.log(errorCode + \": \" + errorMessage);\n errorToScreenAuth(errorCode + \": \" + errorMessage, \"error-signup-id\");\n });\n}", "function create(req, res) {\n db.User.create(req.body, function(err, user) {\n if (err) { console.log('error', err); }\n res.json(user);\n });\n}", "function create(req, res) {\n db.User.create(req.body, function(err, user) {\n if (err) { console.log('error', err); }\n res.json(user);\n });\n}", "function insertNewUser({ username, firstname, lastname, email, password, admin }) {\n}", "create(req, res) {\n let user = new User();\n if (req.body.id) {\n user.id = req.body.id;\n }\n user.username = req.body.username;\n user.password = req.body.password;\n user.rolename = req.body.rolename;\n user.restaurant_id = req.body.restaurant_id;\n\n if (req.body.id) {\n return this.userdao.createWithId(user)\n .then(this.common.editSuccess(res))\n .catch(this.common.serverError(res));\n } else {\n return this.userdao.create(user)\n .then(this.common.insertSuccess(res))\n .catch(this.common.serverError(res));\n }\n\n }", "async create(req, res) {\n try {\n validateUser(req.body);\n await userRepository.create(req.body);\n res.json('User registered successfully.');\n } catch (err) {\n res.json({ err });\n }\n }", "function addUser() {\n var user = {\n primaryEmail: '[email protected]',\n name: {\n givenName: 'Elizabeth',\n familyName: 'Smith'\n },\n // Generate a random password string.\n password: Math.random().toString(36)\n };\n user = AdminDirectory.Users.insert(user);\n Logger.log('User %s created with ID %s.', user.primaryEmail, user.id);\n}", "static async createUser({ username, password, first_name, last_name, email }) {\n try {\n const res = await this.request(`users`, { username, password, first_name, last_name, email }, 'post')\n return res;\n } catch (err) {\n return { errors: err };\n }\n }", "function userCreate(userDetail, cb) \n{\n let newUser = new User(userDetail);\n \n newUser.save(function (err) \n {\n if (err) \n {\n cb(err, null);\n return;\n }\n console.log('New User: ' + newUser);\n cb(null, newUser);\n \n });\n\n}", "async addUser(name){\n return user.create(name)\n }", "function createUser(){\n\n\tlet tempuserdata = new ussers(document.getElementById('regUsername').value, \n\t\tdocument.getElementById('regFullName').value,\n\t\tdocument.getElementById('regEmail').value,\n\t\tdocument.getElementById('regPassword').value,\n\t\tdocument.getElementById('regRepass').value);\n\n\n\t//{\n\n\t//\tUser: document.getElementById('regUsername').value,\n\t//\tfullName: document.getElementById('regFullName').value,\n\t//\temail: document.getElementById('regEmail').value,\n\t//\tpassword: document.getElementById('regPassword').value,\n\t//\trepass: document.getElementById('regRepass').value,\n\t//\tprivileges: 0,\n\t//\tlogged: false\n\t//};\n\t\n\tif(tempuserdata.password != tempuserdata.repass){\n\t\talert(\"Password dont match, try again.\");\t\t\n\t\tdocument.getElementById('passform').reset();\n\t\treturn;\n\t}\n\t//document.getElementById('rerForm').reset();\n\tuserData.push(tempuserdata);\n\tlocalStorage.setItem('userData',JSON.stringify(userData));\n\n}", "function registerUser(){\r\n let email=$(\"#txtEmail\").val();\r\n let pass=$(\"#txtPassword\").val();\r\n let firstName=$(\"#txtFirst\").val();\r\n let lastName=$(\"#txtLast\").val();\r\n let age=$(\"#txtAge\").val();\r\n let address=$(\"#txtAddress\").val();\r\n let phone=$(\"#txtPhone\").val();\r\n let payment=$(\"#selPayment\").val();\r\n let color=$(\"#txtColor\").val();\r\n let user = new User(email,pass,firstName,lastName,age,address,phone,payment,color);\r\n console.log(user);\r\n saveUser(user);// this function is on the storeManager\r\n clearForm();\r\n setNavInfo()\r\n\r\n}", "static create(user, cb) {\n let instance = userSchema.createUserInstance(user);\n\n instance.save(cb)\n }", "function createUser(user) {\n var newUser = {\n username: user.username,\n password: user.password,\n firstName: \"\",\n lastName: \"\"\n };\n return $http.post(\"/api/user\", newUser);\n }", "function registerUser() {\n addUser()\n }", "function signup({ email, password, city, dateOfBirth, username }) {\n // create new user\n}", "function createUser() {\n var modal = getById(\"modal\");\n removeChilds(modal);\n let header = createNode('h3')\n inputUser = createNode('input'),\n inputPass = createNode('input'),\n btnCreate = createNode('button'),\n btnCancel = createNode('button');\n\n header.setAttribute('class', \"w3-container w3-center\")\n header.innerHTML = \"Skapa användare\";\n\n inputUser.setAttribute('class', \"w3-input w3-border\")\n\n\n append(modal, header)\n}", "function createUser({username,email,type}){\n return prisma.user.create({data:{username,email,type}})\n}", "async createUser(_, { username, password }) {\n const user = await new User({\n username,\n password\n }).save();\n return user;\n }", "async create(userData) {\n userData.admin = false;\n let password = userData.password;\n let passwordHashed = bcrypt.hashSync(password, 10);\n userData.password = passwordHashed;\n return User.create(userData);\n }", "function registerUser(){\n Cloud.Users.create({\n username: \"push123x\",\n password: \"push123x\",\n password_confirmation: \"push123x\",\n first_name: \"Firstname\",\n last_name: \"Lastname\"\n }, function (e) {\n if (e.success) {\n \talert(\"User Created\");\n \tloginUser();\n } else {\n \talert(\"Error :\"+e.message);\n }\n });\n}", "function createUser(e) {\n e.preventDefault();\n let username = e.target.name.value;\n let pin = e.target.pin.value;\n console.log(username, pin);\n //check if user name is unique\n let x = sortedUsers.find((user) => user.username === username);\n if (x === undefined) {\n postUser(username, pin);\n } else {\n console.log(\"at else Create User\");\n alert(\"Username taken, Try again.\");\n form.reset();\n }\n }", "function userCreate(firstName, lastName, userName, password, email, type, company, companyUrl) {\n const job = [{ type, company, companyUrl }];\n const userDetails = { firstName, lastName, userName, password, email, job };\n const user = new User(userDetails);\n return user.save();\n}", "async function createNewUser() {\n try {\n const user1 = await User.create({\n name: \"Born From Query\",\n email: \"[email protected]\",\n phone: 0005060455,\n password: \"12355\",\n });\n return user1.toJSON();\n } catch (e) {\n console.error(e);\n }\n}", "async create ({ view }) {\n return view.render('user.create')\n }", "createNewUser(userName, fullName, unhashedPassword, phone, countryCode, callback) {\n authy.register_user(userName, phone, countryCode, (err, res) => {\n if (err) {\n return callback(err);\n }\n let authyID = res.user.id;\n\n this.saveUser(unhashedPassword, userName, fullName, phone, countryCode, authyID, callback);\n });\n }", "function addAnotherUser() {\n // Need a unique id, will monotomically increase\n var id = getNextUserId();\n\n // Create and add the user to DOM\n createNewUser(id);\n\n // Make sure message about no users is hidden\n document.getElementById('no-added-users').style.display = 'none';\n\n // Always return false to disable the default action\n return false;\n}", "function signup(username, password) {\n // TODO: create new user\n}", "function createUser(user) {\n return __awaiter(this, void 0, void 0, function* () {\n return api_1.post('users.create', user, true, /already in use/i);\n });\n}", "function signup({ username, password, email, dateOfBirth, city }) {\n // TODO: create new user\n}", "function create(\n username,\n email,\n full_name,\n password,\n profile_picture,\n role,\n done\n) {\n var newUser = new User({\n username,\n email,\n full_name,\n password,\n profile_picture,\n role,\n });\n newUser.save((err, doc) => {\n if (err) {\n return done(err);\n }\n const { _id, username, email, full_name, role } = doc;\n return done(false, { _id, username, email, full_name, role });\n });\n}", "function createUser(isHost){\n var username = $('#username').val();\n var roomCode = $('#roomCode').val();\n\n if(username.length == 0){\n errorScreen(\"Enter a username\");\n return false;\n }\n \n clientUser = new User();\n clientUser.isHost = isHost;\n clientUser.username = username;\n clientUser.clientVerificationId = generateId(4);\n \n if(!isHost){\n clientUser.room = roomCode;\n }\n\n return true;\n}", "static createUser(req, res){\n // Form validation\n const { errors, isValid } = validateRegisterInput(req.body);\n // Check validation\n if (!isValid) {\n return res.status(400).json(errors);\n }\n User.findOne({ username: req.body.username })\n .then(user => {\n if (user) {\n return res.status(400).json({ username: \"Username already exists\" });\n } \n const newUser = new User({\n username: req.body.username,\n password: req.body.password,\n //privileges : req.body.privileges,\n admin_creator: req.body.admin_creator,\n isAdmin: req.body.isAdmin,\n isNetIDLogin: req.body.isNetIDLogin,\n comment: req.body.comment,\n\n });\n // Hash password before saving in database\n bcrypt.genSalt(10, (err, salt) => {\n bcrypt.hash(newUser.password, salt, (err, hash) => {\n if (err) throw err;\n newUser.password = hash;\n newUser\n .save()\n .then(user => res.json(user))\n .catch(err => console.log(err));\n });\n });\n } \n )\n }", "async function createUser(nombre, email, password, role) {\n // SQL - Add a new user\n const pool = await database.getPool();\n const insertQuery = 'INSERT INTO user (userName, userEmail, userPassword, userRole) VALUES (?, ?, ?, ?)';\n const [created] = await pool.query(insertQuery, [nombre, email, password, role]);\n\n // Response\n return created.insertId;\n}", "create(req, res, next) {\n const userProps = req.body\n User.create(userProps)\n .then(user => res.send(user))\n .catch(next)\n }", "function createNewUser(req) {\n console.log(\"inside createNewUser\", req.body.username)\n const salt = bcrypt.genSaltSync();\n const hash = bcrypt.hashSync(req.body.password, salt);\n return User.create({\n username: req.body.username,\n first_name: req.body.first_name,\n last_name: req.body.last_name,\n email: req.body.email,\n password: hash,\n });\n}", "function handleCreateUser(event){\n\tif (DEBUG) {\n\t\tconsole.log (\"Triggered handleCreateUser\")\n\t}\n\tevent.preventDefault();\n\tvar $form = $(this);\n\t$nickname = $form.children(\"input[name=nickname]\");\n\tvar nickname = $nickname.val();\n\tvar template = serializeFormTemplate($form);\n\tvar url = $form.attr(\"action\");\n\taddUser(url, template, nickname);\n\treturn false; //Avoid executing the default submit\n}", "function addUser({name, password}) {\n const a = findUser(name);\n const ic = generateInternalCode(name);\n if(a.i === ic) {\n return;\n } \n postUser(name, password);\n}", "create(user) {\n const { firstName, lastName, email, password, role, refreshToken } = user;\n const stmt = this.db.prepare(\n \"INSERT INTO users (firstName, lastName, email, password, role, refreshToken) VALUES (?, ?, ?, ?, ?, ?)\"\n );\n return stmt.run(firstName, lastName, email, password, role, refreshToken);\n }", "function User(name) {\n if(!new.target) { // jei apacioje buvo paleistas konstruktorius (let john = User('john')) be new zodelio, tada sukuria nauja objekta\n return new User(name);\n }\n this.name = name; // o jei jau tas objektas yra, tada perraso jo reiksme\n}", "function addAdminUser(uname, password, canSudo, fname, lname) {\n\n\tif ('undefined' === typeof uname || 'string' !== typeof uname || !uname || '' === uname) {\n\t\n\t\treturn console.log('Cannot add user; username is invalid.');\n\t\n\t}\n\t\n\tif ('-h' === uname || '--help' === uname || 'help' === uname) {\n\t\n\t\tactionHelp('adminUser add', 'Add an admin user.', '[username] [password] [canSudo] [first name] [last name]');\n\t\treturn process.exit();\n\t\n\t}\n\t\n\tif ('undefined' === typeof fname || 'string' !== typeof fname || !fname || '' === fname) {\n\t\n\t\tfname = null;\n\t\n\t}\n\t\n\tif ('undefined' === typeof lname || 'string' !== typeof lname || !lname || '' === lname) {\n\t\n\t\tlname = null;\n\t\n\t}\n\t\n\tif ('undefined' === typeof password || 'string' !== typeof password || !password || '' === password) {\n\t\n\t\tconsole.log('Cannot add user; password is invalid.');\n\t\treturn process.exit();\n\t\n\t}\n\tif ('undefined' === typeof canSudo || 'string' !== typeof canSudo || !canSudo || '' === canSudo) {\n\t\n\t\tcanSudo = false;\n\t\n\t}\n\tvar rules = require('password-rules');\n\tvar pwInvalid = rules(password, {maximumLength: 255});\n\tif (pwInvalid) {\n\t\n\t\tconsole.log(pwInvalid.sentence);\n\t\treturn process.exit();\n\t\n\t}\n// \tvar users = new UserModel();\n\tvar now = new Date();\n\tvar newUserObj = {\n\t\t'fName': fname,\n\t\t'lName': lname,\n\t\t'uName': uname,\n\t\t'createdAt': now,\n\t\t'updatedAt': now,\n\t\tpassword,\n\t\t'sudoer': ('string' === typeof canSudo && 'true' === canSudo.toLowerCase()) ? true : false\n\t};\n\tglobal.Uwot.Users.createNew(newUserObj, function(error, user) {\n\t\n\t\tif (error) {\n\t\t\n\t\t\tconsole.log(error.message);\n\t\t\treturn process.exit();\n\t\t\n\t\t}\n\t\tconsole.log('User \"' + uname + '\" has been created (id ' + user._id + ').');\n\t\treturn process.exit();\n\t\n\t});\n\n}", "function create(username, password)\n{\n return userModel.create(\n {\n version: CURRENT_VERSION,\n username: username,\n password: password\n }\n );\n}", "function createUser(){\n return {\n userName: faker.internet.userName(),\n avatar: faker.internet.avatar(),\n id: faker.random.uuid(),\n isStaff: faker.random.boolean() && faker.random.boolean()\n }\n}", "static async create(username, password, name) {\n const response = await axios.post(`${BASE_URL}/signup`, {\n user: {\n username,\n password,\n name,\n }\n });\n // build a new User instance from the API response\n const newUser = new User(response.data.user);\n // attach the token to the newUser instance for convenience\n newUser.loginToken = response.data.token;\n\n return newUser;\n }", "function create(userInfo) {\n \n let user = new User(userInfo);\n return userDao.save(user)\n}", "function createNewUser(username, password, email) {\n return dbinit.then(function(initDB) {\n\t\treturn initDB.User.create({\n\t username: username,\n\t\t\tpassword: password,\n\t\t\temail: email\n\t });\n\t})\n}", "function developerCreate(name, password, email, role, cb) {\n //object for developer details\n developerDetail = {name:name , password: password, email: email, role:role } \n \n const developer = new User(developerDetail);\n developer.save(function (err) {\n if (err) {\n cb(err, null)\n return\n }\n console.log('New Developer: ' + developer);\n users.push(developer)\n cb(null, developer)\n } );\n }", "addNewUser(emailInput, nameInput , passwordInput) {\n this.setState({ newUserEmail: emailInput, newUserName: nameInput, newUserPassword: passwordInput, loggedIn: true, username: nameInput } )\n\n let createdUser = new createUser(this.state.newUserEmail, this.state.newUserName, this.state.newUserPassword);\n userList.push(createdUser); \n }", "create(req, res) {\n if (!req.body.firstName && !req.body.lastName && !req.body.prefEmail) {\n return res.status(400).send({'message': 'All fields are required'})\n }\n const currentUser = UserModel.create(req.body);\n return res.status(201).send(currentUser);\n }", "async createUser(user) {\n try {\n const result = await this.axiosInstance.post(\"/users\", user);\n return result;\n } catch (err) {\n helpMeInstructor(err);\n return err;\n }\n }", "function createUser(user) {\n return fetch('https://wbdv-generic-server.herokuapp.com/api/alkhalifas/users', {\n method: 'POST',\n body: JSON.stringify(user),\n headers: {\n 'content-type': 'application/json'\n }\n })\n .then(response => response.json())\n }", "function createUser(req, res, next) {\n const sql = sqlString.format(`INSERT INTO users SET ?`, req.body)\n\n db.execute(sql, (err, result) => {\n if (err) return next(err)\n res.send('New user added successfully')\n })\n}", "function createNewUser(data){\n let msg = {\n jsonrpc: '2.0',\n id: '0',\n method: 'setUser',\n params: data,\n };\n console.log(\"Making new user request\" )\n doSend(msg); \n}", "function registerUser() {\n let email = $(\"#txtEmail\").val();\n let pass= $(\"#txtPassword\").val();\n let first= $('#txtFirst').val();\n let last = $('#txtLast').val();\n let age = $('#txtAge').val();\n let address = $('#txtAddress').val();\n let phone = $('#txtPhone').val();\n let payment = $('#txtPayment').val();\n let color = $('#txtColor').val();\n\n let user = new User(email, pass, first, last, age, address, phone, payment, color);\n console.log(user);\n\n saveUser(user); // This function is on the storeManager\n clearUser();\n\n}", "_registerUser(id){\n\t\tthis.idUser = id;\n\t}", "function createUser(user) {\n\t// Checks if the user exists.\n\tif (user === undefined)\n\t\treturn Response(404);\n\n\t// Create and add the new user to the holder\n\tvar user = pushToArray(users, new User(nextUserId(), user.name, user.email));\n\n\treturn Response(200, generateIdOutput(user.id));\n}", "async insertUser() {\n\n //validate\n let validate = await this.validate(this.getBody(), {\n 'account': 'required',\n 'password': 'required|min:6|max:30',\n 'name': 'required',\n 'email': 'required|email',\n 'phone': 'required|phone',\n 'gender': 'required|userGender',\n }, {\n 'account.required': 'account không được bỏ trống',\n 'name.required': 'name không được bỏ trống',\n 'email.required': 'email không được bỏ trống',\n 'phone.required': 'phone không được bỏ trống',\n 'email.email': 'email không đúng định dạng',\n 'gender.required': 'gender không được bỏ trống',\n 'gender.userGender': 'gender không đúng định dạng',\n 'password.required': 'password không được bỏ trống',\n 'password.min': 'password không được nhỏ hơn 6 ký tự',\n 'password.max': 'password không được quá 30 ký tự',\n 'phone.phone': 'phone không đúng định dạng',\n });\n\n if (validate.fails()) {\n this.response(validate.messages(), 422);\n return false;\n }\n try {\n //thuc hien insert\n let newUser = await this.model.users.create({\n 'account': this.getInput('account'),\n 'password': this.myFunc.makehash(this.getInput('password')),\n 'name': this.getInput('name'),\n 'email': this.getInput('email'),\n 'phone': this.getInput('phone'),\n 'avatar': null,\n 'status': userType.CONST_STATUS_AVAILABLE,\n 'createdAt': moment().format('YYYY-MM-DD HH:hh:ss'),\n 'updatedAt': moment().format('YYYY-MM-DD HH:hh:ss'),\n });\n\n this.response({ status: true, id: newUser.id });\n\n } catch (error) {\n this.response({ status: false }, 422);\n }\n }", "createUsuario(username) {\n /* Crea un artista y lo agrega a unqfy. */\n this._validarParametros({username:username}, [\"username\"]);\n this._validarDisponibilidadNombreUsuario(username, \"createUsuario\");\n\n const usuarioNuevo = new Usuario(username);\n this._usuarios.push(usuarioNuevo);\n return usuarioNuevo;\n }", "function userCreate(firstName, lastName, userName, password, email, type, company, companyUrl) {\n var job = [{\n type,\n company,\n companyUrl\n }, {\n type,\n company,\n companyUrl\n }];\n var userDetail = {\n firstName,\n lastName,\n userName,\n email,\n password,\n job\n };\n var user = new User(userDetail);\n return user.save(); // returner et promise.\n}", "function createUser(body, next) {\n var url = '/api/users/new';\n request\n .post(url)\n .send(body)\n .accept('application/json')\n .end(function(err, res){\n if(err) { return console.error(err); }\n next(res.body);\n });\n}" ]
[ "0.8000366", "0.766553", "0.7545109", "0.75274885", "0.7477783", "0.73052883", "0.7298886", "0.72558606", "0.7185484", "0.71478766", "0.71478766", "0.7132831", "0.711105", "0.71082383", "0.70794857", "0.7060106", "0.7052198", "0.7050467", "0.7050409", "0.7005526", "0.6987585", "0.69765824", "0.6954137", "0.69320345", "0.69116414", "0.69062597", "0.6893155", "0.687693", "0.68576103", "0.6849168", "0.68444824", "0.6822602", "0.682008", "0.6806739", "0.67970747", "0.6793393", "0.67787987", "0.67686564", "0.6763279", "0.675881", "0.6757917", "0.6747011", "0.67303", "0.67303", "0.67292744", "0.67279696", "0.67247134", "0.67166305", "0.6715318", "0.6711965", "0.67106885", "0.6701245", "0.6700598", "0.6691542", "0.66899896", "0.6683405", "0.6672641", "0.66605985", "0.66596097", "0.66574436", "0.6648353", "0.66428065", "0.6637764", "0.66286725", "0.66260636", "0.661841", "0.6614768", "0.6603962", "0.6590642", "0.65902317", "0.65901273", "0.65861887", "0.6579372", "0.65786815", "0.6577346", "0.65767044", "0.6575461", "0.65709496", "0.657045", "0.6565872", "0.65636843", "0.6560244", "0.6552431", "0.65495616", "0.65472335", "0.6547098", "0.6546511", "0.65442896", "0.65431184", "0.6542415", "0.65411097", "0.6541097", "0.6541074", "0.65384704", "0.6535533", "0.65242434", "0.65195256", "0.65133697", "0.65130454", "0.6510999", "0.6509546" ]
0.0
-1
Get My Data of a connected user (meme fonction pour Api et ApiAdmin)
GetMyData(App, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin ApiGetMyData, Data: App=" + App, User, UserId) let MongoObjectId = require('./Mongo.js').MongoObjectId // Definition de la Query de Mongo const Query = {'_id': new MongoObjectId(UserId)} // Definition de la projection de Mongo en fonction du type de user let Projection = { projection:{ _id: 0, [this._MongoVar.LoginUserItem]:0, [this._MongoVar.LoginAdminItem]:0}} // Find de type Promise de Mongo this._Mongo.FindPromise(Query,Projection, this._MongoVar.UserCollection).then((reponse)=>{ if(reponse.length == 0){ this.LogAppliError("Wrong UserId", User, UserId) res.json({Error: true, ErrorMsg: "Wrong UserId", Data: null}) } else { // les password sont effacés de la réponse reponse[0][this._MongoVar.LoginPassItem]="" reponse[0][this._MongoVar.LoginConfirmPassItem]="" // la reponse est envoyée res.json({Error: false, ErrorMsg: "User data in DB", Data: reponse}) } },(erreur)=>{ this.LogAppliError("ApiGetMyData DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: null}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getUserDetails() {\n return this.api.send('GET', 'user');\n }", "getUserInfo() {\n if (this.infos && this.infos.length > 0)\n return;\n this.client.request(\"GET\", \"users/current\").then((response) => {\n this.infos = response.body;\n this.connect();\n });\n }", "async getUser() {\n // call auth info api with session token\n const response = await this.call(\"GET\", \"/api/auth/info\");\n // parse response\n const userinfo = JSON.parse(response.content);\n return userinfo;\n }", "getUserInfos() {\n return Api.get(\"client/user-infos\");\n }", "function getUserFromDb() {\r\n console.log('clientApp: getting user data from db');\r\n $http({\r\n method: \"GET\",\r\n url: 'acct/getUser'\r\n }).then(function (response) {\r\n //console.log('clientApp: retrieved user:', response);\r\n //console.log('clientApp: current user: ',response.data.email);\r\n //console.log('clientApp: current sisbot: ',response.data.curSisbot);\r\n //console.log('clientApp: current available sisbots: ',response.data.sisSerials);\r\n vm.sisSerials = response.data.sisSerials;\r\n vm.curSisbot = response.data.curSisbot;\r\n\r\n displayUIdata();\r\n })\r\n }", "function getCurrentUserData(){\n\n ApiCalls.getCurrentUser()\n .then((res) => {\n //console.log(\"current\" ,res.data);\n setCurrentUser(res.data);\n }\n ) \n}", "async getUserData() { }", "function getUserData () {\n\t\n\t$.ajax({\n\t\ttype: 'POST',\n\t\turl: 'Project',\n\t\tdata: {\n\t\t\t'domain': 'project',\n\t\t\t'action': 'getUserInfo'\n\t\t}, complete: function (data) {\n\t\t\tif(data.responseJSON) {\n\t\t\t user = data.responseJSON;\n\t\t\t console.log(\"USER = \", user);\n\t\t\t if(user.permission.canAccessAdminPage == false) hideAdminContent();\t \n\t\t getUsers();\t\t \n\t\t\t\t\n\t\t\t} else {\n\t\t\t\tconsole.log(\"GetUserData() RESPONSE = \",data);\n\t\t\t\talert('Server Failure!');\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t});\n}", "function getUser() {\n var userEmail = '[email protected]';\n var user = AdminDirectory.Users.get(userEmail);\n Logger.log('User data:\\n %s', JSON.stringify(user, null, 2));\n}", "async function getUserData() {\n const resp = await supervise_rq(() => axios(API_PATHS.AUTH_WHOAMI));\n\n if (resp.status === STATUS.SUCCESS) {\n dispatch({\n type: AUTH_ACTIONS.AUTH_GET_USER,\n payload: resp.data,\n });\n }\n return resp.data;\n }", "async getInfo() {\n let userResult = await this.request(\"user\");\n return userResult.user;\n }", "getUser(id){\n //postDB(\"user/Get\", { \"use_id\" : id });\n return { \"name\" : \"steven\", \"img\" : '', \"share\" : false };\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "async getUser() {\n return (await this._client.helix.users.getUserById(this._data.user_id));\n }", "getAllUser(){\n return this.auth.get(\"/user\", {}).then(({data})=> data);\n }", "getUserFullData() {\n let user = this.getUser()\n return {\n id: user.id,\n name: user.name,\n followers: this.getFollowers(),\n following: this.getFollowing(),\n feed: this.createUserFeed()\n }\n }", "getUserData() {\n console.log(\"Make a DB query...\");\n return {\n user_id: this.userId,\n name: \"AAA\",\n age: 12,\n };\n }", "getUserInfo(){\n return getUser()\n }", "GetUserDataStructure(Data, res, User, UserId){\n this.LogAppliInfo(\"Call ApiAdmin GetUserDataStructure, Data: \" + Data, User, UserId)\n let reponse=[]\n // Data strucutre d'un user\n reponse.push(this._MongoVar.LoginUserItem)\n reponse.push(this._MongoVar.LoginFirstNameItem)\n reponse.push(this._MongoVar.LoginLastNameItem)\n reponse.push(this._MongoVar.LoginPassItem)\n reponse.push(this._MongoVar.LoginConfirmPassItem)\n reponse.push(this._MongoVar.LoginAdminItem)\n res.json({Error: false, ErrorMsg: \"User data structure\", Data: reponse})\n }", "function getUser () {return user;}", "GetUserData(Data, res, User, UserId){\n this.LogAppliInfo(\"Call ApiAdmin GetUserData, Data: \" + JSON.stringify(Data), User, UserId)\n let MongoObjectId = require('./Mongo.js').MongoObjectId\n // Definition de la Query de Mongo\n const Query = {'_id': new MongoObjectId(Data.UsesrId)}\n // Definition de la projection de Mongo en fonction du type de user\n let Projection = {projection:{}}\n // Find de type Promise de Mongo\n this._Mongo.FindPromise(Query,Projection, this._MongoVar.UserCollection).then((reponse)=>{\n if(reponse.length == 0){\n this.LogAppliError(\"Wrong UserId\", User, UserId)\n res.json({Error: true, ErrorMsg: \"Wrong UserId\", Data: null})\n } else {\n // les password sont effacés de la réponse\n reponse[0][this._MongoVar.LoginPassItem]=\"\"\n reponse[0][this._MongoVar.LoginConfirmPassItem]=\"\"\n // la reponse est envoyée\n res.json({Error: false, ErrorMsg: \"User data in DB\", Data: reponse})\n }\n },(erreur)=>{\n this.LogAppliError(\"ApiAdminGetUserData DB error : \" + erreur, User, UserId)\n res.json({Error: true, ErrorMsg: \"DB Error\", Data: null})\n })\n }", "function getInfo (id, authorisation, self) {\n var url = `${API_URL}/user?id=${id}`; \n if (self == 'self') { \n console.log(`${self}`);\n url = `${API_URL}/user`\n };\n return fetch(url, {\n method: 'GET',\n headers: {\n 'Authorization': `Token ${authorisation}`\n },\n })\n .then(res => {\n //catch 403 status \n if (res.status === 403) {\n alert(\"Invalid auth token\");\n } \n return res.json();\n })\n .catch(error => {\n alert(\"He's dead Jim (Issue getting user information)\");\n });\n}", "function getUserData (req, res, next) {\n db.oneOrNone(`SELECT * FROM \"user\" WHERE user_id = $1`, [req.params.user_id])\n .then((user) => {\n res.rows = user;\n next();\n })\n .catch(err => next(err));\n}", "function GetUsers() {\n UserApi.getUser().then(function (response) {\n $scope.user = response.data;\n }), function () {\n aler(\"Unable to load users info\");\n }\n }", "getUser(idUser) {\n this.helper.publish(JSON.stringify(idUser), Constants.USERS, Constants.GET_USER, (err, user) => {\n this.sockets.forEach((socket) => {\n if (err) socket.emit(Constants.ERROR);\n else socket.emit(Constants.USER_RETURNED, user);\n });\n });\n }", "function getUser(){\n return user;\n }", "getUserData() {\n return JSON.parse(localStorage.getItem(SIMPLEID_USER_SESSION));\n }", "getUserById(id){\n return this.auth.get(`/user/${id}`,{}).then(({data})=> data);\n }", "function getUser() {\n fetch(\"http://localhost/todo\").then((result) =>\n result.json().then((resp) => console.log(\"resp\", resp))\n );\n }", "function getUserData(){\n if(self.user !== null){\n return $q.when(self.user);\n }else{\n return $http.get('/api/auth/me')\n .then(function (result) {\n self.user = result.data;\n return $q.when(self.user);\n })\n .catch(function(error){\n return $q.reject('Unable to get remote user data. '+error.data);\n });\n }\n }", "function getConnectedUser() {\n\n //recup val bouton\n /*var xml = ( window.XMLHttpRequest ) ?\n new XMLHttpRequest() : new ActiveXObject(\"Microsoft.XMLHTTP\");\n\n xml.open(\"GET\", user/myName, true);\n xml.setRequestHeader(\"Content-type\", \"application/json\");\n\n xml.onreadystatechange = function()\n {\n if( xml.readyState === 4 &&\n xml.status === 200 )\n {\n var serverResponse = JSON.parse(xml.responseText);\n switch(serverResponse.d)\n {\n //GET user id et stocker sous forme userID =\n }\n }\n }\n xml.send(null);\n */\n }", "getUser() {\n APIManager.getUserById(this.props.currentUser).then(user => {\n this.getCollectorLevel(user);\n });\n }", "getUserInfo(DB, request, response) {\n\t\ttry {\n\t\t\tDB.get_user_info(request.params.auth_id).then((userData) => {\n\t\t\t\tif (userData[0]) response.status(200).send(userData[0]);\n\t\t\t\telse response.status(404).send('User Not Found...');\n\t\t\t});\n\t\t} catch (err) {\n\t\t\tresponse.status(404).send(err);\n\t\t\tconsole.log('Something went wrong ' + err);\n\t\t}\n\t}", "get apiUser() { return this.get('apiUser'); }", "function userQuery (){\n console.log('userQuery initialized')\n // uses the windows url and sets it to a variable and passes it down to the api GET request\n let currentUrl = window.location.origin;\n\n // api GET request\n $.ajax ({url: `${currentUrl}/api/user`, method: \"GET\"})\n\n .done(function(userData){\n \n // sets the html in friend_head3 to the users name\n $(\"#friend_head3\").html(`<h3>${userData[0].name}</h3>`);\n \n // sets the JSON object to userDataVariable so that its globaly accesable\n userDataVariable = userData[0];\n\n });\n}", "getUserList(data){\nreturn this.post(Config.API_URL + Constant.USER_GETUSERLIST, data);\n}", "getAllUserData () {\n return this.allUserData\n }", "function fetchUserData(){\r\n\t\tif($localStorage.rondin_admin_token && $localStorage.rondin_access_level){\r\n\t\t\t$scope.rondin_admin_token = $localStorage.rondin_admin_token;\r\n\t\t\t$scope.rondin_access_level = $localStorage.rondin_access_level; \r\n\t\t\t$http.get('../php/db_transactions/isAdmin.php', {params:{\"admin_token\": $scope.rondin_admin_token, \"access_level\": $scope.rondin_access_level}}).then(function successCallback(response){\r\n\t\t\t\tif(response.data.status === \"found\"){\r\n\t\t\t\t\t$scope.rondin_logs = response.data.logs;\r\n\t\t\t\t\t$scope.rondin_tags = response.data.tags;\r\n\t\t\t\t\t$scope.rondin_isAdmin = $localStorage.rondin_isAdmin = {\"status\": true, \"name\": response.data.nom_operador, \"access_level\": response.data.access_level};\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t\t$timeout(function(){\r\n\t\t\t\t$scope.isRouteLoading = false;\r\n\t\t\t},2000);\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$localStorage.rondin_isAdmin = {\"name\": \"\", \"status\": false, \"access_level\": \"\"};\r\n\t\t\t$timeout(function(){\r\n\t\t\t\t$scope.isRouteLoading = false;\r\n\t\t\t},2000);\r\n\t\t}\r\n\t}", "function getProfileData() {\n // obtener los datos del usuario al iniciar sesión\n IN.API.Raw(\"people/~:(first-name,last-name,id,num-connections,picture-url,location,positions,summary,public-profile-url)\").result(onSuccess).error(onError); \n }", "async getUserDetails(){\n const res = await Api.get('url', true);\n }", "function getMe(req, res) {\n res.json(req.user);\n}", "async getUser () {\n\t\tthis.user = await this.data.users.getById(this.tokenInfo.userId);\n\t\tif (!this.user || this.user.get('deactivated')) {\n\t\t\tthrow this.errorHandler.error('notFound', { info: 'user' });\n\t\t}\n\t}", "function getUserDetails() {\n\t\tvar baseUrl = 'https://mywell-server.vessels.tech';\n\n\t\treturn $http({\n\t\t\tmethod: \"get\",\n\t\t\turl: baseUrl + \"/api/user/current\"\n\t\t});\n\t}", "get user() {\n return this._model.data\n }", "async function getUser() {\r\n const response = await fetch('http://68.7.7.158:8181/api/v2?apikey=*************************&cmd=get_user_names');\r\n const json = await response.json();\r\n return json;\r\n}", "function pullUserData(){\n var xmlHttp = null;\n xmlHttp = new XMLHttpRequest();\n xmlHttp.onreadystatechange = function() {\n if (xmlHttp.responseText && xmlHttp.status == 200 && xmlHttp.readyState == 4) {\n var obj = jQuery.parseJSON( xmlHttp.responseText );\n $.each(obj, function() {\n FirstName[FirstName.length] = this['firstName'];\n LastName[LastName.length] = this['lastName'];\n if(h[this['_id']] != null){\n ID[ID.length] = h[this['_id']];\n }else{\n ID[ID.length] = \"Not Found\";\n }\n \n });\n }\n };\n xmlHttp.open(\"GET\", \"https://mydesigncompany.herokuapp.com/users\", true);\n //xmlHttp.open(\"GET\", \"https://infinite-stream-2919.herokuapp.com/users\", true);\n xmlHttp.send(null);\n }", "function getAllUser(){\n return $http.get(url.user).then( handleSuccess, handleError );\n }", "function getLoginDetails() {\n var deferred = $q.defer();\n $http.get(\"http://api.everlive.com/v1/IMregDJC77R1b1yM/Users/\")\n .success(function (data) {\n deferred.resolve(data);\n console.log(data);\n })\n .error(function () {\n console.log(\"Error via making http calls\");\n deferred.reject();\n });\n return deferred.promise;\n }", "async function getUserInfos () {\n debug('user', `api endpoint is ${api}`)\n let accessToken = await getAccessToken()\n\n return got(\n new URL('v1/users', api),\n Object.assign({}, defaultApiConfiguration, {\n query: {\n me: true\n },\n headers: {\n 'Authorization': `Bearer ${accessToken}`\n }\n })\n )\n .then(({ body: { data: [ userInformations ] } }) => {\n debug('user ok', user)\n user = userInformations\n return userInformations\n })\n .catch(({ code, response, statusCode, url }) => {\n debug('user ko', code, statusCode, response, url)\n let error\n if (response) {\n error = new Error(`User informations retrieval failed.\\nServer replied with a ${statusCode} status and body: ${JSON.stringify(response.body)}`)\n } else {\n error = new Error(`User info retrieval errored. Code: ${code}, status: ${statusCode}. URL: ${url}`)\n }\n return Promise.reject(error)\n })\n}", "async function getProfileData() {\n const data = await axios.get(`/api/current_user`)\n return data\n }", "function getCoachUser(user_param) {\n\n var url_params = 'user_id=' + user_param;\n\n $http.get('http://localhost:3000/api/v1' + '/users?' + url_params)\n .then(success, error);\n\n // success\n function success(resp) {\n console.log('User result: ', resp);\n $scope.users = resp.data.data;\n }\n // error\n function error(resp) {\n console.log(resp);\n }\n }", "function getUser() {\n return user;\n }", "get(callback) {\n api.get(\n 'user',\n null, null,\n result.$createListener(callback)\n );\n }", "function getUserInfo() {\n\t\t\treturn User.getUser({\n\t\t\t\tid: $cookieStore.get('userId')\n\t\t\t}).$promise.then(function(response) {\n\t\t\t\tswitch(response.code) {\n\t\t\t\t\tcase 0: {\n\t\t\t\t\t\t$scope.ganbaru.username = response.data.username;\n\t\t\t\t\t}\n\t\t\t\t\tdefault: {\n\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}, function() {\n\t\t\t\t//Handling error\n\t\t\t});\n\t\t}", "get(callback) {\n api.get(\n 'user',\n null, null,\n result.$createListener(callback)\n )\n }", "static async getUserInfo(userId) {\n let res = await db.query('SELECT username, mail FROM users WHERE id = $1', [userId]);\n return res.rows[0];\n }", "async getUserData(id) {\n return User.findByPk(id);\n }", "getUserData() {\n\t\tfetch(\"/api/users/\"+userid+\"/\", {\n\t\t\tmethod: 'GET',\n\t\t\tcredentials: \"same-origin\",\n\t\t\theaders : new Headers(),\n\t\t\theaders: {\n\t\t\t\t \"X-CSRFToken\": csrftoken,\n\t\t\t\t 'Accept': 'application/json',\n\t\t\t\t 'Content-Type': 'application/json',\n\t\t\t},\n\t\t})\n\t\t.then(res => res.json())\n\t\t.then(\n\t\t\t(result) => {\n\t\t\t\tthis.setState({\n\t\t\t\t\tmy_posts: result.posts,\n\t\t\t\t\tmy_comments: result.comments,\n\t\t\t\t\tmy_upvoted: result.comments_upvoted,\n\t\t\t\t\tmy_downvoted: result.comments_downvoted,\n\t\t\t\t});\n\t\t\t}\n\t\t)\n\t}", "async getCurrentUser() {\n const options = this.buildOptions({\n path: `${this.path}/user`,\n method: \"get\",\n body: {},\n });\n\n return this.apiCall(options);\n }", "allUsers() {\r\n this.log(`Getting list of users...`);\r\n return this.context\r\n .retrieve(`\r\n SELECT emailAddress, password\r\n FROM Users\r\n `\r\n )\r\n }", "async getUser(uid) {\n console.log('GET /user/%s', uid)\n return this.server.getUser(uid)\n }", "getUserById(id) {\n return this.http.get(\"http://localhost:8080/api/users/\" + id);\n }", "static getAllUsers() {\n return fetch('https://dev-selfiegram.consumertrack.com/users').then(response => {\n return response.json();\n }).catch(error => {\n return error;\n });\n }", "static getUsers() {\n return API.fetcher(\"/user\");\n }", "async user(parent,{id},{dataSources}) { \n const user = await dataSources.users.getUser(id)\n return user;\n }", "getUser(token,username){\n var myHeaders = new Headers();\n myHeaders.append('Content-Type', 'application/json');\n myHeaders.append('accept', 'application/json');\n myHeaders.append('Authorization',`Bearer ${token}`);\n var myInit = { \n method: 'GET',\n headers:myHeaders\n };\n return this.makeAPIRequest('user/?username='+username,myInit);\n }", "async getUsers() {\n let res = await fetch('/users', {credentials: 'include', headers: {'Content-Type': 'application/json'}})\n let v = await res.json()\n return v\n }", "static list(req, res) {\n // access_token\n console.log(\"article lists\")\n const dataUserId = req.userData.id\n console.log(dataUserId)\n\n Article.findAll({\n where: {UserId: dataUserId}\n })\n .then((articles) => {\n res.status(200).json(articles)\n })\n .catch((err) => {\n res\n .status(500)\n .json({ message: err.message || 'internal error server' })\n })\n }", "function api_getuser(ctx) {\n api_req({\n a: 'ug'\n }, ctx);\n}", "static getUser(userId) {\n const req = new Request(`/api/users/${userId}`, {\n method : 'GET',\n headers : this.requestHeaders()\n });\n return fetch(req).then(res => this.parseResponse(res))\n .catch(err => {\n throw err;\n });\n }", "getUserData() {\n return this.userData;\n }", "static getUser() {\n return JSON.parse(localStorage.getItem('userInfo'));\n }", "getUserInfo() {\n return Axios.get(\"/api/users/forum/info\");\n }", "function getUser(id){\n return fetch(`http://localhost:3000/users/${id}`)\n .then(res => res.json())\n }", "getUserDataForLogin(existingUser){\n return fetch(`${remoteURL}/users?name=${existingUser.name}&email=${existingUser.email}`)\n .then(response => response.json())\n }", "function getUserData() {\n if (document.getElementById(\"current-user\")) {\n currentUser = JSON.parse(document.getElementById(\"current-user\").textContent);\n console.log(\"==Retrived user info:\", currentUser);\n console.log(\"Succesfully logged in as\\nUsername:\", currentUser.username, \"\\nDisplay Name:\", currentUser.displayName);\n if (!(currentUser.username && currentUser.displayName)) {\n alert(\"Error: You have been logged out due to an error in function \\\"getUserData\\\" in index.js or \\\"app.use\\\" in server.js.\");\n currentUser = \"\";\n } else {\n updateDisplayLogin();\n }\n }\n}", "getUserByEmail(data){\nreturn this.get(Config.API_URL + Constant.USER_GETUSERBYEMAIL, data);\n}", "function fetchUserInfo(){\n\t gapi.client.load('oauth2', 'v1', function(){\n\t var userinfo = gapi.client.request('oauth2/v1/userinfo?alt=json');\n\t userinfo.execute(function(resp){\n\t window.user={\n\t \t\"email\":resp.email,\n\t \t//\"name\":resp.given_name,\n\t \t//\"id\":resp.id\n\t }\n\t loadTimeline();\n\t });\n\t });\n\t }", "getMe (options) {\n return api('GET', '/user/self', options)\n }", "static async getUser(req, res) {\n const id = req.params.id;\n\n try {\n const user = await userModel.find(id);\n res.status(200).json(user);\n } catch (err) {\n res.status(404).json({ message: err.message });\n }\n }", "function getUser() {\n return {\n name: 'Awotunde',\n handle: '@egunawo33', \n location: 'Orun, Aye'\n }\n}", "function userInfo(api, id, next){\n api.users.info({\n user: id\n }, function (err, res) {\n next(err, res.user);\n });\n }", "function userInfo(api, id, next){\n api.users.info({\n user: id\n }, function (err, res) {\n next(err, res.user);\n });\n }", "async getUser(ctx) {\n\n try {\n const _id = ctx.request.params.id;\n const userData = await User.findById(_id);\n console.log(userData);\n if (!userData) {\n return ctx.body;\n }\n else {\n ctx.body = { userData };\n }\n }\n catch (error) {\n ctx.throw(error);\n }\n }", "function getUserData() {\n return {\n \"id\": Math.floor(Math.random() * 100 + 1),\n \"username\": generateName(),\n \"balance\":2500\n }\n}", "get userData() {}", "getCurrentUser() {\n return HTTP.get('users/me')\n .then(response => {\n return response.data\n })\n .catch(err => {\n throw err\n })\n }", "function getUserInformation(){\n console.log(userInformation);\n return userInformation;\n }", "function getUserDetails(data){\n console.log(\"Get User Data: \"+data);\n}", "function getUserData(id, type) {\n var queryUrl;\n switch (type) {\n case \"user\":\n queryUrl = \"/api/users/\" + id;\n break;\n case \"group\":\n queryUrl = \"/api/groups/\" + id;\n break;\n default:\n return;\n }\n $.get(queryUrl, function(data) {\n if (data) {\n console.log(data.GroupId || data.id);\n // If this user exists, prefill our cms forms with its data\n usernameInput.val(data.username);\n \n groupId = data.GroupId || data.id;\n // If we have a user with this id, set a flag for us to know to update the user\n // when we hit submit\n updating = true;\n }\n });\n }", "function getUserData(req, res){\r\n\t\r\n\tvar accountOwnerId = req.body.accountOwnerId;\r\n\tvar accountId = req.body.accountId;\r\n\tconsole.log(\"RouteJs accountId = : \"+accountId+\" Account Owner Id = : \"+accountOwnerId+\" LoggedIn User = : \"+req.session.email);\r\n\t\r\n\tif(con == null)\r\n\tcon = db.openCon(con);\r\n\tvar obj = {};\r\n\tobj.userdata = null;\r\n\tobj.companydata = null;\r\n\tobj.projectdata = null;\r\n\tPromise.all([\r\n\t\r\n\t\tnew Promise((resolve, reject) => {\r\n\t\t\tcon.query(\"SELECT * FROM users WHERE (email = ? )\", [req.session.email], function(err, result){\r\n\t\t\t\tif(err)console.log(err.stack);\r\n\t\t\t\tif (result.length > 0) {\r\n\t\t\t\t\tresolve(result[0]);\r\n\t\t\t\t}\r\n\t\t\t resolve(null);\r\n\t\t\t});\r\n\t\t}),\r\n\t\t\r\n\t\tnew Promise((resolve, reject) => {\r\n\t\t\tcon.query(\"SELECT * FROM companydetails WHERE accountId = ?\", [accountId], function(err, result){\r\n\t\t\t\tif(err)console.log(err.stack);\r\n\t\t\t\tif(result.length > 0){\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t}\r\n\t\t\t\tresolve(null);\r\n\t\t\t});\r\n\t\t}),\r\n\r\n\t\tnew Promise((resolve, reject) => {\r\n\t\t\tcon.query(\"SELECT * FROM companydetails c INNER JOIN projectdetails p ON c.id = p.companyId \"+\r\n\t\t\t\t\"WHERE c.accountId = ?\", [accountId], function(err, result){\r\n\t\t\t\tif(err)console.log(err.stack);\r\n\t\t\t\tif(result.length > 0){\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t}\r\n\t\t\t\tresolve(null);\r\n\t\t\t});\r\n\t\t}),\r\n\r\n\t\tnew Promise((resolve, reject) => {\r\n\t\t\tcon.query(\"SELECT * FROM useraccount WHERE accountId = ? \", [accountId], function(err, result){\r\n\t\t\t\tif(err)console.log(err.stack);\r\n\t\t\t\tif(result.length > 0){\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t}\r\n\t\t\t\tresolve(null);\r\n\t\t\t});\r\n\t\t}),\r\n \r\n\t\tnew Promise((resolve, reject) => {\r\n\t\t\tcon.query(\"select * from infradb.grouphasusers ghu \"+\r\n\t\t\t\t\t \"inner join infradb.grouphasroles ghr \"+\r\n\t\t\t\t\t \"on ghu.groupId = ghr.groupId \"+\r\n\t\t\t\t\t \"inner join infradb.roles r \"+\r\n\t\t\t\t\t \"on ghr.roleId = r.roleId \"+\r\n\t\t\t\t\t \"where ghu.accountId = ? and ghu.userId = ?\", [accountId,req.session.uid], function(err, result){\r\n\t\t\t\tif(err)console.log(err.stack);\r\n\t\t\t\tconsole.log(\"1519. roles result = : \"+JSON.stringify(result));\r\n\t\t\t\tif(result.length > 0){\r\n\t\t\t\t\tresolve(JSON.stringify(result));\r\n\t\t\t\t}\r\n\t\t\t\tresolve(null);\r\n\t\t\t});\r\n\t\t}),\r\n\r\n\t\tnew Promise((resolve, reject) => {\r\n\t\t\tcon.query(\"SELECT * FROM servers WHERE accountId = ? \", [accountId], function(err, result){\r\n\t\t\t\tif(err)console.log(err.stack);\r\n\t\t\t\tif(result.length > 0){\r\n\t\t\t\t\tresolve(result);\r\n\t\t\t\t}\r\n\t\t\t\tresolve(null);\r\n\t\t\t});\r\n\t\t}),\r\n\r\n\t]).then(function(results){\r\n\t\tobj.userdata = results[0];\r\n\t\tobj.companydata = results[1];\r\n\t\tobj.projectdata = results[2];\r\n\t\tobj.accountdata = results[3];\r\n\t\tobj.userroles = results[4];\r\n\t\tobj.serverdata = results[5];\r\n\t\tres.status(200).json(obj);\r\n\t});\r\n\t\r\n}", "function getUserInfo() {\n const apicall = 'http://localhost:3010/api/users/getUser';\n fetch(apicall, {\n method: 'GET',\n headers: Auth.headerJsonJWT(),\n }).then((response) => response.json())\n .then((json) => {\n if (json.useremail) {\n getMemberEvents(json.useremail);\n getMemberBusinesses(json.useremail);\n getPublicAndMemberEvents(json.useremail);\n setUserEmail(json.useremail);\n }\n\n if (window.location.href === 'http://localhost:3000/') {\n /* show all events */\n setSearchBoolean(false);\n } else {\n setSearchBoolean(true);\n const parsedURL = (window.location.href).split('?');\n /* stick parsedURL in an api call and pass it to search events */\n searchFromURL(parsedURL[1], json.useremail);\n }\n },\n (error) => {\n console.log(error);\n },\n );\n }", "async function userAccountData (req, res) {\n const tokenPayload = await validateToken(req, res)\n // console.log(tokenPayload)\n logger.info(`User email: ${tokenPayload.email}`)\n try {\n const data = await User.findOne({ where: { userEmail: tokenPayload.email } }, { attributes: ['id', 'isAdmin', 'userEmail', 'userName'] })\n if (data) {\n logger.info(`User data retrieved from api db: ${data}`)\n return res.status(200).send(data)\n }\n throw Error('No such user in local db')\n } catch (error) {\n logger.error(`User data retrieving error: ${error}`)\n // console.log(error)\n return res.sendStatus(404)\n }\n}", "function getTheCurrUser(){\r\n let xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n thisUser = JSON.parse(this.responseText);\r\n setup();\r\n\r\n }\r\n };\r\n\r\n xhttp.open(\"GET\", \"/thisUser\", true);\r\n xhttp.send();\r\n}", "function getTheCurrUser(){\r\n let xhttp = new XMLHttpRequest();\r\n xhttp.onreadystatechange = function() {\r\n if (this.readyState == 4 && this.status == 200) {\r\n thisUser = JSON.parse(this.responseText);\r\n setup();\r\n\r\n }\r\n };\r\n\r\n xhttp.open(\"GET\", \"/thisUser\", true);\r\n xhttp.send();\r\n}", "static async getUser() {\n return new Promise((resolve, reject) => {\n axios.get('/auth/user', {\n headers: {'Authorization': `bearer ${Auth.getToken()}`}\n }).then(res => {\n //return res.data.user;\n resolve(res.data.user);\n }).catch(err => {\n //return err.response;\n reject(err);\n });\n });\n }", "function getUserList(){\r\n var userListforGet = [];\r\n for(var i=0;i<chatAppUsers.length;i++){\r\n userListforGet.push(chatAppUsers[i].currentUser);\r\n }\r\n return userListforGet;\r\n}", "static async getUsers() {\n return await this.request('users/', 'get');\n }" ]
[ "0.72843176", "0.7184237", "0.7150534", "0.71446437", "0.7125706", "0.7111886", "0.71086353", "0.70529735", "0.704693", "0.70374095", "0.7031903", "0.69895524", "0.6976439", "0.6976439", "0.6976439", "0.6976439", "0.69638866", "0.69608456", "0.69565874", "0.6942832", "0.69393367", "0.69173586", "0.68727124", "0.6863464", "0.6862821", "0.68619365", "0.6843422", "0.68252504", "0.68082464", "0.6802339", "0.6800799", "0.6757803", "0.67522764", "0.6743209", "0.6734071", "0.6730021", "0.67269", "0.6705108", "0.6704452", "0.6699355", "0.6695144", "0.6662467", "0.6652256", "0.66471505", "0.66431564", "0.663885", "0.66337556", "0.6630465", "0.6628547", "0.66225666", "0.6619046", "0.6615442", "0.66004884", "0.6599421", "0.65722966", "0.6565931", "0.65579915", "0.655351", "0.6552335", "0.6550289", "0.6546466", "0.65349823", "0.6534953", "0.6533586", "0.6531704", "0.6526074", "0.6525744", "0.65251815", "0.652485", "0.652382", "0.6521664", "0.65186656", "0.65178585", "0.651057", "0.65080297", "0.6505554", "0.65009004", "0.6499761", "0.64852756", "0.647854", "0.64727247", "0.64608514", "0.6443787", "0.6442099", "0.6442099", "0.64404213", "0.6437514", "0.6436117", "0.64324754", "0.643012", "0.6429799", "0.6428256", "0.64268136", "0.6424544", "0.64230525", "0.6422852", "0.6422852", "0.6421253", "0.64201033", "0.64198554" ]
0.7348648
0
Get des log de l'application
GetLog(Data, res, User, UserId){ this.LogAppliInfo("Call ApiAdmin GetLog, Skip data value: " + JSON.stringify(Data), User, UserId) // Si Data.LogInfoType = All alors tous les type const LogfInfoType = (Data.LogInfoType == "All") ? '.*' : Data.LogInfoType // Data.LogUser value const LogUser = Data.LogUser // Data.LogMessage value const LogMessage = Data.LogMessage let Query = {} // Si les date et heure sont vide if ((Data.LogDate == "") && (Data.LogHeure == "")){ Query = {$and:[{[this._MongoVar.LogAppliType]:{$regex:".*" + LogfInfoType + ".*"}},{[this._MongoVar.LogAppliUser]:{$regex:".*" + LogUser + ".*"}},{[this._MongoVar.LogAppliValeur]:{$regex:".*" + LogMessage + ".*"}}]} } else { if(Data.LogDate != ""){ let Ijour = parseInt(Data.LogDate.substring(0, 2)) let Imois = parseInt(Data.LogDate.substring(3,5))-1 let Iannee = parseInt(Data.LogDate.substring(6)) //let jour = Data.LogDate.substring(0, 2) //let mois = Data.LogDate.substring(3,5) //let annee = Data.LogDate.substring(6) let date = "" if (Data.LogHeure == ""){ let isoDate1 = new Date(Iannee, Imois, Ijour, 0, 0, 0, 0).toISOString() let isoDate2 = new Date(Iannee, Imois, Ijour, 23, 59, 59, 999).toISOString() date = { $gte:new Date(isoDate1), $lt:new Date(isoDate2) } //date = { $gte:new Date(annee+'-' + mois + '-' + jour +'T00:00:00.000Z'), $lt:new Date(annee+'-' + mois + '-' + jour +'T23:59:59.999Z') } } else { let Iheure = parseInt(Data.LogHeure.substring(0, 2)) let Iminute = parseInt(Data.LogHeure.substring(3)) let isoDate1 = new Date(Iannee, Imois, Ijour, Iheure, Iminute, 0, 0).toISOString() let isoDate2 = new Date(Iannee, Imois, Ijour, Iheure, Iminute, 59, 999).toISOString() date = { $gte:new Date(isoDate1), $lt:new Date(isoDate2) } //date = { $gte:new Date(annee+'-' + mois + '-' + jour +'T' + heure +':' + minute +':00.000Z'), $lt:new Date(annee+'-' + mois + '-' + jour +'T' + heure +':' + minute +':59.999Z') } } Query = {$and:[{[this._MongoVar.LogAppliType]:{$regex:".*" + LogfInfoType + ".*"}},{[this._MongoVar.LogAppliUser]:{$regex:".*" + LogUser + ".*"}},{[this._MongoVar.LogAppliValeur]:{$regex:".*" + LogMessage + ".*"}},{[this._MongoVar.LogAppliNow]:date}]} } else { Query = {$and:[{[this._MongoVar.LogAppliType]:{$regex:".*" + LogfInfoType + ".*"}},{[this._MongoVar.LogAppliUser]:{$regex:".*" + LogUser + ".*"}},{[this._MongoVar.LogAppliValeur]:{$regex:".*" + LogMessage + ".*"}}]} } } let mongocollection = this._MongoVar.LogAppliCollection const Projection = {} const Sort = {[this._MongoVar.LogAppliNow]: -1} this._Mongo.FindSortLimitSkipPromise(Query,Projection, Sort, 20, parseInt(Data.LogCursor), mongocollection).then((reponse)=>{ if(reponse.length == 0){ res.json({Error: false, ErrorMsg: "No Log in BD", Data: null}) } else { res.json({Error: false, ErrorMsg: "Log in DB", Data: reponse}) } },(erreur)=>{ this.LogAppliError("ApiAdminGetLog DB error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "DB Error", Data: ""}) }) }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLog() {\n\t\treturn this.log;\n\t}", "get log() {\n return this.config.log.logger\n }", "getClientLog() {\n\n }", "get log() {\n\t\treturn this._log;\n\t}", "getLog() {\n const { runtime, message, assert, expected } = this.opts;\n\n if (\n runtime === 'inabox' ||\n message.includes('Signing service error for google')\n ) {\n return logs.ads;\n }\n\n if (assert) {\n return logs.users;\n }\n\n if (expected) {\n return logs.expected;\n }\n\n return logs.errors;\n }", "get log() {\n if (!this._log) {\n const instanceName = `${this.constructor.name}@${node.getObjectId(this).substring(0, 4)}`;\n this._log = logger.getLogger(instanceName);\n }\n return this._log;\n }", "function getlogs()\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n return webphone_api.plhandler.getlogs();\n else\n webphone_api.Log('ERROR, webphone_api: getlogs webphone_api.plhandler is not defined');\n}", "function logs(appName, callback) {\n commons.get(format('/%s/apps/%s/logs/', deis.version, appName), callback);\n }", "async getLog(name) {\n let res = find(this.mission, { fileName: name })\n if (!res) return [];\n const logs = res.logModel;\n const list = await logs.findAll({ limit: 20 });\n return list.map((e) => {\n return { level: e.level, data: e.data, time: e.time };\n })\n }", "function _getLogs() {\n return _oLogs;\n }", "function getLogEvents() {\n var eventMap = {};\n if ( Logger.getLog().length > 0 ) {\n var arr = Logger.getLog().split(\"\\n\");\n for (var i in arr) {\n var str = arr[i];\n var regexResultArr = str.match(\"(.+?) INFO: (.+)\");\n var timestamp = regexResultArr[0];\n var event = regexResultArr[1];\n eventMap[i] = timestamp + \" \" + event;\n }\n }\n return eventMap;\n}", "function getLog(key){\n\tlet tmp = key.replace('log',''); //remove log prefix from the key to get the number\n\tlogNumber = Number(tmp); //parse the string into a number\n\tlocalforage.getItem('logs') //load the logs from memory\n\t.then((logs)=>{\n\t\tlet log = logs[key]; //get our log at the parameter key.\n\t\tconsole.log(log)\n\t\tfor(let field in log){ //itwerage over the fields of the log\n\t\t\tlet value = log[field];\n\t\t\tif(typeof value === \"string\") //if the field is a string, it goes to a text input\n\t\t\t\t$(`.${field}`).val(value);\n\t\t\telse if(value){ //or else it is a checkbox\n\t\t\t\t$(`input[val=${field}]`).prop('checked',true);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(`input[val=${field}]`).prop('checked',false);\n\t\t\t}\n\t\t}\n\t})\n\n\treturn\n}", "get log () {\n return this.autos.log;\n }", "function log(){\n var args = Array.prototype.slice.call(arguments);\n args.unshift('(app)');\n console.log.apply(console, args);\n}", "function getLog() {\n var procGitLog = cp.spawn(\n 'git',\n ['--no-pager', 'log', '--color=never', '--pretty=format:commit:%H', '-U0', 'origin/lkgr', 'chrome/VERSION'],\n {cwd: 'src', stdio: ['ignore', 'pipe', process.stderr]}\n );\n var log = '';\n procGitLog.stdout.setEncoding('utf8');\n procGitLog.stdout.on('data', function (data) {\n log += data;\n });\n procGitLog.on('exit', function (code, signal) {\n if (!signal) {\n if (code) { // w/ error, exit\n console.log('[Error]: %s', 'git log failed');\n process.exit(1);\n }\n else { // succeeded\n //console.log(log);\n searchLog(log);\n }\n }\n });\n}", "logView() { return this.call('App.logView', {'host':this.host}, 1); }", "function logLevel() {\n var match = /[?&]log=([a-z]+)/.exec(window.location.search);\n return match ? match[1] : \"\";\n }", "function log() {\n\ttry { \n\t\tconsole.log(\n\t\t\tshowOnly(logjs).forFilter(\n\t\t\t\t{\n\t\t\t\t\tapp: \"opsebf\",\n\t\t\t\t\tdate: \"20180623\",\n\t\t\t\t\tafter: \"1900\",\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}\n\tcatch(err) {\n\t\tvar msg = \"opsebf logs only in development stage\";\n\t\tconsole.warn(msg);\n\t}\n}", "getXmppLog() {\n return (this.connection.logger || {}).log || null;\n }", "async function getLogs() {\n\tconst filenames = await fsp.readdir(path.resolve(__dirname, '../../logs'));\n\tconst logs = [];\n\tfor (const filename of filenames) {\n\t\tif (!filename.includes('.log')) continue;\n\t\tlogs.push({\n\t\t\tname: filename,\n\t\t\tdate: filename.substr(11, 10)\n\t\t});\n\t}\n\treturn logs;\n}", "log(...args) {\n return this.getInstance().log(...args);\n }", "function initLog() {\n\n console.log('estaticoHomeCtrl init');\n }", "listOfLogs() {\n\t\treturn this.bot.autobot.inventory.listBlocksByRegEx(/_log$/);\n\t}", "getXmppLog() {\n return (this.connection.logger || {}).log || null;\n }", "function initLogs(){\n\tif(!localforage){\n\t\talert('failed to load localforage!');\n\t\treturn;\n\t}\n\n\treturn localforage.getItem('maxLogNumber')\n\t.then((result)=>{\n\t\tif(result)\n\t\t\tmaxLogNumber = result;\n\t})\n\t.then(()=>localforage.getItem('logs'))\n\t.then((logs)=>{\n\t\tpopulateLogs(logs,false);\n\t})\n\t.catch((err)=>{\n\t\tconsole.error(err);\n\t\tconsole.error(\"!!ERROR INSTANTATING LOGS\");\n\t});\n}", "function loadLog() {\n let logContent = fs.readFileSync(\"logs/log.json\", \"utf8\");\n return JSON.parse(logContent);\n}", "function Log() {}", "function getMasterLogs()\n{\n\tvar request = {\"Cmd\" : \"logs\"};\n\n\tclearAllWbdTimers(TIMER_MASTERLOGS);\n\tgetMasterLogsFromServer(request);\n\tg_wbdMasterLogsTimeout.push(setTimeout(function(){ getMasterLogs(); }, g_wbdTimeOutVal));\n}", "get logStreams() {\n return this._logStreams;\n }", "getData () {\n return this._logData\n }", "function logDevLogs() {\n var props = PropertiesService.getDocumentProperties();\n var devLog = props.getProperty('devLog');\n Logger.log(devLog);\n}", "getLog() {\n const data = {};\n Object.keys(this.sessions).forEach(sid => {\n const session = this.sessions[sid];\n const pc = session.peerconnection;\n\n if (pc && pc.updateLog) {\n // FIXME: should probably be a .dump call\n data[`jingle_${sid}`] = {\n updateLog: pc.updateLog,\n stats: pc.stats,\n url: window.location.href\n };\n }\n });\n return data;\n }", "getLogStamp() {\r\n const date = new Date();\r\n return `[${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()} ${this.name}:${this.serial}]`;\r\n }", "function logConfig() {\n // Microservice Name\n logger.info('');\n logger.info('--------------------------------------------------------------');\n logger.info('++ ++');\n logger.info('++ ZeroInbox Api-Gateway ++');\n logger.info('++ ++');\n logger.info('--------------------------------------------------------------');\n\n // init env vars\n logger.info('');\n logger.info('********INIT ENV VARS********');\n Object.keys(initEnvVars).forEach((envVar) => {\n logger.info(envVar + ': ' + initEnvVars[envVar]);\n });\n // authentication env vars\n logger.info('');\n logger.info('********AUTH ENV VARS********');\n Object.keys(authEnvVars).forEach((envVar) => {\n logger.info(envVar + ': ' + authEnvVars[envVar]);\n });\n\n logger.info('');\n logger.info('********RABBIT CONNECTION********');\n if (RABBIT_URL) {\n logger.info('RABBIT_URL: ' + RABBIT_URL);\n } else if (RABBIT_CONNECTION) {\n Object.keys(RABBIT_CONNECTION).forEach((key) => {\n logger.info(key + ': ' + RABBIT_CONNECTION[key]);\n });\n }\n logger.info('Rabbit Topology: ' + rabbitTopJSON.toString());\n\n logger.info('');\n}", "function getLog({\n limit=defaultResultLimit\n}={}) {\n return db.allDocs({\n include_docs: true,\n descending: true,\n limit,\n ...keyRangeForPrefix('logEntry/'),\n }).then((result) => {\n return result.rows\n }).catch(err => console.error(err))\n}", "function log() {\n\t\t//var args = [].slice.call(arguments);\n\t\t//send('LOG', args);\n\t}", "function findAllLogs() {\n return $http.get(restApi + '/logs').then(function success(response) {\n return response.data;\n },\n function error(error) {\n return error;\n });\n }", "function log() {\n if (logging) {\n for (let i = 0; i < logBody.length; i++)\n console.log(logBody[i])\n }\n }", "function log() {\n chrome.storage.sync.get(null, function (data) { console.log(data); });\n chrome.alarms.getAll(function (alarms) {\n var print = [];\n for (alarm in alarms) {\n date = new Date(alarms[alarm].scheduledTime);\n print.push([alarms[alarm].name, date.toLocaleDateString() + \" \" + date.toLocaleTimeString()]);\n }\n console.log(print);\n });\n}", "async logDeviceInfo() {\n try {\n let sysinfo = await this.iologik.getSysInfo();\n for (let key in sysinfo) {\n this.log(key + ': ' + sysinfo[key]);\n }\n } catch (e) {\n this.emit('error', e);\n }\n }", "function getLog(logName) /* (logName : string) -> io string */ {\n return $std_core.maybe($std_dict._lb__rb__1(logDict, logName), \"\", $std_core.id);\n}", "function initLog() {\n\n console.log('adminsShowCtrl init');\n }", "function createLogAndHost(app) {\n return hl(function (push, next) {\n leApi.registerHost(app.name, function (err, data) {\n if(err) {\n push(err, { app: app, logs: data })\n return push(null, hl.nil);\n }\n leApi.createLog(\n app.name,\n LOG_TYPE,\n data.host_key,\n (error, logData) => {\n push(err, {\n app: app,\n logData: logData\n });\n push(null, hl.nil);\n });\n });\n });\n}", "log(data = mandatory(), name = 'global') {\n if (!this.logs.hasOwnProperty(name)) {\n this.logs[name] = []\n }\n\n this.logs[name].push(data)\n }", "static get(lgr = \"anon\", maxLog = \"default\", force = \"default\") {\nvar i, len, lg, ref, ref1, ref2, ref3, stat, theLogger;\ntheLogger = null;\nref = Logger._loggers;\nfor (i = 0, len = ref.length; i < len; i++) {\nlg = ref[i];\nif (lg.modName === lgr) {\nif (theLogger == null) {\ntheLogger = lg;\n}\n}\n}\nstat = theLogger != null ? \"Updated\" : \"Created\";\nif (theLogger != null) {\nif (maxLog === \"default\") {\nmaxLog = theLogger.maxLog;\n}\nif (force === \"default\") {\nforce = theLogger.force;\n}\nif ((ref1 = Logger._modLogger) != null) {\nif (typeof ref1.trace === \"function\") {\nref1.trace(`get: Updating ${theLogger.modName} Logger. MaxLog ${theLogger.maxLog} -> ${maxLog}`);\n}\n}\ntheLogger._setLoggers(maxLog, force);\n} else {\nif (maxLog === \"default\") {\nmaxLog = Logger._defaultMaxLog;\n}\nif (force === \"default\") {\nforce = \"noforce\";\n}\nif ((ref2 = Logger._modLogger) != null) {\nif (typeof ref2.trace === \"function\") {\nref2.trace(`get: Create ${lgr} logger`);\n}\n}\ntheLogger = new Logger(lgr, maxLog, force);\n}\nif ((ref3 = Logger._modLogger) != null) {\nif (typeof ref3.debug === \"function\") {\nref3.debug(`${theLogger.modName} ${stat}: ${theLogger.maxLog} (${theLogger.maxLogLev}) ${theLogger.force}`);\n}\n}\nreturn theLogger;\n}", "function log() {\n //log here\n }", "function getLatestLog(node,app,week){\n // Example: /mnt/backups/ci.x7.dev.forj.io/jenkins\n var path = sails.config.env.backups.path + '/' + node + '/' + app + '/' + week + '/logs' ;\n if (! fs.existsSync(path)){\n throw new Error(app + ' doesnt have logs at: ' + path + '.');\n }\n\n var files = fs.readdirSync(path);\n var latestDate = 0;\n var latestLog = '';\n // Get the latest one\n for (var x=0; x<files.length; x++){\n //info_2014-08-24_00-20-02_30556.yaml\n var pattern = /^info_\\d{4}-\\d{2}-\\d{2}_\\d{2}-\\d{2}-\\d{2}_[0-9\\(\\)]+.yaml$/;\n if ( !pattern.test(files[x]) ) {\n continue;\n }\n\n var year = files[x].substring(5,9);\n var month = files[x].substring(10,12);\n var day = files[x].substring(13,15);\n var hours = files[x].substring(16,18);\n var minutes = files[x].substring(19,21);\n var seconds = files[x].substring(22,24);\n var currentDate = Date.UTC(parseInt(year), parseInt(month)-1, parseInt(day), parseInt(hours), parseInt(minutes), parseInt(seconds), 0);\n if (currentDate>latestDate){\n latestDate = currentDate;\n latestLog = files[x];\n }\n }\n return latestLog;\n}", "log() {\n return; // no output for initial application build\n }", "getLogger() {\n return this.s.db.s.logger;\n }", "function readFileLog() {\n try {\n let logText = fs.readFileSync(\"files.log\", \"utf-8\");\n return logText\n } catch(e) {\n console.warn('Unable to load files.log', e)\n }\n return ''\n}", "function getAllLogEntries(worker) {\n var logEntries = datastore.readLogEntries();\n worker.port.emit(\"LogEntriesLoaded\", logEntries);\n}", "function initLog() {\n\n console.log('ticketsStoreCtrl init');\n }", "log() {}", "debugLog() {\n\t\t\tthis.get().then((data) => {\n\t\t\t\tlet text = JSON.stringify(data, null, 2);\n\t\t\t\t// Hide 'token' and 'sessionID' values if available\n\t\t\t\ttext = Util.hideStringInText(data.token, text);\n\t\t\t\ttext = Util.hideStringInText(data.sessionID, text);\n\n\t\t\t\tconsole.info(`chrome.storage.${this.namespace} = ${text}`);\n\t\t\t});\n\t\t}", "function getAPILogger() {\n return apiLogger;\n}", "function printAuditLog() {\n console.log(\"Audit Log:\");\n for (var i = 0; i < localStorage.length; i++) {\n if (localStorage.key(i) === 'auditLog') {\n console.log(localStorage.getItem(localStorage.key(i)));\n }\n }\n }", "function log(log) {\n var dateTime = moment().format('YYYY/MM/DD @ hh:mm:ss a');\n console.log('PraxBot: ' + dateTime + ': ' + log);\n }", "function initLog() {\n\n console.log('adminsIndexCtrl init');\n }", "function _getLogDate() {\n var date = new Date()\n , year = date.getFullYear()\n , month = [\"0\", (date.getMonth() + 1)].join('').substr(-2)\n , day = [\"0\", date.getDate()].join('').substr(-2)\n , hours = [\"0\", date.getHours()].join('').substr(-2)\n , minutes = [\"0\", date.getMinutes()].join('').substr(-2)\n , seconds = [\"0\", date.getSeconds()].join('').substr(-2)\n ;\n\n return [\n [year, month, day].join('-')\n , [hours, minutes, seconds].join(':')\n ].join(' ');\n }", "getMessages() {\n\t\tconst newMessages = this.chat_backlog.getLog();\n\t\tthis.chat_backlog.clearLog();\n\t\treturn newMessages;\n\t}", "function getLog() {\n\tvar log;\n\n\tif (log = GM_getValue(_log_name)) {\n\t\t_log_data = readQuery(log);\n\t\treturn Number(_log_data.enable) ? true : false;\n\t}\n\telse {\n\t\t_log_data = null;\n\t\treturn false;\n\t}\n}", "function logCurentCallToLocaLStorage() {\n\n}", "function log(){\r\n var msg = '[gandalf] ' + Array.prototype.join.call(arguments, '');\r\n if (window.console && window.console.log) {\r\n window.console.log(msg);\r\n }\r\n }", "get logGroup() {\n if (!this._logGroup) {\n const logRetention = new logs.LogRetention(this, 'LogRetention', {\n logGroupName: `/aws/lambda/${this.functionName}`,\n retention: logs.RetentionDays.INFINITE,\n });\n this._logGroup = logs.LogGroup.fromLogGroupArn(this, `${this.node.id}-LogGroup`, logRetention.logGroupArn);\n }\n return this._logGroup;\n }", "log(message) {\n console.log(message)\n\n return null\n\t }", "function lemurlog_View_Log(event, log_id)\n{\n var file;\n if(log_id == 0)\n {\n file = lemurlog_GetLogFile(lemurlog_LOG_FILE);\n }\n else if(log_id == 1)\n {\n file = lemurlog_GetLogFile(lemurlog_PAGE_FILE);\n }\n if(!file.exists())\n {\n file.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE , 0644);\n }\n lemurlog_LoadURL(\"file:///\" + file.path);\n}", "function readAmtAuditLog() {\r\n // See if MicroLMS needs to be started\r\n if ((settings.hostname == '127.0.0.1') || (settings.hostname.toLowerCase() == 'localhost')) {\r\n settings.noconsole = true; startLms(readAmtAuditLogEx);\r\n } else {\r\n readAmtAuditLogEx(9999);\r\n }\r\n}", "function checkLogs(){\n\n}", "function getLogger() {\n return logger;\n}", "getLogger() {\n return this.logger;\n }", "static get servicePath() {\n return 'logging.googleapis.com';\n }", "function logStart() {\n return (new Date(Date.now())).toLocaleTimeString() + \" MMM-Nightscout: \";\n}", "function LogwranglerModule(){}", "function getMe(){\n let me = tg.getMe()\n return Logger.log(me)\n}", "function GetLogTimeStamp() {\n let date = new Date();\n\n let hour = date.getHours();\n hour = (hour < 10 ? '0' : '') + hour;\n\n let min = date.getMinutes();\n min = (min < 10 ? '0' : '') + min;\n\n let sec = date.getSeconds();\n sec = (sec < 10 ? '0' : '') + sec;\n\n let year = date.getFullYear();\n\n let month = date.getMonth() + 1;\n month = (month < 10 ? '0' : '') + month;\n\n let day = date.getDate();\n day = (day < 10 ? '0' : '') + day;\n\n return day + '/' + month + '/' + year + ' ' + hour + ':' + min + ':' + sec;\n}", "listener() {\n\t\trequire('electron').ipcRenderer.send('open:logs');\n\t}", "function init() {\n if (logEndpoints) {\n $http.get(logEndpoints.masterState)\n .then(function (res) {\n var marathonFramework = _.find(res.data.frameworks, {\n name: 'marathon'\n });\n var task = _.find(marathonFramework.tasks, {\n id: $stateParams.instance\n });\n slave = _.find(res.data.slaves, {\n id: task.slave_id\n });\n\n return $http.get(logEndpoints.slaveDebug(slave));\n })\n .then(function (res) {\n $ctrl.canAccessLogs = true;\n\n var logLocation = _.find(_.values(res.data), function (val) {\n return val.indexOf($stateParams.instance) !== -1;\n });\n\n if (logLocation.indexOf('/var') === -1) {\n logLocation = \"/var\" + logLocation;\n }\n\n stdout(slave, logLocation);\n stderr(slave, logLocation);\n });\n }\n }", "get loggingInput() {\n return this._logging;\n }", "printLogger(){\n\t\treturn logger;\n\t}", "get logsInput() {\n return this._logs;\n }", "showSystemLog() {\n logger_1.default.system.debug(\"SystemManagerClient.showSystemLog\");\n routerClientInstance_1.default.transmit(_constants_1.SHOW_SYSLOG_CHANNEL, true);\n }", "filterLog(){\n const api = this.api;\n\n api.getLog((r)=>{\n this.setState(\n prevState => ({\n application: {\n ...prevState.application,\n data_logs: r.data\n },\n active_module: \n (\n <div module='logana-filter'>\n <LoganaTableMenu \n createLog={this.createLog.bind(this)} \n />\n <LoganaTable \n data={r.data} \n selectLog={this.selectLog.bind(this)} \n />\n </div>\n )\n })\n );\n });\n }", "function log(logData) {\n return Console.log(logData, Components.stack.caller);\n}", "function _initLog(){\n //Push the log header to an array\n currentAction.push(\"Timestamp\");\n currentAction.push(\"User Action\");\n currentAction.push(\"Time needed in s\");\n //Push the single action log to an array containing all action logs\n userActions[0] = currentAction;\n //Reset the sinle action array\n currentAction = [];\n }", "function getMe() {\r\n let me = tg.getMe()\r\n return Logger.log(me)\r\n}", "function getWebhookInfo() {\r\n let hasil = tg.getWebhookInfo()\r\n return Logger.log(hasil)\r\n}", "get _logService()\n {\n if (!this.__logService)\n this.__logService = Cc[\"@mozilla.org/consoleservice;1\"].\n getService(Ci.nsIConsoleService);\n return this.__logService;\n }", "function log(session) {\n console.log(\n \"Start: \" + session.start + \" & \" +\n \"Room: \" + rooms[session.room].name + \" & \" +\n \"Type: \" + session.type + \" & \" +\n \"Track: \" + session.track + \" & \" +\n \"Title: \" + session.title\n );\n }", "onBrowserLog(browser, log, type) {\n\n }", "getLogs(numberOfLogs) {\n return fetch(this.startUrl + \"/logs/\" + numberOfLogs, {\n method: \"get\"\n });\n }", "function logger() {}", "function log() {\n if (!config.debug) return\n let ln = '??'\n try {\n const line = ((new Error).stack ?? '').split('\\n')[2]\n const parts = line.split(':')\n ln = parts[parts.length - 2]\n }\n catch { }\n log_print(ln, 'log', arguments)\n}", "static log() {\n var str;\n str = Util.toStrArgs('', arguments);\n Util.consoleLog(str);\n }", "sendLogs() {\n this.log.info('logging from tests');\n }", "function getWebhookInfo() {\n let hasil = tg.getWebhookInfo()\n return Logger.log(hasil)\n}", "function getLogfile(logfileName){\n var logFile = [];\n \n $.ajax({\n type: \"GET\", \n url: 'backend/index.php',\n data: {key: '4me302A3', method:'logfile', value1:logfileName},\n async: false, \n dataType: \"json\"\n\t\t})\n .done(function(data){\n\t\t\tlogFile = data;\n\t\t})\n\t\t.fail(function() {\n\t\t\treturn \"ajax get logfile error\";\n\t\t});\n \n return createArr(logFile);\n}", "function logDate(){\n console.log(new Date());\n}", "askForLogs(){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"READLOGFILE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\t}", "registerLogFeed() {\n const {flags: {domain, utc}} = this.parse(LogsCommand)\n const feed = new LogFeed()\n\n feed.onLog(log => {\n const entry = new LogEntry(log, domain)\n\n // Check if we're waiting\n if (this.canLog) {\n // Stop the spinner\n this.spinner(null)\n\n // Print the line\n this.log(entry.formattedSummary(utc))\n entry.setPrinted()\n\n // Restart the spinner\n this.spinner('Listening for logs from Chec. Press \"up\" to navigate through the existing logs')\n\n // Keep logs pruned\n this.pruneLogs()\n }\n\n // Append the log\n this.logs.push(entry)\n })\n\n this.logFeed = feed\n }", "function formatLogFile() {\n var logText = readLogFile();\n var logTmp = logText.split('[logEnd]');\n var logArray = [];\n _.each(logTmp, function(aLog) {\n var decodedLog = Ti.Utils.base64decode(aLog);\n logArray.push(JSON.parse(decodedLog));\n });\n\n return logArray;\n }", "function LogsView(){\n\tclearNav();\n\t\n\tclearSection();\n\tvar logs = getLocalDeviceLogs();\n\tif(logs==''||logs==null){\n\t\tlogs=\"This device has not performed any events so far.\";\n\t}\n\tvar html= LogsTemplate(logs);\n\tvar content = getContainer();\n\tcontent.innerHTML = html;\n\tremoveClass('active');\n\tdocument.getElementById('my-logs-link').className='active';\n}" ]
[ "0.7300941", "0.6929417", "0.6873043", "0.686987", "0.6788415", "0.6558146", "0.65255064", "0.65127575", "0.6496837", "0.63672733", "0.62746775", "0.62260556", "0.6224749", "0.6206399", "0.6093701", "0.6072589", "0.6063998", "0.60445446", "0.6035631", "0.60073113", "0.59797716", "0.59656453", "0.5964739", "0.5956314", "0.5946592", "0.5914571", "0.58592445", "0.5857725", "0.5857352", "0.58373034", "0.58266824", "0.58247423", "0.5799767", "0.57900447", "0.5782136", "0.5772259", "0.57509995", "0.57467055", "0.5737694", "0.5721511", "0.56991464", "0.56768715", "0.56527144", "0.56492054", "0.5630884", "0.5620882", "0.56155723", "0.5612105", "0.56110144", "0.5605402", "0.5603347", "0.5591555", "0.5591023", "0.5579967", "0.5567267", "0.55629396", "0.55610937", "0.5548177", "0.5537466", "0.5531034", "0.5524683", "0.5524455", "0.5510232", "0.5504492", "0.5500807", "0.55005527", "0.549948", "0.5498323", "0.54923445", "0.54906005", "0.5481209", "0.5480491", "0.5469014", "0.54656184", "0.5450889", "0.5450221", "0.54500157", "0.5440333", "0.54366004", "0.5432016", "0.5431752", "0.5405427", "0.5401477", "0.5398197", "0.53822935", "0.5378442", "0.5376499", "0.53726625", "0.5369345", "0.5366341", "0.5363539", "0.5361523", "0.53600556", "0.5355239", "0.53513765", "0.535132", "0.5351002", "0.5345639", "0.5341744", "0.53406936", "0.5340312" ]
0.0
-1
Get des log de l'application
Backup(ApiData, res, GetJobSchedule, SetJobSchedule, User, UserId){ if (ApiData.Fct == "BackupNow"){ this.LogAppliInfo("Call ApiAdmin BackupNow", User, UserId) // Get GoogleKey this.GetDbConfig("BackupGoogle").then((reponse)=>{ res.json({Error: false, ErrorMsg: "", Data: "DB Backup Started, see log for end validation"}) let credentials = JSON.parse(reponse.GoogleKey) let folder = reponse.Folder let DbBackup = require('./DbBackup').DbBackup let MyDbBackup = new DbBackup(this._MongoVar.DbName,credentials,folder, this.LogAppliInfo.bind(this)) MyDbBackup.Backup().then((reponse)=>{ this.LogAppliInfo("Backup Now sucessfully ended", User, UserId) },(erreur)=>{ this.LogAppliError("Backup Now error: " + erreur, User, UserId) }) },(erreur)=>{ this.LogAppliError("BackupNow Get GoogleKey: "+ erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during BackupNow Get GoogleKey: "+ erreur, Data: ""}) }) } else if (ApiData.Fct == "RestoreNow"){ this.LogAppliInfo("Call ApiAdmin RestoreNow", User, UserId) // Get GoogleKey this.GetDbConfig("BackupGoogle").then((reponse)=>{ res.json({Error: false, ErrorMsg: "", Data: "DB Restore Started, see log for end validation and reload browser"}) let credentials = JSON.parse(reponse.GoogleKey) let folder = reponse.Folder let DbBackup = require('./DbBackup').DbBackup let MyDbBackup = new DbBackup(this._MongoVar.DbName, credentials,folder, this.LogAppliInfo.bind(this)) MyDbBackup.Restore().then((reponse)=>{ this.LogAppliInfo("Restore Now sucessfully ended", User, UserId) },(erreur)=>{ this.LogAppliError("Restore Now error: " + erreur, User, UserId) }) },(erreur)=>{ this.LogAppliError("RestoreNow Get GoogleKey: "+ erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during RestoreNow Get GoogleKey: "+ erreur, Data: ""}) }) } else if (ApiData.Fct == "GetSchedulerData"){ this.LogAppliInfo("Call ApiAdmin GetSchedulerData", User, UserId) let ApiReponse = new Object() ApiReponse.GoogleKeyExist = false ApiReponse.SchedulerData = null this.GetDbConfig("BackupGoogle").then((reponse)=>{ if((reponse.GoogleKey == "") || (reponse.Folder == "")){ res.json({Error: false, ErrorMsg: "Scheduler Data", Data: ApiReponse}) } else { // Get scheduler data let JobSchedule = GetJobSchedule() this.GetSchedulerData(JobSchedule).then((reponsedata)=>{ ApiReponse.GoogleKeyExist = true ApiReponse.SchedulerData =reponsedata res.json({Error: false, ErrorMsg: "Scheduler Data", Data: ApiReponse}) },(erreur)=>{ this.LogAppliError("GetSchedulerData error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during GetSchedulerData: "+ erreur, Data: ""}) }) } },(erreur)=>{ this.LogAppliError("GetSchedulerData error in get google key : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during GetSchedulerData, get google key: "+ erreur, Data: ""}) }) } else if (ApiData.Fct == "SaveConfig"){ this.LogAppliInfo("Call ApiAdmin SaveConfig", User, UserId) // Save nouvelle heure let BackupScheduler = new Object() BackupScheduler.JobScheduleHour = ApiData.Hour BackupScheduler.JobScheduleMinute = ApiData.Minute let JobSchedule = GetJobSchedule() if (JobSchedule == null){ BackupScheduler.JobScheduleStarted = false } else { BackupScheduler.JobScheduleStarted = true } let Data = new Object() Data.Value = BackupScheduler const Query = { [this._MongoVar.ConfigKey]: "BackupScheduler"} this._Mongo.UpdatePromise(Query, Data, this._MongoVar.ConfigCollection).then((reponse)=>{ if (reponse.matchedCount==1) { let JobSchedule = GetJobSchedule() if (JobSchedule != null){ let options = {minute: ApiData.Minute, hour: ApiData.Hour} JobSchedule.reschedule(options) SetJobSchedule(JobSchedule) } this.GetSchedulerData(JobSchedule).then((reponse)=>{ res.json({Error: false, ErrorMsg: "Scheduler Data", Data: reponse}) },(erreur)=>{ this.LogAppliError("SaveConfig error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig: "+ erreur, Data: ""}) }) } else { res.json({Error: true, ErrorMsg: "Upadte error : Key Value not found in config", Data: ""}) } },(erreur)=>{ this.LogAppliError("SaveConfig error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig: "+ erreur, Data: ""}) }) } else if (ApiData.Fct == "SchedulerSetStatus"){ this.LogAppliInfo("Call ApiAdmin SchedulerSetStatus", User, UserId) if (ApiData.Started){ let JobSchedule = GetJobSchedule() if (JobSchedule== null){ this.GetSchedulerData(JobSchedule).then((reponse)=>{ let SchedulerData = reponse var schedule = require('node-schedule') let options = {minute: SchedulerData.JobScheduleMinute, hour: SchedulerData.JobScheduleHour} // Get GoogleKey this.GetDbConfig("BackupGoogle").then((reponseGoogle)=>{ let credentials = JSON.parse(reponseGoogle.GoogleKey) let folder = reponseGoogle.Folder var me = this let JobSchedule = schedule.scheduleJob(options, function(){ let DbBackup = require('./DbBackup').DbBackup let MyDbBackup = new DbBackup(me._MongoVar.DbName,credentials,folder,me.LogAppliInfo.bind(me)) MyDbBackup.Backup().then((reponse)=>{ var now = new Date() me.LogAppliInfo(reponse, User, UserId) console.log(reponse + " " + now) },(erreur)=>{ me.LogAppliError("SchedulerSetStatus error : " + erreur, User, UserId) console.log("Error during SchedulerSetStatus: "+ erreur + " " + now) }) }) SetJobSchedule(JobSchedule) // Save nouveau status let BackupScheduler = new Object() BackupScheduler.JobScheduleHour = SchedulerData.JobScheduleHour BackupScheduler.JobScheduleMinute = SchedulerData.JobScheduleMinute BackupScheduler.JobScheduleStarted = ApiData.Started let DataS = new Object() DataS.Value = BackupScheduler const Query = { [this._MongoVar.ConfigKey]: "BackupScheduler",} this._Mongo.UpdatePromise(Query, DataS, this._MongoVar.ConfigCollection).then((reponseUpdateSatus)=>{ if (reponseUpdateSatus.matchedCount==1) { let JobSchedule = GetJobSchedule() BackupScheduler.JobScheduleNext = this.GetDateTimeString(JobSchedule.nextInvocation()) res.json({Error: false, ErrorMsg: "Scheduler Data", Data: BackupScheduler}) } else { this.LogAppliError("SaveConfig Status error : more than 1 entry in DB", User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig Status: more than 1 entry in DB", Data: ""}) } },(erreur)=>{ this.LogAppliError("SaveConfig Status error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig Status: "+ erreur, Data: ""}) }) },(erreur)=>{ this.LogAppliError("SchedulerSetStatus, get Google key error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SchedulerSetStatus Get GoogleKey: "+ erreur, Data: ""}) }) },(erreur)=>{ this.LogAppliError("SchedulerSetStatus error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SchedulerSetStatus: "+ erreur, Data: ""}) }) } else { this.LogAppliError("JobScheduler already exist", User, UserId) res.json({Error: true, ErrorMsg: "Error JobScheduler already exist", Data: ""}) } } else { let JobSchedule = GetJobSchedule() if ( JobSchedule == null){ res.json({Error: true, ErrorMsg: "Error no JobScheduler defined", Data: ""}) } else { JobSchedule.cancel() SetJobSchedule(null) // Save nouveau status this.GetSchedulerData(null).then((reponse)=>{ let BackupScheduler = new Object() BackupScheduler.JobScheduleHour = reponse.JobScheduleHour BackupScheduler.JobScheduleMinute = reponse.JobScheduleMinute BackupScheduler.JobScheduleStarted = ApiData.Started let DataS = new Object() DataS.Value = BackupScheduler const Query = { [this._MongoVar.ConfigKey]: "BackupScheduler"} this._Mongo.UpdatePromise(Query, DataS, this._MongoVar.ConfigCollection).then((reponse)=>{ if (reponse.matchedCount==1) { BackupScheduler.JobScheduleNext = "Scheduler not started" res.json({Error: false, ErrorMsg: "Scheduler Data", Data: BackupScheduler}) } else { this.LogAppliError("SaveConfig Status error : more than 1 entry in DB", User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig Status: more than 1 entry in DB", Data: ""}) } },(erreur)=>{ this.LogAppliError("SaveConfig Status error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveConfig Status: "+ erreur, Data: ""}) }) },(erreur)=>{ this.LogAppliError("SchedulerSetStatus error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SchedulerSetStatus: "+ erreur, Data: ""}) }) } } } else if (ApiData.Fct == "SaveGoogleKey"){ this.LogAppliInfo("Call ApiAdmin SaveGoogleKey", User, UserId) // Save Google Key let BackupGoogle = new Object() BackupGoogle.GoogleKey = ApiData.key BackupGoogle.Folder = ApiData.folder let Data = new Object() Data.Value = BackupGoogle const Query = { [this._MongoVar.ConfigKey]: "BackupGoogle"} this._Mongo.UpdatePromise(Query, Data, this._MongoVar.ConfigCollection).then((reponse)=>{ if (reponse.matchedCount==1) { res.json({Error: false, ErrorMsg: "SaveGoogleKey Data", Data: null}) } else { this.LogAppliError("Upadte error : Key Value not found in config", User, UserId) res.json({Error: true, ErrorMsg: "Upadte error : Key Value not found in config", Data: ""}) } },(erreur)=>{ this.LogAppliError("SaveGoogleKey error : " + erreur, User, UserId) res.json({Error: true, ErrorMsg: "Error during SaveGoogleKey: "+ erreur, Data: ""}) }) } else { this.LogAppliError("Backup: ApiData.Fct not found= "+ ApiData.Fct, User, UserId) res.json({Error: true, ErrorMsg: "Error during Backup: ApiData.Fct not found= "+ ApiData.Fct, Data: ""}) } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "getLog() {\n\t\treturn this.log;\n\t}", "get log() {\n return this.config.log.logger\n }", "getClientLog() {\n\n }", "get log() {\n\t\treturn this._log;\n\t}", "getLog() {\n const { runtime, message, assert, expected } = this.opts;\n\n if (\n runtime === 'inabox' ||\n message.includes('Signing service error for google')\n ) {\n return logs.ads;\n }\n\n if (assert) {\n return logs.users;\n }\n\n if (expected) {\n return logs.expected;\n }\n\n return logs.errors;\n }", "get log() {\n if (!this._log) {\n const instanceName = `${this.constructor.name}@${node.getObjectId(this).substring(0, 4)}`;\n this._log = logger.getLogger(instanceName);\n }\n return this._log;\n }", "function getlogs()\n{\n if (typeof (webphone_api.plhandler) !== 'undefined' && webphone_api.plhandler !== null)\n return webphone_api.plhandler.getlogs();\n else\n webphone_api.Log('ERROR, webphone_api: getlogs webphone_api.plhandler is not defined');\n}", "function logs(appName, callback) {\n commons.get(format('/%s/apps/%s/logs/', deis.version, appName), callback);\n }", "async getLog(name) {\n let res = find(this.mission, { fileName: name })\n if (!res) return [];\n const logs = res.logModel;\n const list = await logs.findAll({ limit: 20 });\n return list.map((e) => {\n return { level: e.level, data: e.data, time: e.time };\n })\n }", "function _getLogs() {\n return _oLogs;\n }", "function getLogEvents() {\n var eventMap = {};\n if ( Logger.getLog().length > 0 ) {\n var arr = Logger.getLog().split(\"\\n\");\n for (var i in arr) {\n var str = arr[i];\n var regexResultArr = str.match(\"(.+?) INFO: (.+)\");\n var timestamp = regexResultArr[0];\n var event = regexResultArr[1];\n eventMap[i] = timestamp + \" \" + event;\n }\n }\n return eventMap;\n}", "function getLog(key){\n\tlet tmp = key.replace('log',''); //remove log prefix from the key to get the number\n\tlogNumber = Number(tmp); //parse the string into a number\n\tlocalforage.getItem('logs') //load the logs from memory\n\t.then((logs)=>{\n\t\tlet log = logs[key]; //get our log at the parameter key.\n\t\tconsole.log(log)\n\t\tfor(let field in log){ //itwerage over the fields of the log\n\t\t\tlet value = log[field];\n\t\t\tif(typeof value === \"string\") //if the field is a string, it goes to a text input\n\t\t\t\t$(`.${field}`).val(value);\n\t\t\telse if(value){ //or else it is a checkbox\n\t\t\t\t$(`input[val=${field}]`).prop('checked',true);\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$(`input[val=${field}]`).prop('checked',false);\n\t\t\t}\n\t\t}\n\t})\n\n\treturn\n}", "get log () {\n return this.autos.log;\n }", "function log(){\n var args = Array.prototype.slice.call(arguments);\n args.unshift('(app)');\n console.log.apply(console, args);\n}", "function getLog() {\n var procGitLog = cp.spawn(\n 'git',\n ['--no-pager', 'log', '--color=never', '--pretty=format:commit:%H', '-U0', 'origin/lkgr', 'chrome/VERSION'],\n {cwd: 'src', stdio: ['ignore', 'pipe', process.stderr]}\n );\n var log = '';\n procGitLog.stdout.setEncoding('utf8');\n procGitLog.stdout.on('data', function (data) {\n log += data;\n });\n procGitLog.on('exit', function (code, signal) {\n if (!signal) {\n if (code) { // w/ error, exit\n console.log('[Error]: %s', 'git log failed');\n process.exit(1);\n }\n else { // succeeded\n //console.log(log);\n searchLog(log);\n }\n }\n });\n}", "logView() { return this.call('App.logView', {'host':this.host}, 1); }", "function logLevel() {\n var match = /[?&]log=([a-z]+)/.exec(window.location.search);\n return match ? match[1] : \"\";\n }", "function log() {\n\ttry { \n\t\tconsole.log(\n\t\t\tshowOnly(logjs).forFilter(\n\t\t\t\t{\n\t\t\t\t\tapp: \"opsebf\",\n\t\t\t\t\tdate: \"20180623\",\n\t\t\t\t\tafter: \"1900\",\n\t\t\t\t}\n\t\t\t)\n\t\t);\n\t}\n\tcatch(err) {\n\t\tvar msg = \"opsebf logs only in development stage\";\n\t\tconsole.warn(msg);\n\t}\n}", "getXmppLog() {\n return (this.connection.logger || {}).log || null;\n }", "async function getLogs() {\n\tconst filenames = await fsp.readdir(path.resolve(__dirname, '../../logs'));\n\tconst logs = [];\n\tfor (const filename of filenames) {\n\t\tif (!filename.includes('.log')) continue;\n\t\tlogs.push({\n\t\t\tname: filename,\n\t\t\tdate: filename.substr(11, 10)\n\t\t});\n\t}\n\treturn logs;\n}", "log(...args) {\n return this.getInstance().log(...args);\n }", "function initLog() {\n\n console.log('estaticoHomeCtrl init');\n }", "listOfLogs() {\n\t\treturn this.bot.autobot.inventory.listBlocksByRegEx(/_log$/);\n\t}", "getXmppLog() {\n return (this.connection.logger || {}).log || null;\n }", "function initLogs(){\n\tif(!localforage){\n\t\talert('failed to load localforage!');\n\t\treturn;\n\t}\n\n\treturn localforage.getItem('maxLogNumber')\n\t.then((result)=>{\n\t\tif(result)\n\t\t\tmaxLogNumber = result;\n\t})\n\t.then(()=>localforage.getItem('logs'))\n\t.then((logs)=>{\n\t\tpopulateLogs(logs,false);\n\t})\n\t.catch((err)=>{\n\t\tconsole.error(err);\n\t\tconsole.error(\"!!ERROR INSTANTATING LOGS\");\n\t});\n}", "function loadLog() {\n let logContent = fs.readFileSync(\"logs/log.json\", \"utf8\");\n return JSON.parse(logContent);\n}", "function Log() {}", "function getMasterLogs()\n{\n\tvar request = {\"Cmd\" : \"logs\"};\n\n\tclearAllWbdTimers(TIMER_MASTERLOGS);\n\tgetMasterLogsFromServer(request);\n\tg_wbdMasterLogsTimeout.push(setTimeout(function(){ getMasterLogs(); }, g_wbdTimeOutVal));\n}", "get logStreams() {\n return this._logStreams;\n }", "getData () {\n return this._logData\n }", "getLog() {\n const data = {};\n Object.keys(this.sessions).forEach(sid => {\n const session = this.sessions[sid];\n const pc = session.peerconnection;\n\n if (pc && pc.updateLog) {\n // FIXME: should probably be a .dump call\n data[`jingle_${sid}`] = {\n updateLog: pc.updateLog,\n stats: pc.stats,\n url: window.location.href\n };\n }\n });\n return data;\n }", "function logDevLogs() {\n var props = PropertiesService.getDocumentProperties();\n var devLog = props.getProperty('devLog');\n Logger.log(devLog);\n}", "getLogStamp() {\r\n const date = new Date();\r\n return `[${date.getFullYear()}/${date.getMonth() + 1}/${date.getDate()} ${date.getHours()}:${date.getMinutes()}:${date.getSeconds()} ${this.name}:${this.serial}]`;\r\n }", "function logConfig() {\n // Microservice Name\n logger.info('');\n logger.info('--------------------------------------------------------------');\n logger.info('++ ++');\n logger.info('++ ZeroInbox Api-Gateway ++');\n logger.info('++ ++');\n logger.info('--------------------------------------------------------------');\n\n // init env vars\n logger.info('');\n logger.info('********INIT ENV VARS********');\n Object.keys(initEnvVars).forEach((envVar) => {\n logger.info(envVar + ': ' + initEnvVars[envVar]);\n });\n // authentication env vars\n logger.info('');\n logger.info('********AUTH ENV VARS********');\n Object.keys(authEnvVars).forEach((envVar) => {\n logger.info(envVar + ': ' + authEnvVars[envVar]);\n });\n\n logger.info('');\n logger.info('********RABBIT CONNECTION********');\n if (RABBIT_URL) {\n logger.info('RABBIT_URL: ' + RABBIT_URL);\n } else if (RABBIT_CONNECTION) {\n Object.keys(RABBIT_CONNECTION).forEach((key) => {\n logger.info(key + ': ' + RABBIT_CONNECTION[key]);\n });\n }\n logger.info('Rabbit Topology: ' + rabbitTopJSON.toString());\n\n logger.info('');\n}", "function getLog({\n limit=defaultResultLimit\n}={}) {\n return db.allDocs({\n include_docs: true,\n descending: true,\n limit,\n ...keyRangeForPrefix('logEntry/'),\n }).then((result) => {\n return result.rows\n }).catch(err => console.error(err))\n}", "function log() {\n\t\t//var args = [].slice.call(arguments);\n\t\t//send('LOG', args);\n\t}", "function findAllLogs() {\n return $http.get(restApi + '/logs').then(function success(response) {\n return response.data;\n },\n function error(error) {\n return error;\n });\n }", "function log() {\n if (logging) {\n for (let i = 0; i < logBody.length; i++)\n console.log(logBody[i])\n }\n }", "function log() {\n chrome.storage.sync.get(null, function (data) { console.log(data); });\n chrome.alarms.getAll(function (alarms) {\n var print = [];\n for (alarm in alarms) {\n date = new Date(alarms[alarm].scheduledTime);\n print.push([alarms[alarm].name, date.toLocaleDateString() + \" \" + date.toLocaleTimeString()]);\n }\n console.log(print);\n });\n}", "async logDeviceInfo() {\n try {\n let sysinfo = await this.iologik.getSysInfo();\n for (let key in sysinfo) {\n this.log(key + ': ' + sysinfo[key]);\n }\n } catch (e) {\n this.emit('error', e);\n }\n }", "function getLog(logName) /* (logName : string) -> io string */ {\n return $std_core.maybe($std_dict._lb__rb__1(logDict, logName), \"\", $std_core.id);\n}", "function initLog() {\n\n console.log('adminsShowCtrl init');\n }", "function createLogAndHost(app) {\n return hl(function (push, next) {\n leApi.registerHost(app.name, function (err, data) {\n if(err) {\n push(err, { app: app, logs: data })\n return push(null, hl.nil);\n }\n leApi.createLog(\n app.name,\n LOG_TYPE,\n data.host_key,\n (error, logData) => {\n push(err, {\n app: app,\n logData: logData\n });\n push(null, hl.nil);\n });\n });\n });\n}", "log(data = mandatory(), name = 'global') {\n if (!this.logs.hasOwnProperty(name)) {\n this.logs[name] = []\n }\n\n this.logs[name].push(data)\n }", "static get(lgr = \"anon\", maxLog = \"default\", force = \"default\") {\nvar i, len, lg, ref, ref1, ref2, ref3, stat, theLogger;\ntheLogger = null;\nref = Logger._loggers;\nfor (i = 0, len = ref.length; i < len; i++) {\nlg = ref[i];\nif (lg.modName === lgr) {\nif (theLogger == null) {\ntheLogger = lg;\n}\n}\n}\nstat = theLogger != null ? \"Updated\" : \"Created\";\nif (theLogger != null) {\nif (maxLog === \"default\") {\nmaxLog = theLogger.maxLog;\n}\nif (force === \"default\") {\nforce = theLogger.force;\n}\nif ((ref1 = Logger._modLogger) != null) {\nif (typeof ref1.trace === \"function\") {\nref1.trace(`get: Updating ${theLogger.modName} Logger. MaxLog ${theLogger.maxLog} -> ${maxLog}`);\n}\n}\ntheLogger._setLoggers(maxLog, force);\n} else {\nif (maxLog === \"default\") {\nmaxLog = Logger._defaultMaxLog;\n}\nif (force === \"default\") {\nforce = \"noforce\";\n}\nif ((ref2 = Logger._modLogger) != null) {\nif (typeof ref2.trace === \"function\") {\nref2.trace(`get: Create ${lgr} logger`);\n}\n}\ntheLogger = new Logger(lgr, maxLog, force);\n}\nif ((ref3 = Logger._modLogger) != null) {\nif (typeof ref3.debug === \"function\") {\nref3.debug(`${theLogger.modName} ${stat}: ${theLogger.maxLog} (${theLogger.maxLogLev}) ${theLogger.force}`);\n}\n}\nreturn theLogger;\n}", "function log() {\n //log here\n }", "function getLatestLog(node,app,week){\n // Example: /mnt/backups/ci.x7.dev.forj.io/jenkins\n var path = sails.config.env.backups.path + '/' + node + '/' + app + '/' + week + '/logs' ;\n if (! fs.existsSync(path)){\n throw new Error(app + ' doesnt have logs at: ' + path + '.');\n }\n\n var files = fs.readdirSync(path);\n var latestDate = 0;\n var latestLog = '';\n // Get the latest one\n for (var x=0; x<files.length; x++){\n //info_2014-08-24_00-20-02_30556.yaml\n var pattern = /^info_\\d{4}-\\d{2}-\\d{2}_\\d{2}-\\d{2}-\\d{2}_[0-9\\(\\)]+.yaml$/;\n if ( !pattern.test(files[x]) ) {\n continue;\n }\n\n var year = files[x].substring(5,9);\n var month = files[x].substring(10,12);\n var day = files[x].substring(13,15);\n var hours = files[x].substring(16,18);\n var minutes = files[x].substring(19,21);\n var seconds = files[x].substring(22,24);\n var currentDate = Date.UTC(parseInt(year), parseInt(month)-1, parseInt(day), parseInt(hours), parseInt(minutes), parseInt(seconds), 0);\n if (currentDate>latestDate){\n latestDate = currentDate;\n latestLog = files[x];\n }\n }\n return latestLog;\n}", "log() {\n return; // no output for initial application build\n }", "getLogger() {\n return this.s.db.s.logger;\n }", "function readFileLog() {\n try {\n let logText = fs.readFileSync(\"files.log\", \"utf-8\");\n return logText\n } catch(e) {\n console.warn('Unable to load files.log', e)\n }\n return ''\n}", "function getAllLogEntries(worker) {\n var logEntries = datastore.readLogEntries();\n worker.port.emit(\"LogEntriesLoaded\", logEntries);\n}", "function initLog() {\n\n console.log('ticketsStoreCtrl init');\n }", "log() {}", "debugLog() {\n\t\t\tthis.get().then((data) => {\n\t\t\t\tlet text = JSON.stringify(data, null, 2);\n\t\t\t\t// Hide 'token' and 'sessionID' values if available\n\t\t\t\ttext = Util.hideStringInText(data.token, text);\n\t\t\t\ttext = Util.hideStringInText(data.sessionID, text);\n\n\t\t\t\tconsole.info(`chrome.storage.${this.namespace} = ${text}`);\n\t\t\t});\n\t\t}", "function getAPILogger() {\n return apiLogger;\n}", "function printAuditLog() {\n console.log(\"Audit Log:\");\n for (var i = 0; i < localStorage.length; i++) {\n if (localStorage.key(i) === 'auditLog') {\n console.log(localStorage.getItem(localStorage.key(i)));\n }\n }\n }", "function log(log) {\n var dateTime = moment().format('YYYY/MM/DD @ hh:mm:ss a');\n console.log('PraxBot: ' + dateTime + ': ' + log);\n }", "function initLog() {\n\n console.log('adminsIndexCtrl init');\n }", "function _getLogDate() {\n var date = new Date()\n , year = date.getFullYear()\n , month = [\"0\", (date.getMonth() + 1)].join('').substr(-2)\n , day = [\"0\", date.getDate()].join('').substr(-2)\n , hours = [\"0\", date.getHours()].join('').substr(-2)\n , minutes = [\"0\", date.getMinutes()].join('').substr(-2)\n , seconds = [\"0\", date.getSeconds()].join('').substr(-2)\n ;\n\n return [\n [year, month, day].join('-')\n , [hours, minutes, seconds].join(':')\n ].join(' ');\n }", "getMessages() {\n\t\tconst newMessages = this.chat_backlog.getLog();\n\t\tthis.chat_backlog.clearLog();\n\t\treturn newMessages;\n\t}", "function logCurentCallToLocaLStorage() {\n\n}", "function getLog() {\n\tvar log;\n\n\tif (log = GM_getValue(_log_name)) {\n\t\t_log_data = readQuery(log);\n\t\treturn Number(_log_data.enable) ? true : false;\n\t}\n\telse {\n\t\t_log_data = null;\n\t\treturn false;\n\t}\n}", "function log(){\r\n var msg = '[gandalf] ' + Array.prototype.join.call(arguments, '');\r\n if (window.console && window.console.log) {\r\n window.console.log(msg);\r\n }\r\n }", "get logGroup() {\n if (!this._logGroup) {\n const logRetention = new logs.LogRetention(this, 'LogRetention', {\n logGroupName: `/aws/lambda/${this.functionName}`,\n retention: logs.RetentionDays.INFINITE,\n });\n this._logGroup = logs.LogGroup.fromLogGroupArn(this, `${this.node.id}-LogGroup`, logRetention.logGroupArn);\n }\n return this._logGroup;\n }", "function lemurlog_View_Log(event, log_id)\n{\n var file;\n if(log_id == 0)\n {\n file = lemurlog_GetLogFile(lemurlog_LOG_FILE);\n }\n else if(log_id == 1)\n {\n file = lemurlog_GetLogFile(lemurlog_PAGE_FILE);\n }\n if(!file.exists())\n {\n file.create(Components.interfaces.nsIFile.NORMAL_FILE_TYPE , 0644);\n }\n lemurlog_LoadURL(\"file:///\" + file.path);\n}", "log(message) {\n console.log(message)\n\n return null\n\t }", "function readAmtAuditLog() {\r\n // See if MicroLMS needs to be started\r\n if ((settings.hostname == '127.0.0.1') || (settings.hostname.toLowerCase() == 'localhost')) {\r\n settings.noconsole = true; startLms(readAmtAuditLogEx);\r\n } else {\r\n readAmtAuditLogEx(9999);\r\n }\r\n}", "function checkLogs(){\n\n}", "function getLogger() {\n return logger;\n}", "getLogger() {\n return this.logger;\n }", "static get servicePath() {\n return 'logging.googleapis.com';\n }", "function logStart() {\n return (new Date(Date.now())).toLocaleTimeString() + \" MMM-Nightscout: \";\n}", "function LogwranglerModule(){}", "function getMe(){\n let me = tg.getMe()\n return Logger.log(me)\n}", "function init() {\n if (logEndpoints) {\n $http.get(logEndpoints.masterState)\n .then(function (res) {\n var marathonFramework = _.find(res.data.frameworks, {\n name: 'marathon'\n });\n var task = _.find(marathonFramework.tasks, {\n id: $stateParams.instance\n });\n slave = _.find(res.data.slaves, {\n id: task.slave_id\n });\n\n return $http.get(logEndpoints.slaveDebug(slave));\n })\n .then(function (res) {\n $ctrl.canAccessLogs = true;\n\n var logLocation = _.find(_.values(res.data), function (val) {\n return val.indexOf($stateParams.instance) !== -1;\n });\n\n if (logLocation.indexOf('/var') === -1) {\n logLocation = \"/var\" + logLocation;\n }\n\n stdout(slave, logLocation);\n stderr(slave, logLocation);\n });\n }\n }", "function GetLogTimeStamp() {\n let date = new Date();\n\n let hour = date.getHours();\n hour = (hour < 10 ? '0' : '') + hour;\n\n let min = date.getMinutes();\n min = (min < 10 ? '0' : '') + min;\n\n let sec = date.getSeconds();\n sec = (sec < 10 ? '0' : '') + sec;\n\n let year = date.getFullYear();\n\n let month = date.getMonth() + 1;\n month = (month < 10 ? '0' : '') + month;\n\n let day = date.getDate();\n day = (day < 10 ? '0' : '') + day;\n\n return day + '/' + month + '/' + year + ' ' + hour + ':' + min + ':' + sec;\n}", "listener() {\n\t\trequire('electron').ipcRenderer.send('open:logs');\n\t}", "get loggingInput() {\n return this._logging;\n }", "printLogger(){\n\t\treturn logger;\n\t}", "get logsInput() {\n return this._logs;\n }", "showSystemLog() {\n logger_1.default.system.debug(\"SystemManagerClient.showSystemLog\");\n routerClientInstance_1.default.transmit(_constants_1.SHOW_SYSLOG_CHANNEL, true);\n }", "filterLog(){\n const api = this.api;\n\n api.getLog((r)=>{\n this.setState(\n prevState => ({\n application: {\n ...prevState.application,\n data_logs: r.data\n },\n active_module: \n (\n <div module='logana-filter'>\n <LoganaTableMenu \n createLog={this.createLog.bind(this)} \n />\n <LoganaTable \n data={r.data} \n selectLog={this.selectLog.bind(this)} \n />\n </div>\n )\n })\n );\n });\n }", "function log(logData) {\n return Console.log(logData, Components.stack.caller);\n}", "function _initLog(){\n //Push the log header to an array\n currentAction.push(\"Timestamp\");\n currentAction.push(\"User Action\");\n currentAction.push(\"Time needed in s\");\n //Push the single action log to an array containing all action logs\n userActions[0] = currentAction;\n //Reset the sinle action array\n currentAction = [];\n }", "function getMe() {\r\n let me = tg.getMe()\r\n return Logger.log(me)\r\n}", "function getWebhookInfo() {\r\n let hasil = tg.getWebhookInfo()\r\n return Logger.log(hasil)\r\n}", "get _logService()\n {\n if (!this.__logService)\n this.__logService = Cc[\"@mozilla.org/consoleservice;1\"].\n getService(Ci.nsIConsoleService);\n return this.__logService;\n }", "function log(session) {\n console.log(\n \"Start: \" + session.start + \" & \" +\n \"Room: \" + rooms[session.room].name + \" & \" +\n \"Type: \" + session.type + \" & \" +\n \"Track: \" + session.track + \" & \" +\n \"Title: \" + session.title\n );\n }", "onBrowserLog(browser, log, type) {\n\n }", "getLogs(numberOfLogs) {\n return fetch(this.startUrl + \"/logs/\" + numberOfLogs, {\n method: \"get\"\n });\n }", "function logger() {}", "function log() {\n if (!config.debug) return\n let ln = '??'\n try {\n const line = ((new Error).stack ?? '').split('\\n')[2]\n const parts = line.split(':')\n ln = parts[parts.length - 2]\n }\n catch { }\n log_print(ln, 'log', arguments)\n}", "static log() {\n var str;\n str = Util.toStrArgs('', arguments);\n Util.consoleLog(str);\n }", "sendLogs() {\n this.log.info('logging from tests');\n }", "function getLogfile(logfileName){\n var logFile = [];\n \n $.ajax({\n type: \"GET\", \n url: 'backend/index.php',\n data: {key: '4me302A3', method:'logfile', value1:logfileName},\n async: false, \n dataType: \"json\"\n\t\t})\n .done(function(data){\n\t\t\tlogFile = data;\n\t\t})\n\t\t.fail(function() {\n\t\t\treturn \"ajax get logfile error\";\n\t\t});\n \n return createArr(logFile);\n}", "function logDate(){\n console.log(new Date());\n}", "function getWebhookInfo() {\n let hasil = tg.getWebhookInfo()\n return Logger.log(hasil)\n}", "askForLogs(){\n\t\tthis.activeConnection.sendToServer({\n\t\t\tcommand: \"READLOGFILE\",\n\t\t\ttoken: this.activeConnection.token,\n\t\t});\n\t}", "registerLogFeed() {\n const {flags: {domain, utc}} = this.parse(LogsCommand)\n const feed = new LogFeed()\n\n feed.onLog(log => {\n const entry = new LogEntry(log, domain)\n\n // Check if we're waiting\n if (this.canLog) {\n // Stop the spinner\n this.spinner(null)\n\n // Print the line\n this.log(entry.formattedSummary(utc))\n entry.setPrinted()\n\n // Restart the spinner\n this.spinner('Listening for logs from Chec. Press \"up\" to navigate through the existing logs')\n\n // Keep logs pruned\n this.pruneLogs()\n }\n\n // Append the log\n this.logs.push(entry)\n })\n\n this.logFeed = feed\n }", "function LogsView(){\n\tclearNav();\n\t\n\tclearSection();\n\tvar logs = getLocalDeviceLogs();\n\tif(logs==''||logs==null){\n\t\tlogs=\"This device has not performed any events so far.\";\n\t}\n\tvar html= LogsTemplate(logs);\n\tvar content = getContainer();\n\tcontent.innerHTML = html;\n\tremoveClass('active');\n\tdocument.getElementById('my-logs-link').className='active';\n}", "function formatLogFile() {\n var logText = readLogFile();\n var logTmp = logText.split('[logEnd]');\n var logArray = [];\n _.each(logTmp, function(aLog) {\n var decodedLog = Ti.Utils.base64decode(aLog);\n logArray.push(JSON.parse(decodedLog));\n });\n\n return logArray;\n }" ]
[ "0.7302095", "0.69298357", "0.6873926", "0.687113", "0.678862", "0.655895", "0.65263534", "0.6511791", "0.649703", "0.6369022", "0.6273575", "0.6227701", "0.62268627", "0.6204239", "0.6093538", "0.6074416", "0.60634863", "0.60444003", "0.6035557", "0.6006507", "0.5980677", "0.5966427", "0.59656996", "0.59562874", "0.59480554", "0.59149134", "0.5860506", "0.58577824", "0.5857371", "0.58393306", "0.58269036", "0.5826508", "0.58011943", "0.57891816", "0.5783234", "0.5771744", "0.5751627", "0.5746956", "0.5738309", "0.57213885", "0.56985384", "0.56777966", "0.5652972", "0.56496614", "0.5631463", "0.5621714", "0.5614934", "0.56118256", "0.561107", "0.56046724", "0.56037945", "0.5593266", "0.55917716", "0.558162", "0.55677193", "0.55638325", "0.55611086", "0.554913", "0.55376875", "0.5531203", "0.5526718", "0.5525899", "0.5510257", "0.5504837", "0.55024034", "0.5501453", "0.5500215", "0.5498877", "0.54924715", "0.54906714", "0.5481117", "0.54807365", "0.54707295", "0.54660606", "0.5451418", "0.54513276", "0.5449272", "0.5440507", "0.5436825", "0.543167", "0.5431499", "0.5406252", "0.5400591", "0.5400182", "0.53827584", "0.5378093", "0.53779274", "0.53724706", "0.5370293", "0.53672725", "0.5363934", "0.53600603", "0.5359266", "0.5354724", "0.5351734", "0.53513783", "0.5350932", "0.5345293", "0.53437555", "0.53423756", "0.5341231" ]
0.0
-1